diff --git a/html/exhi/application/controllers/Project.php b/html/exhi/application/controllers/Project.php index b6f16c9a3a97569c9216b1e964244d7588e101d4..7a39bf66ae0053d9162dfdfcab59e9ba012093ab 100644 --- a/html/exhi/application/controllers/Project.php +++ b/html/exhi/application/controllers/Project.php @@ -277,7 +277,10 @@ class Project extends Exhibition_Controller { $this->load->model('detail/M_detail','detail'); $this->load->model('member/M_member','member'); $this->load->model('user/M_user','user'); - $user = $this->user->get_user_by_id($select_create)->row(); + $user = ''; + if($graduation == 4){ + $user = $this->user->get_user_by_id($select_create)->row(); + } $path_save_image = ''; if($graduation != 4){ @@ -576,7 +579,10 @@ class Project extends Exhibition_Controller { $path_old = ''; $project = $this->project->get_project_by_id($id)->row(); $user_old = $this->user->get_user_by_id($project->user_id)->row(); - $user = $this->user->get_user_by_id($select_create)->row(); + $user = ''; + if($graduation == 4){ + $user = $this->user->get_user_by_id($select_create)->row(); + } if($project->cluster_id != 0){ $select_old = $this->cluster->get_cluster_by_id($project->cluster_id)->row(); $path_old = '/project/year_'.$project->date.'/y2/'.$select_old->name.'/'; diff --git a/html/exhi/application/views/project/v_project_create.php b/html/exhi/application/views/project/v_project_create.php index 0a8a7faed05d74618c7c8ff203c67b6c8a21fc4e..091f061f757c3c9d61ce718448f2bfa427227ada 100644 --- a/html/exhi/application/views/project/v_project_create.php +++ b/html/exhi/application/views/project/v_project_create.php @@ -779,7 +779,7 @@ function insert_projecct(){ }else{ select =$('#instructor_select').val() } - if(year == '' || graduation == '' || company == '' || name == '' || select == '' || select_create == '' || select_create == null){ + if(year == '' || graduation == '' || company == '' || name == '' || select == ''){ Toast.fire({ icon: 'error', title: 'กรุณากรอกข้อมูล', @@ -789,7 +789,11 @@ function insert_projecct(){ icon: 'error', title: 'กรุณาเพิ่มรูปภาพ', }) - + }else if(graduation == 4 && select_create == null){ + Toast.fire({ + icon: 'error', + title: 'กรุณากรอกข้อมูล', + }) }else if(tags.length < 1){ Toast.fire({ icon: 'error', diff --git a/html/exhi/application/views/project/v_project_edit.php b/html/exhi/application/views/project/v_project_edit.php index ddb6863b98583a0871a6980aca2dc3af53ded696..8ae80edb22ac43da0dc98cfcb7db6386e6f3001f 100644 --- a/html/exhi/application/views/project/v_project_edit.php +++ b/html/exhi/application/views/project/v_project_edit.php @@ -948,7 +948,12 @@ function update_projecct(){ }else{ select =$('#instructor_select').val() } - if(year == '' || graduation == '' || company == '' || name == '' || select == '' || select_create == '' || select_create == null){ + if(year == '' || graduation == '' || company == '' || name == '' || select == ''){ + Toast.fire({ + icon: 'error', + title: 'กรุณากรอกข้อมูล', + }) + }else if(graduation == 4 && select_create == null){ Toast.fire({ icon: 'error', title: 'กรุณากรอกข้อมูล',