Mini Shell

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

<?php
       include 'head.php'; 
        if ($s_status_user == 3) {
           header("Location: login.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>

<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="education.php"><i class="fa fa-dashboard"></i> ข้อมูลประวัติการศึกษา</a></li>
        <li class="active">ประวัติการศึกษา</li>
      </ol>
    </section>
 
    
    <!-- Main content -->
        <section class="content">
          <!-- Your Page Content Here -->
          <?php
             $teacherID = $_GET['teacherID'];
             $sql = "SELECT * FROM teacher AS t1 LEFT JOIN title_name AS t2 ON (t1.titleID = t2.titleID)      
                    LEFT JOIN  education AS t3   ON (t1.teacherID = t3.teacheredID )
                    LEFT JOIN level_education AS t4 ON (t3.levelID = t4.levelID)WHERE (`teacherID`='$teacherID') ";                                 
             $result = mysqli_query($link, $sql);
              $row = mysqli_fetch_assoc($result)
          ?>
          <div class="box box-primary">
         <div class="box-header with-border">
             <h3 class="box-title">เพิ่มประวัติการศึกษา &nbsp;<u><?php echo $row['titleName']; ?><?php echo $row['name']; ?> &nbsp; &nbsp;<?php echo $row['lastName']; ?></u></h3>
         <div class="box-tools pull-right">
      <!-- Here is a label for example -->
      </div><!-- /.box-tools -->
  </div><!-- /.box-header -->
  <div class="box-body">
     
      <div class="box box-solid box-primary">
        <div class="box-header">
          <h3 class="box-title"><i class="fa fa-graduation-cap"></i>&nbsp;รหัสบุคลากร <?php echo $teacherID; ?></h3>
        </div><!-- /.box-header -->
        <div class="box-body">
      
      <div class="row">  
          <div class="col-md-12">
              <form id="form1" action="insert_education.php" method="post" class="form" enctype="multipart/form-data" novalidate>
         <div class="row">
             
      <?php
        $sql = "SELECT * FROM level_education";
        $result = mysqli_query($link, $sql);     
      ?>
         <div class="col-md-4">  
             <input type="hidden" name="teacheredID" id="teacheredID" value="<?php echo $teacherID;?>"> 
           <div class="form-group">
                <label>ระดับการศึกษา</label>
                <select id="levelID" name="levelID" class="form-control select2" style="width: 100%;" data-smk-msg="กรุณาเลื่อกระดับการศึกษา" required>
                  <option value="" >---กรุณาเลื่อก---</option>
                  <?php
                   while ($row = mysqli_fetch_array($result,MYSQLI_NUM)){
		       echo "<option value='$row[0]'>$row[1]</option>";
	
	             }
                     mysqli_close($dbcon);
                     ?>               
                </select>
              </div>
         </div>
            <div class="col-md-4">
            <div class="form-group">
                  <label>วุฒิ</label>
                  <input id="degreeName" name="degreeName" type="text" class="form-control" placeholder="วุฒิการศึกษา">
                </div>
          </div>
          <div class="col-md-4">
            <div class="form-group">
                  <label>วิชาเอก</label>
                  <input id="degreeSubject" name="degreeSubject"type="text" class="form-control" placeholder="วิชาเอก">
                </div>
         </div>
          
      </div>
       <div class="row">
           <div class="col-md-4">
                
           </div>
           <div class="col-md-8">
              <div class="form-group">
                  <label>ชื่อสถานบัน</label>
                  <input id="degreeInstitution" name="degreeInstitution" type="text" class="form-control" placeholder="ชื่อสถานบัน" data-smk-msg="กรุณากรอกชื่อสถานบัน" required>
                </div> 
           </div>
  
     </div>
     <div class="row">
           <div class="col-md-4">
               
           </div>
           <div class="col-md-8">
              <div class="form-group">
                  <label>อื่น ๆ ระบุ</label>
                  <textarea  id="other" name="other" class="form-control" rows="3" placeholder="อื่น ๆ ระบุ"></textarea>
                </div>
           </div>
  
     </div>
       

                  <p class="text-right"> <a href="education.php" class="btn btn-info"><i class="fa fa-reply"></i>&nbsp;กลับ</a> <button id="btn1" type="submit" class="btn btn-primary"><i class="fa fa-floppy-o" ></i>&nbsp;บันทึก</button> <a href="show_education.php?teacherID=<?php echo $teacherID; ?>" class="btn btn-warning"><i class="fa fa-eye"></i>&nbsp;เรียกดูข้อมูล</a></p>      
          
                                              
           </form> 
          </div>
          </div><!-- /.box-body -->
      <!-- /.box -->
    </div>
      
        <div id="spin"></div>        
         
     
      </div>
      
  </div><!-- /.box-body -->
  
  </div><!-- /.box -->   
         

            
        
  
   

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

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

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

<!-- REQUIRED JS SCRIPTS -->
<!--<script src="bootstrap/js/bootstrap-datepicker-th.min.js"></script>
<script src="bootstrap/js/bootstrap-datepicker.th.min.js"></script> -->
<!-- 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="plugins/select2/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/moment.js"></script>
<script src="bootstrap/js/bootstrap-datetimepicker.min.js"></script>
<script src="bootstraptable/bootstrap-table.min.js"></script>




    
 <script>
    $(document).ajaxStart(function () {
        $("#spin").show();
    }).ajaxStop(function () {
        $("#spin").hide();
    });

    $(document).ready(function () {
        $("#levelID").focus();

        //select2



        var spinner = new Spinner().spin();
        $("#spin").append(spinner.el);
        $("#spin").hide();

        $('#form1').on("submit", function (e) {
            if ($('#form1').smkValidate()) {
                //upload file via ajax setting
                $.ajax({
                    url: 'insert_education.php',
                    type: 'POST',
                    data: new FormData(this),
                    processData: false,
                    contentType: false,
                    dataType: 'json'
                }).done(function (data) {
                    if (data.status === "success") {
                        $.smkAlert({text: data.message, type: data.status});
                    } else {
                        $.smkAlert({text: data.message, type: data.status});
                    }
                    $("#levelID").smkClear();
                    $("#degreeName").smkClear();
                    $("#degreeSubject").smkClear();
                    $("#degreeInstitution").smkClear();
                    $("#other").smkClear();
                    $("#levelID").focus();                    
                });
                e.preventDefault();
            }
            e.preventDefault();
        });



    });
 </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