From 7959f4ca23468cf6331c87e2afa4b70535db39a2 Mon Sep 17 00:00:00 2001
From: Woraprat <73052317+aeworaprat@users.noreply.github.com>
Date: Fri, 3 Mar 2023 16:26:32 +0700
Subject: [PATCH] update project

---
 .../views/company/v_company_manage.php        |  5 +-
 .../views/instructor/v_instructor_manage.php  |  2 +-
 .../views/project/v_project_create.php        | 42 ++++++++++--
 .../views/project/v_project_edit.php          |  2 +-
 .../views/project/v_project_manage.php        |  4 +-
 .../views/project/v_project_manage_user.php   |  2 +-
 .../application/views/tag/v_tag_manage.php    |  2 +-
 .../views/template/adminlte/javascript.php    |  3 -
 .../views/template/adminlte/sidebar.php       |  2 +-
 mariadb/initdb/create-tables.sql              | 64 +++++++++++++------
 10 files changed, 88 insertions(+), 40 deletions(-)

diff --git a/html/exhibition/application/views/company/v_company_manage.php b/html/exhibition/application/views/company/v_company_manage.php
index ee472cd..cb8dfe2 100644
--- a/html/exhibition/application/views/company/v_company_manage.php
+++ b/html/exhibition/application/views/company/v_company_manage.php
@@ -172,7 +172,8 @@ input[type="search"]{
 					<div class="text-uppercase">
 					<br> รูปภาพโลโก้ <br> 
 					</div>
-					ขนาดไฟล์น้อยกว่า <br>2 MB.
+					ขนาดไฟล์น้อยกว่า 2 MB. <br>
+					ไฟล์ ่jpg, png
 				</div>
 				</label>
 				<Input class="uploadProfileInput" type="file" name="profile_pic" id="newProfilePhoto" accept="image/*" style="display: none;" />
@@ -258,7 +259,7 @@ function get_company() {
         success: function(data) {
             create_table(data.company);
 			let html_code = ''
-			html_code = '<a type="button" onclick="open_modal(null)" id="submit" class="btn btn=info float-right" style="color:white"><i class="fas fa-plus"></i> เพิ่ม</a>'
+			html_code = '<a type="button" onclick="open_modal(null)" id="submit" class="btn btn=info float-right" style="color:white"><i class="fas fa-plus"></i> เพิ่มบริษัท</a>'
 			$("#myTable_filter").after(html_code);
 		}
     })
diff --git a/html/exhibition/application/views/instructor/v_instructor_manage.php b/html/exhibition/application/views/instructor/v_instructor_manage.php
index b3a1127..87c10f3 100644
--- a/html/exhibition/application/views/instructor/v_instructor_manage.php
+++ b/html/exhibition/application/views/instructor/v_instructor_manage.php
@@ -187,7 +187,7 @@ function get_instructor() {
         dataType: 'json',
         success: function(data) {
             create_table(data.instructor);
-			html_code = '<a type="button" onclick="open_modal(null)" id="submit" class="btn btn=info float-right" style="color:white"><i class="fas fa-plus"></i> เพิ่ม</a>'
+			html_code = '<a type="button" onclick="open_modal(null)" id="submit" class="btn btn=info float-right" style="color:white"><i class="fas fa-plus"></i> เพิ่มอาจารย์ที่ปรึกษา</a>'
 			$("#myTable_filter").after(html_code);
 		}
     })
diff --git a/html/exhibition/application/views/project/v_project_create.php b/html/exhibition/application/views/project/v_project_create.php
index 37cfe21..5185aaa 100644
--- a/html/exhibition/application/views/project/v_project_create.php
+++ b/html/exhibition/application/views/project/v_project_create.php
@@ -68,8 +68,35 @@ label{
     display: inline;
     /* font-weight: bold; */
 }
-.image_logo {
-	display: block;
+.filepond--root,
+.filepond--root .filepond--drop-label {
+	height: auto;
+}
+.tooltip {
+  /* box-sizing: border-box; */
+}
+
+.tooltip::before,
+.tooltip::after {
+  /* position: absolute;
+  transform: translateX(-50%) translateY(var(--translate-y, 0))     scale(var(--scale));
+  transition: 200ms transform;
+  transform-origin: bottom center;
+  top: -0.25rem;
+  left: 50%; */
+}
+
+.tooltip::before {
+
+}
+
+.tooltip:hover::before,
+.tooltip:hover::after {
+  
+}
+
+.tooltip::after {
+
 }
 </style>
 <div class="content-wrapper h-100">
@@ -90,6 +117,7 @@ label{
             <div class="card card-outline card-primary">
                 <div class="card-header">
                     <h1 class="card-title"><b>เพิ่มโปรเจกต์</b></h1>
+					<div class="tooltip" data-tool="Info">Hover here</div>
                 </div>
                 <div class="card-body">
                     <div class="form-body">
@@ -152,7 +180,7 @@ label{
 						<div class="row p-t-20 center">
 							<div class="col-md-6 required">
 								<div class="form-group has-success">
-									<label class="form-label">บริษัท </label>
+									<label class="form-label">บริษัท/สำนักงาน </label>
 									<select class="form-control select-require" id="company">
 										<option value="" selected disabled></option>
 										<?php foreach($companies as $company){ ?>
@@ -163,7 +191,7 @@ label{
 							</div>
 							<div class="col-md-6 required">
 								<div class="form-group has-success">
-									<label class="form-label">หมวดหมู่ </label>
+									<label class="form-label">ป้ายกำกับ </label>
 									<select class="js-example-basic-multiple form-control" name="states[]" multiple="multiple" id="muti">   
 											<?php foreach($tags as $tag){ ?>   
 												<option value="<?php echo $tag->tag_id ?>"><?php echo $tag->name ?></option> 
@@ -190,7 +218,7 @@ label{
 						</div>
 						<div class="card card-outline card-primary">
 							<div class="card-header" id="headadd_detail">
-								<h1 class="card-title"><b>รูปภาพโปรไฟล์ & พื้นหลัง</b></h1>
+								<h1 class="card-title"><b>รูปภาพโปรไฟล์ & พื้นหลัง</b> <span data-toggle="tooltip"  title="รูปภาพโปรไฟล์ควรมีขนาดไม่เกิน 200x200 &#013;รูปภาพพื้นหลังควรมีขนาดไม่เกิน 1920x600"><i class="fa fa-question-circle-o" aria-hidden="true"></i></span></h1>
 							</div>
 							<div class="card-body">
 								<div class="row">
@@ -428,7 +456,7 @@ let index_member = 0;
 
 const pond_image_circle = FilePond.create(image_circle, {
 	acceptedFileTypes: ['image/png'],
-	labelIdle: `<div style="font-size: 40px;"><i class="fa fa-picture-o"></i></div>`,
+	labelIdle: `รูปภาพโปรไฟล์ <div style="font-size: 40px;"><i class="fa fa-picture-o"></i></div>ไฟล์ ่jpg, png`,
 	imagePreviewHeight: 170,
 	imageCropAspectRatio: '1:1',
 	imageResizeTargetWidth: 200,
@@ -449,7 +477,7 @@ pond_image_circle.on('removefile', (error, file) => {
 
 
 const pond_image_cover = FilePond.create(image, {
-	labelIdle: `<div style="font-size: 40px;"><i class="fa fa-picture-o"></i></div>`,
+	labelIdle: `รูปภาพพื้นหลัง <div style="font-size: 40px;"><i class="fa fa-picture-o"></i></div> ไฟล์ ่jpg, png`,
 });
 let data_cover
 pond_image_cover.on('addfile', (error, file) => {
diff --git a/html/exhibition/application/views/project/v_project_edit.php b/html/exhibition/application/views/project/v_project_edit.php
index 435858d..176f1fb 100644
--- a/html/exhibition/application/views/project/v_project_edit.php
+++ b/html/exhibition/application/views/project/v_project_edit.php
@@ -149,7 +149,7 @@ label{
 						<div class="row p-t-20 center">
 							<div class="col-md-6 required">
 								<div class="form-group has-success">
-									<label class="form-label">บริษัท </label>
+									<label class="form-label">บริษัท/สำนักงาน </label>
 									<select class="form-control select-require" id="company">
 										<option value="" selected disabled></option>
 										<?php foreach($companies as $company){ ?>
diff --git a/html/exhibition/application/views/project/v_project_manage.php b/html/exhibition/application/views/project/v_project_manage.php
index dfd39a9..f194a3f 100644
--- a/html/exhibition/application/views/project/v_project_manage.php
+++ b/html/exhibition/application/views/project/v_project_manage.php
@@ -72,7 +72,7 @@ option {
                     <h1 class="card-title"><b>โปรเจกต์</b></h1>
                 </div>
                 <div class="card-body">
-				<a type="button" href="<?php echo site_url() . "/Project/show_project_create"; ?>"  id="submit" class="btn btn=info float-right" style="color:white"><i class="fas fa-plus"></i> เพิ่ม</a>
+				<a type="button" href="<?php echo site_url() . "/Project/show_project_create"; ?>"  id="submit" class="btn btn=info float-right" style="color:white"><i class="fas fa-plus"></i> เพิ่มโปรเจกต์</a>
 				<div id="filler">ค้นหา : <input id="myInput" type="search" onsearch="OnSearch()" size="4">
 					&nbsp;&nbsp;ปี :
 					<select id="yearfiller" onchange="year_filter()" class="form-control">
@@ -149,7 +149,7 @@ function create_table(data) {
 		const tr = document.createElement("tr")
 		const template_clone = template.content.cloneNode(true);
 		template_clone.querySelector('.index').innerText = index+1
-		template_clone.querySelector('.name').innerText = row.name;
+		template_clone.querySelector('.name').innerText = row.name_th;
 		template_clone.querySelector('.year').innerText = row.date;
 		let graduation 
 		if(row.cluster_id != null){
diff --git a/html/exhibition/application/views/project/v_project_manage_user.php b/html/exhibition/application/views/project/v_project_manage_user.php
index dacaa91..9ab4156 100644
--- a/html/exhibition/application/views/project/v_project_manage_user.php
+++ b/html/exhibition/application/views/project/v_project_manage_user.php
@@ -143,7 +143,7 @@ function create_table(data) {
 		const tr = document.createElement("tr")
 		const template_clone = template.content.cloneNode(true);
 		template_clone.querySelector('.index').innerText = index+1
-		template_clone.querySelector('.name').innerText = row.name;
+		template_clone.querySelector('.name').innerText = row.name_th;
 		template_clone.querySelector('.year').innerText = row.date;
 		let graduation 
 		if(row.cluster_id != null){
diff --git a/html/exhibition/application/views/tag/v_tag_manage.php b/html/exhibition/application/views/tag/v_tag_manage.php
index 70e39cc..770c52c 100644
--- a/html/exhibition/application/views/tag/v_tag_manage.php
+++ b/html/exhibition/application/views/tag/v_tag_manage.php
@@ -102,7 +102,7 @@ function get_tag() {
         dataType: 'json',
         success: function(data) {
             create_table(data.tag);
-			html_code = ' <a type="button" onclick="open_modal(null)"  id="submit" class="btn btn=info float-right" style="color:white"><i class="fas fa-plus"></i> เพิ่ม</a>'
+			html_code = ' <a type="button" onclick="open_modal(null)"  id="submit" class="btn btn=info float-right" style="color:white"><i class="fas fa-plus"></i> เพิ่มป้ายกำกับ</a>'
 			$("#myTable_filter").after(html_code);
         }
     })
diff --git a/html/exhibition/application/views/template/adminlte/javascript.php b/html/exhibition/application/views/template/adminlte/javascript.php
index 834277d..e5521f9 100644
--- a/html/exhibition/application/views/template/adminlte/javascript.php
+++ b/html/exhibition/application/views/template/adminlte/javascript.php
@@ -77,6 +77,3 @@
 <script src="<?php echo base_url()?>assets/plugins/filepond-plugin-file-validate-type-master/dist/filepond-plugin-file-validate-type.js"></script> 
 <script src="<?php echo base_url()?>assets/plugins/filepond-plugin-image-exif-orientation-master/dist/filepond-plugin-image-exif-orientation.js"></script> 
 <script src="<?php echo base_url()?>assets/plugins/filepond-plugin-image-preview-master/dist/filepond-plugin-image-preview.js"></script> 
-
-
-
diff --git a/html/exhibition/application/views/template/adminlte/sidebar.php b/html/exhibition/application/views/template/adminlte/sidebar.php
index 4ea75f0..78181a4 100644
--- a/html/exhibition/application/views/template/adminlte/sidebar.php
+++ b/html/exhibition/application/views/template/adminlte/sidebar.php
@@ -24,7 +24,7 @@
 			<li class="nav-item">
                 <a href='<?php echo site_url().'/Tag/show_tag_manage';?>' class="nav-link <?php echo $_SESSION['sidebar'] == 'tag' ? 'active' : '' ?>">
                     <i class="nav-icon fas fa-tag"></i>
-                    <p>หมวดหมู่</p>
+                    <p>ป้ายกำกับ</p>
                 </a>
             </li>
 			<li class="nav-item">
diff --git a/mariadb/initdb/create-tables.sql b/mariadb/initdb/create-tables.sql
index de57863..31390cc 100644
--- a/mariadb/initdb/create-tables.sql
+++ b/mariadb/initdb/create-tables.sql
@@ -1,11 +1,11 @@
 -- phpMyAdmin SQL Dump
--- version 5.0.4
+-- version 5.2.1
 -- https://www.phpmyadmin.net/
 --
--- Host: 127.0.0.1
--- Generation Time: Feb 19, 2023 at 03:08 PM
--- Server version: 10.4.17-MariaDB
--- PHP Version: 8.0.2
+-- Host: db
+-- Generation Time: Mar 03, 2023 at 09:05 AM
+-- Server version: 10.3.38-MariaDB-1:10.3.38+maria~ubu2004
+-- PHP Version: 8.1.16
 
 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
 START TRANSACTION;
@@ -30,7 +30,7 @@ SET time_zone = "+00:00";
 CREATE TABLE `cluster` (
   `cluster_id` int(1) NOT NULL,
   `name` varchar(50) NOT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
 
 --
 -- Dumping data for table `cluster`
@@ -61,7 +61,7 @@ CREATE TABLE `comment` (
   `sender` varchar(50) NOT NULL,
   `date` date NOT NULL,
   `project_id` int(10) NOT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
 
 -- --------------------------------------------------------
 
@@ -74,7 +74,7 @@ CREATE TABLE `company` (
   `image` varchar(50) NOT NULL,
   `name` varchar(100) NOT NULL,
   `is_delete` int(1) NOT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
 
 --
 -- Dumping data for table `company`
@@ -100,7 +100,14 @@ CREATE TABLE `detail` (
   `image2` varchar(100) NOT NULL,
   `template` int(1) NOT NULL,
   `project_id` int(10) NOT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
+
+--
+-- Dumping data for table `detail`
+--
+
+INSERT INTO `detail` (`detail_id`, `description`, `image1`, `image2`, `template`, `project_id`) VALUES
+(19, '<p>ss</p>', '/project/year_2021/y2/cluster2/image_detail_1_0.png', '/project/year_2021/y2/cluster2/image_detail_2_0.png', 1, 54);
 
 -- --------------------------------------------------------
 
@@ -112,7 +119,7 @@ CREATE TABLE `instructor` (
   `instructor_id` int(10) NOT NULL,
   `name` varchar(50) NOT NULL,
   `is_delete` int(1) NOT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
 
 --
 -- Dumping data for table `instructor`
@@ -137,7 +144,7 @@ CREATE TABLE `member` (
   `image` varchar(100) NOT NULL,
   `project_id` int(10) NOT NULL,
   `user_id` int(10) NOT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
 
 -- --------------------------------------------------------
 
@@ -147,7 +154,8 @@ CREATE TABLE `member` (
 
 CREATE TABLE `project` (
   `project_id` int(10) NOT NULL,
-  `name` varchar(100) NOT NULL,
+  `name_th` varchar(100) NOT NULL,
+  `name_en` varchar(100) NOT NULL,
   `image_logo` varchar(100) NOT NULL,
   `image_cover` varchar(100) NOT NULL,
   `date` year(4) NOT NULL,
@@ -157,7 +165,14 @@ CREATE TABLE `project` (
   `team_id` int(10) NOT NULL,
   `instructor_id` int(10) NOT NULL,
   `user_id` int(10) NOT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
+
+--
+-- Dumping data for table `project`
+--
+
+INSERT INTO `project` (`project_id`, `name_th`, `name_en`, `image_logo`, `image_cover`, `date`, `status`, `company_id`, `cluster_id`, `team_id`, `instructor_id`, `user_id`) VALUES
+(54, 'sda', 'sds', '/project/year_2021/y2/cluster2/image_logo_23-03-02.png', '/project/year_2021/y2/cluster2/image_cover_23-03-02.png', '2021', 1, 12, 4, 0, 0, 0);
 
 -- --------------------------------------------------------
 
@@ -169,7 +184,14 @@ CREATE TABLE `project_tag` (
   `project_tag_id` int(10) NOT NULL,
   `project_id` int(10) NOT NULL,
   `tag_id` int(10) NOT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
+
+--
+-- Dumping data for table `project_tag`
+--
+
+INSERT INTO `project_tag` (`project_tag_id`, `project_id`, `tag_id`) VALUES
+(24, 54, 12);
 
 -- --------------------------------------------------------
 
@@ -182,7 +204,7 @@ CREATE TABLE `tag` (
   `name` varchar(50) NOT NULL,
   `status` int(1) NOT NULL COMMENT '0=off\r\n1=on',
   `is_delete` int(1) NOT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
 
 --
 -- Dumping data for table `tag`
@@ -204,7 +226,7 @@ INSERT INTO `tag` (`tag_id`, `name`, `status`, `is_delete`) VALUES
 CREATE TABLE `team` (
   `team_id` int(10) NOT NULL,
   `name` varchar(50) NOT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
 
 --
 -- Dumping data for table `team`
@@ -239,14 +261,14 @@ CREATE TABLE `user` (
   `password` varchar(50) NOT NULL,
   `role` int(1) NOT NULL COMMENT '1=user, 2=admin',
   `is_delete` tinyint(1) NOT NULL COMMENT '1=ถูกลบ, 0=ยังไม่ถูกลบ'
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
 
 --
 -- Dumping data for table `user`
 --
 
 INSERT INTO `user` (`user_id`, `student_id`, `prefix`, `first_name`, `last_name`, `email`, `password`, `role`, `is_delete`) VALUES
-(0, 'admin', '', 'admin', 'admin', 'admin', 'd41d8cd98f00b204e9800998ecf8427e', 2, 0),
+(0, 'admin', '', 'admin', 'admin', 'admin', '21232f297a57a5a743894a0e4a801fc3', 2, 0),
 (1, '62160336', '', 'วรปรัชญ์', 'ฤกษ์เปลี่ยน', '62160336@go.buu.ac.th', 'd41d8cd98f00b204e9800998ecf8427e', 2, 0),
 (15, 'user', '', 'user', 'user', 'user', 'ee11cbb19052e40b07aac0ca060c23ee', 1, 0);
 
@@ -357,7 +379,7 @@ ALTER TABLE `company`
 -- AUTO_INCREMENT for table `detail`
 --
 ALTER TABLE `detail`
-  MODIFY `detail_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
+  MODIFY `detail_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;
 
 --
 -- AUTO_INCREMENT for table `instructor`
@@ -375,13 +397,13 @@ ALTER TABLE `member`
 -- AUTO_INCREMENT for table `project`
 --
 ALTER TABLE `project`
-  MODIFY `project_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=54;
+  MODIFY `project_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=55;
 
 --
 -- AUTO_INCREMENT for table `project_tag`
 --
 ALTER TABLE `project_tag`
-  MODIFY `project_tag_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;
+  MODIFY `project_tag_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;
 
 --
 -- AUTO_INCREMENT for table `tag`
-- 
GitLab