diff --git a/application/controllers/Company.php b/application/controllers/Company.php index c53d57b5f3189fc6a868136c4794932d28248d5a..23fbda168195792c3aa1ebe4f072ca20d1cf9292 100644 --- a/application/controllers/Company.php +++ b/application/controllers/Company.php @@ -48,8 +48,8 @@ class Company extends ExhibitionController { $data['message'] = true; echo json_encode($data); } - - public function edit_company() + //บันทึกข้อมูลที่แก้ไข + public function edit_company() { $id = $this->input->post('id'); $company_name = $this->input->post('company_name'); diff --git a/application/controllers/Project.php b/application/controllers/Project.php index 98b39c1174fa44a2477211e12952989b78e0d9e5..54cd8442782b2969e8d0e3ef8d282bd79c837191 100644 --- a/application/controllers/Project.php +++ b/application/controllers/Project.php @@ -6,7 +6,7 @@ require_once dirname(__FILE__) . './ExhibitionController.php'; class Project extends ExhibitionController { - public function show_project_manage() + public function show_project_manage() //ดึงข้อมูล หน้าดรอปดาวต่างๆ { $_SESSION["sidebar"] = 'project'; $this->output_admin('Project/v_project_manage'); @@ -74,7 +74,7 @@ class Project extends ExhibitionController { $data['message'] = true; echo json_encode($data); } - +//นำข้อมูลที่ดึงมาใส่ public function add_project(){ $project_name = $this->input->post('project_name'); @@ -89,8 +89,8 @@ class Project extends ExhibitionController { $this->load->model('project/M_project', 'project'); - $this->project->add_project($project_name, $class_year, $detail, $company_id, $template); - $max_id = $this->project->get_max_id()->row(); + $this->project->add_project($project_name, $class_year, $detail, $company_id, $template); //เพิ่มเสร้จบันทึกข้อมูล + $max_id = $this->project->get_max_id()->row(); //เอาไอดีที่มากที่สุดของ project มา // เพิ่มiรูป $folder = getcwd().'/image/project/'; mkdir($folder.'project_'.$max_id->max_id); diff --git a/application/controllers/User.php b/application/controllers/User.php index b56fabc6f6b0c97e8e978337d62481b4c6a88864..ce0230ab3c752d421e260f307b5b7432b5026635 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -12,12 +12,12 @@ class User extends ExhibitionController { $this->output_admin('User/v_user_manage'); } -//ดึงข้อมูลuser +//ดึงข้อมูลuser จาก M user public function get_user() { $this->load->model('user/M_user', 'user'); $data = $this->user->get_user()->result(); - echo json_encode($data); + echo json_encode($data); //เอาข้อมูลไปสร้างเป็นตาราง } public function show_user_create(){ @@ -45,11 +45,11 @@ class User extends ExhibitionController { $data['message'] = true; echo json_encode($data); } - + //ดึงข้อมูลของ id ที่เลือก public function show_user_edit($id){ $this->load->model('user/M_user', 'user'); $data['user'] = $this->user->get_user_by_id($id)->row(); - $this->output_admin('User/v_user_edit', $data); + $this->output_admin('User/v_user_edit', $data); //พอดึงได้จะไปแสดงหน้าจอ user edit } public function edit_user(){ @@ -66,7 +66,7 @@ class User extends ExhibitionController { $this->load->model('user/M_user', 'user'); $data['user'] = $this->user->get_user_by_id($id)->row(); - //เช็ต password + //เช็ต password if($this->input->post('pass') != '' && $this->input->post('current_pass') != ''){ if($current_pass == $data['user']->user_password){ $this->user->edit_user($student_id, $first_name, $last_name, $email, $role, $pass, $id); diff --git a/application/views/Company/v_company_manage.php b/application/views/Company/v_company_manage.php index 8a66227c014a7fd3eaa20abcc178f0e8b1f16b23..cf5b63b9fc158c581bb4ca30aa0c7a5e3f367e35 100644 --- a/application/views/Company/v_company_manage.php +++ b/application/views/Company/v_company_manage.php @@ -284,7 +284,7 @@ $('#add-company-modal').on('shown.bs.modal', function (e) { $('#add_company_name').val('') }) - +//ดึงข้อมูล get com function get_company(){ $.ajax({ type: 'post', @@ -295,7 +295,7 @@ function get_company(){ } }) } - +//พอดีงข้อมูลเสร็จจะนำไปสร้างตาราง function create_table(data){ let html_code = ''; html_code +='<table id="myTable" class="table-hover">' @@ -334,7 +334,7 @@ function create_table(data){ $(".dataTables_info").css('clear', 'none'); $(".dataTables_info").css('padding-top', '1'); } - +//กดปุ่ม edit เรียกฟังก์ชัน editModal ทำการ set ข้อมูลที่แก้ไขลงใน modal แล้วก็แสดง function editModal(id, image, name){ $('#edit_id').val(id) $('#edit_name').val(name); @@ -393,7 +393,7 @@ function editCompany(){ } }); } - +//กดปุ่ม delete จะไปเรียกฟังก์ชัน delete_company ใน controller function deleteCompany(id){ $.ajax({ type: 'POST', diff --git a/application/views/Project/v_project_create.php b/application/views/Project/v_project_create.php index c2fb5ebad391e6f7fcab3ee568ce20818d66e025..75b3df1a3dcf65edff0accb598df0e7ae6233587 100644 --- a/application/views/Project/v_project_create.php +++ b/application/views/Project/v_project_create.php @@ -301,11 +301,11 @@ indexImage = 1; //เพิ่ม member function addMember(){ - if(index < 11){ + if(index < 11){ //ไม่เกิน 10 document.querySelector("#memberList").insertAdjacentHTML("beforeend", `<div class="member-list-child"> <input class="form-control-custom stuId" type="text" name='studId'> - <input type="text" name="member" class="form-control-custom member member-child"><button onclick="deleteItem(this)">Delete</button><div>`); + <input type="text" name="member" class="form-control-custom member member-child"><button onclick="deleteItem(this)">Delete</button><div>`); //ปุ่ม delete index++; } } @@ -474,7 +474,7 @@ function deleteImage(dom){ } indexImage-- } - +//ดึงข้อมูล ไปใส่ add_project ใน controlller function addUser(){ let project_name = $('#projectName').val(); let classYear = $("input[name='classYear']:checked").val(); diff --git a/application/views/User/v_user_edit.php b/application/views/User/v_user_edit.php index 3d68e957e314a11d75a66bc9810dd0b320626800..ec8a723b4feb103a0c3dfd6a4d81f19e2ca9c385 100644 --- a/application/views/User/v_user_edit.php +++ b/application/views/User/v_user_edit.php @@ -116,8 +116,9 @@ div.dataTables_filter{ <script> - +//เมื่อกดบันทึกจะเรียกฟังก์ชัน adduser function addUser(){ + //เอาข้อมูลใส่ในตัวแปรแต่ละตัว let id = $('#id').val(); let first_name = $('#firstName').val(); let last_name = $('#lastName').val(); @@ -132,6 +133,7 @@ function addUser(){ type: 'POST', url: "<?php echo site_url() . '/User/edit_user'; ?>", data: { + //ส่งข้อมูลไปยัง controller edit_user 'id': id, 'first_name': first_name, 'last_name': last_name, diff --git a/application/views/User/v_user_manage.php b/application/views/User/v_user_manage.php index c7043b3cff847939d65b651bd3139d9e62b5a848..0c1421e6d6d6abcdc1206ea45167603cdbd7ff3c 100644 --- a/application/views/User/v_user_manage.php +++ b/application/views/User/v_user_manage.php @@ -60,7 +60,7 @@ $( document ).ready(function() { }); //ดึงข้อมูล user -function get_cluster(){ +function get_cluster(){ $.ajax({ type: 'post', url: "<?php echo site_url() . '/User/get_user'; ?>", @@ -71,7 +71,7 @@ function get_cluster(){ }) } -//สร้าง table +//สร้าง table จากไฟล์ get user function create_table(data){ let html_code = ''; html_code +='<table id="myTable" class="table-hover">' @@ -97,7 +97,8 @@ function create_table(data){ }) html_code +='</tbody>'; html_code +='</table>'; - $('#create_table').html(html_code); + $('#create_table').html(html_code); + //datateble ฟังก์ชันตารางเสริม $('#myTable').DataTable({ dom: 'frtlip', aoColumnDefs: [{ @@ -114,7 +115,7 @@ function create_table(data){ function deleteUser(id){ $.ajax({ type: 'POST', - url: "<?php echo site_url() . '/User/delete_user'; ?>", + url: "<?php echo site_url() . '/User/delete_user'; ?>", //ไปcontroller เพื่อลบข้อมูล data: { 'id': id, }, @@ -122,8 +123,8 @@ function deleteUser(id){ success: function(data) { console.log(data) if (data.message) { - toastSuccess() - get_cluster() + toastSuccess() //ลบได้จะแสดงแจ้งเตือน + get_cluster() //เมื่อลบข้อมูลได้ก็จะดึงตารางข้อมูลขึ้นมาใหม่ } else { toastFail() diff --git a/image/project/project_49/image_0.png b/image/project/project_49/image_0.png index e7f5674cfeee837c7dff6846c4c4ce4a14538a04..ccbe60fc6e156bec2a50212b7b67b5abcb29040e 100644 Binary files a/image/project/project_49/image_0.png and b/image/project/project_49/image_0.png differ diff --git a/image/project/project_50/image_0.png b/image/project/project_50/image_0.png index e7f5674cfeee837c7dff6846c4c4ce4a14538a04..ccbe60fc6e156bec2a50212b7b67b5abcb29040e 100644 Binary files a/image/project/project_50/image_0.png and b/image/project/project_50/image_0.png differ diff --git a/image/project/project_51/image_0.png b/image/project/project_51/image_0.png index 7aba61f58eb1b1d4d218c6280316e4d05d36d93e..ccbe60fc6e156bec2a50212b7b67b5abcb29040e 100644 Binary files a/image/project/project_51/image_0.png and b/image/project/project_51/image_0.png differ diff --git a/image/project/project_52/image_0.png b/image/project/project_52/image_0.png index 7aba61f58eb1b1d4d218c6280316e4d05d36d93e..ccbe60fc6e156bec2a50212b7b67b5abcb29040e 100644 Binary files a/image/project/project_52/image_0.png and b/image/project/project_52/image_0.png differ diff --git a/image/project/project_53/image_0.png b/image/project/project_53/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_53/image_0.png differ diff --git a/image/project/project_54/image_0.png b/image/project/project_54/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_54/image_0.png differ diff --git a/image/project/project_55/image_0.png b/image/project/project_55/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_55/image_0.png differ diff --git a/image/project/project_56/image_0.png b/image/project/project_56/image_0.png index 51278549887a1f7de6f11f193ac169c34e93ed0b..ccbe60fc6e156bec2a50212b7b67b5abcb29040e 100644 Binary files a/image/project/project_56/image_0.png and b/image/project/project_56/image_0.png differ diff --git a/image/project/project_57/image_0.png b/image/project/project_57/image_0.png index 51278549887a1f7de6f11f193ac169c34e93ed0b..ccbe60fc6e156bec2a50212b7b67b5abcb29040e 100644 Binary files a/image/project/project_57/image_0.png and b/image/project/project_57/image_0.png differ diff --git a/image/project/project_58/image_0.png b/image/project/project_58/image_0.png index 51278549887a1f7de6f11f193ac169c34e93ed0b..ccbe60fc6e156bec2a50212b7b67b5abcb29040e 100644 Binary files a/image/project/project_58/image_0.png and b/image/project/project_58/image_0.png differ diff --git a/image/project/project_59/image_0.png b/image/project/project_59/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_59/image_0.png differ diff --git a/image/project/project_60/image_0.png b/image/project/project_60/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_60/image_0.png differ diff --git a/image/project/project_61/image_0.png b/image/project/project_61/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_61/image_0.png differ diff --git a/image/project/project_62/image_0.png b/image/project/project_62/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_62/image_0.png differ diff --git a/image/project/project_63/image_0.png b/image/project/project_63/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_63/image_0.png differ diff --git a/image/project/project_64/image_0.png b/image/project/project_64/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_64/image_0.png differ diff --git a/image/project/project_65/image_0.png b/image/project/project_65/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_65/image_0.png differ diff --git a/image/project/project_66/image_0.png b/image/project/project_66/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_66/image_0.png differ diff --git a/image/project/project_67/image_0.png b/image/project/project_67/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_67/image_0.png differ diff --git a/image/project/project_68/image_0.png b/image/project/project_68/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_68/image_0.png differ diff --git a/image/project/project_69/image_0.png b/image/project/project_69/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_69/image_0.png differ diff --git a/image/project/project_70/image_0.png b/image/project/project_70/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_70/image_0.png differ diff --git a/image/project/project_71/image_0.png b/image/project/project_71/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_71/image_0.png differ diff --git a/image/project/project_72/image_0.png b/image/project/project_72/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_72/image_0.png differ diff --git a/image/project/project_73/image_0.png b/image/project/project_73/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_73/image_0.png differ diff --git a/image/project/project_74/image_0.png b/image/project/project_74/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_74/image_0.png differ diff --git a/image/project/project_75/image_0.png b/image/project/project_75/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_75/image_0.png differ diff --git a/image/project/project_76/image_0.png b/image/project/project_76/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_76/image_0.png differ diff --git a/image/project/project_77/image_0.png b/image/project/project_77/image_0.png new file mode 100644 index 0000000000000000000000000000000000000000..ccbe60fc6e156bec2a50212b7b67b5abcb29040e Binary files /dev/null and b/image/project/project_77/image_0.png differ