Thank you everyone for the suggestions - tried changing REQUEST to POST and still getting 0 results back also tried Drummin’s suggestion and same deal but not sure if I am modifying the code correctly
Here is the entire php code:
<?
session_start();
include_once('../php_class/driverreport.class.php');
$ObjReport=new report();
if(isset($_SESSION['Login_Person']))
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="SHORTCUT ICON" href="../images/vtigercrm_icon.ico">
<link rel="stylesheet" type="text/css" href="../css/report.css">
<script src="../js/jquery-1.8.2.js"></script>
<script type="text/javascript" src="../js/autoMask.js"> </script>
<script type="text/javascript" src="../js/common_function.js"> </script>
<? include_once('../includes/calender_scripts.php'); ?>
<script>
$(function() {
var dates1 = $(".ctrDOB").datepicker({
//minDate: 0 , // Use to do not give previous date in selection
showOn: "button",
buttonImage: "images/cal.gif",
buttonImageOnly: true,
changeYear: true,
changeMonth: true,
yearRange: "2013",
dateFormat: 'mm-dd-yy',
onSelect: function() {
$(this).change();
}
});
});
jQuery(function($){
$(".ctrDateMask").mask("99-99-9999",{placeholder:" "});
});
jQuery(function($){
$(".ctrnumber").mask("99999",{placeholder:" "});
});
$(document).ready(function(){
$(".sort").click(function(){
$("#sort_by").val($(this).attr('id'));
$("#search_val").val($("#search_value").val());
//alert($("#sort_by").val());
document.report_form.submit();
//alert($(this).attr('id'));
//return false;
});
$("#search").click(function(){
$("#search_val").val($("#search_value").val());
document.report_form.submit();
});
$("#search_by_option").change(function(){
$("#search_by").val($(this).val());
});
$("#Status").change(function(){
//if($("#Status").val()==="Please Select")
//alert($(this).val());
});
$("#report_form").submit(function(){
var msg='';
if($("#From_Date").val()=="" && ($("#Campaign").val()=="Please Select")) // || $("#Campaign").val()=="ALL"))
{
msg+='- From Date Can not be blank. \n';
}
if($("#To_Date").val()=="" && ($("#Campaign").val()=="Please Select")) // || $("#Campaign").val()=="ALL"))
{
msg+='- To Date Can not be blank. \n';
}
if($("#Status").val()=="Please Select")
{
msg+='- Status Can not be blank. \n';
}
if($("#School").val()=="Please Select")
{
msg+='- School Name Can not be blank. \n';
}
if($("#Campaign").val()=="Please Select")
{
msg+='- Campaign Can not be blank. \n';
}
if($("#State").val()=="Please Select")
{
msg+='- State Can not be blank. \n';
}
if($("#Rep").val()=="Please Select")
{
msg+='- Rep Can not be blank. \n';
}
if(msg=="")
{
/*
$("#report_submited").click(function(){
//alert('hello');
$.ajax({url:"report_result.php?report_submited=report_submited&Status="+$("#Status").val(),success:function(result){
//alert(result);
$("#report_result_div").html(result);
}});
});*/
return true;
}
else
{
alert("Following information is required! \n\n" +msg);
return false;
}
});
$("#chart").click(function(){
//$("#pie_chart").css('display','block');
$("#pie_chart").css('visibility','visible');
$("#chart_close").css('visibility','visible');
});
$("#chart_close").click(function(){
$("#pie_chart").css('visibility','hidden');
$("#chart_close").css('visibility','hidden');
});
});
</script>
</head>
<body>
<table class="container" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" style="padding:0px">
<? include("../includes/header.php");?>
</td>
</tr>
<tr>
<td colspan="2" style="padding:0px">
<div id='linkheader' dir="ltr" >
<?
if(isset($_SESSION['Login_Person']))
{
?>
<a href="../php_class/login_controller.php?Logout=<?=$_SESSION['Login_Person']?>" >Logout</a>
<div class='divider'></div>
<?
}
?>
<a href="search_student.php">Search Student</a>
<?
if($_SESSION['user_detail']->User_Type==1)
{
?>
<div class='divider'></div>
<a href="manage_user.php?">Manage User</a>
<div class='divider'></div>
<a href="add_user.php">Add User</a>
<div class='divider'></div>
<a href="report_sd.php">Report</a>
<div class='divider'></div>
<a href="updatereport_sd.php">Updated Info Report</a>
<div class='divider'></div>
<a href="badaddress_sd.php">Bad Address Report</a>
<?
}
if($_SESSION['user_detail']->User_Type==3)
{
?>
<div class='divider'></div>
<span style="color:#FFFFFF">Driver Report</span>
<?
}
if($_POST['report_submited'])
{
?>
<div class='divider'></div>
<a href="driverexport_data.php?pageno=<?=$_POST['pageno']?>&Status=<?=$_POST['Status']?>&School=<?=$_POST['School']?>&Campaign=<?=$_POST['Campaign']?>&State=<?=$_POST['State']?>&Stdtype=<?=$_POST['Stdtype']?>&Primbad=<?=$_POST['Primbad']?>&Rep=<?=$_POST['Rep']?>&From_Date=<?=$_POST['From_Date']?>&To_Date=<?=$_POST['To_Date']?>&sort_by=<?=$_POST['sort_by']?>&search_by=<?=$_POST['search_by']?>&search_val=<?=$_POST['search_val']?>">Driver Export</a>
<?
}
?>
</div>
</td>
</tr>
<tr>
<td colspan="1" align="center">
<font><h3>Please select the criteria for the report</h3></font>
</td>
</tr>
<tr>
<td align="center" valign="top">
<? // base64_encode(base64_encode('test1'))?>
<br /><br />
<form id='report_form' action="driverreport_sd.php" method="post" name="report_form">
<!--<div class="criteria_div">-->
<table align="center" class="table_border" cellpadding="5" cellspacing="0" width="80%" >
<tr>
<td align="right" class="first_td" >
From Date:
</td>
<td align="left">
<input type="text" class="ctrDateMask ctrDOB" name="From_Date" value="<? if($_POST['pageno']!="" && $_POST['From_Date']!="") { echo date('m-d-Y',strtotime($_POST['From_Date'])); } else echo $_POST['From_Date']; ?>" id="From_Date" maxlength="10" size="10" />
</td>
</tr>
<tr>
<td align="right" class="first_td" >
To Date:
</td>
<td align="left">
<input type="text" class="ctrDateMask ctrDOB" name="To_Date" value="<? if($_POST['pageno']!="" && $_POST['To_Date']!="") { echo date('m-d-Y',strtotime($_POST['To_Date'])); } else echo $_POST['To_Date'];?>" id="To_Date" maxlength="10" size="10" />
</td>
</tr>
<tr>
<td align="right" class="first_td">
Status:
</td>
<td align="left">
<select multiple name='Status' id='Status'>
<?
$statuslist=$ObjReport->ObjStatus->get_Status_List();
while($status=mysql_fetch_object($statuslist))
{
if($status->Status=="Please Select")
{
?><option value="<?=$status->Status?>" <?=($status->Status==$_POST['Status']?"selected=selected":"")?>><?=$status->Status?></option><?
?><option value="ALL" selected="selected" <?=("ALL"==$_POST['Status']?"selected=selected":"")?>>ALL</option><?
}
else
{
?><option value="<?=$status->Status?>" <?=($status->Status==$_POST['Status']?"selected=selected":"")?>><?=$status->Status?></option><?
}
}
?>
</select> </td>
</tr>
<tr>
<td align="right" class="first_td">
School: </td>
<td align="left">
<select name='School' id='School'>
<?
$schoollist=$ObjReport->ObjSchool->get_School_List();
while($school=mysql_fetch_object($schoollist))
{
if($school->School_Name=="Please Select")
{
?><option value="<?=$school->School_Name?>" <?=($school->School_Name==$_POST['School']?"selected=selected":"")?>><?=$school->School_Name?></option><?
?><option value="ALL" selected="selected" <?=("ALL"==$_POST['School']?"selected=selected":"")?>>ALL</option><?
}
else
{
?><option value="<?=$school->School_Name?>" <?=($school->School_Name==$_POST['School']?"selected=selected":"")?>><?=$school->School_Name?></option><?
}
}
?>
</select> </td>
</tr>
<tr>
<td align="right" class="first_td">
Campaign: </td>
<td align="left">
<select name='Campaign' id='Campaign'>
<?
$campaignlist=$ObjReport->ObjCampaign->get_Campaign_List();
while($campaign=mysql_fetch_object($campaignlist))
{
if($campaign->Campaign=="Please Select")
{
?><option value="<?=$campaign->Campaign?>" <?=($campaign->Campaign==$_POST['Campaign']?"selected=selected":"")?>><?=$campaign->Campaign?></option><?
?><option value="ALL" selected="selected" <?=("ALL"==$_POST['Campaign']?"selected=selected":"")?>>ALL</option><?
}
else
{
?><option value="<?=$campaign->Campaign?>" <?=($campaign->Campaign==$_POST['Campaign']?"selected=selected":"")?>><?=$campaign->Campaign?></option><?
}
}
?>
</select>
</td>
</tr>
<tr>
<td align="right" class="first_td">
State: </td>
<td align="left">
<select name='State' id='State'>
<?
$statelist=$ObjReport->ObjState->get_State_List();
while($state=mysql_fetch_object($statelist))
{
if($state->State_Name=="Please Select")
{
?><option value="<?=$state->State_Name?>" <?=($state->State_Name==$_POST['State']?"selected=selected":"")?>><?=$state->State_Name?></option><?
?><option value="ALL" selected="selected" <?=("ALL"==$_POST['State']?"selected=selected":"")?>>ALL</option><?
}
else
{
?><option value="<?=$state->State_Name?>" <?=($state->State_Name==$_POST['State']?"selected=selected":"")?>><?=$state->State_Name?></option><?
}
}
?>
</select>
</td>
</tr>
<tr>
<td align="right" class="first_td">
Student Type: </td>
<td align="left">
<select name='Stdtype' id='Stdtype'>
<?
$stdtypelist=$ObjReport->ObjStdtype->get_stdtype_List();
while($stdtype=mysql_fetch_object($stdtypelist))
{
if($stdtype->Stdtype=="Please Select")
{
?><option value="<?=$stdtype->Stdtype?>" <?=($stdtype->Stdtype==$_POST['Stdtype']?"selected=selected":"")?>><?=$stdtype->Stdtype?></option><?
?><option value="ALL" <?=("ALL"==$_POST['Stdtype']?"selected=selected":"")?>>ALL</option><?
}
else
{
?><option value="<?=$stdtype->Stdtype?>" <?=($stdtype->Stdtype==$_POST['Stdtype']?"selected=selected":"")?> <? if(!isset($_POST['Stdtype']) && $stdtype->Stdtype=="CDR") { echo "Selected=selected"; } ?> ><?=$stdtype->Stdtype?></option><?
}
}
?>
</select>
</td>
</tr>
<tr>
<td align="right" class="first_td">
Primary Address Bad: </td>
<td align="left">
<select name='Primbad' id='Primbad'>
<?
$primbadlist=$ObjReport->ObjPrimbad->get_Primbad_List();
while($primbad=mysql_fetch_object($primbadlist))
{
if($primbad->Primbad_Name=="Please Select")
{
?><option value="<?=$primbad->Primbad_Name?>" <?=($primbad->Primbad_Name==$_POST['Primbad']?"selected=selected":"")?>><?=$primbad->Primbad_Name?></option><?
?><option value="ALL" selected="selected" <?=("ALL"==$_POST['Primbad']?"selected=selected":"")?>>ALL</option><?
}
else
{
?><option value="<?=$primbad->Primbad_Name?>" <?=($primbad->Primbad_Name==$_POST['Primbad']?"selected=selected":"")?><? if(!isset($_POST['Primbad']) && $primbad->Primbad_Name=="No") { echo "Selected=selected"; } ?>><?=$primbad->Primbad_Name?></option><?
}
}
?>
</select> </td>
</tr>
<?
if($_SESSION['user_detail']->Username==11)
{
?>
<tr>
<td align="right" class="first_td">
Radius Rep: </td>
<td align="left">
<select name='Rep' id='Rep'>
<?
$replist=$ObjReport->ObjRep->get_Rep_List();
while($rep=mysql_fetch_object($replist))
{
if($rep->Rep_Name=="11-DavidB")
{
?><option value="11-DavidB" <?=($rep->Rep_Name==11-DavidB?"selected=disabled":"")?>><?=$rep->Rep_Name?></option><?
}
else
{
?><option value="11-DavidB" <?=($rep->Rep_Name==$_POST['11-DavidB']?"selected=disabled":"")?>><?=$rep->Rep_Name?></option><? }
}
?>
</select> </td>
</tr>
<?
}
?>
</tr>
</table>
<table cellpadding="5" cellspacing="0" width="600px" >
<tr>
<td align="center" colspan="2" >
<input type="hidden" id='sort_by' name='sort_by' value="<?=$_POST['sort_by']?>" />
<input type="hidden" name='search_val' id='search_val' value="<?=$_POST['search_val']?>" />
<input type="hidden" name='search_by' id='search_by' value="<?=$_POST['search_by']?>" />
<input type="hidden" name="report_submited" value='report_submited' />
<button type="submit" id="report_submited" name="" value='submit' >Submit</button>
</td>
</tr>
</table>
<!--</div>-->
</form>
</td>
<td align="left">
<!--<div class="chart_close" id='chart_close'>
<img src="../images/btn_close.png" />
</div>-->
<div class="chart_div" id='pie_chart' style="visibility:visible">
</div>
</td>
</tr>
<tr>
<td align="left" >
<?
if($_POST['report_submited'])
{
if($_POST['Status']=="Please Select")
$_POST['Status']="";
/*if($_POST['Status']=="ALL")
$_POST['Status']="";*/
if($_POST['School']=="Please Select")
$_POST['School']="";
/*if($_POST['School']=="ALL")
$_POST['School']="";*/
if($_POST['Campaign']=="Please Select")
$_POST['Campaign']="";
/*if($_POST['Campaign']=="ALL")
$_POST['Campaign']="";*/
if($_POST['State']=="Please Select")
$_POST['State']="";
if($_POST['Stdtype']=="Please Select")
$_POST['Stdtype']="";
if($_POST['Primbad']=="Please Select")
$_POST['Primbad']="";
if($_POST['Rep']=="Please Select")
$_POST['Rep']="";
/*if($_POST['State']=="ALL")
$_POST['State']="";*/
if($_POST['From_Date'] && !isset($_POST['pageno']))
{
$arr_date=explode("-",$_POST['From_Date']);
$_POST['From_Date']=$arr_date[2]."-".$arr_date[0]."-".$arr_date[1];
}
if($_POST['To_Date'] && !isset($_POST['pageno']))
{
$arr_date=explode("-",$_POST['To_Date']);
$_POST['To_Date']=$arr_date[2]."-".$arr_date[0]."-".$arr_date[1];
}
if(!$_POST['sort_by'])
{
$_POST['sort_by']="Status";
}
?>
<br />
<table align="center" class="table_border" cellpadding="5" cellspacing="0" width="600px" >
<tr>
<td align="center" class="first_td" colspan="4">
<b>Summary Report</b>
</td>
</tr>
<tr>
<td class="first_td">
<?
$TotalFiles=$ObjReport->number_of_total_files($_POST['Status'],$_POST['School'],$_POST['Campaign'],$_POST['State'],$_POST['Stdtype'],$_POST['Primbad'],$_POST['Rep'],$_POST['From_Date'],$_POST['To_Date'],$_POST['sort_by'],$_POST['search_by']);
$ReportData=$ObjReport->generate_report_for_csv($_POST['Status'],$_POST['School'],$_POST['Campaign'],$_POST['State'],$_POST['Stdtype'],$_POST['Primbad'],$_POST['Rep'],$_POST['From_Date'],$_POST['To_Date'],$_POST['sort_by'],$_POST['search_by']);
$TotalVisitedFiles=mysql_num_rows($ReportData);
?>
Number of Files: <b><?=$TotalFiles?></b>
</td>
<?
$ReportData=$ObjReport->generate_report_for_csv($_POST['Status'],$_POST['School'],$_POST['Campaign'],$_POST['State'],$_POST['Stdtype'],$_POST['Primbad'],$_POST['Rep'],$_POST['From_Date'],$_POST['To_Date'],$_POST['sort_by'],$_POST['search_by'],$_POST['search_val'],$_POST['search_val']);
$TotalVisitedFiles=mysql_num_rows($ReportData);
$ReportData=$ObjReport->generate_summary_report($_POST['Status'],$_POST['School'],$_POST['Campaign'],$_POST['State'],$_POST['Stdtype'],$_POST['Primbad'],$_POST['Rep'],$_POST['From_Date'],$_POST['To_Date'],$_POST['sort_by'],$_POST['search_by'],$_POST['search_val'],$_POST['search_val']);
$Totalrow=mysql_num_rows($ReportData);
if($Totalrow > 0)
{
?>
<td class="first_td">
Total
</td >
<td class="first_td">
Total % All Files
</td>
<td class="first_td">
Total % Visited Files
</td>
</tr>
<tr>
<td class="first_td">
File Visited (for Given period):
</td>
<td >
<?=$TotalVisitedFiles;?>
<? //$TotalFiles?>
</td>
<td>
<?=number_format((($TotalVisitedFiles*100)/$TotalFiles),1,'.','')?>
<? //number_format((($TotalFiles*100)/$TotalVisitedFiles),1,'.','')?>
</td>
<td>
</td>
</tr>
<?
//$status_list=array('Bad address','Confirmed address','Cured','Pending Cure','Unknown');
$status_detail['Cures']=0;
while($data=mysql_fetch_object($ReportData))
{
//print_r($data);
//echo "<br>";
//if(in_array($data->Status,$status_list))
{
if($data->Status=='Cured' || $data->Status=='Pending Cure')
{
$status_detail['Cures']+=$data->Status_count;
}
else
{
$status_detail[$data->Status]=$data->Status_count;
}
}
}
ksort($status_detail);
foreach($status_detail as $key => $value)
{
if($value!=0)
{
?>
<tr>
<td class="first_td">
<? echo $key; ?>
<?
?>
</td>
<td>
<? echo $value?>
</td>
<td>
<? echo number_format((($value*100)/$TotalFiles),1)?>
<? //echo number_format((($value*100)/$TotalVisitedFiles),1);?>
</td>
<td>
<? echo number_format((($value*100)/$TotalVisitedFiles),1);?>
<? //echo number_format((($value*100)/$TotalFiles),1);?>
</td>
</tr>
<?
}
}
// }
//}
}
?>
</table>
<br /><br />
<?
}
?>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<!--<div id='report_result_div'>
</div>-->
<?
if($_POST['report_submited'])
{
$ReportData=$ObjReport->generate_report($_POST['Status'],$_POST['School'],$_POST['Campaign'],$_POST['State'],$_POST['Stdtype'],$_POST['Primbad'],$_POST['Rep'],$_POST['From_Date'],$_POST['To_Date'],$_POST['sort_by'],$_POST['search_by'],$_POST['search_val']);
$currentTotalRow=mysql_num_rows($ReportData);
if($currentTotalRow>0)
{
?>
<br />
<!--<table class="table_border" cellpadding="5" cellspacing="0" width="2000px">
<tr>
<td width="270px;" align="right">
Seacrh by:
<select name="search_by_option" id='search_by_option'>
<option value="c.cf_644" selected="selected">Student ID</option>
<option value="c.social_security" <?=("c.social_security"==$_POST['search_by']? "selected=selected" : "")?>>Social Security Number</option>
</select>
</td>
<td align="left">
<input type="text" name='search_value' id='search_value' value="<?=$_POST['search_val']?>" />
<button id='search'>Search</button>
</td>
</tr>
</table>-->
<table align="center" class="table_border" cellpadding="5" cellspacing="0" width="1200px" >
<tr>
<td align="center" colspan="19" class="first_td">
<b>Report</b>
</td>
</tr>
<tr>
<td align="center" class="first_td" width="100" >
<?
if($_POST['sort_by']!="Status" && $_POST['sort_by']!='Status DESC')
{
?>
<a class="sort" onclick="" id='Status'>
<!--<img src="../images/up.gif" style="top:-5px; left:15px" />
<img src="../images/down.gif" style=" left:-2px; top:5px" /> -->
<u><b>Current Status</b></u>
</a>
<?
}
else if($_POST['sort_by']!="Status")
{
?>
<a class="sort" onclick="" id='Status'>
<img src="../images/down.gif" style="top:0px" />
<u><b>Current Status</b></u>
</a>
<?
}else if($_POST['sort_by']!='Status DESC')
{
?>
<a class="sort" onclick="" id='Status DESC'>
<img src="../images/up.gif" style=" top:-5px" />
<u><b>Current Status</b></u>
</a>
<?
}
?>
</td>
<td align="center" class="first_td" width="90px">
<?
if($_POST['sort_by']!="Status_Date" && $_POST['sort_by']!='Status_Date DESC')
{
?>
<a class="sort" onclick="" id='Status_Date'>
<!--<img src="../images/up.gif" style="top:-5px; left:15px" />
<img src="../images/down.gif" style=" left:-2px; top:5px" /> -->
<u><b>Status Date</b></u>
</a>
<?
}
else if($_POST['sort_by']!="Status_Date")
{
?>
<a class="sort" onclick="" id='Status_Date'>
<img src="../images/down.gif" style="top:0px" />
<u><b>Status Date</b></u>
</a>
<?
}else if($_POST['sort_by']!='Status_Date DESC')
{
?>
<a class="sort" onclick="" id='Status_Date DESC'>
<img src="../images/up.gif" style="top:-5px" />
<u><b>Status Date</b></u>
</a>
<?
}
?>
</td>
<td align="center" class="first_td"><b>Campaign</b></td>
<td align="center" class="first_td" width="80">
<b>Student ID</b>
</td>
<td align="center" class="first_td" width="100px">
<?
if($_POST['sort_by']!="Stdtype" && $_POST['sort_by']!='Stdtype DESC')
{
?>
<a class="sort" onclick="" id='Stdtype'>
<!--<img src="../images/up.gif" style="top:-5px; left:15px" />
<img src="../images/down.gif" style=" left:-2px; top:5px" /> -->
<u><b>Student Type</b></u>
</a>
<?
}
else if($_POST['sort_by']!="Stdtype")
{
?>
<a class="sort" onclick="" id='Stdtype'>
<img src="../images/down.gif" style="top:0px" />
<u><b>Student Type</b></u>
</a>
<?
}else if($_POST['sort_by']!='Stdtype DESC')
{
?>
<a class="sort" onclick="" id='Stdtype DESC'>
<img src="../images/up.gif" style="top:-5px" />
<u><b>Student Type</b></u>
</a>
<?
}
?>
</td>
<td align="center" class="first_td"><b>Rep</b></td>
<td align="center" class="first_td"><b>First Name</b></td>
<td align="center" class="first_td"><b>Last Name</b></td>
<td align="center" class="first_td"><b>Home Phone</b></td>
<td align="center" class="first_td"><b>Mobile</b></td>
<td align="center" class="first_td"><b>Work Phone</b></td>
<td align="center" class="first_td"><b>Other Phone</b></td>
<!--<td align="center" class="first_td"><b>Street</b></td>
<td align="center" class="first_td"><b>City</b></td>
<td align="center" class="first_td"><b>State</b></td>
<td align="center" class="first_td"><b>Postal Code</b></td>
<td align="center" class="first_td"><b>Social Security Number</b></td>
<td align="center" class="first_td" width="150px"><b>School</b></td>
<td align="center" class="first_td" width="150px"><b>CS Program</b></td>-->
<!--<td align="center" class="first_td">
<?
if($_POST['sort_by']!="Visit_Date" && $_POST['sort_by']!='Visit_Date DESC')
{
?>
<a class="sort" onclick="" id='Visit_Date'>
<img src="../images/up.gif" style="top:-5px" />
<img src="../images/down.gif" style=" left:-17px; top:5px" />
<b>Visiting Date</b>
</a>
<?
}
else if($_POST['sort_by']!="Visit_Date")
{
?>
<a class="sort" onclick="" id='Visit_Date'>
<img src="../images/down.gif" style="top:0px" />
<b>Visiting Date</b>
</a>
<?
}else if($_POST['sort_by']!='Visit_Date DESC')
{
?>
<a class="sort" onclick="" id='Visit_Date DESC'>
<img src="../images/up.gif" style="top:-5px" />
<b>Visiting Date</b>
</a>
<?
}
?>
</td>-->
<td align="center" class="first_td" width="200px"><b>Last Visit Note</b></td>
</tr>
<?
while($data=mysql_fetch_object($ReportData))
{
?>
<tr>
<td>
<?=$data->Status?>
</td>
<td align="center"><?
if(trim($data->Status_Date))
echo date('m-d-Y',strtotime($data->Status_Date));
?> </td>
<td><?=$data->Campaign?> </td>
<td>
<?=$data->Student_ID?>
</td>
<td><?=$data->Stdtype?> </td>
<td><?=$data->Rep?> </td>
<td><?=$data->First_Name?> </td>
<td><?=$data->Last_Name?> </td>
<td><?=$data->Home_Phone?> </td>
<td><?=$data->Mobile?> </td>
<td><?=$data->Work_Phone?> </td>
<td><?=$data->Other_Phone?> </td>
<!--<td><?=$data->Street?> </td>
<td><?=$data->City?> </td>
<td><?=$data->State?> </td>
<td><?=$data->Postal_Code?> </td>
<td><?=$data->SSN?> </td>
<td><?=$data->School?> </td>
<td><?=$data->CS_Program?> </td>-->
<!--<td align="center"><?
if(trim($data->Visit_Date)!="")
{
echo date('m-d-Y',strtotime($data->Visit_Date));
}
?> </td>-->
<td><?
$visit_info_history=explode("\n",$data->visit_info);
echo $visit_info_history[count($visit_info_history)-1];
//echo nl2br($data->visit_info);
?> </td>
</tr>
<?
}
?>
</table>
<table cellpadding="" cellspacing="0" width="600px">
<tr>
<td>
<?=$ObjReport->strPagination?>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<?
$ReportData=$ObjReport->generate_report_for_csv($_POST['Status'],$_POST['School'],$_POST['Campaign'],$_POST['State'],$_POST['Stdtype'],$_POST['Primbad'],$_POST['Rep'],$_POST['From_Date'],$_POST['To_Date']);
$currentTotalRow=mysql_num_rows($ReportData);
if($currentTotalRow>0)
{
while($data=mysql_fetch_object($ReportData))
{
$chart_data[$data->Status]++;
}
?>
<!-- google pie chart library -->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['',''],
<? $data_to_chart="";
foreach($chart_data as $key => $value)
{
$data_to_chart.="['".$key."', ".$value."],";
}
echo trim($data_to_chart,","); ?>
]);
var options = {
title: 'Pie Chart for Status',
is3D:true
};
var chart = new google.visualization.PieChart(document.getElementById('pie_chart'));
chart.draw(data, options);
}
/* *********************** */
</script>
<!--<div class="chart_close" id='chart_close'>
<img src="../images/btn_close.png" />
</div>
<div class="chart_div" id='pie_chart'>
</div>-->
<?
}
//print_r($chart_data);
?>
</td>
</tr>
<?
}
else
{
?>
<tr>
<td colspan="2">
<table align="center" class="table_border" cellpadding="5" cellspacing="0" width="600px">
<tr>
<td align="center" class="first_td">
Report
</td>
</tr>
<tr>
<td align="center">
No data found.
</td>
</tr>
</table>
</td>
</tr>
<?
}
}
?>
</table>
<?
}
else
{
if(isset($_SESSION['Login_Person']))
header("location: ./search_student.php");
else
header("location: ../");
}
?>
</body>
</html>
Basically it is pulling 4 different types of reports from the data and displaying them on the page
Pie chart report
Summary Report
Regular Report
Report that can be exported to csv
Any suggestions? Thanks