<!DOCTYPE html>
<html>

<head>

<?php include 'include/common.php';?>



 <script src="https://unpkg.com/gijgo@1.9.13/js/gijgo.min.js" type="text/javascript"></script>
    <link href="https://unpkg.com/gijgo@1.9.13/css/gijgo.min.css" rel="stylesheet" type="text/css" />



<!-- new datatable js and css -->
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> -->
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.13/datatables.min.css"/>
<!-- <script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.13/datatables.min.js"></script> -->
 <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/responsive/2.2.4/css/responsive.dataTables.min.css"/>
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.6.2/css/buttons.dataTables.min.css"/>

<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.13/datatables.min.js"></script>

<!-- https://code.jquery.com/jquery-3.5.1.js
https://cdn.datatables.net/1.10.21/js/jquery.dataTables.min.js -->
<script type="text/javascript" src="https://cdn.datatables.net/responsive/2.2.4/js/dataTables.responsive.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/dataTables.buttons.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.colVis.min.js"></script>


<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet">
<script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script>

<!-- end new datatable js and css -->


</head>

<body>

    <!-- admin javascript -->
     <script type="text/javascript">

      // alert("123");
      // $( document ).ready(function() {
      //   alert($('#unit_price').val());
      // }
      //   //added change input box javascript
      //    $('#unit_price').change(function() {
      //     alert("123");
      //     // console.log('.change = ' + $(this).val());
      //   });

        //end added change input box javascript
      function showdeletemodal() {
                // checkboxes = document.getElementsByName('admincheck');
                // var favorite = [];
                // $count=0;
                // $.each($("input[name='admincheck']:checked"), function(){
                //     favorite.push($(this).val());
                //     $count=$count+1;
                // });
                // // alert(1);
                // // alert("My favourite sports are: " + favorite.join(", "));
                // document.getElementById("deletenum").innerHTML = $count;
                $('#deleteModalCenter').modal({
                                    show: true,
                                });
    }//function showdeletemodal() {



      $( document ).ready(function() {

          //add control
        $("#btnSubmit").click(function(event) {
          var forcusitem="";
          var passCheck=true;


          if($('#sales_amount').val().length !== 0){
            $("#sales_amount").addClass(" is-valid ");
            $("#sales_amount").removeClass(" is-invalid ");
          }
          else{
            if(forcusitem.length===0){
               forcusitem="#sales_amount";
            }
            passCheck=false;
            $("#sales_amount").addClass(" is-invalid ");
           $("#sales_amount").removeClass(" is-valid ");
          }


          //  if($('#available_qty').val().length !== 0){
          //   $("#available_qty").addClass(" is-valid ");
          //   $("#available_qty").removeClass(" is-invalid ");
          // }
          // else{
          //   if(forcusitem.length===0){
          //      forcusitem="#available_qty";
          //   }
          //   passCheck=false;
          //   $("#available_qty").addClass(" is-invalid ");
          //  $("#available_qty").removeClass(" is-valid ");
          // }


          // if($('#purchased_qty').val().length !== 0){
          //   $("#purchased_qty").addClass(" is-valid ");
          //   $("#purchased_qty").removeClass(" is-invalid ");
          // }
          // else{
          //   if(forcusitem.length===0){
          //      forcusitem="#purchased_qty";
          //   }
          //   passCheck=false;
          //   $("#purchased_qty").addClass(" is-invalid ");
          //  $("#purchased_qty").removeClass(" is-valid ");
          // }

          // if($('#reason').val().length !== 0){
          //   $("#reason").addClass(" is-valid ");
          //   $("#reason").removeClass(" is-invalid ");
          // }
          // else{
          //   if(forcusitem.length===0){
          //      forcusitem="#reason";
          //   }
          //   passCheck=false;
          //   $("#reason").addClass(" is-invalid ");
          //  $("#reason").removeClass(" is-valid ");
          // }


        //   if($('#inputadminname').val().length !== 0){
        //     $("#inputadminname").addClass(" is-valid ");
        //     $("#inputadminname").removeClass(" is-invalid ");
        //   }
        //   else{
        //     if(forcusitem.length===0){
        //        forcusitem="#inputadminname";
        //     }
        //     passCheck=false;
        //     $("#inputadminname").addClass(" is-invalid ");
        //    $("#inputadminname").removeClass(" is-valid ");
        //   }






        //   alert("1");
          if(passCheck==true){


          var GlobalVariables ={
                  'csrfToken': '123',
                  'baseUrl':'<?php echo base_url(); ?>',
                  // 'destUrl':'<?php echo base_url(); ?>/api/v1/frontend/add',
                  'AJAX_SUCCESS' :'SUCCESS',
                  'AJAX_FAILURE' :'FAILURE'
            };

            event.preventDefault();
            var postUrl= GlobalVariables.baseUrl +'/api/v1/bremployeewagelevelend/add';
            // var postData ={
            //       'csrfToken' :'',
            //       'custname' : $('#name').val(),
            //       'tel' : $('#tel').val(),
            //       'email' : $('#email').val(),
            //       'wechat' : $('#wechat').val(),
            //       'birthday' : $('#birthday').val(),
            //       // 'selectedBox' :$('.css-checkbox:checked').val()
            //       'selectedBox' :selectBox1

            // }
            $checkeddebate=0;
            if($('#no_credit_rebate').is(':checked')){
                $checkeddebate=1;
            }
            else
            {
              $checkeddebate=0;
            }

            var postData ={
                'wageid':$('#wageid').val(),
                'sales_amount':$('#sales_amount').val(),
                'precentage':$('#precentage').val(),
                'job_pay':$('#job_pay').val(),
            }
            $.ajax({
                  method: "POST",
                  url: postUrl,
                  dataType: "json",
                 data: postData,
                 success : function(data){

                // alert("posted");
                // // alert('formsubmit');
                // alert(data);

                // alert(data['recordstatus']);
                // alert(data['msg']);
                if(data['recordstatus']=="SUCCESS"){
                    $('#feedback').remove();
                    $( '#newmsg' ).append('<p class="text-primary" id="feedback">'+data['msg']+'</p>');
                    setTimeout(function() {
                        location.reload();
                    }, 3000);
                    // location.reload();

                }
                  if(data['recordstatus']=="FAILURE"){
                    $('#feedback').remove();
                    $( '#newmsg' ).append('<p class="text-danger"  id="feedback">'+data['msg']+'</p>');
                //   $( '#modal-bodymsg' ).empty();
                //   $( '#modal-bodymsg' ).append( '<h5 class="text-center" style="color: #a03d49;">客戶不能增加。</h5> <h5 class="text-center" style="color: #a03d49;">請稍後再嘗試。</h5>' );
                //   $('#finishModal').modal('show');
                // }
                  // if (data.AJAX_SUCCESS==GlobalVariables.AJAX_SUCCESS){
                  //     window.location.href=GlobalVariables.destUrl;
                  // } else {
                  //     $('.alert').text("登入錯誤");
                  //    $('.alert').removeClass('hidden');
                  }
              }
            });

            }//if(passCheck==true){
        });//$("#btnSubmit").click(function(event) {

            $('#btnReset').click(function() {
                  $('#category_code').val('1');
                  $('#code').val('lastestcode');
                  $('#name').val('');
                  $('#description').val('');
                  $('#work').val('2');
                  $('#price').val('');
                  $('#no_credit_rebate').val('');
                  $('#time').val('60');
                  $('#remark').val('');
              });


              //refresh update
              $('#btnResetUpdate').click(function() {
                  location.reload();
              });

              //end refresh updae


              //button update

      $("#btnUpdate").click(function(event) {
          var forcusitem="";
          var passCheck=true;


          if($('#service_id').val().length !== 0){
            $("#service_id").addClass(" is-valid ");
            $("#service_id").removeClass(" is-invalid ");
          }
          else{
            if(forcusitem.length===0){
               forcusitem="#service_id";
            }
            passCheck=false;
            $("#service_id").addClass(" is-invalid ");
           $("#service_id").removeClass(" is-valid ");
          }

          if($('#available_qty').val().length !== 0){
            $("#available_qty").addClass(" is-valid ");
            $("#available_qty").removeClass(" is-invalid ");
          }
          else{
            if(forcusitem.length===0){
               forcusitem="#available_qty";
            }
            passCheck=false;
            $("#available_qty").addClass(" is-invalid ");
           $("#available_qty").removeClass(" is-valid ");
          }


          if($('#purchased_qty').val().length !== 0){
            $("#purchased_qty").addClass(" is-valid ");
            $("#purchased_qty").removeClass(" is-invalid ");
          }
          else{
            if(forcusitem.length===0){
               forcusitem="#purchased_qty";
            }
            passCheck=false;
            $("#purchased_qty").addClass(" is-invalid ");
           $("#purchased_qty").removeClass(" is-valid ");
          }

          if($('#reason').val().length !== 0){
            $("#reason").addClass(" is-valid ");
            $("#reason").removeClass(" is-invalid ");
          }
          else{
            if(forcusitem.length===0){
               forcusitem="#reason";
            }
            passCheck=false;
            $("#reason").addClass(" is-invalid ");
           $("#reason").removeClass(" is-valid ");
          }




        //   if($('#inputadminname').val().length !== 0){
        //     $("#inputadminname").addClass(" is-valid ");
        //     $("#inputadminname").removeClass(" is-invalid ");
        //   }
        //   else{
        //     if(forcusitem.length===0){
        //        forcusitem="#inputadminname";
        //     }
        //     passCheck=false;
        //     $("#inputadminname").addClass(" is-invalid ");
        //    $("#inputadminname").removeClass(" is-valid ");
        //   }






        //   alert("1");
          if(passCheck==true){


          var GlobalVariables ={
                  'csrfToken': '123',
                  'baseUrl':'<?php echo base_url(); ?>',
                  // 'destUrl':'<?php echo base_url(); ?>/api/v1/frontend/add',
                  'AJAX_SUCCESS' :'SUCCESS',
                  'AJAX_FAILURE' :'FAILURE'
            };

            event.preventDefault();
            var postUrl= GlobalVariables.baseUrl +'/api/v1/brserviceuserend/update';
            // var postData ={
            //       'csrfToken' :'',
            //       'custname' : $('#name').val(),
            //       'tel' : $('#tel').val(),
            //       'email' : $('#email').val(),
            //       'wechat' : $('#wechat').val(),
            //       'birthday' : $('#birthday').val(),
            //       // 'selectedBox' :$('.css-checkbox:checked').val()
            //       'selectedBox' :selectBox1

            // }
            // $checkeddebate=0;
            // if($('#no_credit_rebate').is(':checked')){
            //     $checkeddebate=1;
            // }
            // else
            // {
            //   $checkeddebate=0;
            // }

            var postData ={
                'service_id':$('#service_id').val(),
                'available_qty':$('#available_qty').val(),
                'purchased_qty':$('#purchased_qty').val(),
                'unit_price':$('#unit_price').val(),
                'purchased_price':$('#purchased_price').val(),
                'purchased_date':$('#purchased_date').val(),
                // 'inputadminname':$('#inputadminname').val(),
                'remark2':$('#remark2').val(),
                // 'no_credit_rebate':$('#no_credit_rebate').val(),
                'id':$('#id').val(),
                'reason':$('#reason').val()
            }
            $.ajax({
                  method: "POST",
                  url: postUrl,
                  dataType: "json",
                 data: postData,
                 success : function(data){

                // alert("posted");
                // // alert('formsubmit');
                // alert(data);

                // alert(data['recordstatus']);
                // alert(data['msg']);
                if(data['recordstatus']=="SUCCESS"){
                    $('#feedback').remove();
                    $( '#newmsg' ).append('<p class="text-primary" id="feedback">'+data['msg']+'</p>');
                    setTimeout(function() {
                        location.reload();
                    }, 3000);
                    // location.reload();

                }
                  if(data['recordstatus']=="FAILURE"){
                    $('#feedback').remove();
                    $( '#newmsg' ).append('<p class="text-danger"  id="feedback">'+data['msg']+'</p>');
                //   $( '#modal-bodymsg' ).empty();
                //   $( '#modal-bodymsg' ).append( '<h5 class="text-center" style="color: #a03d49;">客戶不能增加。</h5> <h5 class="text-center" style="color: #a03d49;">請稍後再嘗試。</h5>' );
                //   $('#finishModal').modal('show');
                // }
                  // if (data.AJAX_SUCCESS==GlobalVariables.AJAX_SUCCESS){
                  //     window.location.href=GlobalVariables.destUrl;
                  // } else {
                  //     $('.alert').text("登入錯誤");
                  //    $('.alert').removeClass('hidden');
                  }
              }
            });

            }//if(passCheck==true){
        });//$("#btnUpdate").click(function(event) {



        });// $( document ).ready(function() {

        $(document).ready(function(){
             $("#btndeleteSubmit").click(function(event) {
              var forcusitem="";
          var passCheck=true;
            //check delete have value
            // var checkboxvalue = $('.checkbox').val();


             var postData ={
                // 'service_id':$('#service_id').val(),
                // 'available_qty':$('#available_qty').val(),
                // 'purchased_qty':$('#purchased_qty').val(),
                // 'unit_price':$('#unit_price').val(),
                // 'purchased_price':$('#purchased_price').val(),
                // 'remark2':$('#remark2').val(),
                'id':$('#id').val(),
            }

            // var checkboxvalue =  [];
            // // $("input.checkbox[type=checkbox]:checked").each(function(i){
            // //     alert(i.value );
            // // checkboxvalue.push( i.value );
            // // });

            // $('input.checkbox:checkbox:checked').each(function () {

            //     // alert($(this).val());
            //     checkboxvalue.push( $(this).val() );

            // });
            // var postData ={
            //     'inputdeletecheckboxvalue':checkboxvalue
            // }
            var GlobalVariables ={
                  'csrfToken': '123',
                  'baseUrl':'<?php echo base_url(); ?>',
                  'destUrl':'<?php echo base_url(); ?>/api/v1/fileend/delete',
                  'AJAX_SUCCESS' :'SUCCESS',
                  'AJAX_FAILURE' :'FAILURE'
            };

            event.preventDefault();
            var postUrl= GlobalVariables.baseUrl +'/api/v1/brserviceuserend/delete';
            //end　check delete have value
            // $('#loading').show();
             $.ajax({
                      method: "POST",
                      url: postUrl,
                      dataType: "json",
                     data: postData,
                     success : function(data){

                    // alert("posted");
                    // alert('formsubmit');
                    // alert(data);

                    // alert(data['recordstatus']);
                    // alert(data['msg']);
                    if(data['recordstatus']=="SUCCESS"){
                        // $('#feedback').remove();
                        $( '#deletemsg' ).append('<p class="text-primary" id="feedback">'+data['msg']+'</p>');
                        setTimeout(function() {
                        //     location.reload();
                        <?php if (!empty($servicesuserdetails->user_id)) {
	?>

                        location.href='/at-cms/brcustomeradmin/edit/<?php echo $servicesuserdetails->user_id; ?>';

                      <?php
}
?>
                        }, 3000);
                        // location.reload();

                    }
                      if(data['recordstatus']=="FAILURE"){
                        // $('#feedback').remove();
                        $( '#deletemsg' ).append('<p class="text-danger"  id="feedback">'+data['msg']+'</p>');
                    //   $( '#modal-bodymsg' ).empty();
                    //   $( '#modal-bodymsg' ).append( '<h5 class="text-center" style="color: #a03d49;">客戶不能增加。</h5> <h5 class="text-center" style="color: #a03d49;">請稍後再嘗試。</h5>' );
                    //   $('#finishModal').modal('show');
                    // }
                      // if (data.AJAX_SUCCESS==GlobalVariables.AJAX_SUCCESS){
                      //     window.location.href=GlobalVariables.destUrl;
                      // } else {
                      //     $('.alert').text("登入錯誤");
                      //    $('.alert').removeClass('hidden');
                      }
                  }
                });

        });  //$("#btndeleteSubmit").click(function(event)
        });
        $(document).ready(function(){
          //for calculate purchase user qty
          let tempInput;
          $("#purchased_qty").keyup(function(){
            // alert($("#purchased_qty").val);
            tempInput=$("#unit_price").val() * $("#purchased_qty").val();
            $("#purchased_price").val(tempInput);
          });
          $("#unit_price").keyup(function(){
            tempInput=$("#unit_price").val() * $("#purchased_qty").val();
            $("#purchased_price").val(tempInput);
          });
          $("#purchased_price").keyup(function(){
            tempInput=$("#purchased_price").val() / $("#purchased_qty").val();
            $("#unit_price").val(tempInput);
          });

        });


      </script>



    <?php include 'include/header.php';?>
    <div class="wrapper" >

        <?php include 'include/sidebar.php';?>
        <!-- Page Content  -->

           <!-- delete modal -->
            <script>

            </script>

            <div class="modal fade" id="deleteModalCenter" tabindex="-1" role="dialog" aria-labelledby="deleteModalCenterTitle" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered  " role="document" style="max-width: 600px;">
                <div class="modal-content px-3">
                <!-- <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLongTitle">Modal title</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                    </button>
                </div> -->
                <div class="modal-body ">
                     <h5 style="color:<?php echo MAIN_TEXT_COLOR; ?>" class="text-center py-2"><i class="fas fa-plus mr-2" style="color:<?php echo MAIN_TEXT_COLOR; ?>"></i>删除服務</h5>
                     <form>


                    <div class="form-group row">
                        <label for="inputRePassword" class="col-sm-12 "><span style="color:<?php echo MAIN_TEXT_COLOR; ?>;" >確定删除服務?</span></label>

                        <span id="deletemsg" class="text-center"></span>
                    </div>
                    <!-- <div class="form-group row">
                        <div class="col-sm-12">
                        <p style="font-size: 12px;"><span style="color:#616161">*為必填項目<br>登入名稱為英文字或數字組成(不分大小寫)</span></p>
                        <span id="editmsg" class="text-center"></span>
                         </div>
                    </div> -->
                    <div class="form-group row">
                        <div class="col-sm-12 text-center">
                        <button type="button" class="btn  px-5  custombutton" id="btndeleteSubmit">確定</button>
                        <span id="deletemsg" class="text-center"></span>
                        </div>
                    </div>
                    <input type="hidden" class="form-control" id="inputadminid" placeholder="">
                    </form>
                </div>
                <!-- <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                    <button type="button" class="btn btn-primary">Save changes</button>
                </div> -->
                </div>
            </div>
            </div>
            <script type="text/javascript">



            </script>
            <!-- end delete modal -->


        <div id="content" style="background-color: #ffffff;">
          <div class="title"><?php if ($pagemethod == "add") {
	echo "新增薪金級別";
}?>
              <?php if ($pagemethod == "edit") {
	echo "更改薪金級別";
}?></div>

           <div style="" class="menubar2">

<!--            <a href="/at-cms/brservicesadmin">
            <i class="fas fa-chevron-left" style=" display: inline-block;
  border-radius: 10px;
  box-shadow: 0px 0px 2px #888;
  color: #33aaae;
  padding: 2px 2px;"></i>
           返回</a> -->
           <?php

if ($pagemethod == "add") {
	?>
              <a href="/at-cms/bremployeewageadmin/edit/<?php echo $this->uri->segment(4); ?>">
                <i class="fas fa-chevron-left" style=" display: inline-block;
  border-radius: 10px;
  box-shadow: 0px 0px 2px #888;
  color: #33aaae;
  padding: 2px 2px;"></i>
           返回</a>

          <?php
}
?>
           <?php
if ($pagemethod == "edit") {
	?>
            <a href="/at-cms/bremployeewageadmin/edit/<?php echo $wageleveldetails->wageid; ?>">
            <i class="fas fa-chevron-left" style=" display: inline-block;
  border-radius: 10px;
  box-shadow: 0px 0px 2px #888;
  color: #33aaae;
  padding: 2px 2px;"></i>
           返回</a>
           <?php
} //if($pagemethod=="edit"){
?>
         </div>
            <!-- add button -->
            <!-- <h5>新增服務</h5> -->
            <!-- input form -->
            <form>
            <div class="form-group row formrowdiv">
              <div class="col-sm-2 col-form-label formleftdiv" for="username" style="" >薪金級別詳情
            <!--   <label for="username" class="col-sm-2 col-form-label">服務種類*</label> --></div>

            </div>
             <div class="form-group row">
              <label for="name" class="col-sm-2 col-form-label">薪金級別名稱</label>
              <div class="col-sm-10">
                <?php

if ($pagemethod == "add") {
	echo
	$wagedetail->chi_name;
}
if ($pagemethod == "edit") {
	echo $wageleveldetails->chi_name;
}
?>
              </div>
            </div>
            <div class="form-group row">
              <label for="name" class="col-sm-2 col-form-label">開單金額</label>
              <div class="col-sm-10">
                <input type="text" class="form-control" id="sales_amount" name="sales_amount" placeholder="開單金額" value="<?php if ($pagemethod == "add") {
}?><?php if ($pagemethod == "edit") {
	echo
	$wageleveldetails->sales_amount;
}?>"   <?php if ($pagemethod == "details") {
	echo
		"readonly";
}?>>
                <div class="valid-feedback">正確</div>
                <div class="invalid-feedback">没有資料</div>
              </div>
            </div>
            <div class="form-group row">
              <label for="precentage" class="col-sm-2 col-form-label">比率</label>
              <div class="col-sm-10">
                <!-- first column area 1 -->
                             <input type="text" class="form-control" id="precentage" name="precentage" placeholder="開單金額" value="<?php if ($pagemethod == "add") {
}?><?php if ($pagemethod == "edit") {
	echo
	$wageleveldetails->precentage;
}?>"  <?php if ($pagemethod == "details") {
	echo
		"readonly";
}?>>
                <div class="valid-feedback">正確</div>
                <div class="invalid-feedback">没有资料</div>
              </div>
            </div>

            <div class="form-group row">
              <label for="job_pay" class="col-sm-2 col-form-label">消工</label>
              <div class="col-sm-10">
                <!-- first column area 1 -->
                             <input type="text" class="form-control" id="job_pay" name="job_pay" placeholder="消工金額" value="<?php if ($pagemethod == "add") {
}?><?php if ($pagemethod == "edit") {
	echo
	$wageleveldetails->job_pay;
}?>"   <?php if ($pagemethod == "details") {
	echo
		"readonly";
}?>>
                <div class="valid-feedback">正確</div>
                <div class="invalid-feedback">没有资料</div>
              </div>
            </div>



            <!-- <div class="form-group row">
              <label for="available_qty" class="col-sm-2 col-form-label">可用次數*</label>
              <div class="col-sm-10">
                <input type="text" class="form-control" id="available_qty" name="available_qty" placeholder="" value="<?php if ($pagemethod == "edit") {echo $servicesuserdetails->available_qty;}?>">
                <div class="valid-feedback">正確</div>
                <div class="invalid-feedback">没有资料</div>
              </div>
            </div> -->



            <div class="form-group row">
              <label for="inputPassword" class="col-sm-2 col-form-label">備註</label>
              <div class="col-sm-10">
                <textarea  type="text" class="form-control" id="remark" name="remark" rows="4" cols="50" placeholder="輸入備註"><?php if ($pagemethod == "edit") {echo $wageleveldetails->remark;}?></textarea>
              </div>
            </div>


            <div class="form-group row">
                        <div class="col-sm-12">
                        <p style="font-size: 12px;"><span style="color:#616161">*為必填項目</span></p>
                        <span id="newmsg" class="text-center"></span>
                         </div>
            </div>
            <?php if ($pagemethod == "add") {
	?>
             <input type="hidden" class="form-control" id="wageid" name="wageid" placeholder="" value="<?php echo $wagedetail->id; ?>">
            <?php
}
?>
             <?php if ($pagemethod == "edit") {?>
              <input type="hidden" class="form-control" id="wagelevelid" name="wagelevelid" placeholder="" value="<?php echo $wageleveldetails->id; ?>">
            <?php } //if ($pagemethod == "edit") {?>
            <div class="form-group row">
                        <div class="col-sm-12 text-center">
                       <?php if ($pagemethod == "add") {
	?>
                          <button type="button" class="btn  px-5  custombutton mr-5" id="btnReset">重設</button>

                        <button type="button" class="btn  px-5  custombutton" id="btnSubmit">確定</button>
                      <?php
}?><?php if ($pagemethod == "edit") {
	?>

                      <button type="button" class="btn  px-5  custombutton mr-5" id="btnDelete" onclick="showdeletemodal()">删除</button>

                       <button type="button" class="btn  px-5  custombutton mr-5" id="btnResetUpdate">重設</button>

                        <button type="button" class="btn  px-5  custombutton" id="btnUpdate">更改</button>
                <?php
}?>

                        </div>
            </div>
          </form>
          <!-- end input form -->

            <!-- end add button -->


          <!-- end change reason -->


        </div>
    </div>
     <script type="text/javascript">
            $(document).ready(function() {
                $('#reson-table').DataTable( {
                    "order": [[ 0, "desc" ]],
                     dom: 'Bfrtip',
                    buttons: [
                        // 'colvis'
                    ]
                }

                    );
              });
    </script>

    <script type="text/javascript">
        $(document).ready(function () {
            $('#sidebarCollapse').on('click', function () {
                $('#sidebar').toggleClass('active');
            });

            // password click
            bootstrapRevealPassword();

// Plugin to integrate in your javascript file
            function bootstrapRevealPassword() {
            $('[data-password]').closest('.form-group').addClass('position-relative').append('<span class="form-password-icon"><i class="material-icons">visibility_off</i></span>');

            $('.form-password-icon').on('click', function() {
                var clicks = $(this).data('clicks');
                if (clicks) {
                // odd clicks
                $(this).html('<span class="input-group-text "><i class="fas fa-eye-slash"></i></span>').prevAll(':input').attr('type', 'password');
                } else {
                // even clicks
                $(this).html('<span class="input-group-text "><i class="fas fa-eye"></i></span>').prevAll(':input').attr('type', 'text');
                }
                $(this).data("clicks", !clicks);
            });
            }

            // end password click

        });
    </script>
</body>

</html>