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--
2025-10-31 00:51
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 'config.php'; ?> <?php require('phpMailer/class.phpmailer.php'); require('pdf/html2pdf.php'); date_default_timezone_set('Asia/Singapore'); $customer_id = $_POST['customer']; $form = $_POST['maintenance-form']; if (isset($_POST['edit'])) { if ($customer_id == "new") { header('Location: '.'new-customer.php'); } elseif ($form == "new") { $date = date('Y-m-d H:i:s'); $sql = "INSERT INTO maintenance_data (customer_id, created_date) VALUES ('".$customer_id."', '".$date."')"; $result = mysqli_query($conn, $sql); $maintenance_data_id = $conn->insert_id; //link to calendar if (isset($_POST['calendar-id'])) { $sql = "Update calendar set maintenance_id = '".$maintenance_data_id."' where id='".$_POST['calendar-id']."';"; $result = mysqli_query($conn, $sql); } //for each equipment, create checklist $sql = "SELECT id, equipment_type_id from equipment_own where customer_id=".$customer_id." and active=1"; $result = mysqli_query($conn, $sql); while($row = mysqli_fetch_assoc($result)) { $sql = "SELECT value from checklist where equipment_type_id=".$row['equipment_type_id']." ORDER BY position ASC"; $result2 = mysqli_query($conn, $sql); while($row2 = mysqli_fetch_assoc($result2)) { $sql = "INSERT INTO checklist_data (maintenance_data_id, equipment_own_id, value) VALUES ('".$maintenance_data_id."', '".$row['id']."', '".$row2['value']."')"; $result3 = mysqli_query($conn, $sql); } $sql = "INSERT INTO equipment_data (maintenance_data_id, equipment_own_id, status) VALUES ('".$maintenance_data_id."', '".$row['id']."', '"."OK"."')"; $result4 = mysqli_query($conn, $sql); } ?> <form action='maintenance-form.php' method='post' name='frm'> <input type="hidden" name="customer_id" value="<?php echo $customer_id ?>"> <input type="hidden" name="maintenance-form" value="<?php echo $maintenance_data_id ?>"> </form> <script language="JavaScript"> document.frm.submit(); </script> <?php } elseif ($form == "edit") { ?> <form action='edit-customer.php' method='post' name='frm'> <input type="hidden" name="customer_id" value="<?php echo $customer_id ?>"> </form> <script language="JavaScript"> document.frm.submit(); </script> <?php } else { ?> <form action='maintenance-form.php' method='post' name='frm'> <input type="hidden" name="customer_id" value="<?php echo $customer_id ?>"> <input type="hidden" name="maintenance-form" value="<?php echo $form ?>"> </form> <script language="JavaScript"> document.frm.submit(); </script> <?php } } elseif (isset($_POST['uniquekey'])) { session_start(); $_SESSION['customer_id'] = $customer_id; $_SESSION['maintenance_data_id'] = $form; header('Location: '.'uniquekey.php'); } elseif (isset($_POST['delete']) && isset($customer_id) && isset($form)) { $sql = "DELETE from maintenance_data where customer_id=".$customer_id." and id=".$form; mysqli_query($conn, $sql); $sql = "DELETE from equipment_data where maintenance_data_id=".$form; mysqli_query($conn, $sql); $sql = "DELETE from checklist_data where maintenance_data_id=".$form; mysqli_query($conn, $sql); $sql = "Update calendar maintenance_id=0 where maintenance_id=".$form; mysqli_query($conn, $sql); echo "Done"; } elseif (isset($_POST['maintenance-form'])) { $sql = "SELECT * from customer where id=".$_POST['customer']; $result = mysqli_query($conn, $sql); while($row = mysqli_fetch_assoc($result)) { $email = $row['email']; } $pdf=new PDF('P','mm','A4', $_POST['customer'], $_POST['maintenance-form'], $conn); $pdf->SetDisplayMode('real'); $pdf->AddPage(); //body $pdf->WriteBody(); $mail = new PHPMailer(); $doc = $pdf->Output('S'); $mail->AddStringAttachment($doc, 'Maintenance Report # '.$_POST['maintenance-form'].'.pdf', 'base64', 'application/pdf'); $mail->setFrom('contactus@homegym.sg', 'HOMEGYM.SG'); $mail->addAddress($email); $mail->addBCC('homegym.sg@gmail.com'); // Add a recipient $mail->addReplyTo('contactus@homegym.sg', 'HOMEGYM.SG'); $mail->isHTML(true); // Set email format to HTML $mail->Subject = 'Maintenance Report # '.$_POST['maintenance-form']; $mail->Body = 'Dear Person-in-charge, <br /><br />Please see attachment for the report for your recent maintenance performed.'; $mail->AltBody = 'This is an email in plain text for non-HTML mail clients. Please see attachment for maintenance report.'; if (isset($_POST['email'])) { $mail->Send(); $sql = "Update calender set done=1 where maintenance_id=".$form; mysqli_query($conn, $sql); } // output $outputMode = 'I'; if (isset($_POST['download'])) $outputMode = 'D'; $pdf->Output($outputMode, 'Maintenance Report # '.$_POST['maintenance-form'].'.pdf'); } ?> <?php mysqli_close($conn);?>