Mini Shell

Direktori : /var/www/vhosts/ccp.ac.th/smtp.ccp.ac.th/httpdocs/sp/admin_gard_new/student/
Upload File :
Current File : /var/www/vhosts/ccp.ac.th/smtp.ccp.ac.th/httpdocs/sp/admin_gard_new/student/student_home.php

<!doctype html>
<html lang="en">

<!-- head -->
<?php include 'head.php'; 
      include 'session.php';
?>

<body>
    <div class="wrapper">
     <!-- เมนูด้านซ้าย -->
      <?php include 'leftside.php'; ?>
     
        <div class="main-panel">
        <!-- ส่วนหัว -->    
       <?php include 'header.php'; ?>
            
            <div class="content">
                <div class="container-fluid">      
                 <div class="col-md-12">
                      <nav aria-label="breadcrumb">
                       <ol class="breadcrumb">
                           <li class="breadcrumb-item"><a href="home.php">หน้าหลัก</a></li>                         
                       <li class="breadcrumb-item active" aria-current="page">แสดงผลการเรียน</li>
                       </ol>
                     </nav>
                     
                    <?php
                       $user_id = $s_user_id;
                       $year = $s_year; 
                       $sql_chek = "SELECT * FROM grade  WHERE (`academic_year`='$year') AND (`grade_student_id`='$user_id')";
                       $result_chek = mysqli_query($link2, $sql_chek);
                       $chek_grade = mysqli_num_rows($result_chek);
                       if ($chek_grade >= 1) {
   
                        $sql = "SELECT * FROM users_dg left JOIN class_room ON users_dg.user_class_id = class_room.class_id left JOIN level_class ON level_class.lc_id = class_room.lc_id left JOIN course ON class_room.course = course.course_id  WHERE (`year`='$year') AND (`user_id`='$user_id') ";
                        $result = mysqli_query($link2, $sql);
                        $row = mysqli_fetch_assoc($result);
                       ?>
                      <!-- เนื้อหา -->  
                      
                   <div class="header text-center">
                        <h3 class="title">ปีการศึกษา <?php echo $year; ?></h3>                                             
                    </div>
                   <div class="row">
                        <div class="col-sm-6 col-lg-3">    
                             <h4 class="text-uppercase text-center">รหัสประจำตัว : <?php echo $row['username']; ?></h>
                        </div>
                          <?php
                            $title_name = $row['sex'];
                            if ($title_name == 1) {
                                $title_name = "เด็กชาย";
                            } else {
                                $title_name = "เด็กหญิง";
                            }
                            ?>
                        <div class="col-sm-6 col-lg-3">
                             <h4 class="text-uppercase text-center">ชื่อ : <?php echo $title_name.$row['name_peple']; ?> <?php echo $row['sname_peple']; ?></h>
                        </div>
                        <div class="col-sm-6 col-lg-3">
                             <h4 class="text-uppercase text-center"><?php echo $row['lc_name']; ?></h>
                        </div>
                        <div class="col-sm-6 col-lg-3">
                              <h4 class="text-uppercase text-center">ห้อง : <?php echo $row['class_name']; ?> &nbsp;หลักสูตร : <?php echo $row['course_name']; ?></h>
                        </div>
                    </div>  
                      
                <?php                                    
                        $level_class = $row['lc_id'];
                        $course = $row['course'];                
                        $sql_up = "SELECT * FROM grade left JOIN subject ON grade.grade_subject_id = subject.subject_id  WHERE (grade.`academic_year`='$year') AND (`grade_student_id`='$user_id')";
                        $result_up = mysqli_query($link2, $sql_up);   
                      
                       ?>
                     
                          <div class="card">
                                <div class="card-header card-header-icon" data-background-color="rose">
                                    <i class="fad fa-user-edit fa-2x"></i>
                                </div>
                                <div class="card-content">
                                    <h4 class="card-title">กรอกคะแนน</h4>
                                    
                                    <div class="table-responsive">
                                        <table class="table">
                                            <thead class="text-primary">
                                                <th class="text-center">ลำดับที่</th>
                                                <th class="text-center">รหัสวิชา</th>
                                                <th class="text-center">ชื่อวิชา</th>
                                                <th class="text-center">หน่วยกิต</th>
                                                <th class="text-center">คะแนนภาคเรียน 1</th>
                                                <th class="text-center">คะแนนภาคเรียน 2</th>
                                                <th class="text-center">คะแนนรวม</th>
                                                <th class="text-center">ผลการเรียน</th>
                                            </thead>
                                            <tbody>
                                                <?php 
                                               $i=1;
                                               while ($row_up = mysqli_fetch_array($result_up))  {    ?>                  
                                                <tr>                                                   
                                                    <td class="text-center"> <?php echo $i; ?></td>
                                                    <td class="text-center"> <?php echo $row_up['subject_code']; ?> </td>
                                                    <td class="text-center"> <?php echo $row_up['subject_name']; ?></td>
                                                    <td class="text-center"> <?php echo $row_up['credit']; ?></td>
                                                    <td class="text-center"> <?php echo $row_up['score1']; ?></td>
                                                    <td class="text-center"> <?php echo $row_up['score2']; ?></td>
                                                    <?php 
                                                    $sum = $row_up['score1']+$row_up['score2'];
                                                    ?>
                                                    <td class="text-center"> <?php echo $sum; ?> </td>
                                                            <?php
                                                            $grade = $row_up['grade_name'];
                                                            if ($grade == 9) {
                                                                $grade_name = "ยังไม่ประเมินผล";
                                                            } else {
                                                                $grade_name = $row_up['grade_name'];
                                                            }
                                                            ?>
                                                    <td class="text-primary text-center"> <?php echo $grade_name; ?></td>
                                                </tr>
                                                <?php $i++; }  ?>  

                                        </tbody>
                                        </table>
                                    </div>
                      <?php
                         $sql_at = "SELECT * FROM users_dg WHERE (`year`='$year') AND (`user_id`='$user_id')";
                         $result_at = mysqli_query($link2, $sql_at); 
                         $row_at = mysqli_fetch_assoc($result_at);
                       ?>    
                                    
                                </div>
                      <div class="col-md-3 col-md-offset-9">
                            <?php $averg_1 = $row_at['averg']; ?>
                          
                             <?php
                             $averg = $row_at['averg'];
                              if (($averg == "")or ($averg == 0)) {
                                  $averg_full = "ยังไม่ประเมินผล";
                              } else {
                                  $averg_full = number_format( $averg_1 , 2 )."";
                              }
                              ?>
                          
                                <div class="card-content text-center">
                                    <div class="card-header" data-background-color="red">
                                     <h5 class="text-center" >
                                       เกรดเฉลี่ย : 
                                         <?php echo $averg_full; ?> 
                                      </h5>
                                   </div>
                                </div>
                            
                        </div>
                            </div>
            
                          <div class="col-lg-6 col-md-12">
                            <div class="card">
                                  <div class="card-header card-header-icon" data-background-color="rose">
                                   <i class="fad fa-check-double fa-2x"></i>
                                </div>
                        <?php
                                if ($row_at['active1']=="ผ่าน"){
                                    $past1 = ' &nbsp;&nbsp;<i class="far fa-check fa-2x" style="color:green"></i>';
                                   } else if ($row_at['active1']=="ไม่ผ่าน") { 
                                    $past1 = '<i class="far fa-times fa-2x" style="color:red"></i>';
                                   } else if ($row_at['active1']=="ยังไม่ประเมินผล") {
                                    $past1 = "";
                                   }
                                ?>
                                <div class="card-content table-responsive">
                                    <table class="table table-hover">
                                        <tbody>
                                            <tr>
                                                <td class="text-primary">1</td>
                                                <td class="text-primary">กิจกรรม ลูกเสือ/เนตรนารี</td>
                                                <td><?php echo $row_at['active1'].'&nbsp; '.$past1; ?></td>                                          
                                            </tr>
                              <?php
                                if ($row_at['active2']=="ผ่าน"){
                                    $past2 = ' &nbsp;&nbsp;<i class="far fa-check fa-2x" style="color:green"></i>';
                                   } else if ($row_at['active2']=="ไม่ผ่าน") { 
                                    $past2 = '<i class="far fa-times fa-2x" style="color:red"></i>';
                                   } else if ($row_at['active2']=="ยังไม่ประเมินผล") {
                                    $past2 = "";
                                   }
                                ?>
                                            <tr>
                                                <td class="text-primary">2</td>
                                                <td class="text-primary">แนะแนว</td>
                                                <td><?php echo $row_at['active2'].'&nbsp; '.$past2; ?></td>
                                            </tr>
                              <?php
                                if ($row_at['active3']=="ผ่าน"){
                                    $past3 = ' &nbsp;&nbsp;<i class="far fa-check fa-2x" style="color:green"></i>';
                                   } else if ($row_at['active3']=="ไม่ผ่าน") { 
                                    $past3 = '<i class="far fa-times fa-2x" style="color:red"></i>';
                                   } else if ($row_at['active3']=="ยังไม่ประเมินผล") {
                                    $past3 = "";
                                   }
                                ?>
                                            <tr>
                                                <td class="text-primary">3</td>
                                                <td class="text-primary">ชุมนุม</td>
                                                <td><?php echo $row_at['active3'].'&nbsp; '.$past3; ?></td>
                                            </tr>
                             <?php
                                if ($row_at['active4']=="ผ่าน"){
                                    $past4 = ' &nbsp;&nbsp;<i class="far fa-check fa-2x" style="color:green"></i>';
                                   } else if ($row_at['active4']=="ไม่ผ่าน") { 
                                    $past4 = '<i class="far fa-times fa-2x" style="color:red"></i>';
                                   } else if ($row_at['active4']=="ยังไม่ประเมินผล") {
                                    $past4 = "";
                                   }
                                ?>
                                            <tr>
                                                <td class="text-primary">4</td>
                                                <td class="text-primary">สาธารณะประโยชน์</td>
                                                <td><?php echo $row_at['active4'].'&nbsp; '.$past4; ?></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div> 
                      <?php
                      }else{ ?>
                             <div class="alert alert-warning">
                                <span>ยังไม่ได้ประเมินผล !</span>
                             </div>   
                      <?php                  
                      }
                      ?>
                                   
                </div>
                    
              <div id="spin"></div> 
                </div>
            </div>
        
          <!-- footer1 -->
           <?php include 'footer1.php'; ?> 
          
        </div>
    </div>
<!-- footer2 -->
<?php include 'footer2.php'; ?>




<!-- Mirrored from demos.creative-tim.com/material-dashboard-pro/examples/dashboard.html by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 20 Mar 2017 21:32:16 GMT -->
</html>

Zerion Mini Shell 1.0