include variable from other php file

i m fresher in php developing field so pls help me as soon as possible…
describing my problem here…
in my code, by clicking on sign up value,another window is opened showing details of signup values…now on that window m having a value named $total…
i want to build the code which will display sum of all these total on one page at the end of my previous page.m tryng to use ob_start() and ob_end_clean() function…but not getting solution…plsss help me

THis is my first page code:calldetails_month.php

<?php include "../includes/config.php"; include "../includes/functions.php"; include "links.php"; _checkSession(); if($_GET['mon']=='y') { $today=date('Y-m'); $year=date('Y'); $flag='2'; } elseif($_POST) { $month=$_POST['month']; $year=$_POST['year']; $today=date("$year-$month"); $flag='2'; } else { $today=date('Ymd'); $flag='1'; } //$today="20061017"; $fields = "T.name,T.id"; $objectIndex = "TEAM"; $whereclause = " where closed=0"; $otherclause="" ; $alias="T"; $result_array = _getRows($objectIndex, $fields, $whereclause, $otherclause, $alias); $count=count($result_array); // $tdate=$today=date('Y-m-d'); commented by vivek on 06-feb-2008 $tdate=date('Y-m-d'); $fieldsc = "co_id,count(*)"; $objectIndexc = "CLRD"; if($_GET['mon']=='y' || $month!="") $whereclausec = " where C.calldetail like '%$today%' "; else $whereclausec = " where C.calldetail like '$tdate%'"; $otherclausec=" group by co_id"; $aliasc="C"; $result_arrayc = _getRows($objectIndexc, $fieldsc, $whereclausec, $otherclausec, $aliasc); //print_r ($result_arrayc); $res_names=array(); $res_ids=''; for($i=0;$i<count($result_array);$i++) { $res_names[$i]['id']=$result_array[$i][1]; $res_names[$i]['name']=$result_array[$i][0]; $res_names[$i]['meeting']=0; $res_names[$i]['signup']=0; $res_names[$i]['calls']=0; $res_names[$i]['sharedsign']=0; $res_ids.=$result_array[$i][1].","; } $res_ids=substr($res_ids,0,-1); $fields11 = "M.co_id,count(1)"; $objectIndex11 = "MEET,ASGN"; $otherclause11=""; $alias11="M,U"; $whereclause11 = "where M.userid=U.userid and U.meeting=2 and M.closed=0"; if($_GET['mon']=='y'|| $month!="") $whereclause11.= " and M.date like '%$today%' and year(M.date)='".$year."' "; else $whereclause11.= " and M.date='$today' "; $whereclause11.= " and M.came='y' and M.co_id in (".$res_ids.")"; $otherclause11=" group by M.co_id"; $result_array11 = _getRows($objectIndex11, $fields11, $whereclause11, $otherclause11, $alias11); $fields12 = " coid,count(1)"; $objectIndex12 = "SGN"; $otherclause12=" group by coid"; $alias12=""; if($_GET['mon']=='y' || $month!="") $whereclause12 = "where sdate like '%$today%' and year(sdate)='$year'"; else $whereclause12 = "where sdate='$today' "; $whereclause12.= " and coid in (".$res_ids.")"; $result_array12 = _getRows($objectIndex12, $fields12, $whereclause12, $otherclause12, $alias12); $fields16 = " coid,count(1)"; $objectIndex16 = "SGN"; $otherclause16=" group by sharedwith"; $alias12=""; if($_GET['mon']=='y' || $month!="") $whereclause16 = "where sdate like '%$today%' and year(sdate)='$year'"; else $whereclause16 = "where sdate='$today'"; $whereclause16.= " and sharedwith in (".$res_ids.")"; $result_array16 = _getRows($objectIndex16, $fields16, $whereclause16, $otherclause16, $alias16); //sharedsign for($j=0;$j<count($result_array16);$j++) { for($i=0;$i<count($result_array);$i++) { if($res_names[$i]['id']==$result_array16[$j][0]) $res_names[$i]['sharedsign']=$result_array16[$j][1]; } } for($j=0;$j<count($result_array11);$j++) { for($i=0;$i<count($result_array);$i++) { if($res_names[$i]['id']==$result_array11[$j][0]) $res_names[$i]['meeting']=$result_array11[$j][1]; } } for($z=0;$z<count($result_array12);$z++) { for($i=0;$i<count($result_array);$i++) { if($res_names[$i]['id']==$result_array12[$z][0]) $res_names[$i]['signup']=$result_array12[$z][1]; } } for($q=0;$q<count($result_arrayc);$q++) { for($i=0;$i<count($result_array);$i++) { if($res_names[$i]['id']==$result_arrayc[$q][0]) $res_names[$i]['calls']=$result_arrayc[$q][1]; } //$res_names=""; } //print_r ($res_names) ."
"; ?>

		</table>
	</td>
Month:- >January >February >March >April >May >June >July >August >September >October >November >December

 

<?php $curryr=date(Y); ?>

  Year

<?php for($i=2006;$i<=$curryr;$i++) {?> > <?php echo $i ?> <?php } ?>

 

<?php $j=0; for($i=0;$i<count($res_names);$i++) { $id =$res_names[$i]['id']; $name=$res_names[$i]['name']; $meeting=$res_names[$i]['meeting']; $calls=$res_names[$i]['calls']; $signup=$res_names[$i]['signup']; $sharedsign=$res_names[$i]['sharedsign']; $j=$j+1;

?>

<?php }?>
Marketing Executives status
Sr no Co-ordinator name Calls Meetings Sign Up Shared SignUp
<?php echo $j ?> <?php echo $name?> <?php if($calls>0){ //echo " calles found
" ; if($_GET['mon']=='y' || $month!=""){ ?> <?php }else{ ?> <?php } echo $calls ?> <?php }else{ ?> <?php echo $calls ?> <?php }?>
<?php if($meeting>0){?> <?php echo $meeting;?> <?php }else{ ?> <?php echo $meeting ?> <?php }?> <?php if($signup>0){?>

<?php echo $signup;?>

<?php }else{?> <?php echo $signup; ?> <?php for($signup=0;$signup>0;$signup++) { ob_start(); include'dailysigndetails.php'; ob_end_clean(); $x=$x+$total; echo $x; } ?>
	<?php } ?>
<?php if($sharedsign>0){?> <?php echo $sharedsign; ?> <?php }else{?> <?php echo $sharedsign ?> <?php } ?>
   Total                      <?php echo $x?>

and here is another code where this page redirect: dailysigndetails.php

<?php include "../includes/config.php"; include "../includes/functions.php"; include"../includes/drop.php"; //include "links.php"; _checkSession(); $coid=$_GET['id']; if (!$coid) $coid=$_POST['coid']; $dd=date('Y-m-d'); $mon=$_GET['mon']; if ($_POST['month']) $month=$_POST['month']; else $month=date('m'); if ($_POST['year']) $year=$_POST['year']; else $year=date('Y'); //echo $dd; //$userid=$_GET['userid']; $fields = "U.name,S.amount,S.payment_mode,S.package,S.comments,S.sharedwith,S.discount,S.sdate,S.userid,S.coid,U.mobile,U.residence,U.sourcecode"; $objectIndex = "SGN,USD"; $whereclause = "where S.userid=U.userid and (S.sharedwith=$coid or S.coid=$coid)" ; if($mon=='y') { $whereclause.= " and month(sdate)='$month' "; $whereclause.= "and year(sdate)='$year'"; } elseif($mon=='n') $whereclause.= " and sdate='$dd' "; else { $whereclause.= " and month(sdate)='$month' "; $whereclause.= "and year(sdate)='$year'"; } //echo $whereclause; $otherclause=""; $alias="S,U"; $result_array = _getRows($objectIndex, $fields, $whereclause, $otherclause, $alias); //print_r ($result_array); $count=count($result_array); ?>
<?php $objectIndex3="SRC"; $fields3="id, name"; $result_source = _getRows($objectIndex3, $fields3, '', '', ''); for($j=0;$j <?php }?>
jan Feb march april may june july august sept oct nove dec 2010 2009 2008  
View Sign up
Sr no User Name Source Phone Amount My Share Payment mode package Share Discount SignUp date comments
<?php echo $i+1?> <?php echo $name?> <?php echo $source ?> <?php echo $mobile?> <?php echo $amount?> <?php echo $myshare?> <?php echo $paymentmode?> <?php echo $package?> <?php echo $result_name[0][0] ?>/<?php echo $result_name[1][0]?> <?php echo $discount?> <?php echo $sdate?> View comments
   Total                        <?php echo $total?>

ok…nxt tym whn i come across any query related to code i’l definatly post it…m nt posting dat code nw cz i got d soln for my problem…nyways…thanks for responding…
regards…

Sponsor our Newsletter | Privacy Policy | Terms of Service