001.
<!-- start data table -->
002.
<table
class
=
"table table-bordered table-striped"
>
003.
<thead>
004.
<tr>
005.
<th></th>
006.
<th>เรื่อง</th>
007.
<th>จังหวัดที่เกิดเหตุการณ์</th>
008.
<th>วันที่เกิดเรื่อง</th>
009.
<th>วันที่แจ้งเรื่อง</th>
010.
<th>ผู้แจ้ง </th>
011.
<th>ผู้บันทึก</th>
012.
<th>สถานะ</th>
013.
<th>ปัญหาที่เกี่ยวข้อง</th>
014.
015.
</tr>
016.
</thead>
017.
<tbody id=
"myTable"
>
018.
<?php
019.
while
(
$result
=mysqli_fetch_array(
$query
,MYSQLI_ASSOC))
020.
{
021.
022.
if
(
$curentDate
=
date
(
'Y-m-d H:i:s'
) <
$deathLine
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
'+24 hour'
,
strtotime
(
$result
[
"INSERT_DATETIME"
]))))
023.
{
024.
echo
"<tr>"
;
025.
echo
"<td><img src='image/green-button.jpg' width='30px' title ='สถานะ : เรื่องมาใหม่' height ='30px'></td>"
;
026.
echo
"<td><a href='editevent.php?UID="
.
$_GET
[
"UID"
].
"&S="
.
$_GET
[
"S"
].
"&EventID="
.
$result
[
"USER_ID"
].
"&EVID="
.
$result
[
"INSERT_DATETIME"
].
"' class='edit' title='Edit' data-toggle='tooltip'>"
.
$result
[
"EVENT_NAME"
].
"</a><img src="
.
$result
[
"EVENT_STATUS_IMAGE"
].
"></td>"
;
027.
echo
"<td>"
.
$result
[
"EVENT_PROVINCE"
].
"</td>"
;
028.
echo
"<td >"
.thai_dateshort(
strtotime
(
$result
[
"EVENT_DATETIME"
])).
"</td>"
;
029.
echo
"<td >"
.thai_dateshort(
strtotime
(
$result
[
"test"
])).
"</td>"
;
030.
echo
"<td>"
.
$result
[
"PERS_FIRSTNAME"
].
"</td>"
;
031.
echo
"<td>"
.
$result
[
"USER_FIRSTNAME"
].
"</td>"
;
032.
echo
"<td >"
.
$result
[
"EVENT_STATUS_NAME"
].
"</td>"
;
033.
echo
"<td><input type='button' name='view' value='view' data-id='"
.
$result
[
"INSERT_DATETIME"
].
"'class='btn btn-info btn-xs view_data' data-toggle='modal' data-target='#issue'/></td>"
;
034.
035.
036.
echo
"</tr>"
;
037.
038.
039.
}
040.
else
041.
{
042.
echo
"<tr>"
;
043.
echo
"<td><img src='image/red-button.jpg' width='30px' title ='สถานะ : เกิน 24 ชม.' height ='30px'></td>"
;
044.
echo
"<td><a href='editevent.php?UID="
.
$_GET
[
"UID"
].
"&S="
.
$_GET
[
"S"
].
"&EventID="
.
$result
[
"USER_ID"
].
"&EVID="
.
$result
[
"INSERT_DATETIME"
].
"' class='edit' title='Edit' data-toggle='tooltip'>"
.
$result
[
"EVENT_NAME"
].
"</a><img src="
.
$result
[
"EVENT_STATUS_IMAGE"
].
"></td>"
;
045.
echo
"<td>"
.
$result
[
"EVENT_PROVINCE"
].
"</td>"
;
046.
echo
"<td >"
.thai_dateshort(
strtotime
(
$result
[
"EVENT_DATETIME"
])).
"</td>"
;
047.
echo
"<td >"
.thai_dateshort(
strtotime
(
$result
[
"test"
])).
"</td>"
;
048.
echo
"<td>"
.
$result
[
"PERS_FIRSTNAME"
].
"</td>"
;
049.
echo
"<td>"
.
$result
[
"USER_FIRSTNAME"
].
"</td>"
;
050.
echo
"<td >"
.
$result
[
"EVENT_STATUS_NAME"
].
"</td>"
;
051.
echo
"<td><input type='button' name='view' value='view' data-id='"
.
$result
[
"INSERT_DATETIME"
].
"'class='btn btn-info btn-xs view_data' data-toggle='modal' data-target='#issue'/></td>"
;
052.
053.
054.
echo
"</tr>"
;
055.
}
056.
$dateid
=
$result
[
"INSERT_DATETIME"
];
057.
}
058.
?>
059.
</tbody>
060.
</table>
061.
<!--
End
data table -->
062.
</div>
063.
064.
<!-- start Modal issue -->
065.
<div
class
=
"modal fade"
id=
"issue"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"exampleModalLabel"
aria-hidden=
"true"
>
066.
<div
class
=
"modal-dialog"
role=
"document"
>
067.
<div
class
=
"modal-content"
>
068.
<div
class
=
"modal-header"
>
069.
<h5
class
=
"modal-title"
id=
"exampleModalLabel"
><font color=
"#383838"
>ปัญหาที่เกี่ยวข้อง</font></h5>
070.
<button type=
"button"
class
=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
>
071.
<span aria-hidden=
"true"
>×</span>
072.
</button>
073.
</div>
074.
<div
class
=
"modal-body"
id=
"viewissue"
>
075.
076.
<?php
077.
078.
$SQLis
= "SELECT
079.
es.ISSUE_ID,
080.
s.ISSUE_NAME,
081.
es.USER_ID,
082.
es.INSERT_DATETIME,
083.
estatus.EVENT_STATUS_ID,
084.
es.EVENT_STATUS_ID,
085.
estatus.EVENT_STATUS_NAME
086.
087.
FROM tbl_event_issue
as
es
088.
089.
inner join tbl_event_status
as
estatus on estatus.EVENT_STATUS_ID = es.EVENT_STATUS_ID
090.
inner join tbl_issue
as
s on es.issue_id = s.issue_id
091.
092.
WHERE (es.INSERT_DATETIME =
'{$dateid}'
) AND
093.
(es.issue_id = s.issue_id) AND
094.
(estatus.EVENT_STATUS_ID = es.EVENT_STATUS_ID)
095.
096.
ORDER BY es.USER_ID";
097.
098.
$queryis
= mysqli_query(
$con
,
$SQLis
);
099.
100.
$SQLStatus
=
"SELECT * FROM tbl_event_status"
;
101.
$QueryStatus
= mysqli_query(
$con
,
$SQLStatus
);
102.
103.
echo
"<table class='table table-bordered table-striped'>"
;
104.
echo
"<thead>"
;
105.
echo
"<tr>"
;
106.
echo
"<th>ปัญหา</th>"
;
107.
echo
"<th>สถานะ</th>"
;
108.
echo
"</tr>"
;
109.
echo
"</thead>"
;
110.
echo
"<tbody>"
;
111.
112.
while
(
$resultis
=mysqli_fetch_array(
$queryis
,MYSQLI_ASSOC))
113.
{
114.
115.
echo
"<tr>"
;
116.
echo
"<td >"
.
$resultis
[
"ISSUE_NAME"
].
"</td>"
;
117.
118.
echo
"<td ><select name='status' class='form-control'>"
;
119.
echo
"<option selected value='"
.
$resultis
['EVENT_STATUS_ID
'].">".$resultis['
EVENT_STATUS_NAME'].
"</option>"
;
120.
121.
while
(
$result1
=mysqli_fetch_array(
$QueryStatus
,MYSQLI_ASSOC))
122.
{
123.
echo
"<option value='"
.
$result1
['EVENT_STATUS_ID
'].">".$result1['
EVENT_STATUS_NAME'].
"</option>"
;
124.
125.
}
126.
echo
"</select></td>"
;
127.
echo
"</tr>"
;
128.
}
129.
130.
131.
echo
"</tbody>"
;
132.
echo
"</table>"
;
133.
?>
134.
</div>
135.
<div
class
=
"modal-footer"
>
136.
<button type=
"button"
class
=
"btn btn-secondary"
data-dismiss=
"modal"
>ปิด</button>
137.
</div>
138.
</div>
139.
</div>
140.
</div>
141.
142.
<!--
End
Modal issue -->