Server IP : 103.233.192.212 / Your IP : 18.118.104.28 Web Server : Apache/2 System : Linux sv1.inde.co.th 3.10.0-1160.36.2.el7.x86_64 #1 SMP Wed Jul 21 11:57:15 UTC 2021 x86_64 User : sumpatuan ( 1058) PHP Version : 5.5.38 Disable Function : symlink,shell_exec,exec,proc_close,proc_open,popen,system,dl,putenv,passthru,escapeshellarg,escapeshellcmd,pcntl_exec,proc_get_status,proc_nice,proc_terminate,pclose,ini_alter,virtual,openlog,ini_restore MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/sumpatuan/domains/sumpatuan.go.th/public_html/admin/top/ |
Upload File : |
<?php require_once('session_backend_administrator.php'); header('Content-Type: text/html; charset=UTF-8'); if($STT_login=="admin_login_true"){ $check_type = "ข้อมูลบุคลากร"; $check_link = "ChartProfileMain"; $data_id = $con_db_administrator->real_escape_string($_GET['id']); $data_name = $con_db_administrator->real_escape_string($_GET['name']); if( $data_id=="" or !isset($data_id) or $data_name =="" or !isset($data_name) ){ echo "<SCRIPT type='text/javascript'> alert('ไม่ข้อมูล ที่ต้องการแก้ไข'); window.location.replace(document.referrer); </SCRIPT>"; exit; }else{ $sql_data = " SELECT * FROM `data_profile` WHERE `id_profile`='$data_id' AND `name_profile`='$data_name' "; $qr_data = mysqli_query($con_db_administrator, $sql_data); $rs_data = mysqli_fetch_assoc($qr_data); if( empty($rs_data) ){ echo "<SCRIPT type='text/javascript'> alert('ไม่ข้อมูล ที่ต้องการแก้ไข'); window.location.replace('$check_link'); </SCRIPT>"; exit; } } }else{ echo "<SCRIPT type='text/javascript'> alert('กรุณาเข้าสู่ระบบ'); window.location.replace('../index'); </SCRIPT>"; exit; } ?> <!doctype html> <html lang="en"> <head> <?php include_once ("head.html"); ?> </head> <body class="" > <?php include_once ("menu.php"); ?> <div class="container pt-3 pb-4 " > <div class="row "> <div class="col text-secondary" > <div class="p-1 ps-2 box-link " ><a href="../backend-administrator" class="link-info">หน้าหลัก</a> / <a href="<?php echo $check_link;?>" class="link-info"><?php echo $check_type;?></a> / แก้ไขข้อมูล <?php echo $check_type;?></div> </div> <div class="w-100 pb-4"></div> <div class="col m-auto" > <div class="bg-line-1 hideTab"></div> </div> <div class="col-auto text-center"> <span class="lh-sm h1 fw-700">แก้ไขข้อมูล <?php echo $check_type;?> </span> </div> <div class="col m-auto" > <div class="bg-line-1 hideTab"></div> </div> </div> <div class="row mt-4 mb-5 p-2"> <div class="col mx-auto box-data p-4" style="max-width:800px"> <form action="action/save-ChartProfileMain-edit" name='form_ChartprofileMain_edit' id='form_ChartprofileMain_edit' method="post" enctype="multipart/form-data"> <input type="hidden" name="edt_pathimg" value="<?php echo $rs_data['img_profile']; ?>" readonly> <div class="row mb-3"> <label class="col-2 col-form-label fw-700 txtbox-align">สังกัดหน่วยงาน</label> <div class="col-lg-10"> <?php if(!isset($_GET['sel_group']) or $_GET['sel_group']=="" ){ $sel_group = $rs_data['id_group_profile']; }else{ $sel_group = $con_db_administrator->real_escape_string($_GET['sel_group']); } $sql_group = "SELECT * FROM `data_group` ORDER BY `id_group` ASC "; $qr_group = mysqli_query($con_db_administrator,$sql_group) or die( mysqli_error($con_db_administrator)); echo '<select class="form-select" id="slec_group" name="edt_group" required>'; echo '<option></option>'; while($rs_group = mysqli_fetch_array($qr_group )){ echo '<option value="'.$rs_group['id_group'].'"'; if($rs_group['id_group']==$sel_group){ echo "selected"; } echo'>'.$rs_group['name_group'].'</option>'; } echo '</select>'; ?> </div> </div> <div class="row "> <label class="col-2 col-form-label fw-700 txtbox-align">ตำแหน่ง</label> <div class="col-lg-10"> <?php $sql_pst = " SELECT * FROM `data_position` WHERE `id_group_position`='$sel_group' "; $qr_pst = mysqli_query($con_db_administrator,$sql_pst) or die( mysqli_error($con_db_administrator)); echo '<select class="form-select" id="txt_position" name="edt_position" required>'; while($rs_pst = mysqli_fetch_array($qr_pst)){ echo '<option value="'.$rs_pst['id_position']."|".$rs_pst['name_position'].'"'; if( $rs_pst['id_position']==$rs_data['id_position_profile'] ){ echo "selected"; } echo '>'.$rs_pst['name_position'].'</option>'; } echo '</select>'; ?> <script> $(document).ready(function(){ $('#slec_group').on('change', function(){ var id = <?php echo json_encode($rs_data['id_profile']); ?>; var name = <?php echo json_encode($rs_data['name_profile']); ?>; var val_group = $(this).val(); // alert(id); if($(this).val()===""){ $("#txt_position").empty(); }else{ $("#txt_position").empty(); window.location.replace('ChartProfileMain-edit?id='+id+'&name='+name+'&sel_group='+val_group); } }); }); </script> </div> </div> <hr class="hr-das mt-4 mb-4"> <div class="row mb-3"> <label class="col-lg-2 col-form-label fw-700 txtbox-align">ลำดับบุคลากร</label> <div class="col-lg-10"> <input type="text" class="form-control" name="edt_id" value="<?php echo $rs_data['id_profile']; ?>" oninput="this.value = this.value.replace(/\D+/g, '').replace(/^0[^.]/, '0');" maxlength="10" style="max-width:150px" required> <input type="hidden" name="edt_oldid" value="<?php echo $rs_data['id_profile']; ?>" readonly> <div class="mt-1 lh-1"> <small class="fs-12 text-secondary">- ห้ามกรอก<u>ลำดับซ้ำ</u> กับบุคลากรที่มีอยู่</small> <br><small class="fs-12 text-secondary">- หากต้องการลำดับที่มีอยู่แล้ว ให้<u>แก้ไขข้อมูลลำดับ</u>บุคลากรนั้น ก่อนทำการเพิ่มข้อมูล</small> </div> </div> </div> <div class="row mb-3"> <label class="col-2 col-form-label fw-700 txtbox-align">ชื่อบุคลากร</label> <div class="col-lg-10"> <input type="text" class="form-control" name="edt_name" value="<?php echo $rs_data['name_profile']; ?>" required> </div> </div> <div class="row mb-3"> <label class="col-2 col-form-label fw-700 txtbox-align lh-sm">รูปบุคลากร</label> <div class="col-lg-10 "> <img class="img-fluid w-100" src="../../<?php echo $rs_data['img_profile']; ?>" style="max-width:300px"> <div class="mt-3"> <span class="fw-700">แก้ไขรูปบุคลากร</span> <small class="fs-12 text-secondary">- อัพโหลดได้เฉพาะไฟล์รูปภาพเท่านั้น ขนาดรูปที่แนะนำ 300*400 px</small> <input class="form-control mt-1" type="file" id="uploadFile" name="uploadFile" accept="image/png, image/gif, image/jpeg" > </div> </div> </div> <hr class="hr-das mt-4 mb-4"> <div class="text-center"> <button type="submit" class="btn btn-success"><i class="fas fa-save me-2" ></i> บันทึกข้อมูล</button> <button type="button" class="btn btn-danger ms-2" onclick="location.href='<?php echo $check_link;?>'">ย้อนกลับ</button> </div> </form> </div> </div> <?php include_once ("../footer.php"); ?> </div> <script> $('body').on('dragstart drop', function(e){ e.preventDefault(); return false; }); </script> </body> </html>