001.
<?php ob_start(); ?>
002.
<?php
003.
require
(
'connect.php'
);
004.
session_start();
005.
if
(
$_SESSION
[
'User_id'
] ==
""
) {
006.
header(
"Content-type: text/html; charset=utf-8"
);
007.
echo
"<script language='JavaScript' >"
;
008.
echo
"alert('กรุณากรอกข้อมูลเพื่อเข้าสู่ระบบ');"
;
009.
echo
"</script>"
;
010.
echo
"<meta http-equiv='refresh' content='0;url=index.php' />"
;
011.
exit
();
012.
}
013.
if
(
$_SESSION
[
'Usertype_id'
] !=
"1"
) {
014.
015.
echo
"<meta http-equiv='refresh' content='0;url=logout.php'>"
;
016.
exit
();
017.
}
018.
$strSQL
=
"SELECT * FROM tb_user WHERE User_id = '"
.
$_SESSION
['User_id
'] . "'
";
019.
$objQuery
= mysql_query(
$strSQL
);
020.
$objResult
= mysql_fetch_array(
$objQuery
);
021.
?>
022.
<!DOCTYPE html>
023.
<html>
024.
<head>
025.
<meta http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
026.
<meta name=
"description"
content=
""
>
027.
<meta name=
"author"
content=
""
>
028.
<link rel=
"stylesheet"
href=
"bootstrap/css/footer.css"
>
029.
<link rel=
"stylesheet"
href=
"bootstrap/css/base.css"
>
030.
<link rel=
"stylesheet"
href=
"bootstrap/css/skeleton.css"
>
031.
<link rel=
"stylesheet"
href=
"bootstrap/css/layout.css"
>
032.
<meta name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
033.
<link href=
"bootstrap/css/bootstrap.css"
rel=
"stylesheet"
/>
034.
<link type
"text/css"
rel=
"Stylesheet"
href=
"bootstrap/css/bootstrap.css"
/>
035.
<meta charset=
"UTF-8"
>
036.
<div
class
=
"container"
>
037.
<title>Help Desk Management</title>
038.
</head>
039.
<style type=
"text/css"
>
040.
div#mylayout_1{
041.
display:block;
042.
width:300px;
043.
044.
045.
word-wrap:
break
-word;
046.
}
047.
</style>
048.
<body>
049.
<div
class
=
"row clearfix"
>
050.
<div
class
=
"col-md-12 column"
>
051.
</div>
052.
</div>
053.
<div
class
=
"row clearfix"
>
054.
<div
class
=
"col-md-12 column"
>
055.
</div>
056.
</div>
057.
<div
class
=
"row clearfix"
>
058.
<div
class
=
"col-md-12 column"
>
059.
</div>
060.
</div>
061.
<div
class
=
"col-md-12 column"
>
062.
<h3></h3>
063.
</div>
064.
<div
class
=
"container"
>
065.
<div
class
=
"row clearfix"
>
066.
<div
class
=
"col-md-12 column"
>
067.
<div
class
=
"panel-title"
>
068.
<h1><a href=
"helpdesk_add.php"
><img src=
"img/branner.png"
title=
"Open Ticket Click Here"
width=
"533"
height=
"115"
></a></h1>
069.
</div>
070.
<?php
include
(
"navbartop.php"
); ?>
071.
<form name=
"frmSearch"
method=
"GET"
action=
"<?=$_SERVER['SCRIPT_NAME'];?>"
>
072.
<?php
073.
$strSQL
= " SELECT * FROM tb_gadget,tb_priority,tb_issue,tb_status
074.
where
075.
tb_gadget.Gadget_id
076.
AND
077.
tb_gadget.priority_tb = tb_priority.priority_id
078.
AND
079.
tb_gadget.issue_tb = tb_issue.issue_id
080.
AND
081.
tb_gadget.status_tb = tb_status.status_id";
082.
if
(isset(
$_GET
[
'ddlSelect'
])!=
""
and
$_GET
[
"txtKeyword"
] !=
''
)
083.
{
084.
$strSQL
.=
" AND ("
.
$_GET
[
"ddlSelect"
].
" LIKE '%"
.
$_GET
[
"txtKeyword"
].
"%' ) "
;
085.
}
086.
$objQuery
= mysql_query(
$strSQL
.=
" ORDER BY Gadget_id DESC"
)
or
die
(
"Error Query ["
.
$strSQL
.
"]"
);
087.
?>
088.
<?php
089.
require
(
'connect.php'
);
090.
$strSQL
= " SELECT * FROM tb_gadget,tb_priority,tb_issue,tb_status
091.
where
092.
tb_gadget.Gadget_id
093.
AND
094.
tb_gadget.priority_tb = tb_priority.priority_id
095.
AND
096.
tb_gadget.issue_tb = tb_issue.issue_id
097.
AND
098.
tb_gadget.status_tb = tb_status.status_id";
099.
$objQuery
= mysql_query(
$strSQL
)
or
die
(
"Error Query ["
.
$strSQL
.
"]"
);
100.
$Num_Rows
= mysql_num_rows(
$objQuery
);
101.
102.
$Per_Page
= 2;
103.
104.
$Page
= isset(
$_GET
[
'Page'
]) ?
$_GET
[
'Page'
] : 1;
105.
106.
$Prev_Page
=
$Page
-1;
107.
$Next_Page
=
$Page
+1;
108.
109.
$Page_Start
= ((
$Per_Page
*
$Page
)-
$Per_Page
);
110.
if
(
$Num_Rows
<=
$Per_Page
)
111.
{
112.
$Num_Pages
=1;
113.
}
114.
else
if
((
$Num_Rows
%
$Per_Page
)==0)
115.
{
116.
$Num_Pages
=(
$Num_Rows
/
$Per_Page
) ;
117.
}
118.
else
119.
{
120.
$Num_Pages
=(
$Num_Rows
/
$Per_Page
)+1;
121.
$Num_Pages
= (int)
$Num_Pages
;
122.
}
123.
124.
$strSQL
.=
" order by Gadget_id DESC LIMIT $Page_Start , $Per_Page"
;
125.
$objQuery
= mysql_query(
$strSQL
);
126.
?>
127.
<table width=
"Auto"
border=
"1"
>
128.
<tr>
129.
<th height=
"50"
> <span
class
=
"col-sm-0"
> </span>
130.
<span
class
=
"col-sm-3"
>
131.
<select style=
"color:#3399FF"
class
=
"form-control"
name=
"ddlSelect"
id=
"ddlSelect"
title=
"Click Select Item"
>
132.
<option value=
"Gadget_id"
<?
if
(
$_GET
[
"ddlSelect"
]==
"Gadget_id"
){
echo
"selected"
;}?>TICKET_ID</option>
133.
<option value=
"ticket_date"
<?
if
(
$_GET
[
"ddlSelect"
]==
"ticket_date"
){
echo
"selected"
;}?>TICKET_DATE</option>
134.
<option value=
"department_users"
<?
if
(
$_GET
[
"ddlSelect"
]==
"department_users"
){
echo
"selected"
;}?>DEPARTMENT</option>
135.
<option value=
"priority_type"
<?
if
(
$_GET
[
"ddlSelect"
]==
"priority_type"
){
echo
"selected"
;}?>PRIORITY</option>
136.
<option value=
"issue_type"
<?
if
(
$_GET
[
"ddlSelect"
]==
"issue_type"
){
echo
"selected"
;}?>ISSUE</option>
137.
<option value=
"name_user"
<?
if
(
$_GET
[
"ddlSelect"
]==
"name_user"
){
echo
"selected"
;}?>NAME</option>
138.
</select>
139.
</span><span
class
=
"col-sm-3"
>
140.
<input style=
"color:#3399FF"
name=
"txtKeyword"
type=
"text"
placeholder=
"Search"
id=
"txtKeyword"
onFocus=
"this.value = ''"
title=
"Please Fill Search Message"
>
141.
</span><span
class
=
"col-sm-1"
>
142.
<button type=
"submit"
title=
"Click Search"
class
=
"btn btn-primary"
><span
class
=
"glyphicon glyphicon-search"
>Search</span> </button>
143.
</span></th>
144.
</tr>
145.
</table>
146.
<table width=
"140%"
class
=
"table table-hover"
>
147.
<span
class
=
"label label-default"
title=
"ยังไม่กำหนด"
>Undefined</span>
148.
<span
class
=
"label label-info"
title=
"รอดำเนินการ"
>Waiting</span>
149.
<span
class
=
"label label-success"
title=
"กำลังดำเนินการ"
>On Process</span>
150.
<span
class
=
"label label-warning"
title=
"ปิดงานระหว่างกาล"
>Closed-Interim</span>
151.
<span
class
=
"label label-danger"
title=
"ปิดงานระยะยาว"
>Closed-Longterm</span>
152.
<span
class
=
"label label-primary"
title=
"ส่งไปยังผู้จัดจำหน่าย"
>Sent To Supplier</span>
153.
<thead>
154.
<th width=
"9%"
><div align=
"center"
><strong>Ticket ID</strong></div></th>
155.
<th width=
"5%"
><div align=
"center"
><strong>
DATE
</strong></div></th>
156.
<th width=
"9%"
><div align=
"center"
><strong>PRIORITY</strong></div></th>
157.
<th width=
"9%"
align=
"center"
><div align=
"center"
><strong>ISSUE</strong></div></th>
158.
<th width=
"28%"
><div align=
"center"
><strong>QUESTION</strong></div></th>
159.
<th width=
"9%"
><div align=
"center"
><strong>DEPARTMENT</strong></div></th>
160.
<th width=
"10%"
><div align=
"center"
><strong>NAME</strong></div></th>
161.
<th width=
"7%"
align=
"center"
><div align=
"center"
><strong>STATUS</strong></div></th>
162.
<th width=
"9%"
align=
"center"
valign=
"middle"
><div align=
"center"
><strong>MANAGE</strong></div></th>
163.
</tr>
164.
</thead>
165.
<tbody>
166.
<?php
167.
while
(
$objResult
= mysql_fetch_array(
$objQuery
)) {
168.
?>
169.
<tr>
170.
<td height=
"42"
><span
class
=
"label <?php echo $objResult["
status_code
"];?>"
>T<?php
echo
$objResult
[
"ticket_date"
];?>.<?php
echo
$objResult
[
"Gadget_id"
]; ?></span></td>
171.
<td> <?php
echo
$objResult
[
"date_time"
]; ?></td>
172.
<td> <?php
echo
$objResult
[
"priority_type"
]; ?></td>
173.
<td> <?php
echo
$objResult
[
"issue_type"
]; ?></td>
174.
<td><div id=
"mylayout_1"
><?php
echo
$objResult
[
"user_question"
]; ?></div></td>
175.
<td><?php
echo
$objResult
[
"department_users"
]; ?></td>
176.
<td><?php
echo
$objResult
[
"name_user"
]; ?></td>
177.
<td><span
class
=
"label <?php echo $objResult["
status_code
"];?>"
> <?php
echo
$objResult
[
"status_type"
]; ?></td>
178.
<td><a href=
"helpdesk_view.php?view_id=<?php echo $objResult['Gadget_id']; ?>"
>
179.
<button type=
"button"
class
=
"btn btn btn-primary"
title=
"Open Ticket"
> <span
class
=
"glyphicon glyphicon-folder-open"
></span> </button>
180.
181.
<a href=
"helpdesk_edit.php?edit_id=<?php echo $objResult['Gadget_id'];?> "
>
182.
<button type=
"button"
class
=
"btn btn btn-info"
title=
"Manage Ticket"
> <span
class
=
"glyphicon glyphicon-cog"
></span> </button>
183.
</a></td>
184.
</tr>
185.
<?php
186.
}
187.
?>
188.
</table>
189.
190.
<br>
191.
Total <?php
echo
$Num_Rows
;?> Record : <?php
echo
$Num_Pages
;?> Page :
192.
<?php
193.
if
(
$Prev_Page
)
194.
{
195.
echo
" <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< Back</a> "
;
196.
}
197.
198.
for
(
$i
=1;
$i
<=
$Num_Pages
;
$i
++){
199.
if
(
$i
!=
$Page
)
200.
{
201.
echo
"[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]"
;
202.
}
203.
else
204.
{
205.
echo
"<b> $i </b>"
;
206.
}
207.
}
208.
if
(
$Page
!=
$Num_Pages
)
209.
{
210.
echo
" <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'>Next>></a> "
;
211.
}
212.
mysql_close(
$objConnect
);
213.
?>
214.
</tbody>
215.
</table>
216.
<meta http-equiv=
"refresh"
content=
"60;url=Mainpage.php"
>
217.
<?php
include
(
"footer.php"
); ?>
218.
<script src=
"bootstrap/js/jquery.js"
></script>
219.
<script src=
"bootstrap/js/bootstrap-datepicker.js"
></script>
220.
<script src=
"bootstrap/js/bootstrap.js"
></script>
221.
<script src=
"//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js"
></script>
222.
<script>window.jQuery || document.write(
"<script src='js/jquery-1.5.1.min.js'>\x3C/script>"
)</script>
223.
<script src=
"js/app.js"
></script>
224.
</body>
225.
</html>