Your IP : 3.129.194.30


Current Path : /home/lentoinv/churchmr.com/report/
Upload File :
Current File : /home/lentoinv/churchmr.com/report/chart3.php

 <?php     session_start(); ob_start();
  include("../cludes/connect.inc.php");
	

	  
	  
$did= $_SESSION['dsn'];
?>
<?php 
		//$year = 15 ;
$wk = date('W');
$year = date('y');
if(date('D')=="Sun"){$cw=$wk+1; } else{$cw=$wk;}	

	$wk1 = $cw ;
	$wk2 = $wk1-1 ;
	$wk3 = $wk1-2 ;
	$wk4 = $wk1-3 ;
	$wk5 = $wk1-4 ;
	$wk6 = $wk1-5 ;
	$wk7 = $wk1-6 ;
	$wk8 = $wk1-7 ;


	
	
	  $resu = $db->query("SELECT * FROM report WHERE ww = '$wk1' AND did='$did' AND psn=1 "); 
$rr = mysqli_fetch_assoc($resu);  $a1=$rr['total']+0;
	  $resu = $db->query("SELECT * FROM report WHERE ww = '$wk2' AND did='$did' AND psn=1 "); 
$rr = mysqli_fetch_assoc($resu);  $a2=$rr['total']+0;
	  $resu = $db->query("SELECT * FROM report WHERE ww = '$wk3' AND did='$did' AND psn=1 "); 
$rr = mysqli_fetch_assoc($resu);  $a3=$rr['total']+0;
	  $resu = $db->query("SELECT * FROM report WHERE ww = '$wk4' AND did='$did' AND psn=1 "); 
$rr = mysqli_fetch_assoc($resu);  $a4=$rr['total']+0;
	  $resu = $db->query("SELECT * FROM report WHERE ww = '$wk5' AND did='$did' AND psn=1 "); 
$rr = mysqli_fetch_assoc($resu);  $a5=$rr['total']+0;
	  $resu = $db->query("SELECT * FROM report WHERE ww = '$wk6' AND did='$did' AND psn=1 "); 
$rr = mysqli_fetch_assoc($resu);  $a6=$rr['total']+0;
	  $resu = $db->query("SELECT * FROM report WHERE ww = '$wk7' AND did='$did' AND psn=1 "); 
$rr = mysqli_fetch_assoc($resu);  $a7=$rr['total']+0;
	  $resu = $db->query("SELECT * FROM report WHERE ww = '$wk8' AND did='$did' AND psn=1 "); 
$rr = mysqli_fetch_assoc($resu);  $a8=$rr['total']+0;
	

	 
 $p = new chartphp(); 
$st = '320'; 
$p->data = array(array(array($wk8,$a8),array($wk7,$a7),array($wk6,$a6),array($wk5,$a5),array($wk4,$a4),array($wk3,$a3),array($wk2,$a2),array($wk1,$a1)));
$p->chart_type = "bar"; 

// Common Options 
$p->xlabel = "Weeks"; 
$p->ylabel = "Attendance"; 
//$p->options["axes"]["yaxis"]["tickOptions"]["prefix"] = '=N='; 
$p->title = "Weekly Church Growth Chart"; 
$out2 = $p->render('c2'); 
?> 
 
        <div style="width:50%; min-width:100%;"> 
            <?php echo $out2; ?> 
        </div> 

?>