File manager - Edit - /home/autoph/public_html/connect/api/prf/EXECOMNotes.php
Back
<?php date_default_timezone_set('Asia/Manila'); header('Content-Type: application/json'); $sqlUser = 'autoph_arnel'; $sqlDatabase = 'autoph_connect'; $sqlPass = 'Hke@2001'; $toDate = date_create() ->format("Y/m/d"); $conn = mysql_connect($sqlHost, $sqlUser, $sqlPass) or die ("Couldn't connct to MySQL server on $sqlHost: ". mysql_error(). '.'); $db = mysql_select_db($sqlDatabase, $conn) or die ("Couldn't select database $sqlDatabase: ". mysql_error(). '.'); $ApiKey= $_REQUEST['keyID']; // Expect LoginName, LoginPassword //=========================================================================== if($ApiKey == 'AAA1024197710262009EEENOTES'){ $userID = $_REQUEST['userID']; $itemID= $_REQUEST['itemID']; $prfNumber= $_REQUEST['prfNumber']; $sql = "SELECT prf_execomnotes.`id`, prf_execomnotes.`item_id`, prf_execomnotes.`sender_id`, prf_execomnotes.`requestor_id`, prf_execomnotes.`my_notes`, prf_execomnotes.`timestamp`, vts_users.`u_id`, vts_users.`u_fname`, vts_users.`u_lname` FROM prf_execomnotes JOIN vts_users on vts_users.u_id=prf_execomnotes.`sender_id` WHERE prf_execomnotes.item_id=$itemID ORDER BY prf_execomnotes.id DESC"; $sqlTable = mysql_query($sql, $conn); while($sqlRecord = mysql_fetch_assoc($sqlTable)) { $count = $count + 1; $return_tag[]= $sqlRecord; } if($count > 0){ $visible="false"; $itemDescVisible="true"; if($count==''){ $count='0'; } $countMSG = "There are ".$count ." comment/s found."; }else{ if($count==''){ $count='0'; } $visible="true"; $itemDescVisible="false"; $countMSG = "There are ".$count ." comment/s found."; } $json = json_encode([$return_tag,"Visible" => "$visible","itemDesVisible" => "$itemDescVisible","countMSG" => "$countMSG"]); } //=========================================================================== echo $json; ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings