Mini Shell

Direktori : /var/www/vhosts/ccp.ac.th/smtp.ccp.ac.th/httpdocs/sp/admin/
Upload File :
Current File : /var/www/vhosts/ccp.ac.th/smtp.ccp.ac.th/httpdocs/sp/admin/class_report.php

<?php
       include 'head.php';
       include 'function_show.php';
?>
<!DOCTYPE html>
<!--
This is a starter template page. Use this page to start your new project from
scratch. This page gets rid of all links and provides the needed markup only.
-->
<html>
 <script language="javascript">
  window.onload = function () {    
        var a=document.getElementById('mytable'); // อ้างอิงตารางด้วยตัวแปร a
        for(i=0;i<a.rows.length;i++){ // วน Loop นับจำนวนแถวในตาราง
            if(i>0){  // ตรวจสอบถ้าไม่ใช่แถวหัวข้อ
                if(i%2==1){   // ตรวจสอบถ้าไม่ใช่แถวรายละเอียด
                    a.rows[i].className="";     // กำหนด class แถวแรก
                }else{
                    a.rows[i].className="info";  // กำหนด class แถวที่สอง
                }   
            }else{ // ถ้าเป็นแถวหัวข้อกำหนด class 
                a.rows[i].className="bg-primary";  
            }   
        }
 }
 </script>
<!--
BODY TAG OPTIONS:
=================
Apply one or more of the following classes to get the
desired effect
|---------------------------------------------------------|
| SKINS         | skin-blue                               |
|               | skin-black                              |
|               | skin-purple                             |
|               | skin-yellow                             |
|               | skin-red                                |
|               | skin-green                              |
|---------------------------------------------------------|
|LAYOUT OPTIONS | fixed                                   |
|               | layout-boxed                            |
|               | layout-top-nav                          |
|               | sidebar-collapse                        |
|               | sidebar-mini                            |
|---------------------------------------------------------|
-->
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
<!-- Main Header -->
<?php include 'header.php'; ?>
    <!-- Left side column. contains the logo and sidebar -->
<?php include 'leftside.php'; ?> 
  <!-- Content Wrapper. Contains page content -->
 <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1 >
        รายงานข้อมูลบุคลากรตามสายชั้นเรียน 
        <small>รายงานข้อมูลบุคลากรสายชั้น</small>
      </h1>
      <ol class="breadcrumb">
          <li><a href="index.php"><i class="fa fa-home"></i> หน้าหลัก</a></li>
        <li class="active">รายงานตามสายชั้นเรียน </li>
      </ol>
        
    </section>
    
 
    
    <!-- Main content -->
        <section class="content">
            
          <br>

          <!-- Your Page Content Here -->
         
          <div class="box box-primary">
         <div class="box-header with-border">
             <h4 class="text-center" class="box-title">รายงานข้อมูลบุคลากรตามสายชั้นเรียน  </h4>
       
  </div><!-- /.box-header -->
 
 <div class="box-body"> 
<div class="row">
 <div class="col-md-6 col-md-offset-3">
  <form class="form-inline" name="searchform" id="searchform">
  <div class="form-group">
    <label for="textsearch">เลือกสายชั้นประถมศึกษาปีที่ &nbsp;</label>
    <select name="itemname" id="itemname" class="selectpicker show-tick" data-live-search="true" title="---กรุณาเลือกสายชั้น---" required pattern="[a-zA-Zก-ุฯ-๙\s]*" title="กรุณาเลือกสายชั้น">
                   <option value="1">ประถมศึกษาปีที่ 1</option>
                   <option value="2">ประถมศึกษาปีที่ 2</option>
                   <option value="3">ประถมศึกษาปีที่ 3</option>
                   <option value="4">ประถมศึกษาปีที่ 4</option>
                   <option value="5">ประถมศึกษาปีที่ 5</option>
                   <option value="6">ประถมศึกษาปีที่ 6</option>
        </select>
  </div>
  <button type="submit" class="btn btn-primary" id="btnSearch">
 <span class="glyphicon glyphicon-search"></span>
แสดงข้อมูล
 </button>
</form>
    </div>
</div>
 <br>
  
  <?php
include '../db/database.php';
//$academic = $_GET['itemname'];
$class = isset($_GET['itemname']) ? $_GET['itemname'] : ''; 
if(empty($class)){
	
}else{
    $sql = "SELECT * FROM teacher AS t1 INNER JOIN title_name AS t2 ON (t1.titleID = t2.titleID) where (status_user = 1 or status_user = 2 or status_user = 3) and class = '$class' ";


$query = mysqli_query($link,$sql);
?>

  <?php 
          $rows = 6;           
          $row = mysqli_num_rows($query);
          $total_page = ceil($row/$rows);
          if(empty($_GET['page'])){ 
              $page=1;
          } else {
              $page=$_GET['page'];
            }  
          if($page>=$total_page) $page=$total_page; 
          $start=($page-1)*$rows;
          
    if(empty($class)){
	
   }else{
    $sql2 = "SELECT * FROM teacher AS t1 INNER JOIN title_name AS t2 ON (t1.titleID = t2.titleID) where (status_user = 1 or status_user = 2 or status_user = 3) and class = '$class' order By teacherID DESC Limit $start,$rows ";
   }
     $query = mysqli_query($link, $sql2);  
     
     if(empty($class)){
         $academic_name = "แสดงทั้งหมด";
      }else{
         $academic_name = $class;
     }
      ?>
  
 <h5 class="text-center"><strong>รายงานข้อมูลบุคลากรสายชั้นประถมศึกษาปีที่&nbsp;</strong><span class="label label-success"><?php echo $academic_name; ?></span></h5>




<div  class="table-responsive">
    <table align="center"id="mytable" class="table table-hover table-bordered">
        <thead>
            <tr>
                <th class="text-center">ลำดับ</th>
                <th>ชื่อ-นามสกุล</th>
                <th>เบอร์โทรศัพท์</th>
         
               
            </tr>
        </thead>
        <tbody>
            <?php 
            $i=1;
          if($page > 1)
            {
	    $i = ($rows * ($page-1)) + 1; 
            }
             if(!empty($row)){
            while ($result = mysqli_fetch_assoc($query)) { ?>
            <tr>
                <td class="text-center"><?php echo $i;?></td>
                <td><?php echo $result['titleName']. $result['name'];?>&nbsp;&nbsp; <?php echo $result['lastName'];?></td>
                <td><?php echo TelFormat($result['telephone']);?></td>              
            </tr>
            <?php $i++; } ?>
            <?php  
        }else if(empty($row)){ 
            ?>
       <tr>
        <td colspan="4"><div align="center"><i class="fa fa-folder-open"></i>&nbsp;ไม่พบข้อมูล</div></td>  
        </tr>
     <?php  }  ?>
        </tbody>
   
    </table>
     <nav aria-label="Page navigation">
 <div class="text-center">
     <ul class="pagination"> 
    <li <?php if($page==1)echo'class="disabled"';  ?>>
        <a href="class_report.php?itemname=<?php echo $class ?>&page=<?php echo $page-1; ?>"aria-label="Previous">&laquo;  ก่อนหน้า
      </a>
    </li>
    <?php  for($i=1;$i<=$total_page;$i++) {
        if($page-2>=2 and ($i>2and$i<$page-2)){
            echo "<li><a href=>...</a></li>";
            $i=$page-2;
        }
        if($page+5<=$total_page and ($i>=$page+3 and $i<=$total_page-2)){
            echo "<li><a href=>...</a></li>";
            $i=$total_page-1;
        }
    ?>
    <li <?php if($page==$i)echo'class="active"';  ?>><a href="class_report.php?itemname=<?php echo $class ?>&page=<?php echo $i; ?>"> <?php echo $i;?></a></li>
    <?php } ?>
    <li <?php if($page==$total_page)echo'class="disabled"';  ?>>
      <a href="class_report.php?itemname=<?php echo $class ?>&page=<?php echo $page+1; ?>"aria-label="Previous"> ถัดไป  &raquo;
      </a>
    </li>
  </ul>
     <ul class="pagination">
      <li>
      <a aria-label="Previous">
       ทั้งหมด <span class="badge"><?php echo $row;?></span> รายการ
      </a>
    </li> 
    </ul>
</div>
         <a type="button" class="btn btn-warning" href="class_report_pdf.php?itemname=<?php echo $class; ?>" target="_blank"><span class="glyphicon glyphicon-print"></span>&nbsp;&nbsp;พิมพ์รายงาน</a>
         <a type="button" class="btn btn-info" href="class_report_pdf_download.php?itemname=<?php echo $class; ?>"><i class="fa fa-file-pdf-o"></i>&nbsp;&nbsp;ดาวโหลดไฟล์</a>
</nav> 
</div>

  <?php
}
  ?>
    
        </div>

  <div class="box-footer">

  </div><!-- box-footer -->  

  
          </div>
     <!-- /.box-body -->
 
          
          
    <!-- Your Page Content Here -->
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

  <!-- Main Footer -->
 <?php include 'footer.php'; ?>

  
</div>
<!-- ./wrapper -->

<!-- REQUIRED JS SCRIPTS -->

<!-- jQuery 2.2.3 -->
<script src="plugins/jQuery/jQuery-2.1.4.min.js"></script>

<!-- Bootstrap 3.3.6 -->
<script src="bootstrap/js/bootstrap.min.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/app.min.js"></script>
<script src="bootstrap/js/select2.full.min.js"></script>
<script src="bootstrap/js/smoke.min.js"></script>
<script src="bootstrap/js/spin.min.js"></script>
<script src="bootstrap/js/bootstrap-select.min.js"></script>


 <script type="text/javascript">
$(function() {
    $('#my-select').searchableOptionList({
        showSelectAll: true
    });
});    
</script>

<!-- Optionally, you can add Slimscroll and FastClick plugins.
     Both of these plugins are recommended to enhance the
     user experience. Slimscroll is required when using the
     fixed layout. -->
</body>
</html>

Zerion Mini Shell 1.0