diff --git a/html/team0/application/views/Login/login.php b/html/team0/application/views/Login/login.php index 4a585b8a7666e36bb9b67b3341526ce244069860..bc3ea9e1c7b83554ec30d5153dc15511a92e58dd 100644 --- a/html/team0/application/views/Login/login.php +++ b/html/team0/application/views/Login/login.php @@ -15,12 +15,12 @@ view login <meta name="description" content=""> <meta name="author" content=""> <!-- Favicon icon --> - <link rel="icon" type="image/png" sizes="16x16" href="<?= base_url() ?>assets/images/logo3.png"> + <link rel="icon" type="image/png" sizes="16x16" href="<?php echo base_url() ?>assets/images/logo3.png"> <title>IV PERSON</title> <!-- page css --> - <link href="<?= base_url() ?>assets/dist/css/pages/login-register-lock.css" rel="stylesheet"> + <link href="<?php echo base_url() ?>assets/dist/css/pages/login-register-lock.css" rel="stylesheet"> <!-- Custom CSS --> - <link href="<?= base_url() ?>assets/dist/css/style.min.css" rel="stylesheet"> + <link href="<?php echo base_url() ?>assets/dist/css/style.min.css" rel="stylesheet"> </head> <body class="skin-default card-no-border"> @@ -37,7 +37,7 @@ view login <!-- Main wrapper - style you can find in pages.scss --> <!-- ============================================================== --> <section id="wrapper"> - <div class="login-register" style="background-image:url(<?= base_url() ?>assets/images/background/login6-bg.png);background-position: center top;"> + <div class="login-register" style="background-image:url(<?php echo base_url() ?>assets/images/background/login6-bg.png);background-position: center top;"> <div class="login-box card"> <div class="card-body"> <form class="form-horizontal form-material" method="POST" id="loginform" action="Login_controller/check_login"> @@ -80,9 +80,9 @@ view login <!-- ============================================================== --> <!-- All Jquery --> <!-- ============================================================== --> - <script src="<?= base_url() ?>assets/node_modules/jquery/dist/jquery.min.js"></script> + <script src="<?php echo base_url() ?>assets/node_modules/jquery/dist/jquery.min.js"></script> <!-- Bootstrap tether Core JavaScript --> - <script src="<?= base_url() ?>assets/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script> + <script src="<?php echo base_url() ?>assets/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script> <!--Custom JavaScript --> <script type="text/javascript"> $(function() { diff --git a/html/team0/application/views/Manage_user/manage_user.php b/html/team0/application/views/Manage_user/manage_user.php index 0560113771c78726d0d992ca080af348231c87e2..b43826fff81f727de558ab480e0ad51411d44ddf 100644 --- a/html/team0/application/views/Manage_user/manage_user.php +++ b/html/team0/application/views/Manage_user/manage_user.php @@ -93,9 +93,9 @@ view table data in data person of personnel <div class="form-group"> <label for="position" class="form-label">แผนก :</label> <select class="form-control form-select" name="w_dpm_id1" id="w_dpm_id1" required> - <? foreach ($department as $key => $value) { ?> - <option value=<?= $value->dpm_id ?>><?= $value->dpm_name ?></option> - <? } ?> + <?php foreach ($department as $key => $value) { ?> + <option value=<?php echo $value->dpm_id ?>><?php echo $value->dpm_name ?></option> + <?php } ?> </select> </div> </div> @@ -111,22 +111,22 @@ view table data in data person of personnel <div class="col-md-6"> <div class="form-group"> <label for="starting_date" class="form-label">ปีที่บรรจุเข้าทำงาน :</label> - <? $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> + <?php $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> <select class="form-control form-select" name="w_join_year1" id="w_join_year1" required> - <? foreach ($years as $year) : ?> - <option value="<?= $year; ?>"><?= $year + 543; ?></option> - <? endforeach; ?> + <?php foreach ($years as $year) : ?> + <option value="<?php echo $year; ?>"><?php echo $year + 543; ?></option> + <?php endforeach; ?> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="exit_date" class="form-label">ปีที่ออกจากตำแหน่งงาน :</label> - <? $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> + <?php $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> <select class="form-control form-select" name="w_exit_year1" id="w_exit_year1" required> - <? foreach ($years as $year) : ?> - <option value="<?= $year; ?>"><?= $year + 543; ?></option> - <? endforeach; ?> + <?php foreach ($years as $year) : ?> + <option value="<?php echo $year; ?>"><?php echo $year + 543; ?></option> + <?php endforeach; ?> </select> <div class="form-control-feedback" id="feedback_exit_year1"></div> </div> @@ -275,7 +275,7 @@ view table data in data person of personnel } function member_dpm(dpm_name) { - var date_end = "'" + <?= $_SESSION['year'] ?> + "-01-1'"; + var date_end = "'" + <?php echo $_SESSION['year'] ?> + "-01-1'"; var table_index = 0; console.log(dpm_name); $.ajax({ @@ -312,13 +312,13 @@ view table data in data person of personnel $('#CreateTable').html(table); create_data_table_by_id('dpm_report'); // create_data_table_by_id('#dpm_report'); - $("#header").html('<h4 class="modal-title" id="my_large_modal_label">ตารางแสดงรายชื่อบุคลากรใน' + dpm_name + '</h4><button type="button" class="close" data-bs-dismiss="modal" aria-hidden="true">×</button>'); + $("#header").html('<h4 class="modal-title" id="my_large_modal_label">ตารางแสดงรายชื่อบุคลากร' + dpm_name + 'ในปัจจุบัน'+'</h4><button type="button" class="close" data-bs-dismiss="modal" aria-hidden="true">×</button>'); }); } function get_working(w_id) { $.ajax({ - url: "<?= base_url() ?>Manage/Management_controller/show_working/", + url: "<?php echo base_url() ?>Manage/Management_controller/show_working/", type: 'POST', data: { w_id: w_id @@ -408,7 +408,7 @@ view table data in data person of personnel Swal.fire({ type: 'error', title: 'ลบข้อมูลไม่สำเร็จ', - text: 'ปัจจุบันยังมีคนทำงานอยู่ในฝ่ายนี้ !', + text: 'ในประวัติการทำงานยังมีคนทำงานอยู่ในฝ่ายนี้ !', }) } }); @@ -427,7 +427,7 @@ view table data in data person of personnel }) } else if ($('#w_exit_year1').val() != null) { $.ajax({ - url: "<?= base_url() ?>Manage/Management_controller/update_working_exp", + url: "<?php echo base_url() ?>Manage/Management_controller/update_working_exp", type: 'POST', data: { w_id: $('#w_id1').val(), @@ -455,7 +455,7 @@ view table data in data person of personnel }); } else { $.ajax({ - url: "<?= base_url() ?>Manage/Management_controller/update_working_exp", + url: "<?php echo base_url() ?>Manage/Management_controller/update_working_exp", type: 'POST', data: { w_id: $('#w_id1').val(), diff --git a/html/team0/application/views/Manage_user/table_dpm.php b/html/team0/application/views/Manage_user/table_dpm.php index 4a1a7704af26cf9f581a14ba3fd9ada27bb65b82..a552c15a173b29bef4bf1e6e7bb4e3a2df660225 100644 --- a/html/team0/application/views/Manage_user/table_dpm.php +++ b/html/team0/application/views/Manage_user/table_dpm.php @@ -15,41 +15,41 @@ </tr> </thead> <tbody> - <? $index = 0; ?> - <? foreach ($dpm as $key => $value) : ?> + <?php $index = 0; ?> + <?php foreach ($dpm as $key => $value) : ?> <tr> - <td class="text-center"><?= ++$index ?></td> - <td><?= $value->dpm_name ?></td> - <td><?= $value->dpm_name_eng ?></td> + <td class="text-center"><?php echo ++$index ?></td> + <td><?php echo $value->dpm_name ?></td> + <td><?php echo $value->dpm_name_eng ?></td> <td> - <? + <?php $count = 0; foreach ($work as $key1 => $value_work) : if (($value->dpm_id == $value_work->w_dpm_id)) : $count++; endif; endforeach; ?> - <a data-bs-toggle="modal" data-bs-target="#dpm" href="#" onclick="member_dpm('<?= $value->dpm_name ?>')" data-bs-toggle="tooltip" title="ดูรายละเอียด"><?= $count; ?></a> + <a data-bs-toggle="modal" data-bs-target="#dpm" href="#" onclick="member_dpm('<?php echo $value->dpm_name ?>')" data-bs-toggle="tooltip" title="ดูรายละเอียด"><?php echo $count; ?></a> </td> <td> <center> <!-- <a type="button" class="btn waves-effect waves-light btn-info " data-bs-toggle="tooltip" title="ดูบุคลากรในฝ่าย"><i class="fas fa-search text-white"></i></a> --> <!-- <a type="button" class="btn waves-effect waves-light btn-warning " data-bs-toggle="tooltip" title="แก้ไขข้อมูลฝ่าย"><i class="fas fa-pencil-alt text-white"></i></a> --> - <? if ($count == 0) { ?> - <button disabled type="button" data-bs-toggle="modal" onclick="member_dpm('<?= $value->dpm_name ?>')" data-bs-target="#dpm" data-bs-toggle="tooltip" title="ดูรายละเอียด" class="btn btn-sm waves-effect waves-light btn-info "><i class="fas fa-search text-white"></i></button> + <?php if ($count == 0) { ?> + <button disabled type="button" data-bs-toggle="modal" onclick="member_dpm('<?php echo $value->dpm_name ?>')" data-bs-target="#dpm" data-bs-toggle="tooltip" title="ดูรายละเอียด" class="btn btn-sm waves-effect waves-light btn-info "><i class="fas fa-search text-white"></i></button> - <? } else { ?> - <button type="button" data-bs-toggle="modal" onclick="member_dpm('<?= $value->dpm_name ?>')" data-bs-target="#dpm" data-bs-toggle="tooltip" title="ดูรายละเอียด" class="btn btn-sm waves-effect waves-light btn-info "><i class="fas fa-search text-white"></i></button> + <?php } else { ?> + <button type="button" data-bs-toggle="modal" onclick="member_dpm('<?php echo $value->dpm_name ?>')" data-bs-target="#dpm" data-bs-toggle="tooltip" title="ดูรายละเอียด" class="btn btn-sm waves-effect waves-light btn-info "><i class="fas fa-search text-white"></i></button> - <? } ?> - <button type="button" data-bs-toggle="modal" onclick="get_department('<?= $value->dpm_id ?>')" data-bs-target="#dpm_edit_name" data-bs-toggle="tooltip" title="แก้ไขชื่อฝ่าย" class="btn btn-sm waves-effect waves-light btn-warning "><i class="fas fa-pencil-alt text-white"></i></button> - <button type="button" data-bs-toggle="modal" onclick="delete_dpm('<?= $value->dpm_id ?>')" title="ลบฝ่าย" class="btn btn-sm waves-effect waves-light btn-danger"><i class="ti-trash text-white"></i></button> + <?php } ?> + <button type="button" data-bs-toggle="modal" onclick="get_department('<?php echo $value->dpm_id ?>')" data-bs-target="#dpm_edit_name" data-bs-toggle="tooltip" title="แก้ไขชื่อฝ่าย" class="btn btn-sm waves-effect waves-light btn-warning "><i class="fas fa-pencil-alt text-white"></i></button> + <button type="button" data-bs-toggle="modal" onclick="delete_dpm('<?php echo $value->dpm_id ?>')" title="ลบฝ่าย" class="btn btn-sm waves-effect waves-light btn-danger"><i class="ti-trash text-white"></i></button> </center> </td> </tr> - <? endforeach; ?> + <?php endforeach; ?> </tbody> </table> \ No newline at end of file diff --git a/html/team0/application/views/Management/data_person.php b/html/team0/application/views/Management/data_person.php index 2c2297912b0046fdaf9e4f27af8997ec3d59cc88..58eea2f550034454147c7487fb775869ae4652d3 100644 --- a/html/team0/application/views/Management/data_person.php +++ b/html/team0/application/views/Management/data_person.php @@ -99,7 +99,7 @@ view data personnel <label> <!-- <input type="file" name="image" id="image" style="display:none;" /> --> <div id="profile-image" data-bs-toggle="modal" data-bs-target="#bs-exElite-modal-lg "> - <img id="profile-image__image" src='<?= base_url() ?>assets/images/profile/<?= $person->p_photo_person ?>' class="img-circle"> + <img id="profile-image__image" src='<?php echo base_url() ?>assets/images/profile/<?php echo $person->p_photo_person ?>' class="img-circle"> <div id="profile-image__content"> <span id="profile-image__icon"><i class="fas fa-camera"></i></span> <span id="profile-image__text">Edit Profile</span> @@ -110,7 +110,7 @@ view data personnel </div> </div> </div> - <? if (count($working) != 0) { + <?php if (count($working) != 0) { $work = $working[count($working) - 1]->w_position; $dpm = $working[count($working) - 1]->dpm_name; } else { @@ -120,9 +120,9 @@ view data personnel <div class="col-md-10"> <div class="card-body "> - <h5 class="card-title m-b-15 m-t-10"><?= $person->p_pf_id . ' ' . $person->p_first_name . ' ' . $person->p_last_name ?></h5> - <h6 id="show_position" class="card-subtitle">ตำแหน่ง: <?= $work ?></h6> - <h6 id="show_department" class="card-subtitle">ฝ่าย: <?= $dpm ?> </h6> + <h5 class="card-title m-b-15 m-t-10"><?php echo $person->p_pf_id . ' ' . $person->p_first_name . ' ' . $person->p_last_name ?></h5> + <h6 id="show_position" class="card-subtitle">ตำแหน่ง: <?php echo $work ?></h6> + <h6 id="show_department" class="card-subtitle">ฝ่าย: <?php echo $dpm ?> </h6> </div> </div> </div> @@ -141,15 +141,15 @@ view data personnel </div> <div class="modal-body"> <div id="show_photo"> - <input type="hidden" id="p_id" name="p_id" value="<?= $person->p_id ?>"> - <center><img src='<?= base_url() ?>assets/images/profile/<?= $person->p_photo_person ?>' id="preview" class="img-thumbnail" width="150px" height="150px"></center><br><br> + <input type="hidden" id="p_id" name="p_id" value="<?php echo $person->p_id ?>"> + <center><img src='<?php echo base_url() ?>assets/images/profile/<?php echo $person->p_photo_person ?>' id="preview" class="img-thumbnail" width="150px" height="150px"></center><br><br> </div> <div id="upload_photo"> <center><label for="img" class="btn btn-info">Choose Photo</label></center> <center><input id="pic" type="file" class="btn btn-defaultt file_button" name="pic" accept="image/jpg, image/jpeg"></center><br> <!-- <input id="img" type="file" name="img"> --> - <input type="hidden" name="p_id_photo" id="p_id_photo" value="<?= $person->p_id ?>"> - <input type="hidden" name="p_teacher_id" id="p_teacher_id" value="<?= $person->p_teacher_id ?>"> + <input type="hidden" name="p_id_photo" id="p_id_photo" value="<?php echo $person->p_id ?>"> + <input type="hidden" name="p_teacher_id" id="p_teacher_id" value="<?php echo $person->p_teacher_id ?>"> </div> <div class="modal-footer"> <button onclick="reset_modal('edit_picture')" type="reset" style="background-color:#696969;" class="btn waves-effect waves-light text-white" data-bs-dismiss="modal" data-bs-reset="modal" value="ยกเลิก">ยกเลิก</button> @@ -161,7 +161,7 @@ view data personnel </div> </div> <!-- end edit photo --> -<? +<?php //สถานะภาพ selected $checked_mr_1 = ''; $checked_mr_2 = ''; @@ -225,10 +225,10 @@ endif; <div class="p-0"> <!-- <h1>ข้อมูลส่วนตัว</h1> --> <!-- <form> --> - <input type="hidden" id="p_id" name="p_id" value="<?= $person->p_id ?>"> - <input type="hidden" id="adr_id" name="adr_id" value="<?= $person->adr_id ?>"> - <input type="hidden" id="nt_id" value="<?= $person->p_nt_id ?>"> - <input type="hidden" id="pf_id" value="<?= $person->p_pf_id ?>"> + <input type="hidden" id="p_id" name="p_id" value="<?php echo $person->p_id ?>"> + <input type="hidden" id="adr_id" name="adr_id" value="<?php echo $person->adr_id ?>"> + <input type="hidden" id="nt_id" value="<?php echo $person->p_nt_id ?>"> + <input type="hidden" id="pf_id" value="<?php echo $person->p_pf_id ?>"> <div class="card m-t-20"> <div class="card-header bg-success"> <h4 class="m-b-0 text-white">ประวัติส่วนตัว</h4> @@ -245,27 +245,27 @@ endif; </div> <div class="col-md"> <label for="name" class="form-label"> ชื่อ </label> - <input type="text" class="form-control" id="p_first_name" name="name" value="<?= $person->p_first_name ?>" class="format"> + <input type="text" class="form-control" id="p_first_name" name="name" value="<?php echo $person->p_first_name ?>" class="format"> </div> <div class="col-md"> <label for="lastname" class="form-label"> นามสกุล </label> - <input type="text" class="form-control" id="p_last_name" name="lastname" value="<?= $person->p_last_name ?>"> + <input type="text" class="form-control" id="p_last_name" name="lastname" value="<?php echo $person->p_last_name ?>"> </div> </div> <div class="row "> <div class="col-md form-group"> <label for="name" class="form-label"> รหัสประจำตัว </label> - <input type="text" class="form-control" id="p_teacher_id1" name="name" value="<?= $person->p_teacher_id ?>" class="format"> + <input type="text" class="form-control" id="p_teacher_id1" name="name" value="<?php echo $person->p_teacher_id ?>" class="format"> <div class="form-control-feedback" id="feedback_teacher_id1"></div> </div> <div class="col-md form-group"> <label for="p_citizen_id_edit" class="form-label required">เลขบัตรประชาชน</label> - <input type="text" class="form-control" id="p_citizen_id_edit" placeholder="หมายเลขบัตรประชาชน" minlength="13" maxlength="13" name="p_citizen_id_edit" value="<?= $person->p_citizen_id ?>" required> + <input type="text" class="form-control" id="p_citizen_id_edit" placeholder="หมายเลขบัตรประชาชน" minlength="13" maxlength="13" name="p_citizen_id_edit" value="<?php echo $person->p_citizen_id ?>" required> <div class="form-control-feedback" id="feedback_Id_card_edit"></div> </div> <div class="col-md form-group"> <label for="date" class="form-label"> วัน/เดือน/ปีเกิด </label> - <input type="date" class="form-control" id="p_birth_date" name="date" value="<?= $person->p_birth_date ?>" class="format"> + <input type="date" class="form-control" id="p_birth_date" name="date" value="<?php echo $person->p_birth_date ?>" class="format"> </div> </div> @@ -273,31 +273,31 @@ endif; <div class="col-md form-group"> <label for="p_mr_id" class="form-label"> สถานภาพสมรส </label> <select class="select2 form-control form-select" id="p_mr_id" name="p_mr_id"> - <option value="1" <?= $checked_mr_1 ?>>โสด</option> - <option value="2" <?= $checked_mr_2 ?>>สมรส</option> - <option value="3" <?= $checked_mr_3 ?>>หย่าร้าง</option> - <option value="4" <?= $checked_mr_4 ?>>ไม่ทราบ</option> + <option value="1" <?php echo $checked_mr_1 ?>>โสด</option> + <option value="2" <?php echo $checked_mr_2 ?>>สมรส</option> + <option value="3" <?php echo $checked_mr_3 ?>>หย่าร้าง</option> + <option value="4" <?php echo $checked_mr_4 ?>>ไม่ทราบ</option> </select> </div> <div class="col-md form-group "> <label for="p_religion" class="form-label"> ศาสนา </label> <select class="select2 form-control form-select" id="p_religion" name="p_religion"> - <option value="1" <?= $checked_religion_1 ?>>พุทธ</option> - <option value="2" <?= $checked_religion_2 ?>>อิสลาม</option> - <option value="3" <?= $checked_religion_3 ?>>คริสต์</option> - <option value="4" <?= $checked_religion_4 ?>>ฮินดู</option> - <option value="5" <?= $checked_religion_5 ?>>ซิกข์</option> - <option value="6" <?= $checked_religion_5 ?>>อื่นๆ</option> - <option value="7" <?= $checked_religion_6 ?>>ไม่ทราบ</option> - <option value="8" <?= $checked_religion_7 ?>>ไม่นับถือศาสนา</option> + <option value="1" <?php echo $checked_religion_1 ?>>พุทธ</option> + <option value="2" <?php echo $checked_religion_2 ?>>อิสลาม</option> + <option value="3" <?php echo $checked_religion_3 ?>>คริสต์</option> + <option value="4" <?php echo $checked_religion_4 ?>>ฮินดู</option> + <option value="5" <?php echo $checked_religion_5 ?>>ซิกข์</option> + <option value="6" <?php echo $checked_religion_5 ?>>อื่นๆ</option> + <option value="7" <?php echo $checked_religion_6 ?>>ไม่ทราบ</option> + <option value="8" <?php echo $checked_religion_7 ?>>ไม่นับถือศาสนา</option> </select> - <!-- <input type="text" class="form-control" id="p_religion" name="p_religion" value="<?= $person->p_religion ?>"> --> + <!-- <input type="text" class="form-control" id="p_religion" name="p_religion" value="<?php echo $person->p_religion ?>"> --> </div> <div class="col-md form-group"> <label for="p_nt_id" class="form-label"> สัญชาติ </label> <select class="select2 form-control form-select" id="p_nt_id" name="p_nt_id"> </select> - <!-- <input type="text" class="form-control" id="p_nt_id" name="p_nt_id" minlength="10" maxlength="10" value="<?= $person->p_nt_id ?>"> --> + <!-- <input type="text" class="form-control" id="p_nt_id" name="p_nt_id" minlength="10" maxlength="10" value="<?php echo $person->p_nt_id ?>"> --> </div> </div> </div> @@ -310,12 +310,12 @@ endif; <div class="row "> <div class="col-md-6 form-group"> <label for="p_email_edit" class="form-label"> อีเมล </label> - <input type="email" class="form-control" id="p_email_edit" name="p_email_edit" value="<?= $person->p_email ?>" class="format"> + <input type="email" class="form-control" id="p_email_edit" name="p_email_edit" value="<?php echo $person->p_email ?>" class="format"> <div class="form-control-feedback" id="feedback_email_edit"></div> </div> <div class="col-md-6 form-group"> <label for="p_tel_edit" class="form-label"> เบอร์โทรศัพท์ </label> - <input type="number" class="form-control" id="p_tel_edit" name="p_tel_edit" minlength="10" maxlength="10" value="<?= $person->p_tel ?>"> + <input type="number" class="form-control" id="p_tel_edit" name="p_tel_edit" minlength="10" maxlength="10" value="<?php echo $person->p_tel ?>"> <div class="form-control-feedback" id="feedback_tel_edit"></div> </div> </div> @@ -331,46 +331,46 @@ endif; <div class="row form-group"> <div class="col-md-2"> <label for="address" class="form-label"> บ้านเลขที่ </label> - <input type="text" name="adr_building_number" id="adr_building_number" class="form-control" value="<?= $person->adr_building_number ?>"> + <input type="text" name="adr_building_number" id="adr_building_number" class="form-control" value="<?php echo $person->adr_building_number ?>"> </div> <div class="col-md-1"> <label for="address" class="form-label"> หมู่ที่ </label> - <input type="text" class="form-control" id="adr_township_number" name="adr_township_number" value="<?= $person->adr_township_number ?>"> + <input type="text" class="form-control" id="adr_township_number" name="adr_township_number" value="<?php echo $person->adr_township_number ?>"> </div> <div class="col-md-3"> <label for="address" class="form-label">ชื่อหมู่บ้าน</label> - <input type="text" class="form-control" id="adr_township_name" name="adr_township_name" value="<?= $person->adr_township_name ?>"> + <input type="text" class="form-control" id="adr_township_name" name="adr_township_name" value="<?php echo $person->adr_township_name ?>"> </div> <div class="col-md-3"> <label for="address" class="form-label"> ตรอก </label> - <input type="text" class="form-control" id="adr_sublane" name="adr_sublane" value="<?= $person->adr_sublane ?>"> + <input type="text" class="form-control" id="adr_sublane" name="adr_sublane" value="<?php echo $person->adr_sublane ?>"> </div> <div class="col-md-3"> <label for="address" class="form-label"> ซอย</label> - <input type="text" class="form-control" id="adr_lane" name="adr_lane" value="<?= $person->adr_lane ?>"> + <input type="text" class="form-control" id="adr_lane" name="adr_lane" value="<?php echo $person->adr_lane ?>"> </div> </div> <div class="row form-group" id="address"> <div class="col-md-2"> <label for="address" class="form-label"> ถนน </label> - <input type="text" name="adr_street_name" id="adr_street_name" class="form-control" value="<?= $person->adr_street_name ?>"> + <input type="text" name="adr_street_name" id="adr_street_name" class="form-control" value="<?php echo $person->adr_street_name ?>"> </div> <div class="col-md-2"> <label for="address" class="form-label"> ตำบล </label> - <input type="text" class="form-control" id="adr_subdistrict" name="adr_subdistrict" value="<?= $person->adr_subdistrict ?>"> + <input type="text" class="form-control" id="adr_subdistrict" name="adr_subdistrict" value="<?php echo $person->adr_subdistrict ?>"> </div> <div class="col-md-3"> <label for="address" class="form-label"> อำเภอ </label> - <input type="text" class="form-control" id="adr_district" name="adr_district" value="<?= $person->adr_district ?>"> + <input type="text" class="form-control" id="adr_district" name="adr_district" value="<?php echo $person->adr_district ?>"> </div> <div class="col-md-3"> <label for="address" class="form-label"> จังหวัด</label> - <input type="text" class="form-control" id="adr_province" name="adr_province" value="<?= $person->adr_province ?>"> + <input type="text" class="form-control" id="adr_province" name="adr_province" value="<?php echo $person->adr_province ?>"> </div> <div class="col-md-2"> <label for="address" class="form-label">รหัสไปรษณีย์</label> - <input type="text" class="form-control" id="adr_postcode" name="adr_postcode" value="<?= $person->adr_postcode ?>"> + <input type="text" class="form-control" id="adr_postcode" name="adr_postcode" value="<?php echo $person->adr_postcode ?>"> </div> </div> <div style="text-align: right;" id="submit_person"> @@ -400,7 +400,7 @@ endif; <div class="modal-body"> <!-- ฟอร์ม input ข้อมูลการศึกษา --> <div class="form-group"> - <input type="hidden" class="form-control" id="edu_p_id" name="edu_p_id" value="<?= $person->p_id ?>"> + <input type="hidden" class="form-control" id="edu_p_id" name="edu_p_id" value="<?php echo $person->p_id ?>"> </div> <div class="row form-group"> <div class="col-6"> @@ -431,21 +431,21 @@ endif; <div class="row "> <div class="col form-group"> <label for="starting_date" class="form-label">ปีที่เข้ารับการศึกษา :</label><span class="text-danger"> *</span> - <? $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> + <?php $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> <select class="form-control form-select" name="edu_start_year" id="edu_start_year" required> - <? foreach ($years as $year) : ?> - <option value="<?= $year; ?>"><?= $year + 543; ?></option> - <? endforeach; ?> + <?php foreach ($years as $year) : ?> + <option value="<?php echo $year; ?>"><?php echo $year + 543; ?></option> + <?php endforeach; ?> </select> <div class="form-control-feedback" id="feedback_start_year"></div> </div> <div class="col form-group"> <label for="starting_date" class="form-label">ปีที่จบการศึกษา :</label><span class="text-danger"> *</span> - <? $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> + <?php $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> <select class="form-control form-select" name="edu_graduated_year" id="edu_graduated_year" required> - <? foreach ($years as $year) : ?> - <option value="<?= $year; ?>"><?= $year + 543; ?></option> - <? endforeach; ?> + <?php foreach ($years as $year) : ?> + <option value="<?php echo $year; ?>"><?php echo $year + 543; ?></option> + <?php endforeach; ?> </select> <div class="form-control-feedback" id="feedback_graduated_year"></div> </div> @@ -514,22 +514,22 @@ endif; <div class="col-md-6"> <div class="form-group"> <label for="starting_date" class="form-label">ปีที่เข้ารับการศึกษา :</label> - <? $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> + <?php $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> <select class="form-control form-select" name="edu_start_year1" id="edu_start_year1" required> - <? foreach ($years as $year) : ?> - <option value="<?= $year; ?>"><?= $year + 543; ?></option> - <? endforeach; ?> + <?php foreach ($years as $year) : ?> + <option value="<?php echo $year; ?>"><?php echo $year + 543; ?></option> + <?php endforeach; ?> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="starting_date" class="form-label">ปีที่จบการศึกษา :</label> - <? $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> + <?php $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> <select class="form-control form-select" name="edu_graduated_year1" id="edu_graduated_year1" required> - <? foreach ($years as $year) : ?> - <option value="<?= $year; ?>"><?= $year + 543; ?></option> - <? endforeach; ?> + <?php foreach ($years as $year) : ?> + <option value="<?php echo $year; ?>"><?php echo $year + 543; ?></option> + <?php endforeach; ?> </select> <div class="form-control-feedback" id="feedback_graduated_year1"></div> </div> @@ -570,16 +570,16 @@ endif; </div> <div class="modal-body"> <div class=" form-group"> - <input type="text" class="form-control" id="w_p_id" name="w_p_id" value="<?= $person->w_p_id ?>" hidden> + <input type="text" class="form-control" id="w_p_id" name="w_p_id" value="<?php echo $person->w_p_id ?>" hidden> </div> <!-- ฟอร์ม input ข้อมูลการศึกษา --> <div class="row form-group"> <div class="col"> <label for="position" class="form-label">แผนก :</label><span class="text-danger"> *</span> <select class="form-control form-select" name="w_dpm_id" id="w_dpm_id" required> - <? foreach ($department as $key => $value) { ?> - <option value=<?= $key + 1 ?>><?= $value->dpm_name ?></option> - <? } ?> + <?php foreach ($department as $key => $value) { ?> + <option value=<?php echo $key + 1 ?>><?php echo $value->dpm_name ?></option> + <?php } ?> </select> </div> @@ -591,11 +591,11 @@ endif; <div class="row form-group"> <div class="col"> <label for="starting_date" class="form-label">ปีที่บรรจุเข้าทำงาน :</label><span class="text-danger"> *</span> - <? $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> + <?php $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> <select class="form-control form-select" name="w_join_year" id="w_join_year" required> - <? foreach ($years as $year) : ?> - <option value="<?= $year; ?>"><?= $year + 543; ?></option> - <? endforeach; ?> + <?php foreach ($years as $year) : ?> + <option value="<?php echo $year; ?>"><?php echo $year + 543; ?></option> + <?php endforeach; ?> </select> </div> </div> @@ -627,9 +627,9 @@ endif; <div class="form-group"> <label for="position" class="form-label">แผนก :</label> <select class="form-control form-select" name="w_dpm_id1" id="w_dpm_id1" required> - <? foreach ($department as $key => $value) { ?> - <option value=<?= $key + 1 ?>><?= $value->dpm_name ?></option> - <? } ?> + <?php foreach ($department as $key => $value) { ?> + <option value=<?php echo $key + 1 ?>><?php echo $value->dpm_name ?></option> + <?php } ?> </select> </div> </div> @@ -645,22 +645,22 @@ endif; <div class="col-md-6"> <div class="form-group"> <label for="starting_date" class="form-label">ปีที่บรรจุเข้าทำงาน :</label> - <? $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> + <?php $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> <select class="form-control form-select" name="w_join_year1" id="w_join_year1" required> - <? foreach ($years as $year) : ?> - <option value="<?= $year; ?>"><?= $year + 543; ?></option> - <? endforeach; ?> + <?php foreach ($years as $year) : ?> + <option value="<?php echo $year; ?>"><?php echo $year + 543; ?></option> + <?php endforeach; ?> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="exit_date" class="form-label">ปีที่ออกจากตำแหน่งงาน :</label> - <? $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> + <?php $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> <select class="form-control form-select" name="w_exit_year1" id="w_exit_year1" required> - <? foreach ($years as $year) : ?> - <option value="<?= $year; ?>"><?= $year + 543; ?></option> - <? endforeach; ?> + <?php foreach ($years as $year) : ?> + <option value="<?php echo $year; ?>"><?php echo $year + 543; ?></option> + <?php endforeach; ?> </select> <div class="form-control-feedback" id="feedback_exit_year1"></div> </div> @@ -701,7 +701,7 @@ endif; </div> <div class="modal-body"> <div class="form-group"> - <input type="hidden" class="form-control" id="personID" name="p_id" value="<?= $person->p_id ?>"> + <input type="hidden" class="form-control" id="personID" name="p_id" value="<?php echo $person->p_id ?>"> </div> <div class="form-group"> <label for="train_topic" class="form-label">หลักสูตร</label><span class="text-danger"> *</span> @@ -755,7 +755,7 @@ endif; <div class="card"> <div class="card-body"> <div class="form-group"> - <input type="hidden" class="form-control" id="t_id" name="p_id" value="<?= $person->t_id ?>"> + <input type="hidden" class="form-control" id="t_id" name="p_id" value="<?php echo $person->t_id ?>"> </div> <div class="form-group"> <label for="train_topic" class="form-label">หลักสูตร</label> @@ -833,22 +833,22 @@ endif; <div class="col-md-6"> <div class="form-group"> <label for="starting_date" class="form-label">ปีที่เข้าทำงาน :</label><span class="text-danger"> *</span> - <? $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> + <?php $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> <select class="form-control form-select" name="pw_join_year" id="pw_join_year" required> - <? foreach ($years as $year) : ?> - <option value="<?= $year; ?>"><?= $year + 543; ?></option> - <? endforeach; ?> + <?php foreach ($years as $year) : ?> + <option value="<?php echo $year; ?>"><?php echo $year + 543; ?></option> + <?php endforeach; ?> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="starting_date" class="form-label">ปีที่ออกจากที่ทำงาน :</label><span class="text-danger"> *</span> - <? $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> + <?php $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> <select class="form-control form-select" name="pw_exit_year" id="pw_exit_year" required> - <? foreach ($years as $year) : ?> - <option value="<?= $year; ?>"><?= $year + 543; ?></option> - <? endforeach; ?> + <?php foreach ($years as $year) : ?> + <option value="<?php echo $year; ?>"><?php echo $year + 543; ?></option> + <?php endforeach; ?> </select> <div class="form-control-feedback" id="feedback_pw_exit_year"></div> </div> @@ -898,22 +898,22 @@ endif; <div class="col-md-6"> <div class="form-group"> <label for="starting_date" class="form-label">ปีที่เข้าทำงาน :</label> - <? $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> + <?php $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> <select class="form-control form-select" name="pw_join_year1" id="pw_join_year1" required> - <? foreach ($years as $year) : ?> - <option value="<?= $year; ?>"><?= $year + 543; ?></option> - <? endforeach; ?> + <?php foreach ($years as $year) : ?> + <option value="<?php echo $year; ?>"><?php echo $year + 543; ?></option> + <?php endforeach; ?> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="starting_date" class="form-label">ปีที่ออกจากที่ทำงาน :</label> - <? $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> + <?php $years = range(strftime("%Y", time()), strftime("%Y", time()) - 60); ?> <select class="form-control form-select" name="pw_exit_year1" id="pw_exit_year1" required> - <? foreach ($years as $year) : ?> - <option value="<?= $year; ?>"><?= $year + 543; ?></option> - <? endforeach; ?> + <?php foreach ($years as $year) : ?> + <option value="<?php echo $year; ?>"><?php echo $year + 543; ?></option> + <?php endforeach; ?> </select> <div class="form-control-feedback" id="feedback_pw_exit_year1"></div> </div> @@ -959,7 +959,7 @@ $('.daterang').daterangepicker({ } }); $(document).ready(function() { - load_table(<?= $person->p_id ?>) + load_table(<?php echo $person->p_id ?>) $.getJSON("../assets/DataStandardList-Nationality.json", function(data) { var items = []; $.each(data, function(key, val) { diff --git a/html/team0/application/views/Management/from_person.php b/html/team0/application/views/Management/from_person.php index 090e78527fc569dd60224dc2bfcb728c2ea26a94..8405a8933d86235b33acecc14626d3a1cdaabe1d 100644 --- a/html/team0/application/views/Management/from_person.php +++ b/html/team0/application/views/Management/from_person.php @@ -26,22 +26,11 @@ view form add data of personnel </div> </div> <div class="row form-group"> - <div class="col-2"> <label for="p_pf_id" class="form-label"> คำนำหน้า </label> <select class="select2 form-control form-select" id="p_pf_id" name="p_pf_id"> </select> - <!-- <input type="text" class="form-control" id="p_nt_id" name="p_nt_id" minlength="10" maxlength="10" value="<?= $person->p_nt_id ?>"> --> </div> - <!-- <div class="col-2"> - <label for="prefix" class="form-label">คำนำหน้า</label><span class="text-danger"> *</span> - <select class="selectPrefix form-control form-select" id="p_prefix" name="p_prefix" required> - <option hided disabled selected value></option> - <option value="1">นาย</option> - <option value="2">นาง</option> - <option value="3">นางสาว</option> - </select> - </div> --> <div class="col-sm-5"> <label for="firstName" class="form-label">ชื่อจริง</label><span class="text-danger"> *</span> <input type="text" class="form-control" id="p_first_name" placeholder="ชื่อจริง" name="p_first_name" required> @@ -81,14 +70,11 @@ view form add data of personnel items.push("<option value='" + data[key].TITLE + "'>" + data[key].TITLE + "</option>"); }); $('#p_pf_id').html(items); - console.log($('#pf_id').val()); - // console.log('**********'); $.each(data, function(key, val) { if ($('#pf_id').val() == data[key].TITLE) { $('select#p_pf_id option[value="' + data[key].TITLE + '"]').attr('selected', 'selected') } }); }); - // $(".select2").select2(); </script> \ No newline at end of file diff --git a/html/team0/application/views/Management/manage.php b/html/team0/application/views/Management/manage.php index 13f1206e491785b1456fc4e50833c07406cf6ddc..7623afa7a717ec7dccb7639eaa6d135221c8d8e3 100644 --- a/html/team0/application/views/Management/manage.php +++ b/html/team0/application/views/Management/manage.php @@ -53,7 +53,7 @@ view manage data of personnel file all javaScript <div id="manage"> <div class="row"> <div class="col-12"> - <!-- <? print_r($getData) ?> --> + <!-- <?php print_r($getData) ?> --> <div class="card"> <div class="card-body"> <div class="row"> @@ -85,7 +85,7 @@ view manage data of personnel file all javaScript <div id="show_photo"> - <center><img src='<?= base_url() ?>assets/images/profile/default.jpg' id="preview" class="img-thumbnail" width="150px" height="150px"></center><br><br> + <center><img src='<?php echo base_url() ?>assets/images/profile/default.jpg' id="preview" class="img-thumbnail" width="150px" height="150px"></center><br><br> </div> <div id="upload_photo"> <center><input type="hidden" id="p_id_photo" name="p_id_for_photo"></center> @@ -127,7 +127,7 @@ view manage data of personnel file all javaScript <label for="p_pf_id" class="form-label"> คำนำหน้า </label> <select class="form-control form-select" id="p_pf_id" name="p_pf_id"> </select> - <!-- <input type="text" class="form-control" id="p_nt_id" name="p_nt_id" minlength="10" maxlength="10" value="<?= $person->p_nt_id ?>"> --> + <!-- <input type="text" class="form-control" id="p_nt_id" name="p_nt_id" minlength="10" maxlength="10" value="<?php echo $person->p_nt_id ?>"> --> </div> <div class="col-sm-5"> <label for="p_first_name" class="form-label">ชื่อจริง</label><span class="text-danger"> *</span> @@ -341,7 +341,7 @@ function reset_modal($modal_name) { $('#feedback_Id_card').html(''); $('#feedback_email').html(''); $('#feedback_tel').html(''); - $('#show_photo').html('<center><img src="<?= base_url() ?>assets/images/profile/default.jpg" id="preview" class="img-thumbnail" width="150px" height="150px"></center><br><br>'); + $('#show_photo').html('<center><img src="<?php echo base_url() ?>assets/images/profile/default.jpg" id="preview" class="img-thumbnail" width="150px" height="150px"></center><br><br>'); } else if ($modal_name == "edu") { $("#edu_level").val('ป.ตรี'); @@ -1514,24 +1514,6 @@ function change_status($id, $type) { }); } -function modal_photo(p_id) { - $.ajax({ - url: "Management_controller/show_person/", - type: 'POST', - data: { - p_id: p_id - }, - dataType: 'JSON', - success: function(data) { - $('#p_id_for_photo').val(data['p_id']); - photo = data['p_photo_person']; - - //ต้องแก้ localhost - $('#photo').html(" <center><img src='http://localhost/team0/assets/images/profile/" + photo + "' class='img-circle' width='300' height='300'></center>"); - } - }); -} - function delete_person($id) { Swal.fire({ title: 'คุณต้องการเปลี่ยนสถานะของบุคลากรหรือไม่?', @@ -1725,7 +1707,7 @@ function load_photo_banner(p_id) { confirmButtonText: 'ตกลง', }).then((result) => { console.log(data); - $('#edit_photo').html('<center><label><div id="profile-image" data-bs-toggle="modal" data-bs-target="#bs-exElite-modal-lg "><img id="profile-image__image" src="<?= base_url() ?>assets/images/profile/' + data.p_photo_person + '" class="img-circle"><div id="profile-image__content"><span id="profile-image__icon"><i class="fas fa-camera"></i></span><span id="profile-image__text">Edit Profile</span></div></div></label></center>'); + $('#edit_photo').html('<center><label><div id="profile-image" data-bs-toggle="modal" data-bs-target="#bs-exElite-modal-lg "><img id="profile-image__image" src="<?php echo base_url() ?>assets/images/profile/' + data.p_photo_person + '" class="img-circle"><div id="profile-image__content"><span id="profile-image__icon"><i class="fas fa-camera"></i></span><span id="profile-image__text">Edit Profile</span></div></div></label></center>'); $('#bs-exElite-modal-lg').modal('hide'); }); diff --git a/html/team0/application/views/Management/table.php b/html/team0/application/views/Management/table.php index c17b67c836455c499290e70bdd97d67eed099e6b..1d6df8fdcfcc0a4eef5154c2d8dd7540e9d97654 100644 --- a/html/team0/application/views/Management/table.php +++ b/html/team0/application/views/Management/table.php @@ -40,9 +40,9 @@ view table data in data person of personnel <?php foreach ($getData as $key => $value) : ?> <?php if ($value->p_status != "0") : ?> <tr> - <td class="text-center" style='vertical-align: middle;'><?= ++$index ?></td> - <td style='vertical-align: middle;'><?= $value->p_teacher_id ?></td> - <td style='vertical-align: middle;'><?= + <td class="text-center" style='vertical-align: middle;'><?php echo ++$index ?></td> + <td style='vertical-align: middle;'><?php echo $value->p_teacher_id ?></td> + <td style='vertical-align: middle;'><?php echo $value->p_pf_id . ' ' . $value->p_first_name . ' ' . $value->p_last_name ?></td> <td style='vertical-align: middle;'> @@ -63,9 +63,9 @@ view table data in data person of personnel <center id="select_s"> <!-- <?php echo $index; ?> --> <?php if($_SESSION['data_user_login']->p_type >= $value->p_type) : ?> - <select class="select2 form-control form-select opt" id="p_type_<?php echo $index; ?>" name="p_type_<?php echo $index; ?>" onchange="update_type('<?php echo $value->p_id ?>','<?php echo $index ?>')"> + <select class="select2 form-control form-select opt" id="select2-p_type_<?php echo $index; ?>" name="p_type_<?php echo $index; ?>" onchange="update_type('<?php echo $value->p_id ?>','<?php echo $index ?>')"> <?php else : ?> - <select class="select2 form-control form-select opt" id="p_type_<?php echo $index; ?>" name="p_type_<?php echo $index; ?>" onchange="update_type('<?php echo $value->p_id ?>','<?php echo $index ?>')" disabled> + <select class="select2 form-control form-select opt" id="select2-p_type_<?php echo $index; ?>" name="p_type_<?php echo $index; ?>" onchange="update_type('<?php echo $value->p_id ?>','<?php echo $index ?>')" disabled> <?php endif; ?> <option value="0">บุคลากรทั่วไป</option> <option value="1">เจ้าหน้าที่</option> @@ -81,10 +81,10 @@ view table data in data person of personnel <center> <?php if($_SESSION['data_user_login']->p_type >= $value->p_type) : ?> <?php if ($value->p_status == "1") : ?> - <a type="button" onclick="edit_status(<?= $value->p_id; ?>,'2')" class="btn waves-effect waves-light" data-bs-toggle="tooltip" title="ปฏิบัติงาน"><i class="fas fa-unlock-alt text-black" style="color:black;"></i></a> + <a type="button" onclick="edit_status(<?php echo $value->p_id; ?>,'2')" class="btn waves-effect waves-light" data-bs-toggle="tooltip" title="ปฏิบัติงาน"><i class="fas fa-unlock-alt text-black" style="color:black;"></i></a> <?php elseif ($value->p_status == "2") : ?> <!-- ลาศึกษาต่อ --> - <a type="button" onclick="edit_status(<?= $value->p_id; ?>,'1')" class="btn waves-effect waves-light" data-bs-toggle="tooltip" title="ลาพัก"><i class="fas fa-lock text-black" style="color:#FF0000;"></i></a> + <a type="button" onclick="edit_status(<?php echo $value->p_id; ?>,'1')" class="btn waves-effect waves-light" data-bs-toggle="tooltip" title="ลาพัก"><i class="fas fa-lock text-black" style="color:#FF0000;"></i></a> <?php endif ?> <?php else : ?> ไม่มีสิทธิ์ดำเนินการ @@ -93,14 +93,14 @@ view table data in data person of personnel </td> <td style='vertical-align: middle;'> - <form method="post" action="<?= base_url() ?>Profile/Profile_controller/export_cv" target="_blank"> + <form method="post" action="<?php echo base_url() ?>Profile/Profile_controller/export_cv" target="_blank"> <center> <?php if($_SESSION['data_user_login']->p_type >= $value->p_type) : ?> - <input type="hidden" id="p_id" name="p_id" value="<?= $value->p_id ?>"> - <a type="button" onclick="get_person_profile(<?= $value->p_id; ?>)" class="btn btn-sm waves-effect waves-light btn-warning " data-bs-toggle="tooltip" title="แก้ไขข้อมูล"><i class="fas fa-pencil-alt text-white"></i></a> + <input type="hidden" id="p_id" name="p_id" value="<?php echo $value->p_id ?>"> + <a type="button" onclick="get_person_profile(<?php echo $value->p_id; ?>)" class="btn btn-sm waves-effect waves-light btn-warning " data-bs-toggle="tooltip" title="แก้ไขข้อมูล"><i class="fas fa-pencil-alt text-white"></i></a> <button type="submit" onclick="" class="btn btn-sm waves-effect waves-light btn-info" data-bs-toggle="tooltip" title="ดาวน์โหลดแฟ้มสะสมผลงาน"><i class="fas fa-download text-white"></i></button> - <a type="button" onclick="delete_person(<?= $value->p_id; ?>)" class="btn btn-sm waves-effect waves-light btn-danger" data-bs-toggle="tooltip" title="ลบข้อมูลบุคคลากร"><i class="ti-trash text-white"></i></a> + <a type="button" onclick="delete_person(<?php echo $value->p_id; ?>)" class="btn btn-sm waves-effect waves-light btn-danger" data-bs-toggle="tooltip" title="ลบข้อมูลบุคคลากร"><i class="ti-trash text-white"></i></a> <?php else : ?> ไม่มีสิทธิ์ดำเนินการ <?php endif; ?> diff --git a/html/team0/application/views/Management/table_manage.php b/html/team0/application/views/Management/table_manage.php index 37911688640b7f447c9de5b14a399e9296f84177..e413735ae4877cb96c8a696512be4e2eeb59ac17 100644 --- a/html/team0/application/views/Management/table_manage.php +++ b/html/team0/application/views/Management/table_manage.php @@ -25,8 +25,8 @@ view table data of module management </tr> </thead> <tbody> - <? if (is_array($edu)) : ?> - <? foreach ($edu as $key => $value) : ?> + <?php if (is_array($edu)) : ?> + <?php foreach ($edu as $key => $value) : ?> <?php $edu_level = "" ?> <?php if ($value->edu_level == "ป.ตรี") { $edu_level = "ปริญญาตรี"; @@ -37,22 +37,22 @@ view table data of module management } ?> <tr> <td class="details-control" style="width: 5%"><i class="fa fa-plus-square" aria-hidden="true"></td> - <td style="width: 5%"><?= $key + 1 ?></td> - <td><?= $edu_level ?></td> - <td><?= $value->edu_certificate ?></td> - <td><?= $value->edu_graduated ?></td> - <td><?= $value->edu_academy ?></td> - <td hidden><?= $value->edu_start_year + 543 ?></td> - <td hidden><?= $value->edu_graduated_year + 543 ?></td> + <td style="width: 5%"><?php echo $key + 1 ?></td> + <td><?php echo $edu_level ?></td> + <td><?php echo $value->edu_certificate ?></td> + <td><?php echo $value->edu_graduated ?></td> + <td><?php echo $value->edu_academy ?></td> + <td hidden><?php echo $value->edu_start_year + 543 ?></td> + <td hidden><?php echo $value->edu_graduated_year + 543 ?></td> <td style="width: 20%"> <center> - <a type="button" data-bs-toggle="modal" data-bs-target=".bs-example-modal-lg" onclick="edit_edu_modal(<?= $value->edu_id ?>)" type="button" class="btn btn-sm waves-effect waves-light btn-warning"><i class="fas fa-pencil-alt text-white"></i></a> - <a type="button" type="button" class="btn btn-sm waves-effect waves-light btn-danger" onclick="change_status(<?= $value->edu_id ?>,'edu')"><i class="ti-trash text-white"></i></a> + <a type="button" data-bs-toggle="modal" data-bs-target=".bs-example-modal-lg" onclick="edit_edu_modal(<?php echo $value->edu_id ?>)" type="button" class="btn btn-sm waves-effect waves-light btn-warning"><i class="fas fa-pencil-alt text-white"></i></a> + <a type="button" type="button" class="btn btn-sm waves-effect waves-light btn-danger" onclick="change_status(<?php echo $value->edu_id ?>,'edu')"><i class="ti-trash text-white"></i></a> </center> </td> </tr> - <? endforeach; ?> - <? endif; ?> + <?php endforeach; ?> + <?php endif; ?> </tbody> </table><br> </div> @@ -75,29 +75,29 @@ view table data of module management </tr> </thead> <tbody> - <? if (is_array($working)) : ?> - <? foreach ($working as $key => $value) : ?> - <? if ($value->w_exit_year == "") { + <?php if (is_array($working)) : ?> + <?php foreach ($working as $key => $value) : ?> + <?php if ($value->w_exit_year == "") { $exit_year = "-"; } else { $exit_year = $value->w_exit_year + 543; } ?> <tr> <!-- <td class="details-control" style="width: 5%"><i class="fa fa-plus-square" aria-hidden="true"></td> --> - <td style="width: 5%"><?= $key + 1 ?></td> - <td><?= $value->w_position ?></td> - <td><?= $value->dpm_name ?></td> - <td><?= $value->w_join_year + 543 ?></td> - <td><?= $exit_year ?></td> + <td style="width: 5%"><?php echo $key + 1 ?></td> + <td><?php echo $value->w_position ?></td> + <td><?php echo $value->dpm_name ?></td> + <td><?php echo $value->w_join_year + 543 ?></td> + <td><?php echo $exit_year ?></td> <td style="width: 20%"> <center> - <a type="button" data-bs-toggle="modal" data-bs-target=".bs-example1-modal-lg" onclick="edit_modal_working(<?= $value->w_id ?>)" type="button" class="btn btn-sm waves-effect waves-light btn-warning"><i class="fas fa-pencil-alt text-white"></i></a> - <a type="button" type="button" class="btn btn-sm waves-effect waves-light btn-danger" onclick="change_status(<?= $value->w_id ?>,'working')"><i class="ti-trash text-white"></i></a> + <a type="button" data-bs-toggle="modal" data-bs-target=".bs-example1-modal-lg" onclick="edit_modal_working(<?php echo $value->w_id ?>)" type="button" class="btn btn-sm waves-effect waves-light btn-warning"><i class="fas fa-pencil-alt text-white"></i></a> + <a type="button" type="button" class="btn btn-sm waves-effect waves-light btn-danger" onclick="change_status(<?php echo $value->w_id ?>,'working')"><i class="ti-trash text-white"></i></a> </center> </td> </tr> - <? endforeach; ?> - <? endif; ?> + <?php endforeach; ?> + <?php endif; ?> </tbody> </table><br> </div> @@ -121,25 +121,25 @@ view table data of module management </tr> </thead> <tbody> - <? if (is_array($train)) : ?> - <? foreach ($train as $key => $value) : ?> + <?php if (is_array($train)) : ?> + <?php foreach ($train as $key => $value) : ?> <tr> <td class="details-control" style="width: 5%"><i class="fa fa-plus-square" aria-hidden="true"></td> - <td style="width: 5%"><?= $key + 1 ?></td> - <td><?= $value->t_topic ?></td> - <td><?= $value->t_organizing_agency ?></td> - <td hidden><?= date_format(date_create($value->t_first_date), "d/m/Y") . ' - ' . date_format(date_create($value->t_end_date), "d/m/Y") ?></td> - <td><?= $value->t_hour ?></td> - <td><?= $value->t_location ?></td> + <td style="width: 5%"><?php echo $key + 1 ?></td> + <td><?php echo $value->t_topic ?></td> + <td><?php echo $value->t_organizing_agency ?></td> + <td hidden><?php echo date_format(date_create($value->t_first_date), "d/m/Y") . ' - ' . date_format(date_create($value->t_end_date), "d/m/Y") ?></td> + <td><?php echo $value->t_hour ?></td> + <td><?php echo $value->t_location ?></td> <td style="width: 20%"> <center> - <a type="button" data-bs-toggle="modal" class="btn btn-sm waves-effect waves-light btn-warning" data-bs-target=".bs-example2-modal-lg" onclick="edit_modal_train(<?= $value->t_id ?>)"><i class="fas fa-pencil-alt text-white"></i></a> - <a type="button" type="button" class="btn btn-sm waves-effect waves-light btn-danger" onclick="change_status(<?= $value->t_id ?>,'train')"> <i class="ti-trash text-white"></i></a> + <a type="button" data-bs-toggle="modal" class="btn btn-sm waves-effect waves-light btn-warning" data-bs-target=".bs-example2-modal-lg" onclick="edit_modal_train(<?php echo $value->t_id ?>)"><i class="fas fa-pencil-alt text-white"></i></a> + <a type="button" type="button" class="btn btn-sm waves-effect waves-light btn-danger" onclick="change_status(<?php echo $value->t_id ?>,'train')"> <i class="ti-trash text-white"></i></a> </center> </td> </tr> - <? endforeach; ?> - <? endif; ?> + <?php endforeach; ?> + <?php endif; ?> </tbody> </table><br> </div> @@ -162,24 +162,24 @@ view table data of module management </tr> </thead> <tbody> - <? if (is_array($preworking)) : ?> - <? foreach ($preworking as $key => $value) : ?> + <?php if (is_array($preworking)) : ?> + <?php foreach ($preworking as $key => $value) : ?> <tr> <!-- <td class="details-control" style="width: 5%"><i class="fa fa-plus-square" aria-hidden="true"></td> --> - <td style="width: 5%"><?= $key + 1 ?></td> - <td><?= $value->pw_company ?></td> - <td><?= $value->pw_position ?></td> - <td><?= $value->pw_join_year + 543 ?> - <?= $value->pw_exit_year + 543 ?></td> - <td><?= $value->pw_job_des ?></td> + <td style="width: 5%"><?php echo $key + 1 ?></td> + <td><?php echo $value->pw_company ?></td> + <td><?php echo $value->pw_position ?></td> + <td><?php echo $value->pw_join_year + 543 ?> - <?php echo $value->pw_exit_year + 543 ?></td> + <td><?php echo $value->pw_job_des ?></td> <td style="width: 20%"> <center> - <a type="button" data-bs-toggle="modal" data-bs-target=".bs-example7-modal-lg" onclick="edit_modal_prework(<?= $value->pw_id ?>)" type="button" class="btn btn-sm waves-effect waves-light btn-warning"><i class="fas fa-pencil-alt text-white"></i></a> - <a type="button" type="button" class="btn btn-sm waves-effect waves-light btn-danger" onclick="change_status(<?= $value->pw_id ?>,'prework')"><i class="ti-trash text-white"></i></a> + <a type="button" data-bs-toggle="modal" data-bs-target=".bs-example7-modal-lg" onclick="edit_modal_prework(<?php echo $value->pw_id ?>)" type="button" class="btn btn-sm waves-effect waves-light btn-warning"><i class="fas fa-pencil-alt text-white"></i></a> + <a type="button" type="button" class="btn btn-sm waves-effect waves-light btn-danger" onclick="change_status(<?php echo $value->pw_id ?>,'prework')"><i class="ti-trash text-white"></i></a> </center> </td> </tr> - <? endforeach; ?> - <? endif; ?> + <?php endforeach; ?> + <?php endif; ?> </tbody> </table><br> </div> diff --git a/html/team0/application/views/Report/report_table_age.php b/html/team0/application/views/Report/report_table_age.php index b1256ad2ee16babded6f72a6dd7f78701f829fea..5cfbb6a026e4c4a044425a7ada44ac88c91f8613 100644 --- a/html/team0/application/views/Report/report_table_age.php +++ b/html/team0/application/views/Report/report_table_age.php @@ -14,7 +14,7 @@ * @Author4 62160100 Punyanuch Hiruntreekoon (Mook) * @Create Date 2565-01-15 */ --> -<? +<?php // var_dump($work); // variable declaration date $date_s = (int)$_SESSION['year']; @@ -54,16 +54,16 @@ $date1 = new DateTime($date); </tr> </thead> <tbody> - <? if (is_array($dpm)) : ?> - <? foreach ($dpm as $key => $value_dpm) : ?> + <?php if (is_array($dpm)) : ?> + <?php foreach ($dpm as $key => $value_dpm) : ?> <tr> <td class="text-center" style="width: 5%"> - <?= $key + 1 ?> + <?php echo $key + 1 ?> </td> - <td><?= $value_dpm->dpm_name ?></td> + <td><?php echo $value_dpm->dpm_name ?></td> <td class="text-center"> - <? //calculate for age + <?php //calculate for age $count_age = 0; foreach ($work as $key2 => $value_work) : $date2 = new DateTime($value_work->p_birth_date); @@ -75,10 +75,10 @@ $date1 = new DateTime($date); endforeach; ?> - <a href="" data-bs-toggle="modal" data-bs-target="#report_button" style="font-weight: 400;" class="link text-success display-11 ms-auto" data-bs-toggle="tooltip" title="ดูรายละเอียด" onclick="personnel_report('<?= $value_dpm->dpm_name ?>', '20', '29','<?php echo $_SESSION['year'];?>')"><?= $count_age . ' ' ?></a> + <a href="" data-bs-toggle="modal" data-bs-target="#report_button" style="font-weight: 400;" class="link text-success display-11 ms-auto" data-bs-toggle="tooltip" title="ดูรายละเอียด" onclick="personnel_report('<?php echo $value_dpm->dpm_name ?>', '20', '29','<?php echo $_SESSION['year'];?>')"><?php echo $count_age . ' ' ?></a> </td> <td class="text-center"> - <? //calculate for age + <?php //calculate for age $count_age = 0; foreach ($work as $key2 => $value_work) : $date2 = new DateTime($value_work->p_birth_date); @@ -89,10 +89,10 @@ $date1 = new DateTime($date); endif; endforeach; ?> - <a href="" data-bs-toggle="modal" data-bs-target="#report_button" style="font-weight: 400;" class="link text-success display-11 ms-auto" data-bs-toggle="tooltip" title="ดูรายละเอียด" onclick="personnel_report('<?= $value_dpm->dpm_name ?>', '30', '39','<?php echo $_SESSION['year'];?>')"><?= $count_age . ' ' ?></a> + <a href="" data-bs-toggle="modal" data-bs-target="#report_button" style="font-weight: 400;" class="link text-success display-11 ms-auto" data-bs-toggle="tooltip" title="ดูรายละเอียด" onclick="personnel_report('<?php echo $value_dpm->dpm_name ?>', '30', '39','<?php echo $_SESSION['year'];?>')"><?php echo $count_age . ' ' ?></a> </td> <td class="text-center"> - <? //calculate for age + <?php //calculate for age $count_age = 0; foreach ($work as $key2 => $value_work) : $date2 = new DateTime($value_work->p_birth_date); @@ -103,10 +103,10 @@ $date1 = new DateTime($date); endif; endforeach; ?> - <a href="" data-bs-toggle="modal" data-bs-target="#report_button" style="font-weight: 400;" class="link text-success display-11 ms-auto" data-bs-toggle="tooltip" title="ดูรายละเอียด" onclick="personnel_report('<?= $value_dpm->dpm_name ?>', '40', '49','<?php echo $_SESSION['year'];?>')"><?= $count_age . ' ' ?></a> + <a href="" data-bs-toggle="modal" data-bs-target="#report_button" style="font-weight: 400;" class="link text-success display-11 ms-auto" data-bs-toggle="tooltip" title="ดูรายละเอียด" onclick="personnel_report('<?php echo $value_dpm->dpm_name ?>', '40', '49','<?php echo $_SESSION['year'];?>')"><?php echo $count_age . ' ' ?></a> </td> <td class="text-center"> - <? //calculate for age + <?php //calculate for age $count_age = 0; foreach ($work as $key2 => $value_work) : $date2 = new DateTime($value_work->p_birth_date); @@ -117,10 +117,10 @@ $date1 = new DateTime($date); endif; endforeach; ?> - <a href="" data-bs-toggle="modal" data-bs-target="#report_button" style="font-weight: 400;" class="link text-success display-11 ms-auto" data-bs-toggle="tooltip" title="ดูรายละเอียด" onclick="personnel_report('<?= $value_dpm->dpm_name ?>', '50', '59','<?php echo $_SESSION['year'];?>')"><?= $count_age . ' ' ?></a> + <a href="" data-bs-toggle="modal" data-bs-target="#report_button" style="font-weight: 400;" class="link text-success display-11 ms-auto" data-bs-toggle="tooltip" title="ดูรายละเอียด" onclick="personnel_report('<?php echo $value_dpm->dpm_name ?>', '50', '59','<?php echo $_SESSION['year'];?>')"><?php echo $count_age . ' ' ?></a> </td> <td class="text-center"> - <? //calculate for age + <?php //calculate for age $count_age = 0; foreach ($work as $key2 => $value_work) : $date2 = new DateTime($value_work->p_birth_date); @@ -131,11 +131,11 @@ $date1 = new DateTime($date); endif; endforeach; ?> - <a href="" data-bs-toggle="modal" data-bs-target="#report_button" style="font-weight: 400;" class="link text-success display-11 ms-auto" data-bs-toggle="tooltip" title="ดูรายละเอียด" onclick="personnel_report('<?= $value_dpm->dpm_name ?>', '60', 'ปี ขึ้นไป','<?php echo $_SESSION['year'];?>')"><?= $count_age . ' ' ?></a> + <a href="" data-bs-toggle="modal" data-bs-target="#report_button" style="font-weight: 400;" class="link text-success display-11 ms-auto" data-bs-toggle="tooltip" title="ดูรายละเอียด" onclick="personnel_report('<?php echo $value_dpm->dpm_name ?>', '60', 'ปี ขึ้นไป','<?php $_SESSION['year'];?>')"><?php echo $count_age . ' ' ?></a> </td> </tr> - <? endforeach; ?> - <? endif; ?> + <?php endforeach; ?> + <?php endif; ?> </tbody> </table> </div> @@ -159,7 +159,7 @@ $date1 = new DateTime($date); <script> var table1; var data_dpm; -var date_end = "'" + <?= $_SESSION['year'] ?> + "-01-1'"; +var date_end = "'" + <?php echo $_SESSION['year'] ?> + "-01-1'"; var date_bd; var newdate; var age; @@ -298,7 +298,7 @@ function personnel_report(dpm_name, fix_age1, fix_age2, year) { var date = year + "-12-31"; $.ajax({ - url: "<?= base_url() ?>/Report/Report_controller/get_dpm_name", + url: "<?php echo base_url() ?>/Report/Report_controller/get_dpm_name", data: { dpm_name: dpm_name }, diff --git a/html/team0/application/views/main.php b/html/team0/application/views/main.php index 76a6b5eb544fefadcf7a81eca116d11a36bc7240..762336e6c0c56439c3016e8c7429d8601158d485 100644 --- a/html/team0/application/views/main.php +++ b/html/team0/application/views/main.php @@ -199,7 +199,7 @@ logo { <i class="ti-blackboard "></i><span class="hide-menu">รายงาน</span></a> </li> --> <!-- <?php var_dump($_SESSION['data_user_login']); ?> --> - <? if ($_SESSION['data_user_login']->p_type >= 1) : ?> + <?php if ($_SESSION['data_user_login']->p_type >= 1) : ?> <li> <a class="has-arrow waves-effect waves-dark" href="javascript:void(0)" aria-expanded="false"> <i class="ti-blackboard"></i><span class="hide-menu">รายงาน</span></a> <ul aria-expanded="false" class="collapse"> @@ -211,18 +211,18 @@ logo { </ul> </li> - <? endif; ?> - <? if ($_SESSION['data_user_login']->p_type >= 1) : ?> + <?php endif; ?> + <?php if ($_SESSION['data_user_login']->p_type >= 1) : ?> <li> <a class="waves-effect waves-dark" href="<?php echo base_url() ?>Manage/Management_controller" aria-expanded="false"> <i class="mdi mdi-account "></i><span class="hide-menu">จัดการข้อมูลบุคลากร</span></a> </li> - <? endif; ?> - <? if ($_SESSION['data_user_login']->p_type == 2) : ?> + <?php endif; ?> + <?php if ($_SESSION['data_user_login']->p_type == 2) : ?> <li> <a class="waves-effect waves-dark" href="<?php echo base_url() ?>Manage_user/Manage_user_controller" aria-expanded="false"> <i class="fas fa-building "></i><span class="hide-menu">จัดการข้อมูลองค์กร</span></a> </li> - <? endif; ?> - <? endif; ?> + <?php endif; ?> + <?php endif; ?> </ul> </nav> @@ -263,56 +263,56 @@ logo { if ($_SESSION['year'] == date("Y") + 3) : ?> <option selected value="<?php echo (int)date("Y") + 3 ?>">ปีพุทธศักราช <?php echo (int)date("Y") + 3 + 543 ?></option> - <? elseif ($_SESSION['year'] != date("Y") + 3) : ?> + <?php elseif ($_SESSION['year'] != date("Y") + 3) : ?> <option value="<?php echo (int)date("Y") + 3 ?>">ปีพุทธศักราช <?php echo (int)date("Y") + 3 + 543 ?></option> - <? endif; ?> + <?php endif; ?> - <? if ($_SESSION['year'] == date("Y") + 2) : ?> + <?php if ($_SESSION['year'] == date("Y") + 2) : ?> <option selected value="<?php echo (int)date("Y") + 2 ?>">ปีพุทธศักราช <?php echo (int)date("Y") + 2 + 543 ?></option> - <? elseif ($_SESSION['year'] != date("Y") + 2) : ?> + <?php elseif ($_SESSION['year'] != date("Y") + 2) : ?> <option value="<?php echo (int)date("Y") + 2 ?>">ปีพุทธศักราช <?php echo (int)date("Y") + 2 + 543 ?></option> - <? endif; ?> + <?php endif; ?> - <? if ($_SESSION['year'] == date("Y") + 1) : ?> + <?php if ($_SESSION['year'] == date("Y") + 1) : ?> <option selected value="<?php echo (int)date("Y") + 1 ?>">ปีพุทธศักราช <?php echo (int)date("Y") + 1 + 543 ?></option> - <? elseif ($_SESSION['year'] != date("Y") + 1) : ?> + <?php elseif ($_SESSION['year'] != date("Y") + 1) : ?> <option value="<?php echo (int)date("Y") + 1 ?>">ปีพุทธศักราช <?php echo (int)date("Y") + 1 + 543 ?></option> - <? endif; ?> - <? if ($_SESSION['year'] == date("Y")) : ?> + <?php endif; ?> + <?php if ($_SESSION['year'] == date("Y")) : ?> <option selected value="<?php echo (int)date("Y") ?>">ปีพุทธศักราช <?php echo (int)date("Y") + 543 ?></option> - <? elseif ($_SESSION['year'] != date("Y")) : ?> + <?php elseif ($_SESSION['year'] != date("Y")) : ?> <option value="<?php echo (int)date("Y") ?>">ปีพุทธศักราช <?php echo (int)date("Y") + 543 ?></option> - <? endif; ?> + <?php endif; ?> - <? if ($_SESSION['year'] == date("Y") - 1) : ?> + <?php if ($_SESSION['year'] == date("Y") - 1) : ?> <option selected value="<?php echo (int)date("Y") - 1 ?>">ปีพุทธศักราช <?php echo (int)date("Y") - 1 + 543 ?></option> - <? elseif ($_SESSION['year'] != date("Y") - 1) : ?> + <?php elseif ($_SESSION['year'] != date("Y") - 1) : ?> <option value="<?php echo (int)date("Y") - 1 ?>">ปีพุทธศักราช <?php echo (int)date("Y") - 1 + 543 ?></option> - <? endif; ?> + <?php endif; ?> - <? if ($_SESSION['year'] == date("Y") - 2) : ?> + <?php if ($_SESSION['year'] == date("Y") - 2) : ?> <option selected value="<?php echo (int)date("Y") - 2 ?>">ปีพุทธศักราช <?php echo (int)date("Y") - 2 + 543 ?></option> - <? elseif ($_SESSION['year'] != date("Y") - 2) : ?> + <?php elseif ($_SESSION['year'] != date("Y") - 2) : ?> <option value="<?php echo (int)date("Y") - 2 ?>">ปีพุทธศักราช <?php echo (int)date("Y") - 2 + 543 ?></option> - <? endif; ?> + <?php endif; ?> - <? if ($_SESSION['year'] == date("Y") - 3) : ?> + <?php if ($_SESSION['year'] == date("Y") - 3) : ?> <option selected value="<?php echo (int)date("Y") - 3 ?>">ปีพุทธศักราช <?php echo (int)date("Y") - 3 + 543 ?></option> - <? elseif ($_SESSION['year'] != date("Y") - 3) : ?> + <?php elseif ($_SESSION['year'] != date("Y") - 3) : ?> <option value="<?php echo (int)date("Y") - 3 ?>">ปีพุทธศักราช <?php echo (int)date("Y") - 3 + 543 ?></option> - <? endif; ?> + <?php endif; ?> </select> <!-- ============================================================== --> @@ -485,14 +485,14 @@ logo { console.log($("#Year_d").val()); $.ajax({ type: "POST", - url: "http://localhost/team0/Dashboard/Dashboard_controller/set_session", + url: "<?php echo base_url() ?>Dashboard/Dashboard_controller/set_session", data: { year: $("#Year_d").val() }, success: function(response) { console.log("success"); - window.location.href = "http://localhost/team0/Dashboard/Dashboard_controller"; + window.location.href = "<?php echo base_url() ?>Dashboard/Dashboard_controller"; // $.ajax({ // type: "POST",