| Current Path : /home/bolconlineco/public_html/coordinator/ |
| Current File : /home/bolconlineco/public_html/coordinator/search_query_reg.php |
<?php
ob_start();
session_start();
if(!isset($_SESSION['coordinator']) && $_SESSION['coordinatorrole'] != 2) {
header("location:../index.php");
exit('d');
}else{
$coordinator = $_SESSION['coordinator'];
$coordinatorrole = $_SESSION['coordinatorrole'];
}
include('../includes/connection/func.inc.php');
header('Cache-Control: max-age=900'); ?>
<!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">
<?php
// $_SESSION['coordinator'] = $coordinator;
// $_SESSION['coordinatorrole'] = $coordinatorrole;
// echo $_SESSION['coordinator'];exit;
if(isset($_POST['Search']))
{
unset($_SESSION['student_search']);
session_destroy($_SESSION['student_search']);
if(!empty($_POST['studentId']))
{
$_SESSION['student_search']['studentId'] =$_POST['studentId'];
// $studentId=sql_strip($_POST['studentId']);
// $result=mysql_query("select * from student where rollno='$studentId'");
}elseif(!empty($_POST['number']))
{
$_SESSION['student_search']['number'] =$_POST['number'];
}elseif(!empty($_POST['phone']))
{
$_SESSION['student_search']['phone'] =$_POST['phone'];
}else if(!empty($_POST['email'])) {
$_SESSION['student_search']['email'] =$_POST['email'];
// $email=sql_strip($_POST['email']);
// $result=mysql_query("select * from student where email like '%$email%'");
}else if(!empty($_POST['firstname']))
{
$_SESSION['student_search']['firstname'] =$_POST['firstname'];
// header("Location: search_reg.php");
// $firstname=sql_strip($_POST['firstname']);
// $result=mysql_query("select * from student where fname like '%$firstname%' order by registrationdate");
// $num=mysql_num_rows($result);
}else if(!empty($_POST['lastname']))
{
$_SESSION['student_search']['lastname'] =$_POST['lastname'];
// $lastname=sql_strip($_POST['lastname']);
// $result=mysql_query("select * from student where lname like '%$lastname%' order by registrationdate");
}else if(!empty($_POST['tutor']))
{
$_SESSION['student_search']['tutor'] =$_POST['tutor'];
// Return more rows
// $tutr=sql_strip($_POST['tutor']);
// $result=mysql_query("select s.*,ac.* from student as s join assigncourse as ac on s.rollno=ac.rollno where
// ac.tutorId='$tutr' order by registrationdate");
}else if(!empty($_POST['country']))
{
$_SESSION['student_search']['country'] =$_POST['country'];
// $country=$_POST['country'];
// $result=mysql_query("select * from student where country like '%$country%' order by registrationdate");
}else if(!empty($_POST['city']))
{
$_SESSION['student_search']['city'] =$_POST['city'];
// $city=sql_strip($_POST['city']);
// $result=mysql_query("select * from student where city like '%$city%' order by registrationdate");
}else if(!empty($_POST['dob']))
{
$_SESSION['student_search']['dob'] =$_POST['dob'];
// $dob=$_POST['dob'];
// $d1=explode('/',$dob);
// $new=$d1[2].'-'.$d1[1].'-'.$d1[0];
// $result=mysql_query("select * from student where dob='$new' order by registrationdate");
}else if(!empty($_POST['registfrom']) && !empty($_POST['rto'])&& !empty($_POST['sstatus'])){
//$_SESSION['student_search']['registfrom'] =$_POST['registfrom'];
//$_SESSION['student_search']['rto'] =$_POST['rto'];
//$_SESSION['student_search']['sstatus'] =$_POST['sstatus'];
$date2=$_POST['registfrom'];
$full2=explode('/',$date2);
$rfrom=$full2[2].'-'.$full2[1].'-'.$full2[0];
$date1=$_POST['rto'];
$full=explode('/',$date1);
$sta=$_POST['sstatus'];
$rto=$full[2].'-'.$full[1].'-'.$full[0];
//
$from=date('Y-m-d',strtotime($_POST['registfrom']));
$too=date('Y-m-d',strtotime($_POST['rto']));
// $result=mysql_query("select s.*,ac.* from student as s join assigncourse as ac on s.rollno=ac.rollno where
// s.registrationdate between '$rfrom' and '$rto' and studentstatus='$sta' order by s.registrationdate");
} else if (!empty($_POST['registfrom']) && !empty($_POST['rto'])) {
$_SESSION['student_search']['registfrom'] =$_POST['registfrom'];
$_SESSION['student_search']['rto'] =$_POST['rto'];
$date2=$_POST['registfrom'];
$full2=explode('/',$date2);
$rfrom=$full2[2].'-'.$full2[1].'-'.$full2[0];
$date1=$_POST['rto'];
$full=explode('/',$date1);
$rto=$full[2].'-'.$full[1].'-'.$full[0];
// $result=mysql_query("select s.*,ac.* from student as s join assigncourse as ac on s.rollno=ac.rollno where
// s.registrationdate between '$rfrom' and '$rto' order by s.registrationdate");
}
else if(!empty($_POST['compfrom']) && !empty($_POST['compto'])){
$_SESSION['student_search']['compfrom'] =$_POST['compfrom'];
$_SESSION['student_search']['compto'] =$_POST['compto'];
// $date2=$_POST['compfrom'];
// $full2=explode('/',$date2);
// $rfrom=$full2[2].'-'.$full2[1].'-'.$full2[0];
// $date1=$_POST['compto'];
// $full=explode('/',$date1);
// $rto=$full[2].'-'.$full[1].'-'.$full[0];
// //$from=date('Y-m-d',strtotime($_POST['registfrom']));
// //$too=date('Y-m-d',strtotime($_POST['rto']));
// $result=mysql_query("select s.*,ac.* from student as s join assigncourse as ac on s.rollno=ac.rollno where
// s.comp_date between '$rfrom' and '$rto' order by s.registrationdate");
}
else if(!empty($_POST['taskfrom']) && !empty($_POST['taskto'])) {
$_SESSION['student_search']['taskfrom'] =$_POST['taskfrom'];
$_SESSION['student_search']['taskto'] =$_POST['taskto'];
// $date2=$_POST['taskfrom'];
// $full2=explode('/',$date2);
// $taskfrom=$full2[2].'-'.$full2[1].'-'.$full2[0];
// $date1=$_POST['taskto'];
// $full=explode('/',$date1);
// $taskto=$full[2].'-'.$full[1].'-'.$full[0];
// $result=mysql_query("select s.*,t.* from student as s join tasks as t on s.rollno=t.rollno where
// t.taskdate between '$taskfrom' and '$taskto' group by s.rollno order by t.taskdate,s.registrationdate");
} else if(!empty($_POST['assg_task'])) {
$_SESSION['student_search']['assg_task'] =$_POST['assg_task'];
// $result=mysql_query("select s.*,t.* from student as s join tasks as t on s.rollno=t.rollno where t.assigned_to = '".$_POST['assg_task']."' group by s.rollno order by t.taskdate,s.registrationdate");
}
else if(!empty($_POST['balfrom']) && !empty($_POST['balto'])){
$_SESSION['student_search']['balfrom'] =$_POST['balfrom'];
$_SESSION['student_search']['balto'] =$_POST['balto'];
// $balfrom=date($_POST['balfrom']);
// $balto=date($_POST['balto']);
// //$result=mysql_query("select s.*,sum(tf.paid) as total from student as s inner join tbl_fees_install as tf on s.rollno=tf.rollno group by s.rollno having total between '$balfrom' and '$balto' ") or die(mysql_error());
// // $result=mysql_query("select s.*,abs(sum(tf.payble)-sum(f.paid)) as total from student as s join tbl_fees_install as tf on s.rollno=tf.rollno join tbl_install as f on tf.rollno=f.rollno group by s.rollno having total between '$balfrom' and '$balto'") or die(mysql_error());
// $result=mysql_query("select s.*,abs(sum(f.payble)-sum(f.paid)) as total_dues from student as s join tbl_fees_install as f on s.rollno=f.rollno group by rollno having total_dues between '$balfrom' and '$balto'");
}
else if(!empty($_POST['from']) && !empty($_POST['to'])){
$_SESSION['student_search']['from'] =$_POST['from'];
$_SESSION['student_search']['to'] =$_POST['to'];
// $formm=date($_POST['from']);
// $full1=explode('/',$formm);
// $too=date($_POST['to']);
// $full2=explode('/',$too);
// $f=$full1[2].'-'.$full1[1].'-'.$full1[0];
// $t=$full2[2].'-'.$full2[1].'-'.$full2[0];
// if(isset($_POST['assg_all']))
// {
// $result=mysql_query("select s.*,ua.* from student as s join uploadassignment as ua on s.rollno=ua.rollno where ua.uploaddate between '$f' and '$t' group by s.rollno order by ua.uploaddate desc") or die(mysql_error());
// }
// else if(isset($_POST['assg_comp']))
// {
// $result=mysql_query("select s.*,ua.* from student as s join uploadassignment as ua on s.rollno=ua.rollno where ua.uploadStatus=0 and ua.uploaddate between '$f' and '$t' group by s.rollno order by ua.uploaddate desc") or die(mysql_error());
// }
// else
// {
// $result=mysql_query("select s.*,ua.* from student as s join uploadassignment as ua on s.rollno=ua.rollno where ua.uploadStatus=1 and ua.uploaddate between '$f' and '$t' group by s.rollno order by ua.uploaddate desc") or die(mysql_error());
// }
}else if(!empty($_POST['category']) && !empty($_POST['course']))
{
$_SESSION['student_search']['category'] =$_POST['category'];
$_SESSION['student_search']['course'] =$_POST['course'];
//$category=sql_strip($_POST['category']);
// $course=sql_strip($_POST['course']);
// $query="select s.*,ac.* from student as s join assigncourse as ac on s.rollno=ac.rollno
// where ac.courseid='$course' order by s.registrationdate";
// $result=mysql_query($query) or die(mysql_error());
} else if(!empty($_POST['sstatus'])) {
$_SESSION['student_search']['sstatus'] =$_POST['sstatus'];
// $status=sql_strip($_POST['sstatus']);
// //$query="select * from student where studentstatus='$status'";
// $result=mysql_query("select * from student where studentstatus='$status' order by registrationdate");
} else if(!empty($_POST['stage'])) {
$_SESSION['student_search']['stage'] =$_POST['stage'];
// $stage=sql_strip($_POST['stage']);
// //$query="select * from student where studentstatus='$status'";
// $result=mysql_query("select * from student where stage='$stage' order by registrationdate");
}
//redirect('location','search.php');
$_SESSION['student_search']['Search'] =$_POST['Search'];
header("Location: search_reg.php");
exit;
}