001.
<?php
002.
session_start();
003.
004.
if
(!isset(
$_SESSION
[
'username'
])) {
005.
header(
'location: index.php'
);
006.
}
007.
008.
if
(isset(
$_GET
[
'logout'
])) {
009.
session_destroy();
010.
unset(
$_SESSION
[
'username'
]);
011.
header(
'location: index.php'
);
012.
}
013.
014.
015.
require
(
'connect.php'
);
016.
if
(isset(
$_GET
[
'id'
])){
017.
$id
= mysqli_real_escape_string(
$con
,
$_GET
[
'id'
]);
018.
$sql_name
=
"SELECT name FROM project WHERE id = '$id' "
;
019.
$result_name
= mysqli_query(
$con
,
$sql_name
);
020.
while
(
$row_name
= mysqli_fetch_assoc(
$result_name
)) {
021.
$name_data
=
$row_name
[
'name'
];
022.
break
;
023.
}
024.
}
025.
?>
026.
027.
<!DOCTYPE html>
028.
<html lang=
"en"
>
029.
<head>
030.
031.
<!--- Head --->
032.
<?php
require
(
'structure/head.php'
); ?>
033.
034.
</head>
035.
<body>
036.
037.
<!--- nav --->
038.
<?php
require
(
'structure/nav.php'
); ?>
039.
040.
<!--- Card Content --->
041.
<div
class
=
"container pt-4 d-block"
>
042.
<div
class
=
"card-deck mb-1"
>
043.
<!--- Card Content - Sub --->
044.
<div
class
=
"card mb-4 shadow-sm"
>
045.
<div
class
=
"card-header text-white"
id=
"card-content-admin-project"
> <h5
class
=
"mt-2"
> <i
class
=
"far fa-edit"
></i> แก้ไขข้อมูลโครงการ/กิจกรรม : <?php
echo
$name_data
?> </h5></div>
046.
<div
class
=
"card-body"
>
047.
<div
class
=
"card-header"
>
048.
<div
class
=
"float-end text-white"
>
049.
<button
class
=
"btn bg-primary text-white"
data-bs-toggle=
"modal"
data-bs-target=
"#AddUserPj"
> <i
class
=
"fas fa-plus pe-1"
></i> เพิ่ม</dutton>
050.
</div>
051.
<ul
class
=
"nav nav-tabs card-header-tabs"
>
052.
<li
class
=
"nav-item"
>
053.
<a
class
=
"nav-link active"
href=
"admin_project.php"
>รายชื่อทั้งหมด</a>
054.
</li>
055.
<li
class
=
"nav-item"
>
056.
<a
class
=
"nav-link "
id =
"nav-admin-custom"
data-bs-toggle=
"modal"
data-bs-target=
"#AddCSV"
>นำเข้ารายชื่อ</a>
057.
</li>
058.
<li
class
=
"nav-item"
>
059.
<a
class
=
"nav-link "
id =
"nav-admin-custom"
data-bs-toggle=
"modal"
data-bs-target=
"#AddTempate"
>อัปโหลดเกียรติบัตร</a>
060.
</li>
061.
<li
class
=
"nav-item"
>
062.
<a
class
=
"nav-link"
id =
"nav-admin-custom"
href=
"admin.php"
>กลับสู่หน้าหลัก</a>
063.
</li>
064.
</ul>
065.
</div>
066.
</div>
067.
068.
<div
class
=
"card-body"
>
069.
<table id=
"adminloaduser"
class
=
"table table-bordered nowrap"
style=
"width:100%"
>
070.
<thead
class
=
"table-light"
>
071.
<tr>
072.
<th>ชื่อ-นามสกุล</th>
073.
<th>เลขที่เกียรติบัตร</th>
074.
<th>ดำเนินการ</th>
075.
</tr>
076.
</thead>
077.
<tbody>
078.
<tr>
079.
<td> </td>
080.
<td> </td>
081.
<td> </td>
082.
</tr>
083.
</tbody>
084.
</table>
085.
</div>
086.
</div>
087.
</div>
088.
</div>
089.
090.
<!-- Modal Upload Excel -->
091.
<div
class
=
"modal fade"
id=
"AddCSV"
tabindex=
"-1"
>
092.
<div
class
=
"modal-dialog "
>
093.
<div
class
=
"modal-content "
>
094.
<div
class
=
"modal-header"
>
095.
<h5> นำเข้ารายชื่อ </h5>
096.
<button type=
"button"
class
=
"btn-close"
data-bs-dismiss=
"modal"
aria-label=
"Close"
></button>
097.
</div>
098.
<div
class
=
"modal-body"
>
099.
<form action=
".php"
method=
"post"
>
100.
101.
<div
class
=
"mb-3"
>
102.
<label
class
=
"form-label"
for
=
"name"
>กรุณาอัปโหลดไฟล์ .csv (UTF-8 คั่นด้วยจุลภาค) เท่านั้น</label>
103.
<input
class
=
"form-control"
type=
"file"
name=
"csv"
placeholder=
"โครงการ/กิจกรรม"
required>
104.
</div>
105.
106.
<label
class
=
"form-label pe-3"
for
=
"name"
>ตัวอย่างไฟล์ </label>
107.
<a
class
=
"text-success"
href=
"file/example.csv"
> <i
class
=
"fas fa-file-excel"
></i> exsample.csv </a>
108.
109.
<div
class
=
"text-center mt-3"
>
110.
<button
class
=
"btn btn-primary"
type=
"submit"
name=
"submit"
class
=
"btn"
> <i
class
=
"fas fa-file-import"
></i> นำเข้า</button>
111.
</div>
112.
</form>
113.
</div>
114.
</div>
115.
</div>
116.
</div>
117.
</div>
118.
119.
120.
<!-- Modal Upload Tempate -->
121.
<div
class
=
"modal fade"
id=
"AddTempate"
tabindex=
"-1"
>
122.
<div
class
=
"modal-dialog "
>
123.
<div
class
=
"modal-content "
>
124.
<div
class
=
"modal-header"
>
125.
<h5> นำเข้าเกียรติบัตร </h5>
126.
<button type=
"button"
class
=
"btn-close"
data-bs-dismiss=
"modal"
aria-label=
"Close"
></button>
127.
</div>
128.
<div
class
=
"modal-body"
>
129.
130.
<form action=
"admineditpj_upimg.php"
method=
"post"
enctype=
"multipart/form-data"
>
131.
132.
<div
class
=
"mb-3"
>
133.
<label
class
=
"form-label"
for
=
"tempate"
>กรุณาอัปโหลดไฟล์ .jpg .png เท่านั้น</label>
134.
<input
class
=
"form-control"
type=
"file"
name=
"upload"
required>
135.
</div>
136.
137.
<label
class
=
"form-label"
for
=
"name"
>รูปแบบ : </label>
138.
139.
<input type=
"hidden"
id= >
140.
<div
class
=
"text-center mt-3"
>
141.
<button
class
=
"btn btn-primary"
type=
"submit"
name=
"submit"
class
=
"btn"
> <i
class
=
"fas fa-file-import"
></i> นำเข้า</button>
142.
</div>
143.
</form>
144.
145.
</div>
146.
</div>
147.
</div>
148.
</div>
149.
</div>
150.
151.
152.
153.
<!--- Footer --->
154.
<?php
require
(
'structure/footer.php'
); ?>
155.
156.
<!-- Script -->
157.
<?php
require
(
'structure/script.php'
); ?>
158.
159.
<!-- Script DataTable - LoadProjectAdmin-->
160.
<script>
161.
$(document).ready(
function
() {
162.
var
table = $(
'#adminloaduser'
).DataTable( {
163.
"processing"
: true,
164.
"serverSide"
: true,
165.
"ajax"
:
"admineditpj_loaduser.php?id=<?php echo (isset($_GET['id']) ? $_GET['id'] : ''); ?>"
,
166.
"language"
: {
167.
"emptyTable"
:
"ไม่มีข้อมูลในตาราง"
,
168.
"info"
:
"แสดง _START_ ถึง _END_ จาก _TOTAL_ แถว"
,
169.
"infoEmpty"
:
"แสดง 0 ถึง 0 จาก 0 แถว"
,
170.
"infoFiltered"
:
"(กรองข้อมูล _MAX_ ทุกแถว)"
,
171.
"infoThousands"
:
","
,
172.
"lengthMenu"
:
"แสดง _MENU_ แถว"
,
173.
"loadingRecords"
:
"กำลังโหลดข้อมูล..."
,
174.
"processing"
:
"กำลังดำเนินการ..."
,
175.
"search"
:
"ค้นหา: "
,
176.
"zeroRecords"
:
"ไม่พบข้อมูล"
,
177.
"paginate"
: {
178.
"first"
:
"หน้าแรก"
,
179.
"previous"
:
"ก่อนหน้า"
,
180.
"next"
:
"ถัดไป"
,
181.
"last"
:
"หน้าสุดท้าย"
182.
},
183.
"aria"
: {
184.
"sortAscending"
:
": เปิดใช้งานการเรียงข้อมูลจากน้อยไปมาก"
,
185.
"sortDescending"
:
": เปิดใช้งานการเรียงข้อมูลจากมากไปน้อย"
186.
},
187.
"autoFill"
: {
188.
"cancel"
:
"ยกเลิก"
,
189.
"fill"
:
"กรอกทุกช่องด้วย"
,
190.
"fillHorizontal"
:
"กรอกตามแนวนอน"
,
191.
"fillVertical"
:
"กรอกตามแนวตั้ง"
,
192.
"info"
:
"ข้อมูลเพิ่มเติม"
193.
},
194.
"buttons"
: {
195.
"collection"
:
"ชุดข้อมูล"
,
196.
"colvis"
:
"การมองเห็นคอลัมน์"
,
197.
"colvisRestore"
:
"เรียกคืนการมองเห็น"
,
198.
"copy"
:
"คัดลอก"
,
199.
"copyKeys"
:
"กดปุ่ม Ctrl หรือ Command + C เพื่อคัดลอกข้อมูลบนตารางไปยัง Clipboard ที่เครื่องของคุณ"
200.
}
201.
},
202.
"order"
: [[ 0,
"desc"
]],
203.
"columns"
: [
204.
{
"width"
:
"50%"
},
205.
{
"width"
:
"40%"
},
206.
{
"width"
:
"10%"
}
207.
],
208.
responsive: true
209.
} );
210.
new
$.fn.dataTable.FixedHeader( table );
211.
} );
212.
213.
</script>
214.
215.
216.
</body>
217.
</html>