Mini Shell

Direktori : /var/www/vhosts/ccp.ac.th/smtp.ccp.ac.th/httpdocs/new/sp/admin/
Upload File :
Current File : /var/www/vhosts/ccp.ac.th/smtp.ccp.ac.th/httpdocs/new/sp/admin/frm_tp.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 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="type_personnel.php"><i class="fa fa-dashboard"></i> รายการประเภทบุคลากร</a></li>
        <li class="active">ประเภทบุคลากร</li>
      </ol>
    </section>
    
    <!-- Main content -->
        <section class="content">
          <!-- Your Page Content Here -->
         
          <div class="box box-primary">
         <div class="box-header with-border">
         <h3 class="box-title">เพิ่มประเภทบุคลากร</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="row">  
          <div class="col-md-6">
              <form id="formtp" action="insert_tp.php" method="post" class="form" novalidate>
                  <div class="form-group">
                      <label for="typeID">รหัส</label>
                      <input id="typeID" type="text" class="form-control" name="typeID" data-smk-msg="กรุณากรอกรหัส" required>
                  </div>
                  <div class="form-group">
                      <label for="typePersonnel">ประเภทบุคลากร</label>
                      <input id="typePersonnel" type="text" class="form-control" name="typePersonnel" data-smk-msg="กรุณากรอกประเภทบุคลากร" required>                   
                  </div>
                  <button id="btn1" type="button" class="btn btn-primary"><i class="fa fa-floppy-o" aria-hidden="true"></i>&nbsp;บันทึก</button>
              </from>
          </div>
      
      </div>
      
  </div><!-- /.box-body -->
 
</div><!-- /.box -->   

<div id="spin"></div>   

    </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/sweetalert.min.js"></script>
<script src="bootstrap/js/smoke.min.js"></script>
<script src="bootstrap/js/spin.min.js"></script>
<script>
            $( document ).ajaxStart(function() {
                $("#spin").show();
             }).ajaxStop(function() {
                $("#spin").hide(); 
             });
                            
            $(document).ready(function(){
                $("#typeID").focus();
                
                var spinner = new Spinner().spin();
                $("#spin").append(spinner.el);
                $("#spin").hide();

                $('#btn1').on("click",function(e) {
                    if ($('#formtp').smkValidate()) {
                        $.post("insert_tp.php", $("#formtp").serialize() )
                                .done(function( data ) {
                                    if (data.status === "success") {
                                        $.smkAlert({text: data.message , type: data.status});
                                    } else {
                                        $.smkAlert({text: data.message , type: data.status});
                                    }
                                    $('#formtp').smkClear();
                                    $("#typeID").focus();
                                });
                                               
                        e.preventDefault();
                    }
                   e.preventDefault();
                });
                
            });
    </script>
    
    <script type="text/javascript">
$(document).ready(function(){

//*** Function (Start)
function inputNumberFunction(ctrl) {

    $(ctrl).keydown(function (event) {
        // Allow:  delete, tab, enter and . - , f5 

        if ($.inArray(event.keyCode, [8, 9, 27, 13, 46, 109, 110, 190, 189, 116]) !== -1 ||
        // Allow: Ctrl+A

            (event.keyCode == 65 && event.ctrlKey === true) ||
        // Allow: home, end, left, right
            (event.keyCode >= 35 && event.keyCode <= 39)) {
            // let it happen, don't do anything
            return;
        }
        else {
            // Ensure that it is a number and stop the keypress
            if (event.shiftKey || (event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105)) {
                event.preventDefault();
            }
        }
    });

    $(ctrl).change(function () {
        var value = $(this).val();
        if (isNaN(value)) {
            $(this).val('0');
              swal('เกิดข้อผิดพลาด!...','กรุณากรอกเฉพาะตัวเลขเท่านั้น!...','error');
              $(this).focus();
        }
    });

}
//*** Function (End)

inputNumberFunction("#typeID");
});
</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