Current File : /home/inlingua/public_html/noida/icentex_noida/admin_fdOLD/ingl_admission.select1.php |
<?php
// Created on: 16-02-2013
session_start();
/*
$loggedUserNo = $_SESSION['loggedUserNo'];
if ($loggedUserNo == "")
{ echo "Please <a href='index.php'>login</a> first.";
exit(0);
}
*/
// Include header
include "header_fd.php";
//error_reporting(E_ALL);
?>
<h3>In-Centre Reports(<a href="<?php echo "../admin_cert/reports/".$_REQUEST['location']."_visit_detailed.xlsx" ?>" target="_blank">Download Excel Report</a>)</h3>
<div id="contentnew">
<?php if ($_SESSION['dispMesg'][1] != "" && (date("U") - $_SESSION['dispMesg'][0] < 7))
{ ?>
<span id='mesgSpan'><font color='#da0000'><?php echo $_SESSION['dispMesg'][1];?></font></span>
<script>
setTimeout(function() { $('#mesgSpan').fadeOut('slow'); }, 4000); // <-- time in milliseconds
</script>
<br>
<?php
}
unset($_SESSION['dispMesg']);
?>
<?php
// Include the database connection details
require('../dbConnection.php');
// Include common functions
require('../commonFunc.php');
// Include common functions
require('../globalVars.php');
// Include the table handler class
require('../dbHandler.class.php');
// Init and connect to database
$dbObject = new dbHandler();
$dbObject->connect();
// Records selection sql
$sqlQuery = "SELECT a.*,DATE(createDate) as dat1,b.location,c.category,d.name FROM ingl_admission a left join timesheet_location b on
a.center_no=b.recNo left join ingl_test_category c on a.test_category=c.recNo left join timesheet_user d on a.createdBy=d.recNo where 1=1 && status_delete='0'";
if($_REQUEST['search_name']!="")
{
$sqlQuery.=" && CONCAT(a.firstName, a.lastName) like '%".$_REQUEST['search_name']."%'";
}
if($_REQUEST['startdate']!="" && $_REQUEST['enddate']!="")
{
$sqlQuery.=" && date(a.createDate)>='".$_REQUEST['startdate']."' && date(a.createDate)<='".$_REQUEST['enddate']."'";
}
if($_REQUEST['location']!="")
{
$sqlQuery.=" && a.center_no='".$_REQUEST['location']."'";
}
if($_REQUEST['age_group']!="")
{
$sqlQuery.=" && a.age_group='".$_REQUEST['age_group']."'";
}
if($_REQUEST['country']!="")
{
$sqlQuery.=" && a.country like '".$_REQUEST['country']."%'";
}
if($_REQUEST['state']!="")
{
$sqlQuery.=" && a.state like '".$_REQUEST['state']."%'";
}
if($_REQUEST['city']!="")
{
$sqlQuery.=" && a.city like '".$_REQUEST['city']."%'";
}
if($_REQUEST['pincode']!="")
{
$sqlQuery.=" && a.pincode like '".$_REQUEST['pincode']."%'";
}
if($_REQUEST['telephone']!="")
{
$sqlQuery.=" && a.telephone like '".$_REQUEST['telephone']."%'";
}
if($_REQUEST['mobile']!="")
{
$sqlQuery.=" && a.mobile like '".$_REQUEST['mobile']."%'";
}
if($_REQUEST['email']!="")
{
$sqlQuery.=" && a.email like '".$_REQUEST['email']."%'";
}
if($_REQUEST['city_school']!="")
{
$sqlQuery.=" && a.city_school like '".$_REQUEST['city_school']."%'";
}
if($_REQUEST['medium_school_english']!="")
{
$sqlQuery.=" && a.medium_school_english='".$_REQUEST['medium_school_english']."'";
}
if($_REQUEST['medium_school_hindi']!="")
{
$sqlQuery.=" && a.medium_school_hindi='".$_REQUEST['medium_school_hindi']."'";
}
if($_REQUEST['medium_school_other']!="")
{
$sqlQuery.=" && a.medium_school_other='".$_REQUEST['medium_school_other']."'";
}
if($_REQUEST['student']!="")
{
$sqlQuery.=" && a.student='".$_REQUEST['student']."'";
}
if($_REQUEST['working']!="")
{
$sqlQuery.=" && a.working='".$_REQUEST['working']."'";
}
$sqlQuery.=" order by a.createDate desc";
$sqlQuery1=$sqlQuery;
// Prepare page navigation
$resultsPerPage = 20; // number of rows to return per page
// Prepare add on URL
$addOnUrl = "&search_name=".$_REQUEST['search_name']."
&startdate=".$_REQUEST['startdate']."&enddate=".$_REQUEST['enddate']."&location=".$_REQUEST['location']."
&age_group=".$_REQUEST['age_group']."&country=".$_REQUEST['country']."&state=".$_REQUEST['state']."&city=".$_REQUEST['city']."
&pincode=".$_REQUEST['pincode']."&telephone=".$_REQUEST['telephone']."
&mobile=".$_REQUEST['mobile']."
&email=".$_REQUEST['email']."
&city_school=".$_REQUEST['city_school']."
&medium_school_english=".$_REQUEST['medium_school_english']."
&medium_school_hindi=".$_REQUEST['medium_school_hindi']."
&medium_school_other=".$_REQUEST['medium_school_other']."
&student=".$_REQUEST['student']."
&working=".$_REQUEST['working']."
";
$offset=$_REQUEST['offset'];
if ($resultsPerPage > 0)
{ $prev_next_links = $dbObject->prev123Next($sqlQuery, $resultsPerPage,$addOnUrl);
$sqlQuery .= " limit " . $offset . "," . $resultsPerPage ;
}
// Print navigation bar
function printArray($element) { echo "$element"; }
if ($resultsPerPage > 0 && $prev_next_links && count($prev_next_links) > 1)
{ echo "Page: ";
array_walk($prev_next_links, 'printArray');
}
// Select records from table
$selectedRecords = $dbObject->Select($sqlQuery);
?>
Total: <?php echo $selectedRecords; ?><br>
<table border='0' class='pa-nor pa-table' width="100%">
<tr valign='top' class='rowH'>
<td>S.No.</td>
<td>Date</td>
<td>Test</td>
<td>Reference No</td>
<td>Password</td>
<td>Center</td>
<td>Name</td>
<td>Added By</td>
<td>Action</td>
</tr>
<?php
// If no records selected, print message
if (!$selectedRecords)
{ ?>
<tr><td colspan='5'>There are no entries</td></tr>
<?php
}
$i=1;
while($objectData=$dbObject->SelectNext())
{
$queryW="select * from ingl_test_answer where student_id='".$objectData['recNo']."'";
$resultW=mysql_query($queryW);
$countW=mysql_num_rows($resultW);
$numW=mysql_fetch_array($resultW);
////////////////////
$queryOral="select * from ingl_test_oral where student_id='".$objectData['recNo']."'";
$resultOral=mysql_query($queryOral);
$countOral=mysql_num_rows($resultOral);
$numOral=mysql_fetch_array($resultOral);
$queryAnalysis="select * from ingl_admission_analysis where ingl_student='".$objectData['recNo']."'";
$resultAnalysis=mysql_query($queryAnalysis);
$countAnalysis=mysql_num_rows($resultAnalysis);
$numAnalysis=mysql_fetch_array($resultAnalysis);
if($countW>0)
{
$written='<a href="#" style="color:green;">'.$objectData['ref_No'].'</a>';
}
else{
$written='<a href="#" style="color:red;">'.$objectData['ref_No'].'</a>';
}
if($countOral>0)
{
$oral='<a href="#" style="color:green;">Oral Test</a>';
}
else{
$oral='<a href="#" style="color:red;">Oral Test</a>';
}
if($countAnalysis>0)
{
$Analysis='<a href="#" style="color:green;">Need Analysis</a>';
}
else{
$Analysis='<a href="#" style="color:red;">Need Analysis</a>';
}
?>
<tr valign='top' onmouseover="this.className='pa-row-highlight'" onmouseout="this.className='pa-nor'">
<td><?php echo $i;?></td>
<td><?php echo $objectData['dat1'];?></td>
<td><?php echo $objectData['category'];?></td>
<td><?php echo $written; ?><br>
<?php echo $oral; ?><br><?php echo $Analysis; ?>
</td>
<td><?php echo $objectData['password'];?></td>
<td><?php echo $objectData['location'];?></td>
<td><?php echo $objectData['firstName'];?> <?php echo $objectData['lastName'];?></td>
<td><?php echo $objectData['name'];?></td>
<td>
<a href='ingl_admission.main.php?aC=sV&kV=<?php echo $objectData['recNo'] ;?>' title='View entry'><img src='../images/view.png' border='0' hspace='2'></a>
</td>
</tr>
<?php
$lo=$objectData['location'];
$i++;
}
?>
</table>
<?php
if($_REQUEST['location']=="")
{
$lo="All Centers";
}
// Print navigation bar
if ($resultsPerPage > 0 && $prev_next_links && count($prev_next_links) > 1)
{ echo "Page: ";
array_walk($prev_next_links, 'printArray');
echo "<br>";
}
?>
<script type="text/javascript">
function confDel()
{ var agree = confirm("Are You Sure?");
if (agree)
return true;
else
return false;
}
</script>
</div>
<?php
//error_reporting(E_ALL);
// Include footer
//include "footer_cert.php";
?>
<?php
include("05featuredemo1_visit_detailed.php");
$dbObject->CloseConnection();
include("footer_fd.php");
?>