home
/
uttpolic
/
web
/
uttpolice-coop.com
/
public_html
➕ New
📤 Upload
✎ Editing:
calendar.php
← Back
<?php include("layout/header.php")?> <style> .form-control { display: block; width: 100%; font-size: 14px !important; line-height: 30px; height: 40px; color: #333; background-color: #fff; background-image: none; border: 1px solid #CCCCCC; border-radius: 5px; -webkit-box-shadow: none; box-shadow: none; -webkit-transition: border-color ease-in-out 0.15s, -webkit-box-shadow ease-in-out 0.15s; -o-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; } </style> <articles> <section> <div class="wrapper"> <div class="container"> <div class="toppic"> <h1>ปฏิทินกิจกรรม</h1> </div> <?php $textsearch = @$_POST['textsearch']; ?> <div class="panel panel-default"> <div style = "float:right;padding:15px;"> <form class="form-inline" action = "announce.php" method = "POST"> <div class="form-group mx-sm-3 mb-2"> <input type="text" class="form-control" name = "textsearch" value = "<?php echo $textsearch;?>" placeholder="กรอกคำที่ต้องการค้นหา"> </div> <button type="submit" class="btn btn-success mb-2">ค้นหา</button> </form> </div> <br> <div class="panel-body" style = "font-size:15px;"> <br> <div class="box-list-news"> <ul> <?php $perpage = 20; if (isset($_GET['page'])) { $page = $_GET['page']; } else { $page = 1; } $wh = ""; if($textsearch){ $wh = " AND announce_title LIKE '%$textsearch%' " ; } $start = ($page - 1) * $perpage; $sql = "SELECT * FROM utt_calendar WHERE 1 ".$wh." ORDER BY calendar_date ASC limit {$start} , {$perpage}"; $q = mysqli_query($con,$sql); $i = 0; while($r_calendar = mysqli_fetch_array($q)){ $i++; $date_calendar = explode('-',$r_calendar['calendar_date']); $day = $date_calendar[2]; $year = $date_calendar[0]+543; $month = $date_calendar[1]; if($month == '01'){ $month_th = "ม.ค."; }elseif($month == '02'){ $month_th = "ก.พ."; }elseif($month == '03'){ $month_th = "มี.ค."; }elseif($month == '04'){ $month_th = "เม.ย"; }elseif($month == '05'){ $month_th = "พ.ค."; }elseif($month == '06'){ $month_th = "มิ.ย."; }elseif($month == '07'){ $month_th = "ก.ค."; }elseif($month == '08'){ $month_th = "ส.ค."; }elseif($month == '09'){ $month_th = "ก.ย."; }elseif($month == '10'){ $month_th = "ต.ค."; }elseif($month == '11'){ $month_th = "พ.ย."; }elseif($month == '12'){ $month_th = "ธ.ค."; } ?> <li> <div class="boxfile"> <div class="box-calendar"> <div class="box-calendar-date"> <strong><?php echo $day;?></strong> <span><?php echo $month_th;?></span> <div><?php echo $year;?></div> </div> <div class="box-calendar-des"> <div class="t-event"> <a href=""><?php echo $r_calendar['calendar_header'];?></a> </div> <span style = "font-size:11px;"><?php echo $r_calendar['calendar_detail'];?></span> </div> </div> </div> <hr> </li> <?php } ?> </ul> </div> <?php $sql2 = "select * from utt_announce WHERE 1 ".$wh; $query2 = mysqli_query($con, $sql2); $total_record = mysqli_num_rows($query2); $total_page = ceil($total_record / $perpage); ?> <nav style = "float:right;"> <ul class="pagination"> <li> <a href="announce.php?page=1" aria-label="Previous"> <span aria-hidden="true">«</span> </a> </li> <?php for($i=1;$i<=$total_page;$i++){ ?> <li><a href="announce.php?page=<?php echo $i; ?>"><?php echo $i; ?></a></li> <?php } ?> <li> <a href="announce.php?page=<?php echo $total_page;?>" aria-label="Next"> <span aria-hidden="true">»</span> </a> </li> </ul> </nav> </div> </div> </div><!--end container--> </div> </section> </articles> <?php include("layout/footer.php");?> <?php function datethai($date) { $explode = explode('-',$date); if($explode[1] == '01'){ $month = "ม.ค."; }elseif($explode[1] == '02'){ $month = "ก.พ."; }elseif($explode[1] == '03'){ $month = "มี.ค."; }elseif($explode[1] == '04'){ $month = "เม.ย"; }elseif($explode[1] == '05'){ $month = "พ.ค."; }elseif($explode[1] == '06'){ $month = "มิ.ย."; }elseif($explode[1] == '07'){ $month = "ก.ค."; }elseif($explode[1] == '08'){ $month = "ส.ค."; }elseif($explode[1] == '09'){ $month = "ก.ย."; }elseif($explode[1] == '10'){ $month = "ต.ค."; }elseif($explode[1] == '11'){ $month = "พ.ย."; }elseif($explode[1] == '12'){ $month = "ธ.ค."; } $year = $explode[0]+543; return $explode[2].' '.$month.' '.$year; } ?> </body> </html>
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel