File manager - Edit - /home/autoph/public_html/voc/home/sub_add_dealer.php
Back
<?php include 'core/init.php'; //$connect_error = 'Sorry, we\'re experiencing connection problem. Please try again later... Thank you!'; //mysql_connect('localhost','root','aee1024') or die ($connect_error); //mysql_select_db('db_vts') or die($connect_error); //error_reporting(1); $userID=$user_data['u_id']; $toDate = date_create() ->format("Y-m-d"); //if submit/ save to databasevar if(isset($_POST['done'])){ $dealCode = mysql_escape_string($_POST['dealCode']); $dealName = mysql_escape_string($_POST['dealName']); $address = mysql_escape_string($_POST['address']); $location = mysql_escape_string($_POST['location']); $company = mysql_escape_string($_POST['company']); $contact = mysql_escape_string($_POST['contact']); $addBy = mysql_escape_string($_POST['addBy']); $addDate = mysql_escape_string($_POST['addDate']); $outStat = 1; $outCode = 'OUT'; //insert mysql_query("INSERT INTO vts_dealerships (deal_code, deal_name, deal_address, deal_city, deal_contact, comp_id, date, add_by) VALUES('{$dealCode}','{$dealName}','{$address}','{$location}','{$contact}','{$company}','{$addDate}','{$addBy}')"); //UPDATE CHECK-OUT REASON TABLE TO INCLUDE DEALER IN SELECTION DURING GUARD CHECK-OUT mysql_query("INSERT INTO vts_check_out_reasons (out_description, out_status, code) VALUES('{$dealName}','{$outStat}','{$outCode}')"); $systemMessage="Record has been saved..."; exit(); } //display from database if(isset($_POST['display'])){ $result = mysql_query("SELECT * FROM vts_dealerships WHERE `deal_status`=1 ORDER BY `date` DESC"); echo "<table style='width:100%;'>"; echo "<thead> <tr> <th>CODE</th> <th>COMPANY</th> <th>DEALERSHIP</th> <th>ADDRESS</th> <th>CITY</th> <th>STATUS</th> </tr> </thead>"; while($row=mysql_fetch_array($result)){ echo "<tr>"; echo "<td>".$row['deal_code']."</td>"; echo "<td>"; $compCode = mysql_result(mysql_query("SELECT `comp_code` FROM `vts_company` WHERE `comp_id`='".$row['comp_id']."'"),0); echo $compCode; echo "</td>"; echo "<td>".$row['deal_name']."</td>"; echo "<td>".$row['deal_address']."</td>"; echo "<td>".$row['deal_city']."</td>"; echo "<td>"; if($row['deal_status']==1){echo 'Active';}else{echo 'InActive';} echo"</td>"; echo "</tr>"; } echo "</table>"; exit(); } ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings