File manager - Edit - /home/autoph/public_html/connect/home/PRF_UPDATEPRFItemsAndHeaders.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); 193 * 1067 * 215 $prfDate = date_create() ->format("Y-m-d"); $prfTime = date('H:i:s'); $myDate = date_create() ->format("Y-m-d"); $myUID = $user_data['u_id']; if(isset($_POST['done'])){ $UpdatePRFReferenceNumber = mysql_escape_string($_POST['UpdatePRFReferenceNumber']); $UpdateprfCompanySelected = mysql_escape_string($_POST['UpdateprfCompanySelected']); $UpdatemyDealerList = mysql_escape_string($_POST['UpdatemyDealerList']); $UpdateprfCategorySelected = mysql_escape_string($_POST['UpdateprfCategorySelected']); $UpdateCategorySubItem = mysql_escape_string($_POST['UpdateCategorySubItem']); $UpdatePurposeOfReqeust = mysql_escape_string($_POST['UpdatePurposeOfReqeust']); $UpdateDateNeeded = mysql_escape_string($_POST['UpdateDateNeeded']); $UpdateprfApprovingHead = mysql_escape_string($_POST['UpdateprfApprovingHead']); $UpdatetxtAddItemDesc = mysql_escape_string($_POST['UpdatetxtAddItemDesc']); $UpdatetxtAddItemQty = mysql_escape_string($_POST['UpdatetxtAddItemQty']); $UpdateUnitOfMeasure = mysql_escape_string($_POST['UpdateUnitOfMeasure']); $UnitOfMeasure = mysql_escape_string($_POST['UnitOfMeasure']); $itemCategoryCleanUpdate = mysql_escape_string($_POST['UpdateItemCategory']); $itemCategoryUpdate = str_replace(' ', '', $itemCategoryCleanUpdate); //check if item class do exist in the database. If not exist insert this class as new $chkIFitemCategoryExist = mysql_result(mysql_query("SELECT COUNT(id) FROM `prf_item_category` WHERE `item_category`='$itemCategoryUpdate'"),0); if($chkIFitemCategoryExist == 0 ){ mysql_query("INSERT INTO prf_item_category(item_category,asset_cat) VALUES('{$itemCategoryUpdate}','{$UpdateprfCategorySelected}')"); } $UpdateitemCategoryID = mysql_result(mysql_query("SELECT `id` FROM `prf_item_category` WHERE `item_category`='$itemCategoryUpdate'"),0); //ADD FIRST ITEM TO PRF DETAILS $hrdID = mysql_result(mysql_query("SELECT id from prf_request_hdr WHERE reference_code='$UpdatePRFReferenceNumber' AND comp_id ='$UpdateprfCompanySelected'"),0); mysql_query("INSERT INTO prf_request_detl(item_class,header_id,header_ref_code,comp_id,dealer_id,category_id,sub_category_id,item_description,uom,quantity,date_created, time_created) VALUES('{$UpdateitemCategoryID}','{$hrdID}','{$UpdatePRFReferenceNumber}','{$UpdateprfCompanySelected}','{$UpdatemyDealerList}','{$UpdateprfCategorySelected}','{$UpdateCategorySubItem}','{$UpdatetxtAddItemDesc}','{$UpdateUnitOfMeasure}','{$UpdatetxtAddItemQty}','{$prfDate}','{$prfTime}')"); //$getItemDetl = mysql_query("SELECT * FROM prf_request_detl WHERE header_ref_code='$UpdatePRFReferenceNumber' AND `comp_id`='$UpdateprfCompanySelected'"); $getItemDetl = mysql_query("SELECT * FROM prf_request_detl WHERE header_ref_code='$UpdatePRFReferenceNumber' AND `deleted`=0"); echo "<table>"; echo "<thead>"; echo "<th style='width:30px'>NO</th>"; echo "<th style='width:80px'>REF. #</th>"; echo "<th style='width:80px'>ITEM TYPE</th>"; echo "<th style='width:450px'>ITEM DESCRIPTION</th>"; echo "<th style='width:30px'>UoM</th>"; echo "<th style='width:40px'>QUANTITYx</th>"; echo "</thead>"; while($row=mysql_fetch_array($getItemDetl)){ $count = $count + 1; $itemClassID = $row['item_class']; $itemClassDes = mysql_result(mysql_query("SELECT `item_category` FROM `prf_item_category` WHERE `id`='$itemClassID'"),0); ?><tr onclick="javascript:POPUPShowDeleteSubItem(this);"><?php echo "<td>".$count."</td>"; echo "<td>".strtoupper($row['header_ref_code'])."</td>"; echo "<td>".strtoupper($itemClassDes)."</td>"; echo "<td>".strtoupper($row['item_description'])."</td>"; echo "<td>".strtoupper($row['uom'])."</td>"; echo "<td style='text-align:center'>".$row['quantity']."</td>"; echo "</tr>"; } echo "</table>"; exit(); } ?> <!--- LOCALIZED COPY OF JAVASCRIPT --> <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript"> $(document).ready(function(){ //====================================================================================================== //====================================================================================================== });
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings