From 08290cc85f3117ba13d0cc204a31fd1d1d22924c Mon Sep 17 00:00:00 2001
From: Woraprat <73052317+aeworaprat@users.noreply.github.com>
Date: Sun, 12 Mar 2023 22:48:48 +0700
Subject: [PATCH] update project tag general

---
 html/exhi/application/controllers/Tag.php     |  4 ++--
 html/exhi/application/controllers/User.php    |  2 +-
 .../views/general/v_general_select.php        | 19 +++++++++++++++----
 .../views/project/v_project_manage_user.php   |  2 +-
 .../application/views/tag/v_tag_manage.php    |  2 +-
 5 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/html/exhi/application/controllers/Tag.php b/html/exhi/application/controllers/Tag.php
index 4e5cbf9..4d268e8 100644
--- a/html/exhi/application/controllers/Tag.php
+++ b/html/exhi/application/controllers/Tag.php
@@ -28,7 +28,7 @@ class Tag extends Exhibition_Controller {
 
 	public function insert_tag(){
 		$data['message'] = true ;
-		$name = $this->input->post('name');
+		$name = trim($this->input->post('name'));
 		$this->load->model('tag/M_tag','tag');
 		$tags = $this->tag->get_all()->result();
 		foreach($tags as $tag){
@@ -45,7 +45,7 @@ class Tag extends Exhibition_Controller {
 	public function update_tag(){
 		$data['message'] = true ;
 		$id = $this->input->post('id');
-		$name = $this->input->post('name');
+		$name = trim($this->input->post('name'));
 		$this->load->model('tag/M_tag','tag');
 		$tags = $this->tag->get_all()->result();
 		foreach($tags as $tag){
diff --git a/html/exhi/application/controllers/User.php b/html/exhi/application/controllers/User.php
index fff81a4..d9ee93a 100644
--- a/html/exhi/application/controllers/User.php
+++ b/html/exhi/application/controllers/User.php
@@ -51,7 +51,7 @@ class User extends Exhibition_Controller {
 		$first_name = $this->input->post('first_name');
 		$last_name = $this->input->post('last_name');
 		$student_id = $this->input->post('student_id');
-		$email = $this->input->post('email');
+		$email = trim($this->input->post('email'));
 		$password = $this->input->post('password');
 		$role = $this->input->post('role');
 		$this->load->model('user/M_user','user');
diff --git a/html/exhi/application/views/general/v_general_select.php b/html/exhi/application/views/general/v_general_select.php
index e515d4a..1df619a 100644
--- a/html/exhi/application/views/general/v_general_select.php
+++ b/html/exhi/application/views/general/v_general_select.php
@@ -138,7 +138,7 @@ span{
 .image-detail {
 	object-fit: cover;
 	width: auto;
-	height: 300px;
+	height: auto;
 	padding: 20px;
 	display: block;
     margin-left: auto;
@@ -177,9 +177,20 @@ span{
 							<div class="row">
 								<p style="white-space: pre-line; font-size: 20px; margin-left: 5px;"><?php echo $project->name_th ?></p>
 							</div>
-							<div class="row">
-								<p style="white-space: pre-line; font-size: 20px; margin-left: 5px;"><?php echo $project->select ?></p>
-							</div>
+							<?php if($project->cluster_id != 0){ ?>
+								<div class="row">
+									<p style="white-space: pre-line; font-size: 20px; margin-left: 5px;">มกุล : <?php echo $project->select ?></p>
+								</div>
+							<?php }else if($project->team_id != 0){ ?>
+								<div class="row">
+									<p style="white-space: pre-line; font-size: 20px; margin-left: 5px;">ทีม : <?php echo $project->select ?></p>
+								</div>
+							<?php }else { ?>
+								<div class="row">
+									<p style="white-space: pre-line; font-size: 20px; margin-left: 5px;">อาจารย์ที่ปรึกษา : <?php echo $project->select ?></p>
+								</div>
+
+							<?php } ?>
 							<div class="row">
 								<p style="white-space: pre-line; font-size: 20px; margin-left: 5px;">ปี : <?php echo $project->date ?></p>
 							</div>
diff --git a/html/exhi/application/views/project/v_project_manage_user.php b/html/exhi/application/views/project/v_project_manage_user.php
index 5f2dcf9..c58fc49 100644
--- a/html/exhi/application/views/project/v_project_manage_user.php
+++ b/html/exhi/application/views/project/v_project_manage_user.php
@@ -271,7 +271,7 @@ function update_status(id, status) {
 			if (data['message'] == true) {
 				Toast.fire({
 					icon: 'success',
-					title: 'เปลี่ยนสถานะสำเร็จ',
+					title: 'อัพเดตสถานะสำเร็จ',
 				});
 				await get_project()
 			} 
diff --git a/html/exhi/application/views/tag/v_tag_manage.php b/html/exhi/application/views/tag/v_tag_manage.php
index 770c52c..d9729e5 100644
--- a/html/exhi/application/views/tag/v_tag_manage.php
+++ b/html/exhi/application/views/tag/v_tag_manage.php
@@ -249,7 +249,7 @@ function insert_tag(name) {
 					type: 'post',
 					url: "<?php echo site_url().'/Tag/insert_tag'; ?>",
 					data: {
-						'name': name
+						'name': name.trim()
 					},
 					dataType: 'json',
 					success: async function(data) {
-- 
GitLab