Your IP : 3.141.45.90
<?php
session_start(); ob_start();
include('control.php');
$data = json_decode($_SESSION['userdata']);
extract($_GET);
if($type=='getpid'){
$x = $pro->fetchProgramReport($pid);
echo $x;
$y = json_decode($x,true);
echo $y[3]['off'];
}
if($type=='reportdata'){
echo $pro->fetchReport($pid, $did);
}
if($type=='showstat'){
echo $pro->showStat($data->sn);
}
if($type=='addmember'){
echo $pro->AddNewMember();
}
if($type=='programopt'){
$opt = '';
$ymd = date('ymd');
$sql = $db->query("SELECT * FROM progs WHERE ymd<='$ymd' AND x=1 ORDER BY ymd DESC LIMIT 100 ") or die(mysqli_error($db));
while($row=mysqli_fetch_array($sql)){ $opt .= '<option value="'.$row['sn'].'">'.$row['date'].' '.$row['prog'].'</option>'; }
echo $opt;
}
if($type=='memberopt'){
$opt = '';
$sql = $db->query("SELECT * FROM mdata WHERE did<='$data->sn' ORDER BY surname ") or die(mysqli_error($db));
while($row=mysqli_fetch_array($sql)){ $opt .= '<option value="'.$row['sn'].'">'.$row['surname'].' '.$row['firstname'].' '.$row['othername'].'</option>'; }
echo $opt;
}
if($type=='districtdata'){
$ab = $pro->districtData();
$_SESSION['didata'] = $ab;
//setcookie('didata', $ab, time() + (86400*30), '/');
echo $ab;
}
if($type=='addreport'){
echo $pro->submitReport($pid, $a1, $a2, $a3, $a4, $a5, $a6, $a7, $a8, $a9, $a10, $a11, $prog, $pdate);
}
if($type=='addinvite'){
echo $pro->submitInvite($a1, $a2, $a3, $a4, $a5);
}
if($type=='invitelist'){$i=1;
$sql = $db->query("SELECT * FROM idata WHERE did = '$data->sn' ORDER BY created DESC ");
while($row=mysqli_fetch_assoc($sql)){ $e=$i++;
echo '<tr><td>'.$e.'</td><td>'.$row['surname'].'</td><td>'.$row['sex'].'</td><td>'.$row['phone'].'</td><td>'.$row['address'].'</td><td>'.userName($row['rep']).'</td></tr>';
}
}
if($type=='invitelistall'){$a=1; $total=0; $m='';
$s = $db->query("SELECT * FROM zone WHERE rid = '$data->rid' ORDER BY zone ASC ");
while($r=mysqli_fetch_assoc($s)){ $b=$a++; $gid = $r['sn'];
echo '<tr><th>'.$b.'</th><th colspan="6">'.strtoupper($r['zone']).'</th></tr>';
$sql = $db->query("SELECT * FROM idata WHERE gid = '$gid' ORDER BY did ASC ");
$i=1;
while($row=mysqli_fetch_assoc($sql)){ $e=$i++; $total += 1;$m .= $row['phone'].',';
echo '<tr><td>'.$e.'</td><td>'.$row['surname'].'</td><td>'.$row['sex'].'</td><td>'.$row['phone'].'</td><td>'.$row['address'].'</td><td>'.userName($row['rep']).'</td><td>'.sqLx('district','sn',$row['did'],'district').'</td></tr>';
}
}
echo '<tr><th></th><th colspan="6"> TOTAL INVITEES: '.number_format($total).'</th></tr>';
// $sql = $db->query("SELECT * FROM idata WHERE rid = '$data->rid' ORDER BY sn ASC LIMIT 300");
// while($row=mysqli_fetch_assoc($sql)){ $e=$i++; $total += 1;$m .= $row['phone'].','; }
// echo '<tr><td colspan="6">'.$m.'</td><tr>';
}
if($type=='invitelistgroup'){$gid = $_SESSION['gid']; $a=1;
$s = $db->query("SELECT * FROM district WHERE gid = '$gid' ORDER BY district ASC ");
while($r=mysqli_fetch_assoc($s)){ $b=$a++; $did = $r['sn'];
echo '<tr><th>'.$b.'</th><th colspan="6">'.strtoupper($r['district']).'</th></tr>';
$sql = $db->query("SELECT * FROM idata WHERE did = '$did' ORDER BY surname ASC ");
$i=1;
while($row=mysqli_fetch_assoc($sql)){ $e=$i++;
echo '<tr><td>'.$e.'</td><td>'.$row['surname'].'</td><td>'.$row['sex'].'</td><td>'.$row['phone'].'</td><td>'.$row['address'].'</td><td>'.userName($row['rep']).'</td><td>'.sqLx('district','sn',$row['did'],'district').'</td></tr>';
}
}
}
if($type=='editreport'){
echo $pro->updateReport($sn, $a1, $a2, $a3, $a4, $a5, $a6, $a7, $a8, $a9, $a10, $a11);
}
if($type=='memberlist'){
if($mode==1){$sql = $db->query("SELECT * FROM mdata WHERE did = '$data->sn' ORDER BY surname ASC ") or die(mysqli_error($db)); }
elseif($mode==2){$sql = $db->query("SELECT * FROM mdata WHERE did = '$data->sn' AND worker=1 ORDER BY surname ASC ") or die(mysqli_error($db)); }
elseif($mode==3){$sql = $db->query("SELECT * FROM mdata WHERE did = '$data->sn' AND leader=1 ORDER BY surname ASC ") or die(mysqli_error($db)); }
elseif($mode==4){$sql = $db->query("SELECT * FROM cdata WHERE did = '$data->sn' AND work=1 ORDER BY surname ASC ") or die(mysqli_error($db)); }
elseif($mode==5){$sql = $db->query("SELECT * FROM cdata WHERE did = '$data->sn' AND work=0 ORDER BY surname ASC ") or die(mysqli_error($db)); }
echo '<table class="table table-sm"><tr><th>SN</td><th>Name</td><th>Section</td></tr>';
$i=1;
while($row=mysqli_fetch_array($sql)){ $e=$i++;
echo '<tr><td>'.$e.'</td><td>'.userName($row['sn']).'</td><td>'.$row['section'].'</td></tr>';
}
echo '</table>';
}
if($type=='weeklyrep'){
$sql = $db->query("SELECT * FROM progs WHERE ymd<='$ymd' AND yy = '$year' AND ww='$wk' AND x=1 ORDER BY ymd ASC ") or die(mysqli_error($db));
while($row=mysqli_fetch_array($sql)){ $pid = $row['sn']; $date = $row['date'];
$prog = $row['prog'];
$ymdx = $row['ymd'];
$num = sqL2('report','pid',$pid,'did',$data->sn);
if($num==1){
$re = $db->query("SELECT * FROM report WHERE pid = '$pid' AND did = '$data->sn' ") or die(mysqli_error());
$rc=mysqli_fetch_array($re);
$male = $rc['a1']+$rc['y1']+$rc['c1'];
$female = $rc['a2']+$rc['y2']+$rc['c2'];
$frep = $pro->fetchReport($pid, $data->sn);
?>
<script type="text/javascript">
sessionStorage.setItem('<?= $pid ?>','<?= $frep ?>');
</script>
<div class="col-md-4 col-sm-6 col-xs-12" style="padding:0 10px">
<div class="info-box" style="border: thin solid #CCC;" onclick="popModalEdit('<?= $pid ?>','<?= $data->sn ?>')">
<span class="info-box-icon bg-green-active"><i class="fa fa-calendar-check-o"></i></span>
<div class="info-box-content">
<span class="info-box-text"><center><strong><?= $prog ?><br><?= $date ?></strong></center> </span>
<input name="pid" type="hidden" value="<?php echo $pid; ?>">
<div>
<table class="table table-sm" style="margin: 0; padding:0">
<tr><td><b>AD</b><br><?= $rc['a1']+$rc['a2'] ?></td><td><b>YO</b><br><?= $rc['y1']+$rc['y2'] ?></td><td><b>CH</b><br><?= $rc['c1']+$rc['c2'] ?></td><td><b>T</b><br><?= $male+$female ?></td><td><b>OFF</b><br>N<?= number_format($rc['off']) ?></td></tr>
</table>
</div>
</div><!-- /.info-box-content -->
</div><!-- /.info-box -->
</div><!-- /.col -->
<?php }else{ ?>
<div class="col-md-4 col-sm-6 col-xs-12" style="padding:0 10px">
<div class="info-box" style="border: thin solid #CCC;" id="popModal" data-prog="<?= strtoupper($prog) ?>" data-date="<?= strtoupper($date) ?>" data-pid="<?= $pid ?>" >
<span class="info-box-icon bg-aqua-active"><i class="fa fa-calendar-times-o"></i></span>
<div class="info-box-content">
<span class="info-box-text"><center><strong><?= $prog ?><br><?= $date ?></strong></center> </span>
<button type="button" class="btn btn-primary btn-sm btn-block">SUBMIT REPORT</button>
</div><!-- /.info-box-content -->
</div><!-- /.info-box -->
</div><!-- /.col -->
<?php } } } ?>
<?php
if($type=='pendingrep'){
$created = $pro->firstReport($data->sn);//date('ymd',strtotime(sqLx('district','sn',$data->sn,'created')));
$sql = $db->query("SELECT * FROM progs WHERE ymd<'$ymd' AND ymd>='$created' AND x=1 ORDER BY sn DESC LIMIT 40") or die(mysqli_error());
$m = array();
while($row=mysqli_fetch_array($sql)){ $pid = $row['sn']; $date = $row['date'];
$prog = $row['prog'];
$ymdx = $row['ymd'];
$num = sqL2('report','pid',$pid,'did',$data->sn);
if($num==0){
$m[] = array('prog'=>$prog,'date'=>$date,'pid'=>$pid);
?>
<?php } } $pend=json_encode($m); setcookie('penda', $pend, time() + 86400, '/'); echo $pend;
} ?>
<?php
if($type=='allpending'){ $mm = date('m',$time); $yy = date('y',$time);
$created = $pro->firstReport($data->sn);//date('ymd',strtotime(sqLx('district','sn',$data->sn,'created')));
$sql = $db->query("SELECT * FROM progs WHERE yy='$yy' AND ymd<'$ymd' AND ymd>='$created' AND mm='$mm' AND x=1 ORDER BY sn DESC ") or die(mysqli_error());
$i=0;
while($row=mysqli_fetch_array($sql)){ $pid = $row['sn']; $date = $row['date'];
$prog = $row['prog'];
$ymdx = $row['ymd'];
$num = sqL2('report','pid',$pid,'did',$data->sn);
if($num==0){ $i += 1;
?>
<div class="col-md-4 col-sm-6 col-xs-12" style="padding:0 10px">
<div class="info-box" style="border: thin solid #CCC;" id="popModal" data-prog="<?= strtoupper($prog) ?>" data-date="<?= strtoupper($date) ?>" data-pid="<?= $pid ?>">
<span class="info-box-icon bg-maroon-active"><i class="fa fa-calendar-times-o"></i></span>
<div class="info-box-content">
<span class="info-box-text"><center><strong><?= $prog ?><br><?= $date ?></strong></center> </span>
<button type="button" class="btn btn-danger btn-sm btn-block">SUBMIT REPORT</button>
</div><!-- /.info-box-content -->
</div><!-- /.info-box -->
</div><!-- /.col -->
<?php } }
if($i==0){ echo '<center><h4>No pending report for this month</h4></center>'; }
} ?>
<?php if($type=='recentrep'){
$re = $db->query("SELECT * FROM report WHERE did = '$data->sn' ORDER BY sn DESC LIMIT 3") or die(mysqli_error()); $i=1;
while($rc=mysqli_fetch_array($re)){ $pid=$rc['pid']; $e=$i++;
$male = $rc['a1']+$rc['y1']+$rc['c1'];
$female = $rc['a2']+$rc['y2']+$rc['c2'];
$frep = $pro->fetchReport($pid, $data->sn);
?>
<script type="text/javascript">
sessionStorage.setItem('<?= $pid ?>','<?= $frep ?>');
sessionStorage.setItem('p'+'<?= $e ?>','<?= $pid ?>');
</script>
<div class="col-md-4 col-sm-6 col-xs-12" style="padding:0 10px">
<div class="info-box" style="border: thin solid #CCC; " onclick="popModalEdit('<?= $pid ?>','<?= $data->sn ?>')">
<span class="info-box-icon bg-green-active"><i class="fa fa-calendar-check-o"></i></span>
<div class="info-box-content">
<span class="info-box-text"><center><strong><?= $rc['prog'] ?><br><?= $rc['day'] ?></strong></center> </span>
<div>
<table class="table table-sm" style="margin: 0; padding:0">
<tr><td><b>AD</b><br><?= $rc['a1']+$rc['a2'] ?></td><td><b>YO</b><br><?= $rc['y1']+$rc['y2'] ?></td><td><b>CH</b><br><?= $rc['c1']+$rc['c2'] ?></td><td><b>T</b><br><?= $male+$female ?></td><td><b>OFF</b><br>N<?= number_format($rc['off']) ?></td></tr>
</table>
</div>
</div><!-- /.info-box-content -->
</div><!-- /.info-box -->
</div><!-- /.col -->
<?php }
echo '<em style="padding-left:15px">Click a report to update it</em>';
} ?>
<?php
if($type=='showmonth'){ echo ': '.strtoupper(date('F Y',$time)); }
if($type=='showhistory'){ $year = date('y',$time); $month = date('m',$time);
$sql = $db->query("SELECT * FROM progs WHERE yy='$year' AND mm='$month' AND x=1 "); ?>
<table class="table table-sm">
<tr>
<th>SN</th><th>Date</th><th>Program</th><th>AM</th><th>AF</th><th>YM</th><th>YF</th><th>CM</th><th>CF</th><th>Total</th><th>Offering</th><th>S.Off</th><th>Comment</th>
</tr>
<?php $i=1; $la = $bel = ''; while($row=mysqli_fetch_assoc($sql)){ $sn=$row['sn']; $e=$i++; $raw = json_decode($pro->fetchPidReport($sn,$data->sn)); $dat = substr($row['prog'],0,3).'/'.substr($row['date'],0,2); $bel .= '['.$e.','.$raw->total.'],';
$la .= "[".$e.",'".$dat."'],";
echo '<tr><td>'.$e.'</td><td>'.$row['date'].'</td><td>'.abbreviate($row['prog']).'</td><td>'.$raw->a1.'</td><td>'.$raw->a2.'</td><td>'.$raw->y1.'</td><td>'.$raw->y2.'</td><td>'.$raw->c1.'</td><td>'.$raw->c2.'</td><td>'.$raw->total.'</td><td>'.number_format($raw->off).'</td><td>'.number_format($raw->soff).'</td><td>'.$raw->rem.'</td></tr>'; }
?>
</table>
<h4>Graphical Presentation</h4>
<div id="bar-chart" style="height: 300px; margin-top:10px"></div>
<script type="text/javascript">
$(function () {
/*
* BAR CHART
* ---------
*/
var bar_data = {
data : [<?= $bel ?>],
bars: { show: true }
}
$.plot('#bar-chart', [bar_data], {
grid : {
borderWidth: 1,
borderColor: '#f3f3f3',
tickColor : '#f3f3f3'
},
series: {
bars: {
show: true, barWidth: 0.5, align: 'center',
},
},
colors: ['#3c8dbc'],
xaxis : {
ticks: [<?= $la ?>]
}
})
/* END BAR CHART */
})
</script>
<?php } ?>
<?php
if($type=='showgrowthhistory'){ $g = rangeMonth($from,$to); if($g>12 OR $g<1){ echo '<center><h4>You have entered an invalid data range</h4></center>';}else{ $fr = date('ym01',$from); $t = date('ymt',$to);
$sql = $db->query("SELECT * FROM progs WHERE day='$prog' AND ymd BETWEEN '$fr' AND '$t' ");
?>
<table class="table table-sm">
<tr>
<th>SN</th><th>Date</th><th>Program</th><th>AM</th><th>AF</th><th>YM</th><th>YF</th><th>CM</th><th>CF</th><th>Total</th><th>Offering</th><th>S.Off</th><th>Comment</th>
</tr>
<?php $i=1; $la = $bel = ''; while($row=mysqli_fetch_assoc($sql)){ $sn=$row['sn']; $e=$i++; $raw = json_decode($pro->fetchPidReport($sn,$data->sn)); $dat = substr($row['prog'],0,3).'/'.substr($row['date'],0,2); $bel .= '['.$e.','.$raw->total.'],';
$la .= "[".$e.",'".$dat."'],";
echo '<tr><td>'.$e.'</td><td>'.$row['date'].'</td><td>'.abbreviate($row['prog']).'</td><td>'.$raw->a1.'</td><td>'.$raw->a2.'</td><td>'.$raw->y1.'</td><td>'.$raw->y2.'</td><td>'.$raw->c1.'</td><td>'.$raw->c2.'</td><td>'.$raw->total.'</td><td>'.number_format($raw->off).'</td><td>'.number_format($raw->soff).'</td><td>'.$raw->rem.'</td></tr>'; }
?>
</table>
<h4>Graphical Presentation</h4>
<div id="bar-chart" style="height: 300px; margin-top:10px"></div>
<script type="text/javascript">
$(function () {
/*
* BAR CHART
* ---------
*/
var bar_data = {
data : [<?= $bel ?>],
bars: { show: true }
}
$.plot('#bar-chart', [bar_data], {
grid : {
borderWidth: 1,
borderColor: '#f3f3f3',
tickColor : '#f3f3f3'
},
series: {
bars: {
show: true, barWidth: 0.5, align: 'center',
},
},
colors: ['#3c8dbc'],
xaxis : {
ticks: [<?= $la ?>]
}
})
/* END BAR CHART */
})
</script>
<?php } } ?>
<?php
if($type=='programtable'){
$x = $pro->fetchProgramReport($pid);
//echo $x;
$y = json_decode($x,true);
function grow($did,$v){
global $y;
if(!isset($y[$did])){return 0; }
return $y[$did][$v];
}
?>
<center> <h4 class="box-title">DEEPER LIFE BIBLE CHURCH, <?= strtoupper(sqLx('region','sn',$data->rid,'region')) ?> REGION<br>DOCUMENTATION FOR <?php echo strtoupper(sqLx('progs','sn',$pid,'prog')); ?>, DATE: <?php echo strtoupper(sqLx('progs','sn',$pid,'date')); ?></h4></center>
<table id="example1" class="table table-bordered table-sm ">
<thead>
<tr>
<th></th>
<th></th>
<th colspan="3"><center>ADULT</center></th>
<th colspan="3"><center>YOUTH</center></th>
<th></th>
<th colspan="3"><center>CHILDREN</center></th>
<th></th>
<th>VIS</th>
<th>CONV</th>
</tr>
<tr>
<th>SN</th>
<th>GROUP/DISTRICT</th>
<th>M</th>
<th>F</th>
<th>T</th>
<th>B</th>
<th>G</th>
<th>T</th>
<th>SUB.T</th>
<th>B</th>
<th>G</th>
<th>T</th>
<th>ROW.T</th>
<th></th>
<th></th>
</tr>
</thead>
</thead>
<tbody>
<?php $rid=$data->rid; $p=1; $que=$db->query("SELECT * FROM zone WHERE rid='$rid' ORDER BY zone ASC " )or die(mysqli_error());
while($rw=mysqli_fetch_array($que)){
$zone = $rw['zone'];
$gid = $rw['sn'];
$q=$p++; ?>
<tr> <th class="center"><?php echo $q ?></th>
<th colspan="14"><?php echo strtoupper($rw['zone']); ?></th> </tr>
<?php $i=1;
$a1=$a2=$a3=$a4=$a5=$a6=$a7=$a8=$a9=$a10=$a11=$a12=$a13=0;
$query=$db->query("SELECT * FROM district WHERE gid='$gid' ORDER BY district ASC " )or die(mysqli_error());
while($row=mysqli_fetch_array($query)){
$did = $row['sn'];
$e=$i++ ;
$b1 = grow($did,'a1'); $a1 += $b1;
$b2 = grow($did,'a2'); $a2 += $b2;
$b3 = $b1+$b2; $a3 += $b3;
$b4 = grow($did,'y1'); $a4 += $b4;
$b5 = grow($did,'y2'); $a5 += $b5;
$b6 = $b4+$b5; $a6 += $b6;
$b7 = grow($did,'c1'); $a7 += $b7;
$b8 = grow($did,'c2'); $a8 += $b8;
$b9 = $b7+$b8; $a9 += $b9;
$b10 = $b3+$b6; $a10 += $b10;
$b11 = $b9+$b10; $a11 += $b11;
$vis = grow($did,'vis'); $a12 += $vis;
$conv = grow($did,'conv'); $a13 += $conv;
?>
<tr class="odd gradeX">
<td class="center"><?php echo $e ?></td>
<td><?= $row['district']; ?></td>
<td><?= $b1 ?></td>
<td><?= $b2 ?></td>
<td><?= $b3 ?></td>
<td><?= $b4 ?></td>
<td><?= $b5 ?></td>
<td><?= $b6 ?></td>
<td><?= $b10 ?></td>
<td><?= $b7 ?></td>
<td><?= $b8 ?></td>
<td><?= $b9 ?></td>
<td><?= $b11 ?></td>
<td><?= $vis ?></td>
<td><?= $conv ?></td>
</tr>
<?php } ?>
<tr class="odd gradeX">
<th></td> <td class="center" colspan=""><strong>SUB-TOTAL</strong></td>
<th><?= $a1 ?></th>
<th><?= $a2 ?></th>
<th><?= $a3 ?></th>
<th><?= $a4 ?></th>
<th><?= $a5 ?></th>
<th><?= $a6 ?></th>
<th><?= $a10 ?></th>
<th><?= $a7 ?></th>
<th><?= $a8 ?></th>
<th><?= $a9 ?></th>
<th><?= $a11 ?></th>
<th><?= $a12 ?></th>
<th><?= $a13 ?></th>
</tr>
<?php } ?>
<?php
$c1 = colSum1('report', 'a1', 'pid', $pid);
$c2 = colSum1('report', 'a2', 'pid', $pid);
$c3 = $c1+$c2;
$c4 = colSum1('report', 'y1', 'pid', $pid);
$c5 = colSum1('report', 'y2', 'pid', $pid);
$c6 = $c4+$c5;
$c7 = colSum1('report', 'c1', 'pid', $pid);
$c8 = colSum1('report', 'c2', 'pid', $pid);
$c9 = $c7+$c8;
$c10 = $c3+$c6;
$c11 = $c9+$c10;
$c12 = colSum1('report', 'vis', 'pid', $pid);
$c13 = colSum1('report', 'conv', 'pid', $pid);
?>
<tr class="odd gradeX">
<th class="center"></th>
<th>GRAND TOTAL</th>
<th><?= $c1 ?></th>
<th><?= $c2 ?></th>
<th><?= $c3 ?></th>
<th><?= $c4 ?></th>
<th><?= $c5 ?></th>
<th><?= $c6 ?></th>
<th><?= $c10 ?></th>
<th><?= $c7 ?></th>
<th><?= $c8 ?></th>
<th><?= $c9 ?></th>
<th><?= $c11 ?></th>
<th><?= $c12 ?></th>
<th><?= $c13 ?></th>
</tr>
</tbody>
</table>
<?php } ?>
<?php
if($type=='programtable2'){
$x = $pro->fetchProgramReport($pid);
//echo $x;
$y = json_decode($x,true);
function grow($did,$v){
global $y;
if(!isset($y[$did])){return 0; }
return $y[$did][$v];
}
?>
<center> <h4 class="box-title">DEEPER LIFE BIBLE CHURCH, <?= strtoupper(sqLx('region','sn',$data->rid,'region')) ?> REGION<br>DOCUMENTATION FOR <?php echo strtoupper(sqLx('progs','sn',$pid,'prog')); ?>, DATE: <?php echo strtoupper(sqLx('progs','sn',$pid,'date')); ?></h4></center>
<table id="example1" class="table table-bordered table-sm ">
<thead>
<tr>
<th></th>
<th></th>
<th colspan="3"><center>ADULT</center></th>
<th colspan="3"><center>YOUTH</center></th>
<th></th>
<th colspan="3"><center>CHILDREN</center></th>
<th></th>
<th>VIS</th>
<th>CONV</th>
</tr>
<tr>
<th>SN</th>
<th>GROUP/DISTRICT</th>
<th>M</th>
<th>F</th>
<th>T</th>
<th>B</th>
<th>G</th>
<th>T</th>
<th>SUB.T</th>
<th>B</th>
<th>G</th>
<th>T</th>
<th>ROW.T</th>
<th></th>
<th></th>
</tr>
</thead>
</thead>
<tbody>
<?php $rid=$data->rid; $p=1; $que=$db->query("SELECT * FROM zone WHERE rid='$rid' ORDER BY zone ASC " )or die(mysqli_error());
while($rw=mysqli_fetch_array($que)){
$zone = $rw['zone'];
$gid = $rw['sn'];
$q=$p++; ?>
<!--<tr> <th class="center"><?php echo $q ?></th>-->
<!-- <th colspan="12"><?php echo strtoupper($rw['zone']); ?></th> </tr>-->
<?php $i=1;
$a1=$a2=$a3=$a4=$a5=$a6=$a7=$a8=$a9=$a10=$a11=$a12=$a13=0;
$query=$db->query("SELECT * FROM district WHERE gid='$gid' ORDER BY district ASC " )or die(mysqli_error());
while($row=mysqli_fetch_array($query)){
$did = $row['sn'];
$e=$i++ ;
$b1 = grow($did,'a1'); $a1 += $b1;
$b2 = grow($did,'a2'); $a2 += $b2;
$b3 = $b1+$b2; $a3 += $b3;
$b4 = grow($did,'y1'); $a4 += $b4;
$b5 = grow($did,'y2'); $a5 += $b5;
$b6 = $b4+$b5; $a6 += $b6;
$b7 = grow($did,'c1'); $a7 += $b7;
$b8 = grow($did,'c2'); $a8 += $b8;
$b9 = $b7+$b8; $a9 += $b9;
$b10 = $b3+$b6; $a10 += $b10;
$b11 = $b9+$b10; $a11 += $b11;
$vis = grow($did,'vis'); $a12 += $vis;
$conv = grow($did,'conv'); $a13 += $conv;
} ?>
<tr class="odd gradeX">
<td><?php echo $q ?></td>
<td class="center" colspan=""><?php echo strtoupper($rw['zone']); ?></td>
<td><?= $a1 ?></td>
<td><?= $a2 ?></td>
<td><?= $a3 ?></td>
<td><?= $a4 ?></td>
<td><?= $a5 ?></td>
<td><?= $a6 ?></td>
<td><?= $a10 ?></td>
<td><?= $a7 ?></td>
<td><?= $a8 ?></td>
<td><?= $a9 ?></td>
<th><?= $a11 ?></th>
<td><?= $a12 ?></td>
<td><?= $a13 ?></td>
</tr>
<?php } ?>
<?php
$c1 = colSum1('report', 'a1', 'pid', $pid);
$c2 = colSum1('report', 'a2', 'pid', $pid);
$c3 = $c1+$c2;
$c4 = colSum1('report', 'y1', 'pid', $pid);
$c5 = colSum1('report', 'y2', 'pid', $pid);
$c6 = $c4+$c5;
$c7 = colSum1('report', 'c1', 'pid', $pid);
$c8 = colSum1('report', 'c2', 'pid', $pid);
$c9 = $c7+$c8;
$c10 = $c3+$c6;
$c11 = $c9+$c10;
$c12 = colSum1('report', 'vis', 'pid', $pid);
$c13 = colSum1('report', 'conv', 'pid', $pid);
?>
<tr class="odd gradeX">
<th class="center"></th>
<th>GRAND TOTAL</th>
<th><?= $c1 ?></th>
<th><?= $c2 ?></th>
<th><?= $c3 ?></th>
<th><?= $c4 ?></th>
<th><?= $c5 ?></th>
<th><?= $c6 ?></th>
<th><?= $c10 ?></th>
<th><?= $c7 ?></th>
<th><?= $c8 ?></th>
<th><?= $c9 ?></th>
<th><?= $c11 ?></th>
<th><?= $c12 ?></th>
<th><?= $c13 ?></th>
</tr>
</tbody>
</table>
<?php } ?>
<?php
if($type=='programtablegr'){
$x = $pro->fetchGroupProgramReport($pid,$data->sn);
$zone = $data->zone;
$gid = $data->sn;
$y = json_decode($x,true);
function grow($did,$v){
global $y;
if(!isset($y[$did])){return 0; }
return $y[$did][$v];
}
?>
<table id="example1" class="table table-bordered table-sm ">
<thead>
<tr>
<th></th>
<th></th>
<th colspan="3"><center>ADULT</center></th>
<th colspan="3"><center>YOUTH</center></th>
<th></th>
<th colspan="3"><center>CHILDREN</center></th>
<th></th>
</tr>
<tr>
<th>SN</th>
<th>DISTRICT</th>
<th>M</th>
<th>F</th>
<th>T</th>
<th>B</th>
<th>G</th>
<th>T</th>
<th>SUB.T</th>
<th>B</th>
<th>G</th>
<th>T</th>
<th>ROW.T</th>
</tr>
</thead>
<tbody>
<?php $i=1;
$a1=$a2=$a3=$a4=$a5=$a6=$a7=$a8=$a9=$a10=$a11=0;
$query=$db->query("SELECT * FROM district WHERE gid='$gid' ORDER BY district ASC " )or die(mysqli_error());
while($row=mysqli_fetch_array($query)){
$did = $row['sn'];
$e=$i++ ;
$b1 = grow($did,'a1'); $a1 += $b1;
$b2 = grow($did,'a2'); $a2 += $b2;
$b3 = $b1+$b2; $a3 += $b3;
$b4 = grow($did,'y1'); $a4 += $b4;
$b5 = grow($did,'y2'); $a5 += $b5;
$b6 = $b4+$b5; $a6 += $b6;
$b7 = grow($did,'c1'); $a7 += $b7;
$b8 = grow($did,'c2'); $a8 += $b8;
$b9 = $b7+$b8; $a9 += $b9;
$b10 = $b3+$b6; $a10 += $b10;
$b11 = $b9+$b10; $a11 += $b11;
?>
<tr class="odd gradeX">
<td class="center"><?php echo $e ?></td>
<td><?= $row['district']; ?></td>
<td><?= $b1 ?></td>
<td><?= $b2 ?></td>
<td><?= $b3 ?></td>
<td><?= $b4 ?></td>
<td><?= $b5 ?></td>
<td><?= $b6 ?></td>
<td><?= $b10 ?></td>
<td><?= $b7 ?></td>
<td><?= $b8 ?></td>
<td><?= $b9 ?></td>
<td><?= $b11 ?></td>
</tr>
<?php } ?>
<tr class="odd gradeX">
<th></td> <td class="center" colspan=""><strong>SUB-TOTAL</strong></td>
<th><?= $a1 ?></th>
<th><?= $a2 ?></th>
<th><?= $a3 ?></th>
<th><?= $a4 ?></th>
<th><?= $a5 ?></th>
<th><?= $a6 ?></th>
<th><?= $a10 ?></th>
<th><?= $a7 ?></th>
<th><?= $a8 ?></th>
<th><?= $a9 ?></th>
<th><?= $a11 ?></th>
</tr>
</tbody>
</table>
<?php } ?>
<?php
if($type=='compliance'){
$yy = date('y',$time); $mm = date('m',$time);
$all = sqL3('progs','x',1,'yy',$yy,'mm',$mm);
$rec = sqL3('report','yy',$yy,'mm',$mm,'rid',$data->rid);
$alldid = $all*sqL1('district','rid',$data->rid);
//echo $mm2;
?>
<center> <h4 class="box-title">DEEPER LIFE BIBLE CHURCH, <?= strtoupper(sqLx('region','sn',$data->rid,'region')) ?> REGION<br>REPORT SUBMISSION COMPLIANCE FOR <?php echo strtoupper(date('F Y',$time)); ?></h4></center>
<table id="example1" class="table table-bordered table-sm ">
<thead>
<tr>
<th>SN</th>
<th>GROUP/DISTRICT</th>
<th>EXPECTED</th>
<th>RECEIVED</th>
<th>REMARK</th>
</tr>
</thead>
<tbody>
<?php $rid=$data->rid; $p=1; $que=$db->query("SELECT * FROM zone WHERE rid='$rid' ORDER BY zone ASC " )or die(mysqli_error());
while($rw=mysqli_fetch_array($que)){
$zone = $rw['zone'];
$gid = $rw['sn'];
$q=$p++; ?>
<tr> <th class="center"><?php echo $q ?></th>
<th colspan="12"><?php echo strtoupper($rw['zone']); ?></th> </tr>
<?php $i=1;
$a1=$a2=$a3=0;
$query=$db->query("SELECT * FROM district WHERE gid='$gid' ORDER BY district ASC " )or die(mysqli_error());
while($row=mysqli_fetch_array($query)){
$did = $row['sn'];
$e=$i++ ;
$b1 = $all; $a1 += $b1;
$b2 = sqL3('report','did',$did,'yy',$yy,'mm',$mm); $a2 += $b2;
$b3 = 100*$b2/$b1; $a3 += $b3;
?>
<tr class="odd gradeX">
<td class="center"><?php echo $e ?></td>
<td><?= $row['district']; ?></td>
<td><?= $b1 ?></td>
<td><?= $b2 ?></td>
<td><?= number_format($b3) ?>%</td>
</tr>
<?php } ?>
<tr class="odd gradeX">
<th></td> <td class="center" colspan=""><strong>SUB-TOTAL</strong></td>
<th><?= $a1 ?></th>
<th><?= $a2 ?></th>
<th><?= number_format($a3/$e) ?>%</th>
</tr>
<?php } ?>
<tr class="odd gradeX">
<th class="center"></th>
<th>GRAND TOTAL</th>
<th><?= $alldid ?></th>
<th><?= $rec ?></th>
<th><?= number_format(100*$rec/$alldid) ?>%</th>
</tr>
</tbody>
</table>
<?php } ?>
<?php
if($type=='compliancegr'){
$gid = $data->sn;
$yy = date('y',$time); $mm = date('m',$time);
$all = sqL3('progs','x',1,'yy',$yy,'mm',$mm);
$rec = sqL3('report','yy',$yy,'mm',$mm,'gid',$gid);
$alldid = $all*sqL1('district','gid',$gid);
//echo $mm2;
?>
<table id="example1" class="table table-bordered table-sm ">
<thead>
<tr>
<th>SN</th>
<th>DISTRICT</th>
<th>EXPECTED</th>
<th>RECEIVED</th>
<th>REMARK</th>
</tr>
</thead>
<tbody>
<?php $i=1;
$a1=$a2=$a3=0;
$query=$db->query("SELECT * FROM district WHERE gid='$gid' ORDER BY district ASC " )or die(mysqli_error());
while($row=mysqli_fetch_array($query)){
$did = $row['sn'];
$e=$i++ ;
$b1 = $all; $a1 += $b1;
$b2 = sqL3('report','did',$did,'yy',$yy,'mm',$mm); $a2 += $b2;
$b3 = 100*$b2/$b1; $a3 += $b3;
?>
<tr class="odd gradeX">
<td class="center"><?php echo $e ?></td>
<td><?= $row['district']; ?></td>
<td><?= $b1 ?></td>
<td><?= $b2 ?></td>
<td><?= number_format($b3) ?>%</td>
</tr>
<?php } ?>
<tr class="odd gradeX">
<th></td> <td class="center" colspan=""><strong>SUB-TOTAL</strong></td>
<th><?= $a1 ?></th>
<th><?= $a2 ?></th>
<th><?= number_format($a3/$e) ?>%</th>
</tr>
</tbody>
</table>
<?php } ?>
<?php
if($type=='sectionform'){
?>
<?php if($section == 'Adult'){ ?>
<p>
<input name="surname" class="form-control" placeholder="Surname*" required >
</p>
<p>
<input name="firstname" class="form-control" placeholder="First Name*" required>
</p>
<p>
<input name="othername" class="form-control" placeholder="Other Names" >
</p>
<input name="familyname" type="hidden" value="0">
<p>
<select name="sex" class="form-control select2" required="">
<option selected disabled value="">SELECT GENDER...</option>
<option>Male</option>
<option>Female</option>
</select>
</p>
<p>
<select name="marital" class="form-control select2" required="">
<option selected disabled value="">SELECT MARITAL STATUS...</option>
<option>Single</option>
<option>Married</option>
<option>Widowed</option>
</select>
</p>
<p>
<i>Date of Birth</i>
<input name="birthday" type="date" class="form-control" placeholder="Date of Birth*" required >
</p>
<p>
<input name="phone2" class="form-control" placeholder="Phone Number (CUG)" >
</p>
<p>
<input name="phone" class="form-control" placeholder="Phone Number (Non CUG)" >
</p>
<p>
<input name="address" class="form-control" placeholder="Detailed Residential Address*" >
</p>
<p>
<input name="addressarea" class="form-control" placeholder="Describe Area, Community, Bus Stop, Junction" >
</p>
<p>
<input name="email" type="email" class="form-control" placeholder="E-mail" >
</p>
<p>
<input name="occupation" class="form-control" placeholder="Occupation" >
</p>
<p>
<input name="office" class="form-control" placeholder="Office Address" >
</p>
<p>
<input name="academic" class="form-control" placeholder="Academic Qualification" >
</p>
<p>
<input name="professional" class="form-control" placeholder="Professional Qualification" >
</p>
<p><span><strong>Church Worker?</strong></span>
<label for="chkYes">
<input type="radio" id="chkYes" name="chkwork" onclick="ShowHideDiv()" value="1" required />
Yes
</label>
<label for="chkNo">
<input type="radio" id="chkNo" name="chkwork" onclick="ShowHideDiv()" value="0" required />
No
</label>
</p>
<div id="dvPassport" style="display: none">
<p>
<select name="designation" class="form-control select2" style="width: 100%">
<option selected disabled>DESIGNATION...</option>
<?php
$query=$db->query("select * FROM port ORDER BY port ASC " )or die(mysqli_error());
while($row=mysqli_fetch_array($query)){
?>
<option><?php echo ucwords($row['port']); ?></option>
<?php } ?>
</select>
</p>
<p>
<select name="aow" class="form-control select2" style="width: 100%">
<option selected disabled>AREA OF WORK...</option>
<?php
$query=$db->query("select * FROM aow ORDER BY aow ASC " )or die(mysqli_error());
while($row=mysqli_fetch_array($query)){
?>
<option><?php echo ucwords($row['aow']); ?></option>
<?php } ?>
</select>
<br><em>Retreats/District Area of Work</em>
</p>
<p> <b>Attends Tuesday Leaders Meeting?</b> <br><strong> <input name="leader" type="radio" value="1" > Yes <input name="leader" type="radio" value="0" > No</strong></p>
</div>
<p>
<button type="button" class="btn btn-primary" onclick="addMember()" style="width:100%">REGISTER ADULT</button>
</p>
<?php } ?>
<?php if($section == 'Campus'){ ?>
<p>
<input name="surname" class="form-control" placeholder="Surname*" required >
</p>
<p>
<input name="firstname" class="form-control" placeholder="First Name*" required>
</p>
<p>
<input name="othername" class="form-control" placeholder="Other Names" >
</p>
<input name="familyname" type="hidden" value="0">
<p>
<select name="sex" class="form-control select2" required="">
<option selected disabled value="">SELECT GENDER...</option>
<option>Male</option>
<option>Female</option>
</select>
</p>
<p>
<select name="marital" class="form-control select2" required="">
<option selected disabled value="">SELECT MARITAL STATUS...</option>
<option>Single</option>
<option>Married</option>
<option>Widowed</option>
</select>
</p>
<p><i>Date of Birth</i>
<input name="birthday" type="date" class="form-control" placeholder="Date of Birth*" required >
</p>
<p>
<input name="phone2" class="form-control" placeholder="Phone Number (CUG)" >
</p>
<p>
<input name="phone" class="form-control" placeholder="Phone Number (Non CUG)" >
</p>
<p>
<input name="address" class="form-control" placeholder="Detailed Residential Address*" >
</p>
<p>
<input name="addressarea" class="form-control" placeholder="Describe Area, Community, Bus Stop, Junction" >
</p>
<p>
<input name="email" type="email" class="form-control" placeholder="E-mail" >
</p>
<p>
<input name="campus" class="form-control" placeholder="Institution/Campus" >
</p>
<p>
<input name="faculty" class="form-control" placeholder="Faculty/School" >
</p>
<p>
<input name="dept" class="form-control" placeholder="Department" >
</p>
<p>
<input name="level" class="form-control" placeholder="Level/Year" >
</p>
<p><span><strong>Church Worker?</strong></span>
<label for="chkYes">
<input type="radio" id="chkYes" name="chkwork" onclick="ShowHideDiv()" value="1" required />
Yes
</label>
<label for="chkNo">
<input type="radio" id="chkNo" name="chkwork" onclick="ShowHideDiv()" value="0" required />
No
</label>
</p>
<div id="dvPassport" style="display: none">
<p>
<select name="designation" class="form-control select2" style="width: 100%">
<option selected disabled value="">DESIGNATION...</option>
<?php
$query=$db->query("select * FROM port ORDER BY port ASC " )or die(mysqli_error());
while($row=mysqli_fetch_array($query)){
?>
<option><?php echo ucwords($row['port']); ?></option>
<?php } ?>
</select>
</p>
<p>
<select name="aow" class="form-control select2" style="width: 100%">
<option selected disabled value="">AREA OF WORK...</option>
<?php
$query=$db->query("select * FROM aow ORDER BY aow ASC " )or die(mysqli_error());
while($row=mysqli_fetch_array($query)){
?>
<option><?php echo ucwords($row['aow']); ?></option>
<?php } ?>
</select>
<br><em>Retreats/District Area of Work</em>
</p>
<p> <b>Attends Tuesday Leaders Meeting?</b> <br><strong> <input name="leader" type="radio" value="1" > Yes <input name="leader" type="radio" value="0" > No</strong></p>
</div>
<p>
<button type="button" class="btn btn-info" style="width:100%" onclick="addMember()">REGISTER CAMPUS STUDENT</button>
</p>
<?php } ?>
<?php if($section == 'Youth'){ ?>
<p>
<input name="surname" class="form-control" placeholder="Surname*" required >
</p>
<p>
<input name="firstname" class="form-control" placeholder="First Name*" required>
</p>
<p>
<input name="othername" class="form-control" placeholder="Other Names" >
</p>
<input name="familyname" type="hidden" value="0">
<p>
<select name="sex" class="form-control select2" required="">
<option selected disabled value="">SELECT GENDER...</option>
<option>Male</option>
<option>Female</option>
</select>
</p>
<p>
<i>Date of Birth</i>
<input name="birthday" type="date" class="form-control" placeholder="Date of Birth*" required >
</p>
<p>
<input name="phone2" class="form-control" placeholder="Phone Number (CUG)" >
</p>
<p>
<input name="phone" class="form-control" placeholder="Phone Number (Non CUG)" >
</p>
<p>
<input name="address" class="form-control" placeholder="Detailed Residential Address*" >
</p>
<p>
<input name="addressarea" class="form-control" placeholder="Describe Area, Community, Bus Stop, Junction" >
</p>
<p>
<input name="email" type="email" class="form-control" placeholder="E-mail" >
</p>
<p><span><strong>Are you a student?</strong></span>
<label for="chkYes">
<input type="radio" id="chkYes" name="chkwork" onclick="ShowHideDiv()" value="1" required />
Student
</label>
<label for="chkNo">
<input type="radio" id="chkNo" name="chkwork" onclick="ShowHideDiv()" value="0" required />
Vocational
</label>
</p>
<div id="dvPassport" style="display: none">
<p><input name="school" class="form-control" placeholder="School" ></p>
<p>
<select name="class" class="form-control select2" style="width: 100%" >
<option selected disabled value="">SELECT CLASS...</option>
<option>JSS 1</option>
<option>JSS 2</option>
<option>JSS 3</option>
<option>SSS 1</option>
<option>SSS 2</option>
<option>SSS 3</option>
<option>EX-STUDENT</option>
</select>
</p>
</div>
<div id="dvPass" style="display: none">
<p><input name="vocation" class="form-control" placeholder="Vocation" ></p>
<p><input name="office" class="form-control" placeholder="Workshop Address" ></p>
</div>
<p>
<button type="button" class="btn btn-success" style="width:100%" onclick="addMember()">REGISTER STUDENT</button>
</p>
<?php } ?>
<?php if($section == 'Children'){ ?>
<p>
<input name="surname" class="form-control" placeholder="Surname*" required >
</p>
<p>
<input name="firstname" class="form-control" placeholder="First Name*" required>
</p>
<p>
<input name="othername" class="form-control" placeholder="Other Names" >
</p>
<input name="familyname" type="hidden" value="0">
<p>
<select name="sex" class="form-control select2" required="">
<option selected disabled value="">SELECT GENDER...</option>
<option>Male</option>
<option>Female</option>
</select>
</p>
<p><i>Date of Birth</i>
<input name="birthday" type="date" class="form-control" placeholder="Date of Birth*" required >
</p>
<p>
<input name="address" class="form-control" placeholder="Detailed Residential Address*" >
</p>
<p>
<input name="addressarea" class="form-control" placeholder="Describe Area, Community, Bus Stop, Junction" >
</p>
<p><input name="school" class="form-control" placeholder="School" ></p>
<p>
<select name="class" class="form-control select2" style="width: 100%" required>
<option selected disabled value="">SELECT CLASS...</option>
<option>PRE NUR</option>
<option>NUR</option>
<option>PRY 1</option>
<option>PRY 2</option>
<option>PRY 3</option>
<option>PRY 4</option>
<option>PRY 5</option>
<option>PRY 6</option>
<option>JSS 1</option>
<option>JSS 2</option>
<option>JSS 3</option>
</select>
</p>
<p>
<button type="button" class="btn btn-warning" style="width:100%" onclick="addMember()">REGISTER CHILD</button>
</p>
<?php } ?>
<script type="text/javascript">
$(".select2").select2();
function ShowHideDiv() {
var chkYes = document.getElementById("chkYes");
var dvPassport = document.getElementById("dvPassport");
dvPassport.style.display = chkYes.checked ? "block" : "none"; }
function Show() {
var kYes = document.getElementById("kYes");
var dvPass = document.getElementById("dvPass");
dvPass.style.display = kYes.checked ? "block" : "none";
}
</script>
<?php }
// ini_set('display_errors','on');
// $i=1; $t=time();
// while($i<1100){$e=$i++;
// $tt = $t+86400*$e;
// $ymd = date('ymd',$tt);
// $yy = date('y',$tt);
// $ww = date('W',$tt);
// $dd = date('d',$tt);
// $day = date('D',$tt);
// $date = date('d-M-Y',$tt);
// $mm = date('m',$tt);
// $month = date('M',$tt);
// $prog = $prog2 = ''; $x=0;
// if($day=='Mon'){$prog='Monday Bible Study'; $x=1; }
// elseif($day=='Thu'){$prog='Thursday Revival Service'; $x=1; }
// elseif($day=='Sun'){$prog='Sunday Worship Service';
// $prog2='Home Caring Fellowship'; $x=1;
// addProg($ymd,$yy,$ww,$dd,$day,$date,$prog2,$month,$mm,$x); }
// addProg($ymd,$yy,$ww,$dd,$day,$date,$prog,$month,$mm,$x);
// }
// $_SESSION['ak47']=1;
?>