001.
<?php
002.
session_start();
003.
if
(!isset(
$_SESSION
[
'UserID'
]) || (
$_SESSION
[
'Status'
] !=
"ADMIN"
)) {
004.
header(
"Location: index.php"
);
005.
exit
;
006.
}
007.
008.
$local_id
= null;
009.
if
(isset(
$_GET
[
"local_id"
]))
010.
{
011.
$local_id
=
$_GET
[
"local_id"
];
012.
}
013.
014.
if
(
empty
(
$_REQUEST
[
'local_id'
])){
echo
"<script>history.back();</script>"
;
exit
;}
015.
$id
=
$_REQUEST
[
'local_id'
];
016.
017.
include
"../config/config.php"
;
018.
019.
$results
=
$mysqli
->query(
"SELECT * FROM member WHERE UserID = '"
.
$_SESSION
['UserID
']."'
");
020.
021.
022.
$row
=
$results
->fetch_array();
023.
?>
024.
<html>
025.
<head>
026.
<title>ThaiCreate.Com Tutorial</title>
027.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
>
028.
<link href=
"//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"
rel=
"stylesheet"
>
029.
<link href=
"../dist/css/ripples.min.css"
rel=
"stylesheet"
>
030.
<link href=
"../dist/css/material-wfont.min.css"
rel=
"stylesheet"
>
031.
<link href=
"//fezvrasta.github.io/snackbarjs/dist/snackbar.min.css"
rel=
"stylesheet"
>
032.
<meta name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
033.
<title>บัญชาแวนทัวร์</title>
034.
<script type=
"text/javascript"
src=
"../ckeditor/ckeditor.js"
></script>
036.
<script src=
"../javascript/jquery.carousel.js"
type=
"text/javascript"
></script>
037.
<link href=
"../stylesheets/jquery.carousel.css"
rel=
"stylesheet"
type=
"text/css"
/>
038.
039.
</head>
040.
041.
<body leftmargin=
"0"
topmargin=
"0"
marginwidth=
"0"
marginheight=
"0"
>
042.
<div
class
=
"container"
>
043.
044.
045.
<div
class
=
"navbar navbar-default"
>
046.
<img src=
"../img/h.png"
width=
"100%"
>
047.
<button type=
"button"
class
=
"navbar-toggle"
data-toggle=
"collapse"
data-target=
".navbar-responsive-collapse"
>
048.
<span
class
=
"icon-bar"
></span>
049.
<span
class
=
"icon-bar"
></span>
050.
<span
class
=
"icon-bar"
></span>
051.
</button>
052.
<div
class
=
"navbar-collapse collapse navbar-responsive-collapse"
>
053.
<ul
class
=
"nav navbar-nav"
>
054.
<li
class
=
"active"
><a href=
"index.php"
>หน้าแรก</a></li>
055.
<li><a data-toggle=
"modal"
data-target=
"#myModal"
>โปรแกรมทัวร์</a></li>
056.
<li
class
=
"dropdown"
>
057.
<a href=
"bootstrap-elements.html"
data-target=
"#"
class
=
"dropdown-toggle"
data-toggle=
"dropdown"
>คู่มือ<b
class
=
"caret"
></b></a>
058.
<ul
class
=
"dropdown-menu"
>
059.
<li><a href=
"javascript:void(0)"
>จองทัวร์</a></li>
060.
<li><a href=
"local.php"
>สถานที่</a></li>
061.
<li><a href=
"payment.php"
>ชำระเงิน</a></li>
062.
</ul>
063.
</li>
064.
</ul>
065.
<form
class
=
"navbar-form navbar-left"
>
066.
<input type=
"text"
class
=
"form-control col-lg-8"
placeholder=
"Search"
>
067.
</form>
068.
<ul
class
=
"nav navbar-nav navbar-right"
>
069.
<li><a href=
"index.php?To=member&Do=register"
>สมัครสมาชิก</a></li>
070.
</ul>
071.
</div>
072.
</div><!--
End
Float-->
073.
074.
<div
class
=
"panel panel-default"
>
075.
<div
class
=
"panel-body"
>
076.
<?php
077.
$sql
=
$mysqli
->query(
"SELECT * FROM news WHERE local_id='"
.
$local_id
.
"' "
);
078.
$result
=mysqli_fetch_array(
$sql
,MYSQLI_ASSOC);
079.
?>
080.
<form name=
"form1"
class
=
"form-horizontal"
method=
"post"
action=
"save.php"
onSubmit=
"JavaScript:return fncSubmit();"
>
081.
<fieldset>
082.
<legend>เพิ่มข้อมูลรูปภาพ</legend>
083.
084.
วันนี้ :
085.
<?php
function
DateThai(
$strDate
)
086.
{
087.
$strYear
=
date
(
"Y"
,
strtotime
(
$strDate
))+543;
088.
$strMonth
=
date
(
"n"
,
strtotime
(
$strDate
));
089.
$strDay
=
date
(
"d"
,
strtotime
(
$strDate
));
090.
$strMonthCut
= Array(
""
,
"มกราคม"
,
"กุมภาพันธ์"
,
"มีนาคม"
,
"เมษายน"
,
"พฤษภาคม"
,
"มิถุนายน"
,
"กรกฏาคม"
,
"สิงหาคม"
,
"กันยายน"
,
"ตุลาคม"
,
"พฤสจิกายน"
,
"ธันวาคม"
);
091.
$strMonthThai
=
$strMonthCut
[
$strMonth
];
092.
return
"$strDay $strMonthThai $strYear"
;
093.
}
094.
$strDate
=
date
(
"Y-n-d H:i:s"
);
095.
echo
DateThai(
$strDate
);
096.
$ThaiMonth
=
array
(
"มกราคม"
,
"กุมภาพันธ์"
,
"มีนาคม"
,
"เมษายน"
,
"พฤษภาคม"
,
"มิถุนายน"
,
"กรกฎาคม"
,
"สิงหาคม"
,
"กันยายน"
,
"ตุลาคม"
,
"พฤษจิกายน"
,
"ธันวาคม"
);
097.
098.
099.
100.
?>
101.
102.
<br/>
103.
<div
class
=
"form-group"
>
104.
<label
for
=
"inputEmail"
class
=
"col-lg-2 control-label"
>หัวข้อ</label>
105.
<div
class
=
"col-lg-6"
>
106.
ID <?php
echo
$result
[
"local_id"
];?>
107.
<input type=
"text"
name=
"local_name"
class
=
"form-control"
id=
"inputEmail"
value=
"<?php echo $result["
local_name
"];?>"
placeholder=
"หัวข้อข่าว"
>
108.
</div>
109.
</div>
110.
<div
class
=
"form-group"
>
111.
<label
for
=
"select"
class
=
"col-lg-2 control-label"
>รูปแบบแสดงผล</label>
112.
<div
class
=
"col-lg-6"
>
113.
<select
class
=
"form-control"
name=
"Status"
id=
"select"
>
114.
<option name=
"Status"
value=
"0"
>ไม่แสดงหน้าแรก</option>
115.
<option name=
"Status"
value=
"1"
>แสดงหน้าแรก</option>
116.
</select>
117.
</div>
118.
</div>
119.
<div
class
=
"form-group"
>
120.
<label
for
=
"textArea"
class
=
"col-lg-2 control-label"
>รายละเอียด</label>
121.
<div
class
=
"col-lg-6"
>
122.
<textarea cols=
"100%"
id=
"ckeditor"
class
=
"ckeditor"
name=
"local_detail"
rows=
"11"
><?php
echo
$result
[
"local_detail"
];?></textarea>
123.
<!--textarea cols=
"100%"
id=
"editor1"
class
=
"form-control"
name=
"local_detail"
rows=
"11"
></textarea-->
124.
125.
<script type=
"text/javascript"
>
126.
127.
CKEDITOR.replace(
'editor1'
, {
128.
skin :
'moono'
,
129.
height : 200,
130.
width : 500,
131.
toolbar:
132.
[ [
'Bold'
,
'Italic'
,
'Underline'
,
'-'
,
'Subscript'
,
'Superscript'
,
'-'
,
133.
'NumberedList'
,
'BulletedList'
,
'-'
,
'Link'
,
'Unlink'
],
134.
[
'Outdent'
,
'Indent'
,
'-'
,
'JustifyCenter'
,
'JustifyRight'
,
'JustifyBlock'
],
135.
'/'
,
136.
[
'Image'
,
'Flash'
,
'Smiley'
,
'-'
,
'Table'
,
'HorizontalRule'
,
'SpecialChar'
] ]
137.
});
138.
</script>
139.
<span
class
=
"help-block"
>รายละเอียดของข่าว</span>
140.
</div>
141.
</div>
142.
<div
class
=
"form-group"
>
143.
<label
for
=
"inputEmail"
class
=
"col-lg-2 control-label"
>ลิงค์</label>
144.
<div
class
=
"col-lg-6"
>
145.
<input type=
"text"
name=
"local_link"
value=
"<?php echo $result["
local_link
"];?>"
class
=
"form-control"
id=
"inputEmail"
placeholder=
"ลิงค์เชื่อมโยงเนื้อหา"
>
146.
</div>
147.
</div>
148.
<a href=
"admin_page.php"
class
=
"btn btn-danger btn-raised"
>ยกเลิก</a>
149.
<input name=
"btnSubmit"
class
=
"btn btn-success btn-raised"
type=
"submit"
value=
"บันทึก"
>
150.
</fieldset>
151.
</form>
152.
</div><!-- panel-body -->
153.
</div><!--
End
Container-->
154.
155.
156.
157.
<!-- Modal -->
158.
<div
class
=
"modal fade"
id=
"myModal"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
159.
<div
class
=
"modal-dialog"
>
160.
<div
class
=
"modal-content"
>
161.
<div
class
=
"modal-header"
>
162.
<button type=
"button"
class
=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span aria-hidden=
"true"
>×</span></button>
163.
<h4
class
=
"modal-title"
id=
"myModalLabel"
>โปรแกรมทัวร์</h4>
164.
</div>
165.
<div
class
=
"modal-body"
>
166.
...
167.
</div>
168.
<div
class
=
"modal-footer"
>
169.
<button type=
"button"
class
=
"btn btn-danger"
data-dismiss=
"modal"
>ปิด</button>
170.
<!--button type=
"button"
class
=
"btn btn-primary"
>Save changes</button-->
171.
</div>
172.
</div>
173.
</div>
174.
</div>
175.
<script type=
"text/javascript"
>
176.
$(
function
(){
177.
$(
'.carousel'
).carousel();
178.
});
179.
</script>
180.
<script src=
"//code.jquery.com/jquery-1.10.2.min.js"
></script>
181.
<script src=
"//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"
></script>
182.
<script>
183.
(
function
(){
184.
185.
var
$button
= $(
"<div id='source-button' class='btn btn-primary btn-xs'>< ></div>"
).click(
function
(){
186.
var
index = $(
'.bs-component'
).index( $(this).parent() );
187.
$.get(window.location.href,
function
(data){
188.
var
html = $(data).find(
'.bs-component'
).eq(index).html();
189.
html = cleanSource(html);
190.
$(
"#source-modal pre"
).text(html);
191.
$(
"#source-modal"
).modal();
192.
})
193.
194.
});
195.
196.
$(
'.bs-component [data-toggle="popover"]'
).popover();
197.
$(
'.bs-component [data-toggle="tooltip"]'
).tooltip();
198.
199.
$(
".bs-component"
).hover(
function
(){
200.
$(this).append(
$button
);
201.
$button
.show();
202.
},
function
(){
203.
$button
.hide();
204.
});
205.
206.
function
cleanSource(html) {
207.
var
lines = html.split(/\n/);
208.
209.
lines.shift();
210.
lines.splice(-1, 1);
211.
212.
var
indentSize = lines[0].length - lines[0].trim().length,
213.
re =
new
RegExp(
" {"
+ indentSize +
"}"
);
214.
215.
lines = lines.map(
function
(line){
216.
if
(line.match(re)) {
217.
line = line.substring(indentSize);
218.
}
219.
220.
return
line;
221.
});
222.
223.
lines = lines.join(
"\n"
);
224.
225.
return
lines;
226.
}
227.
228.
$(
".icons-material .icon"
).each(
function
() {
229.
$(this).after(
"<br><br><code>"
+ $(this).attr(
"class"
).replace(
"icon "
,
""
) +
"</code>"
);
230.
});
231.
232.
})();
233.
234.
</script>
235.
<script src=
"../dist/js/ripples.min.js"
></script>
236.
<script src=
"../dist/js/material.min.js"
></script>
237.
<script src=
"//fezvrasta.github.io/snackbarjs/dist/snackbar.min.js"
></script>
238.
239.
240.
<script src=
"//cdnjs.cloudflare.com/ajax/libs/noUiSlider/6.2.0/jquery.nouislider.min.js"
></script>
241.
<script>
242.
$(
function
() {
243.
$.material.init();
244.
$(
".shor"
).noUiSlider({
245.
start: 40,
246.
connect:
"lower"
,
247.
range: {
248.
min: 0,
249.
max: 100
250.
}
251.
});
252.
253.
$(
".svert"
).noUiSlider({
254.
orientation:
"vertical"
,
255.
start: 40,
256.
connect:
"lower"
,
257.
range: {
258.
min: 0,
259.
max: 100
260.
}
261.
});
262.
});
263.
</script>
264.
<script src=
"../config/addedcheck.js"
type=
"text/javascript"
></script>
265.
</body>
266.
</html>