1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
|
<?php import_request_variables('pG', 'p_'); //#5.3#//if($p_select!="") { $select=trim($p_select); } $select = isset($p_select) ? $p_select : '';
if($select!=""){ $sql="update cms_main_themes set status=0 where status=1"; $result=mysql_query($sql);
$sqlch="SELECT * FROM cms_main_themes WHERE id='$select'"; $re=mysql_query($sqlch); $d=mysql_num_rows($re); if($d==1){ $sql="update cms_main_themes set status='1' where id='$select'"; $result=mysql_query($sql); }else{ $sql="INSERT INTO `cms_main_themes` VALUES('$select', '#AFB98A', '1', 'f01.swf', 'f02.jpg', '#66CD00', '#c9d4e5', '#e9b4da', '#B0DE00', '#F8FCE2', '#C2DFCA', '#77a091', 'menu1', 'top_1.jpg', 'top_2.jpg', 'top_3.jpg', 1, 0, '#9cbbea', '#daff6a', '', '', '', '', 'marker.gif')"; $re=mysql_query($sql);
$sql="update cms_main_themes set status='1' where id='$select'"; $result=mysql_query($sql); } }
$sql="SELECT * FROM cms_main_themes WHERE status='1'"; $re=mysql_query($sql); $data=mysql_fetch_array($re); $_SESSION['themes_']="$data[id]"; // version_theme $_SESSION['title_color']="$data[title_color]"; // title_color $_SESSION['bg_body2']="$data[color1]"; // bg_body2
// table color $_SESSION["tb_bgcolor"]="$data[bg_textrun]"; // table bgcolor $_SESSION["tb_row_color1"]="$data[color]"; // table row bgcolor 1 for swap color $_SESSION["tb_row_color2"]="$data[color1]"; // table row bgcolor 2 for swap color $_SESSION["menu"]="$data[menu_ccs]"; // menu_css $_SESSION["tb_head_bgcolor"]="$data[bg_menu]"; $_SESSION['bg_textrun']="$data[bg_textrun]"; //กลาง $_SESSION['bg_header']="$data[heder_color]"; $_SESSION['bg_line']="$data[line_title_table]"; //เข้ม $_SESSION['bg_menu']="$data[bg_menu]"; //อ่อน
//สีตัวอักษร $_SESSION['bg_body1']="$data[color]"; // Font Color
//ขนาดความสูงของ Footer $_SESSION['herder_top_03']="$data[herder_top_03]"; //ขนาดความสูงของ Footer //menu font color $_SESSION["head_menu_color"] = $data['h_menu_color']; $_SESSION["sub_menu_color"] = $data['sub_menu_color'];
// font footer $_SESSION["footer_head"] = $data['footer_head']; $_SESSION["footer_sub"] = $data['footer_sub'];
// Image_Menu $_SESSION["image_menu"] = isset($data['image_menu']) ? $data['image_menu'] : 'menu.jpg';
// Flash Header $_SESSION["flash"] = $data['flash']; $_SESSION["flash_width"] = isset($data['footer_head']) && $data['footer_head'] > 0 ? $data['footer_head'] : ($_SESSION["flash_width"] != '' ? $_SESSION["flash_width"] : '100%'); $_SESSION["flash_height"] = isset($data['footer_sub']) && $data['footer_sub'] > 0 ? $data['footer_sub'] : ($_SESSION["flash_height"] != '' ? $_SESSION["flash_height"] : '');
// Background $_SESSION["background1"] = $data['herder_top_01']; $_SESSION["background2"] = isset($data['sub_menu_color']) ? $data['sub_menu_color'] : 'background.gif'; $_SESSION["background3"] = $data['herder_top_02'];
// Footer $_SESSION["footer_bg"] = isset($data['h_menu_color']) ? $data['h_menu_color'] : 'footer.gif';
// Navagator $_SESSION["header_navigator"] = isset($data['header_navigator']) ? $data['header_navigator'] : 'navagator.jpg'; $_SESSION["height_navigator"] = isset($data['height_navigator']) ? $data['height_navigator'] : '30'; $_SESSION["icon_navigator"] = isset($data['icon_navigator']) ? $data['icon_navigator'] : (file_exists("$_SESSION[web_name]/theme/$_SESSION[themes_]/$data[image_menu]") ? $data['image_menu'] : 'icon.gif'); // Bar Header $_SESSION["bar_header1"] = isset($data['header_navigator']) ? $data['navigrator'] : (file_exists("$_SESSION[web_name]/theme/$_SESSION[themes_]/bar1.gif") ? 'bar1.gif' : 'bar01.gif'); $_SESSION["bar_header2"] = isset($data['header_navigator']) ? $data['title_color'] : (file_exists("$_SESSION[web_name]/theme/$_SESSION[themes_]/bar1.gif") ? 'bar2.gif' : 'bar02.gif'); $_SESSION["bar_header3"] = isset($data['header_navigator']) ? $data['bg_list_table'] : (file_exists("$_SESSION[web_name]/theme/$_SESSION[themes_]/bar1.gif") ? 'bar3.gif' : 'bar03.gif'); if(!isset($data['home_template'])){ mysql_query("ALTER TABLE `cms_main_themes` ADD `home_template` VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT 't01';"); mysql_query("ALTER TABLE `cms_main_themes` CHANGE `h_menu_color` `h_menu_color` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;"); mysql_query("ALTER TABLE `cms_main_themes` CHANGE `sub_menu_color` `sub_menu_color` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;"); $_SESSION['template'] = 't01'; $chkMTemplate = mysql_query("SELECT id_sub FROM cms_menu_sub WHERE name = 'เปลี่ยนรูปแบบ/Template'"); $MTemplate = mysql_num_rows($chkMTemplate); if($MTemplate == 0){ $queOrder = mysql_query("SELECT MAX(position) AS position FROM cms_menu_sub WHERE id_top = '1'"); $objOrder = mysql_fetch_assoc($queOrder); $mxOrder = $objOrder['position'] + 1; mysql_query("INSERT INTO `cms_menu_sub` (`id_sub`, `id_top`, `id_type`, `name`, `url`, `position`, `status`) VALUES ('0', '1', '1', 'เปลี่ยนรูปแบบ/Template', 'index.php?mod=manage_template&path=template', '$mxOrder', '1');"); mysql_query("UPDATE `cms_menu_sub` SET name = 'เปลี่ยน Banner/พื้นหลัง/Footer' WHERE name = 'เปลี่ยน Flash/พื้นหลัง/Footer';"); set_menu_graphic(); } }else{ $_SESSION['template'] = $data['home_template']; } //##### New Module #####// $chkModuleQuestion = mysql_query("select * from cms_module where e_name = 'question'"); $numModuleQuestion = mysql_num_rows($chkModuleQuestion); if($numModuleQuestion == 0){ //##### 1 - Questionnaire #####// mysql_query("insert into cms_module (name, allow, e_name) values ('แบบสอบถาม', '3', 'question')"); mysql_query("CREATE TABLE `cms_question` ( `id_question` int(11) NOT NULL PRIMARY KEY, `topic` varchar(200) COLLATE utf8_unicode_ci NOT NULL, `status` int(11) NOT NULL DEFAULT '1', `id_sub` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"); mysql_query("CREATE TABLE `cms_question_ansheader` ( `header_id` int(11) NOT NULL PRIMARY KEY, `question_id` int(11) NOT NULL, `user_ip` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `datetime` varchar(50) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"); mysql_query("CREATE TABLE `cms_question_answer` ( `answer_id` int(11) NOT NULL PRIMARY KEY, `header_id` int(11) NOT NULL, `question_id` int(11) NOT NULL, `title_id` int(11) NOT NULL, `type_id` int(11) NOT NULL, `parent_id` int(11) NOT NULL, `answer` text COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"); mysql_query("CREATE TABLE `cms_question_choice` ( `choice_id` int(11) NOT NULL PRIMARY KEY, `choice_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `choice_order` int(11) NOT NULL, `title_id` int(11) NOT NULL, `question_id` int(11) NOT NULL, `choice_status` int(11) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"); mysql_query("CREATE TABLE `cms_question_title` ( `title_id` int(11) NOT NULL PRIMARY KEY, `title_name` varchar(500) COLLATE utf8_unicode_ci NOT NULL, `title_parent` int(11) NOT NULL, `title_order` int(11) NOT NULL, `question_id` int(11) NOT NULL, `type_id` int(11) NOT NULL, `title_other` int(11) NOT NULL DEFAULT '0', `title_status` int(11) NOT NULL DEFAULT '1', `title_validate` int(11) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"); mysql_query("CREATE TABLE `cms_question_type` ( `type_id` int(11) NOT NULL PRIMARY KEY, `type_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"); mysql_query("INSERT INTO `cms_question_type` (`type_id`, `type_name`) VALUES (1, 'ถาม-ตอบ'), (2, 'ระดับความพึงพอใจ'), (3, 'ตอบได้หลายข้อ'), (4, 'ตอบได้ข้อเดียว'), (5, 'ข้อเสนอแนะ'), (6, 'คำอธิบาย');"); //##### 2 - E-Service #####// mysql_query("CREATE TABLE `cms_eservice` ( `id` int(11) NOT NULL PRIMARY KEY, `type_id` int(11) NOT NULL, `topic` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `detail` text COLLATE utf8_unicode_ci NOT NULL, `sender_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `sender_tel` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `sender_mail` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `send_date` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `sender_ip` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `file_attach` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `service_status` int(11) NOT NULL DEFAULT '0' COMMENT '0:receive, 1:waiting, 2:complete, 3:information', `remark` text COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"); mysql_query("CREATE TABLE `cms_service_title` ( `title_id` int(11) NOT NULL PRIMARY KEY, `title_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title_status` int(11) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"); mysql_query("INSERT INTO `cms_service_title` (`title_id`, `title_name`, `title_status`) VALUES (1, 'รับเรื่องราวร้องทุกข์', 1), (2, 'ร้องเรียนการทุจริต', 1), (3, 'สายตรงนายกองค์การบริหารส่วนตำบล', 1), (4, 'สายตรงปลัดองค์การบริหารส่วนตำบล', 1);");
//##### 3 - EGP #####// mysql_query("CREATE TABLE `cms_egprss` ( `egp_id` int(11) NOT NULL, `egp_title` varchar(500) NOT NULL, `egp_description` varchar(250) NOT NULL, `egp_rss_title` varchar(500) NOT NULL, `egp_rss_link` varchar(500) NOT NULL, `egp_rss_pub_date` date NOT NULL, `egp_date` date NOT NULL, `id_home` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); // default questionnaire # main blog $sqlTop = "select max(id_top+1) from cms_menu_top"; $queTop = mysql_query($sqlTop); $maxTop = mysql_fetch_row($queTop); $sqlPos = "select max(`position`+1) from cms_menu_top where left_right = '2'"; $quePos = mysql_query($sqlPos); $maxPos = mysql_fetch_row($quePos); mysql_query("INSERT INTO cms_menu_top (id_top, name, position, left_right, `status`, `lock`, module_type, permission) values ('$maxTop[0]', 'แบบสอบถาม', '$maxPos[0]', '2', '1', 1, 'link', 0)"); # sub menu $sqlSub = "select max(id_sub+1) from `cms_menu_sub`"; $queSub = mysql_query($sqlSub); $maxSub = mysql_fetch_row($queSub); $url = "index.php?mod=question&path=question&id_sub=$maxSub[0]"; $menuname = 'แบบสอบถามความพึงพอใจต่อการให้บริการ'; mysql_query("INSERT INTO `cms_menu_sub` (`id_sub`, `id_top`, `id_type`, `name`, `url`, `position`, `status`) VALUES ('$maxSub[0]', '$maxTop[0]', '1', '$menuname', '$url', '1', '1')"); # main question $sqlQst = "select max(id_question) + 1 from cms_question"; $queQst = mysql_query($sqlQst); $maxQst = mysql_fetch_row($queQst); $QstId = $maxQst[0] == '' ? 1 : $maxQst[0]; mysql_query("INSERT INTO cms_question (id_question, topic, id_sub) VALUES ('$QstId', '$menuname', '$maxSub[0]')"); # question title $sqlMain = "select name_web from cms_main_data where id_main_data = '1'"; $queMain = mysql_query($sqlMain); $objMain = mysql_fetch_row($queMain); $MainName = $objMain[0]; mysql_query("INSERT INTO `cms_question_title` (`title_id`, `title_name`, `title_parent`, `title_order`, `question_id`, `type_id`, `title_other`, `title_status`, `title_validate`) VALUES (1, 'แบบสอบถามความพึงพอใจ', 0, 1, 1, 6, 0, 1, 1), (2, '<p> $MainName ได้จัดทำแบบสอบถามความพึงพอใจของประชาชนที่มีต่อการให้บริการของ$MainName หรือหน่วยงานต่างๆ ที่มาติดต่อใช้บริการงานด้านต่างๆ ของ$MainName เพื่อนำข้อมูลที่ได้จากการสำรวจนี้มาประมวลสรุปผลลัพธ์ทำแผนปรับปรุงการให้บริการ และดำเนินการแก้ไขข้อบกพร่องของการบริการด้านต่างๆ ให้มีประสิทธิภาพ และตรงกับความต้องการของผู้รับบริการมากยิ่งขึ้นต่อไป</p>\r\n', 1, 1, 1, 0, 0, 1, 1), (3, 'ส่วนที่ 1 : ข้อมูลทั่วไปผู้ขอรับบริการ', 0, 2, 1, 1, 0, 1, 1), (4, 'ชื่อผู้ขอรับบริการ (บุคคลหรือหน่วยงาน)', 3, 1, 1, 0, 0, 1, 1), (5, 'ที่อยู่ผู้ขอรับบริการ', 3, 2, 1, 0, 0, 1, 0), (6, 'โทรศัพท์ผู้ขอรับบริการ', 3, 3, 1, 0, 0, 1, 1), (7, 'ขอรับบริการจาก (ชื่อหน่วยงานผู้ให้บริการ)', 3, 4, 1, 0, 0, 1, 1), (8, 'ส่วนที่ 2 : เรื่องที่ขอรับบริการ', 0, 3, 1, 4, 0, 1, 1), (9, 'การขอข้อมูลข่าวสารทางราชการ', 8, 1, 1, 0, 0, 1, 1), (10, 'การยื่นเรื่องร้องทุกข์/ร้องเรียน', 8, 2, 1, 0, 0, 1, 1), (11, 'การใช้ Internet ตำบล', 8, 3, 1, 0, 0, 1, 1), (12, 'การขออนุญาตปลูกสร้างอาคาร', 8, 4, 1, 0, 0, 1, 1), (13, 'การขอแบบบ้านเพื่อประชาชน', 8, 5, 1, 0, 0, 1, 1), (14, 'การออกแบบอาคาร', 8, 6, 1, 0, 0, 1, 1), (15, 'การชำระภาษีโรงเรือนและที่ดิน', 8, 7, 1, 0, 0, 1, 1), (16, 'การชำระภาษีป้าย', 8, 8, 1, 0, 0, 1, 1), (17, 'การชำระภาษีบำรุงท้องที่', 8, 9, 1, 0, 0, 1, 1), (18, 'การขอรับเบี้ยยังชีพผู้สูงอายุ', 8, 10, 1, 0, 0, 1, 1), (19, 'การขอรับเบี้ยยังชีพคนพิการ', 8, 11, 1, 0, 0, 1, 1), (20, 'การขอรับเบี้ยยังชีพผู้ป่วยโรคเอดส์', 8, 12, 1, 0, 0, 1, 1), (21, 'การฉีดวัคซีนป้องกันโรคพิษสุนัขบ้า', 8, 13, 1, 0, 0, 1, 1), (22, 'การฉีดพ่นสารเคมีเพื่อป้องกันโรคไข้เลือดออก', 8, 14, 1, 0, 0, 1, 1), (23, 'การขอจัดตั้งสถานจำหน่ายอาหารและสะสมอาหาร', 8, 15, 1, 0, 0, 1, 1), (24, 'การขอประกอบกิจการที่เป็นอันตรายต่อสุขภาพ', 8, 16, 1, 0, 0, 1, 1), (25, 'การสมัครเข้าเรียนในศูนย์ศิลปวัฒนธรรม และภูมิปัญญาท้องถิ่น', 8, 17, 1, 0, 0, 1, 1), (26, 'อื่นๆ', 8, 18, 1, 0, 1, 1, 1), (27, 'ส่วนที่ 3 : แบบสอบถามความพึงพอใจที่มีต่อการให้บริการ', 0, 4, 1, 6, 0, 1, 1), (28, '<p>หัวข้อแบบสอบถามความพึงพอใจ</p>\r\n', 27, 1, 1, 0, 0, 1, 1), (29, '1. ด้านเจ้าหน้าที่ผู้ให้บริการ', 0, 5, 1, 2, 0, 1, 1), (30, 'เจ้าหน้าที่พูดจาสุภาพ อัธยาศัยดี แต่งกายสุภาพ การวางตัว เรียบร้อย', 29, 1, 1, 0, 0, 1, 1), (31, 'เจ้าหน้าที่ให้บริการด้วยความเต็มใจ รวดเร็ว และเอาใจใส่', 29, 2, 1, 0, 0, 1, 1), (32, 'เจ้าหน้าที่ให้คำแนะนำ ตอบข้อซักถามได้อย่างชัดเจน ถูกต้อง น่าเชื่อถือ', 29, 3, 1, 0, 0, 1, 1), (33, 'เจ้าหน้าที่สามารถแก้ปัญหา อุปสรรค ที่เกิดขึ้นได้อย่างเหมาะสม', 29, 4, 1, 0, 0, 1, 1), (34, '2. ด้านกระบวนการขั้นตอนการให้บริการ', 0, 6, 1, 2, 0, 1, 1), (35, 'มีช่องทางการให้บริการที่หลากหลาย', 34, 1, 1, 0, 0, 1, 1), (36, 'ขั้นตอนการให้บริการมีระบบ ไม่ยุ่งยาก ซับซ้อน มีความชัดเจน', 34, 2, 1, 0, 0, 1, 1), (37, 'ขั้นตอนการให้บริการแต่ละขั้นตอนมีความสะดวก รวดเร็ว', 34, 3, 1, 0, 0, 1, 1), (38, 'มีผังลำดับขั้นตอนและระยะเวลาการให้บริการอย่างชัดเจน', 34, 4, 1, 0, 0, 1, 1), (39, '3. ด้านสิ่งอำนวยความสะดวก', 0, 7, 1, 2, 0, 1, 1), (40, 'การจัดสิ่งอำนวยความสะดวกในสถานที่ให้บริการ เช่น ที่จอดรถ น้ำดื่ม', 39, 1, 1, 0, 0, 1, 1), (41, 'มีเครื่องมือ/อุปกรณ์/ระบบในการบริการข้อมูลสารสนเทศ', 39, 2, 1, 0, 0, 1, 1), (42, 'มีการจัดผังการให้บริการและการใช้อาคารไว้อย่างชัดเจนสะดวก เหมาะสม', 39, 3, 1, 0, 0, 1, 1), (43, 'อาคารสถานที่มีความสะอาด ปลอดภัย', 39, 4, 1, 0, 0, 1, 1), (44, 'ส่วนที่ 4 : ท่านคิดว่า $MainName ควรปรับปรุงด้านใด (ตอบได้มากกว่า 1 ข้อ)', 0, 8, 1, 3, 0, 1, 1), (45, 'ด้านการให้บริการของเจ้าหน้าที่ในหน่วยงาน', 44, 1, 1, 0, 0, 1, 1), (46, 'ด้านข้อมูลข่าวสารที่ให้บริการแก่ประชาชน', 44, 2, 1, 0, 0, 1, 1), (47, 'ด้านสถานที่ในการบริการข้อมูลข่าวสาร', 44, 3, 1, 0, 0, 1, 1), (48, 'ด้านวิธีการเข้ามามีส่วนร่วมของประชาชนในการจัดทำแผนพัฒนา', 44, 4, 1, 0, 0, 1, 1), (49, 'ด้านบริการการรับชำระภาษี', 44, 5, 1, 0, 0, 1, 1), (50, 'ด้านบริการการอนุญาตก่อสร้างอาคาร', 44, 6, 1, 0, 0, 1, 1), (51, 'อื่นๆ', 44, 7, 1, 0, 1, 1, 1), (52, 'ข้อเสนอแนะ', 0, 9, 1, 5, 0, 1, 1);"); mysql_query("INSERT INTO `cms_question_choice` (`choice_id`, `choice_name`, `choice_order`, `title_id`, `question_id`, `choice_status`) VALUES (1, 'มากที่สุด', 1, 29, 1, 1), (2, 'มาก', 2, 29, 1, 1), (3, 'ปานกลาง', 3, 29, 1, 1), (4, 'น้อย', 4, 29, 1, 1), (5, 'ควรปรับปรุง', 5, 29, 1, 1), (6, 'มากที่สุด', 1, 34, 1, 1), (7, 'มาก', 2, 34, 1, 1), (8, 'ปานกลาง', 3, 34, 1, 1), (9, 'น้อย', 4, 34, 1, 1), (10, 'ควรปรับปรุง', 5, 34, 1, 1), (11, 'มากที่สุด', 1, 39, 1, 1), (12, 'มาก', 2, 39, 1, 1), (13, 'ปานกลาง', 3, 39, 1, 1), (14, 'น้อย', 4, 39, 1, 1), (15, 'ควรปรับปรุง', 5, 39, 1, 1);"); }
chmod($_SESSION['web_name'], 0755); # create folder for e-service $dir_eservice = $_SESSION['web_name'].'/module_eservice/'; if($_SESSION['web_name'] != '' && !is_dir($dir_eservice)){ mkdir($dir_eservice, 0755, true); } # create folder for e-service1 # 25032021 $dir_eservice1 = $_SESSION['web_name'].'/module_eservice1/'; if($_SESSION['web_name'] != '' && !is_dir($dir_eservice1)){ mkdir($dir_eservice1, 0755, true); //##### 25/03/2021 : E-Service1 #####// mysql_query("CREATE TABLE `cms_eservice1` ( `id` int(11) NOT NULL PRIMARY KEY, `type_id` int(11) NOT NULL, `topic` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `detail` text COLLATE utf8_unicode_ci NOT NULL, `sender_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `sender_tel` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `sender_mail` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `send_date` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `sender_ip` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `file_attach` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `service_status` int(11) NOT NULL DEFAULT '0' COMMENT '0:receive, 1:waiting, 2:complete, 3:information', `remark` text COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"); //##### 26/03/2021 #####// mysql_query("CREATE TABLE `cms_service_title1` ( `title_id` int(11) NOT NULL PRIMARY KEY, `title_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title_status` int(11) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"); mysql_query("INSERT INTO `cms_service_title1` (`title_id`, `title_name`, `title_status`) VALUES (1, 'คำร้องขอใช้รถน้ำ', 1), (2, 'คำร้องขอใช้น้ำประปา', 1);"); } # create folder for file editor thumb $dir_editor = $_SESSION['web_name'].'/file_thumbs/'; if($_SESSION['web_name'] != '' && !is_dir($dir_editor)){ mkdir($dir_editor, 0755, true); } chmod($_SESSION['web_name'], 0555); //####### End New Module ########//
$template = isset($p_template) ? $p_template : ''; if($template != ''){ $currTemplate = $_SESSION['template']; $_SESSION['template'] = $template; $menu_top = array(); $menu_count = array('1' => 0, '2' => 0, '3' => 0); // $template_34 = array('boss_message' => '1', 'calendar' => '2', 'service' => '3', 'poll' => '4', 'counter' => '5'); $template_78 = array('calendar' => '1', 'service' => '2', 'web_link' => '3', 'poll' => '4', 'counter' => '5'); $sel_menu = "SELECT * FROM cms_menu_top WHERE module_type!='other' and `lock`='1' ORDER BY left_right, position"; $que_menu = mysql_query($sel_menu); $count = 0; while($obj_menu = mysql_fetch_assoc($que_menu)){ // $menu_top[$obj_menu['id_top']] = $obj_menu; // $menu_order[$obj_menu['position']] = $obj_menu; $menu_top[$count] = $obj_menu; $curr_blog[$obj_menu['left_right']] = $obj_menu['left_right']; ++$count; } sort($curr_blog); $str_blog = implode('', $curr_blog); $half = round($count / 2); $array_menu = array(); if($currTemplate == 't07') # 123 { if(in_array($template, array('t01', 't02'))){ # 12 foreach($menu_top as $codr => $obj){ if($codr < $half){ ++$menu_count[1]; $obj['new_order'] = $menu_count[1]; $array_menu[1][$obj['id_top']] = $obj; }else{ ++$menu_count[2]; $obj['new_order'] = $menu_count[2]; $array_menu[2][$obj['id_top']] = $obj; } } }else if(in_array($template, array('t03', 't05', 't09'))){ # 13 foreach($menu_top as $codr => $obj){ if($codr < $half){ ++$menu_count[1]; $obj['new_order'] = $menu_count[1]; $array_menu[1][$obj['id_top']] = $obj; }else{ ++$menu_count[3]; $obj['new_order'] = $menu_count[3]; $array_menu[3][$obj['id_top']] = $obj; } } }else if(in_array($template, array('t04', 't06', 't10'))){ # 23 foreach($menu_top as $codr => $obj){ if($codr < $half){ ++$menu_count[2]; $obj['new_order'] = $menu_count[2]; $array_menu[2][$obj['id_top']] = $obj; }else{ ++$menu_count[3]; $obj['new_order'] = $menu_count[3]; $array_menu[3][$obj['id_top']] = $obj; } } }else if($template == 't08'){ # 213 foreach($menu_top as $obj){ if($obj['left_right'] == 3){ ++$menu_count[3]; $obj['new_order'] = $menu_count[3]; $array_menu[3][$obj['id_top']] = $obj; }else if($obj['left_right'] == 1){ ++$menu_count[2]; $obj['new_order'] = $menu_count[2]; $array_menu[2][$obj['id_top']] = $obj; }else{ ++$menu_count[1]; $obj['new_order'] = $menu_count[1]; $array_menu[1][$obj['id_top']] = $obj; } } }else{ foreach($menu_top as $obj){ ++$menu_count[$obj['left_right']]; $obj['new_order'] = $menu_count[$obj['left_right']]; $array_menu[$obj['left_right']][$obj['id_top']] = $obj; } } } else if($currTemplate == 't08') # 213 { if(in_array($template, array('t01', 't02'))){ # 12 foreach($menu_top as $codr => $obj){ if($codr < $half){ ++$menu_count[1]; $obj['new_order'] = $menu_count[1]; $array_menu[1][$obj['id_top']] = $obj; }else{ ++$menu_count[2]; $obj['new_order'] = $menu_count[2]; $array_menu[2][$obj['id_top']] = $obj; } } }else if(in_array($template, array('t03', 't05', 't09'))){ # 13 foreach($menu_top as $codr => $obj){ if($codr < $half){ ++$menu_count[1]; $obj['new_order'] = $menu_count[1]; $array_menu[1][$obj['id_top']] = $obj; }else{ ++$menu_count[3]; $obj['new_order'] = $menu_count[3]; $array_menu[3][$obj['id_top']] = $obj; } } }else if(in_array($template, array('t04', 't06', 't10'))){ # 23 foreach($menu_top as $codr => $obj){ if($codr < $half){ ++$menu_count[2]; $obj['new_order'] = $menu_count[2]; $array_menu[2][$obj['id_top']] = $obj; }else{ ++$menu_count[3]; $obj['new_order'] = $menu_count[3]; $array_menu[3][$obj['id_top']] = $obj; } } }else if($template == 't07'){ # 123 foreach($menu_top as $obj){ if($obj['left_right'] == 3){ ++$menu_count[3]; $obj['new_order'] = $menu_count[3]; $array_menu[3][$obj['id_top']] = $obj; }else if($obj['left_right'] == 1){ ++$menu_count[2]; $obj['new_order'] = $menu_count[2]; $array_menu[2][$obj['id_top']] = $obj; }else{ ++$menu_count[1]; $obj['new_order'] = $menu_count[1]; $array_menu[1][$obj['id_top']] = $obj; } } }else{ foreach($menu_top as $obj){ ++$menu_count[$obj['left_right']]; $obj['new_order'] = $menu_count[$obj['left_right']]; $array_menu[$obj['left_right']][$obj['id_top']] = $obj; } } } else { if($str_blog == '12') # t01, t02 { if(in_array($template, array('t03', 't05', 't09'))){ foreach($menu_top as $obj){ if($obj['left_right'] == 1){ ++$menu_count[1]; $obj['new_order'] = $menu_count[1]; $array_menu[1][$obj['id_top']] = $obj; }else if($obj['left_right'] == 2){ ++$menu_count[3]; $obj['new_order'] = $menu_count[3]; $array_menu[3][$obj['id_top']] = $obj; } } }else if(in_array($template, array('t04', 't06', 't10'))){ foreach($menu_top as $obj){ if($obj['left_right'] == 2){ ++$menu_count[2]; $obj['new_order'] = $menu_count[2]; $array_menu[2][$obj['id_top']] = $obj; }else if($obj['left_right'] == 1){ ++$menu_count[3]; $obj['new_order'] = $menu_count[3]; $array_menu[3][$obj['id_top']] = $obj; } } }else if($template == 't07'){ foreach($menu_top as $codr => $obj){ if($obj['left_right'] == 2){ ++$menu_count[2]; $obj['new_order'] = $menu_count[2]; $array_menu[2][$obj['id_top']] = $obj; }else{ if($codr < 4){ ++$menu_count[1]; $obj['new_order'] = $menu_count[1]; $array_menu[1][$obj['id_top']] = $obj; }else{ ++$menu_count[3]; $obj['new_order'] = $menu_count[3]; $array_menu[3][$obj['id_top']] = $obj; } } } }else if($template == 't08'){ foreach($menu_top as $codr => $obj){ if($obj['left_right'] == 1){ ++$menu_count[1]; $obj['new_order'] = $menu_count[1]; $array_menu[1][$obj['id_top']] = $obj; }else{ if($codr < 4){ ++$menu_count[2]; $obj['new_order'] = $menu_count[2]; $array_menu[2][$obj['id_top']] = $obj; }else{ ++$menu_count[3]; $obj['new_order'] = $menu_count[3]; $array_menu[3][$obj['id_top']] = $obj; } } } }else{ foreach($menu_top as $obj){ ++$menu_count[$obj['left_right']]; $obj['new_order'] = $menu_count[$obj['left_right']]; $array_menu[$obj['left_right']][$obj['id_top']] = $obj; } } } else if($str_blog == '13') # t03, t05, t09 { if(in_array($template, array('t01', 't02'))){ foreach($menu_top as $obj){ if($obj['left_right'] == 1){ ++$menu_count[1]; $obj['new_order'] = $menu_count[1]; $array_menu[1][$obj['id_top']] = $obj; }else if($obj['left_right'] == 3){ ++$menu_count[2]; $obj['new_order'] = $menu_count[2]; $array_menu[2][$obj['id_top']] = $obj; } } }else if(in_array($template, array('t04', 't06', 't10'))){ foreach($menu_top as $obj){ if($obj['left_right'] == 3){ ++$menu_count[3]; $obj['new_order'] = $menu_count[3]; $array_menu[3][$obj['id_top']] = $obj; }else if($obj['left_right'] == 1){ ++$menu_count[2]; $obj['new_order'] = $menu_count[2]; $array_menu[2][$obj['id_top']] = $obj; } } }else if($template == 't07'){ foreach($menu_top as $codr => $obj){ if($obj['left_right'] == 3){ ++$menu_count[3]; $obj['new_order'] = $menu_count[3]; $array_menu[3][$obj['id_top']] = $obj; }else{ if($codr < 4){ ++$menu_count[1]; $obj['new_order'] = $menu_count[1]; $array_menu[1][$obj['id_top']] = $obj; }else{ ++$menu_count[2]; $obj['new_order'] = $menu_count[2]; $array_menu[2][$obj['id_top']] = $obj; } } } }else if($template == 't08'){ foreach($menu_top as $codr => $obj){ if($obj['left_right'] == 3){ ++$menu_count[3]; $obj['new_order'] = $menu_count[3]; $array_menu[3][$obj['id_top']] = $obj; }else{ if($codr < 4){ ++$menu_count[2]; $obj['new_order'] = $menu_count[2]; $array_menu[2][$obj['id_top']] = $obj; }else{ ++$menu_count[1]; $obj['new_order'] = $menu_count[1]; $array_menu[1][$obj['id_top']] = $obj; } } } }else{ foreach($menu_top as $obj){ ++$menu_count[$obj['left_right']]; $obj['new_order'] = $menu_count[$obj['left_right']]; $array_menu[$obj['left_right']][$obj['id_top']] = $obj; } } } else if($str_blog == '23') # t04, t06, t10 { if(in_array($template, array('t01', 't02'))){ foreach($menu_top as $obj){ if($obj['left_right'] == 2){ ++$menu_count[2]; $obj['new_order'] = $menu_count[2]; $array_menu[2][$obj['id_top']] = $obj; }else if($obj['left_right'] == 3){ ++$menu_count[1]; $obj['new_order'] = $menu_count[1]; $array_menu[1][$obj['id_top']] = $obj; } } }else if(in_array($template, array('t03', 't05', 't09'))){ foreach($menu_top as $obj){ if($obj['left_right'] == 3){ ++$menu_count[3]; $obj['new_order'] = $menu_count[3]; $array_menu[3][$obj['id_top']] = $obj; }else if($obj['left_right'] == 2){ ++$menu_count[1]; $obj['new_order'] = $menu_count[1]; $array_menu[1][$obj['id_top']] = $obj; } } }else if($template == 't07'){ foreach($menu_top as $codr => $obj){ if($obj['left_right'] == 3){ ++$menu_count[3]; $obj['new_order'] = $menu_count[3]; $array_menu[3][$obj['id_top']] = $obj; }else{ if($codr < 4){ ++$menu_count[1]; $obj['new_order'] = $menu_count[1]; $array_menu[1][$obj['id_top']] = $obj; }else{ ++$menu_count[2]; $obj['new_order'] = $menu_count[2]; $array_menu[2][$obj['id_top']] = $obj; } } } }else if($template == 't08'){ foreach($menu_top as $codr => $obj){ if($obj['left_right'] == 3){ ++$menu_count[3]; $obj['new_order'] = $menu_count[3]; $array_menu[3][$obj['id_top']] = $obj; }else{ if($codr < 4){ ++$menu_count[2]; $obj['new_order'] = $menu_count[2]; $array_menu[2][$obj['id_top']] = $obj; }else{ ++$menu_count[1]; $obj['new_order'] = $menu_count[1]; $array_menu[1][$obj['id_top']] = $obj; } } } }else{ foreach($menu_top as $obj){ ++$menu_count[$obj['left_right']]; $obj['new_order'] = $menu_count[$obj['left_right']]; $array_menu[$obj['left_right']][$obj['id_top']] = $obj; } } } } // echo '<pre>'; // print_r($array_menu); // echo '</pre>'; $update_template = "UPDATE cms_main_themes SET home_template = '$template'"; $query_update = mysql_query($update_template); if($query_update){ foreach($array_menu as $blog => $element){ foreach($element as $id => $ele){ $upd_menu = "UPDATE cms_menu_top SET left_right = '$blog', position = '$ele[new_order]' WHERE id_top = '$ele[id_top]'"; mysql_query($upd_menu); } } } echo "<meta http-equiv='refresh' content='0; url=index.php'>"; }
function set_menu_graphic(){ $arrayMTop = array( '0.gif' => 'อบต.ในเครือข่าย', '1.gif' => 'หมู่บ้านในเขต อบต.', '2.gif' => 'ปฏิทินกิจกรรม', '3.gif' => 'โรงแรม/ที่พัก', '4.gif' => 'ข้อมูลพื้นฐาน อบต.', '5.gif' => 'รวมลิงค์ต่างๆ', '6.gif' => 'ระบบ MIS', '7.gif' => 'โครงสร้างการบริหาร', '8.gif' => 'ผลิตภัณฑ์ประจำตำบล', '9.gif' => 'ทำเนียบบุคลากร', '10.gif' => 'แบบสำรวจความคิดเห็น', '11.gif' => 'แนะนำร้านอาหาร', '12.gif' => 'การให้บริการ', '13.gif' => 'สาส์นจากผู้บริหาร', '14.gif' => 'สถิติผู้เข้าชมเว็บไซต์', '15.gif' => 'สถานที่ท่องเที่ยว', '16.gif' => 'จัดการระบบเว็บไซต์', '17.gif' => 'สาส์นจากนายกฯ', '18.gif' => 'สาส์นจากประธานสภา', '19.gif' => 'สาส์นจากปลัด', '20.gif' => 'งบประมาณ อบต.', '21.gif' => 'ความรู้เกี่ยวกับภาษี', '22.gif' => 'ความรู้เกี่ยวกับ อบต.', '23.gif' => 'กฎหมายน่ารู้', '24.gif' => 'ราคาน้ำมันวันนี้', '25.gif' => 'เว็บไซต์บริการ', '26.gif' => 'เว็บไซต์ท้องถิ่นไทย', '27.gif' => 'ข่าวจากกรมส่งเสริมการปกครองท้องถิ่น', '28.gif' => 'สำนักปลัด', '29.gif' => 'ส่วนการคลัง', '30.gif' => 'ส่วนการศึกษา', '31.gif' => 'ส่วนโยธา', '32.gif' => 'ส่วนสาธารณสุข', '33.gif' => 'ส่วนส่งเสริมการเกษตร', '34.gif' => 'งานควบคุมภายใน', '35.gif' => 'งานบริหารบุคคล', '36.gif' => 'ศูนย์พัฒนาเด็กเล็ก', '37.gif' => 'แผนพัฒนาตำบล', '38.gif' => 'งานการเงิน', '39.gif' => 'งานนโยบายและแผน', '40.gif' => 'งานงบประมาณ', '41.gif' => 'งานพัสดุ', '42.gif' => 'งานสังคมสงเคราะห์', '43.gif' => 'ข้อมูลพื้นฐานเทศบาล', '44.gif' => 'Link กระทรวง', '45.gif' => 'หมู่บ้านในเขตเทศบาล', '46.gif' => 'เครือข่ายของเรา', '47.gif' => 'ความรู้เกี่ยวกับเทศบาล', '48.gif' => 'สายตรงผู้บริหาร', '49.gif' => 'ขั้นตอนการติดต่อราชการ', '50.gif' => 'ข้อมูลการจัดซื้อจัดจ้าง', '51.gif' => 'บริการออนไลน์' ); foreach($arrayMTop as $gif => $text){ mysql_query("UPDATE cms_menu_top SET name = '$text' WHERE name = '$gif';"); } }
#/*//##### delete old news and old news_tender #####// $sqlNews = "select * from cms_news where year(date_post) < '2558'"; $queNews = mysql_query($sqlNews); while($news = mysql_fetch_assoc($queNews)){ if($news['pic1'] != '' && file_exists($_SESSION['web_name'].'/mainfile/'.$news['pic1'])){ @unlink($_SESSION['web_name'].'/mainfile/'.$news['pic1']); } if($news['pic2'] != '' && file_exists($_SESSION['web_name'].'/mainfile/'.$news['pic2'])){ @unlink($_SESSION['web_name'].'/mainfile/'.$news['pic2']); } if($news['pic3'] != '' && file_exists($_SESSION['web_name'].'/mainfile/'.$news['pic3'])){ @unlink($_SESSION['web_name'].'/mainfile/'.$news['pic3']); } if($news['pic4'] != '' && file_exists($_SESSION['web_name'].'/mainfile/'.$news['pic4'])){ @unlink($_SESSION['web_name'].'/mainfile/'.$news['pic4']); } if($news['files'] != '' && file_exists($_SESSION['web_name'].'/mainfile/'.$news['files'])){ @unlink($_SESSION['web_name'].'/mainfile/'.$news['files']); } mysql_query("delete from cms_news where id = '$news[id]'"); } $sqlTender = "select * from cms_news_tender where year(date_post) < '2558'"; $queTender = mysql_query($sqlTender); while($tender = mysql_fetch_assoc($queTender)){ if($tender['file'] != '' && file_exists($_SESSION['web_name'].'/mainfile/'.$tender['file'])){ @unlink($_SESSION['web_name'].'/mainfile/'.$tender['file']); } mysql_query("delete from cms_tender where id = '$tender[file]'"); }
include('coremain/connec_out.php'); $sqlOut = "select * from cms_news where year(date_post) < '2558'"; $queOut = mysql_query($sqlOut); while($out = mysql_fetch_assoc($queOut)){ mysql_query("delete from cms_news where id = '$out[id]'"); } $sqlTOut = "select * from cms_news_tender where year(date_post) < '2558'"; $queTOut = mysql_query($sqlTOut); while($tout = mysql_fetch_assoc($queTOut)){ mysql_query("delete from cms_news_tender where id = '$tout[id]'"); } mysql_close($handle_out); include("$_SESSION[web_name]/connect.php"); //################## end delete #################//*/
?>
|