if (isset($_GET['id'])) { $id = $_GET['id']; } else { $id = 'PO_ID'; } if (isset($_GET['class'])) { $class = 'class="required"'; } else { $class = ''; } $po->createPOList(); $sel = new selectlist($id, $po->getPOList(), 'Select Purchase Order', 'PO_ID', 'podes', '', '', '1'); break; case 'spare': //machine list $spare = new Spares(); if (isset($_GET['id'])) { $id = $_GET['id']; } else { $id = 'Spare_ID'; } $spare->createSpareList(); $sel = new selectlist($id, $spare->getSpareList(), 'Select Spare', 'Spare_ID', 'Description', '', '', '1'); break; case 'maintenance': //machine list $any = new Anylist(); if (isset($_GET['id'])) { $id = $_GET['id']; } else { $id = 'Maintenance_Type_ID';
$ml->setValue('mainttypeid', $_GET['mtid']); $ml->setValue('machineid', $_GET['mcid']); $ml->showMaintenanceUI(); } if (isset($_GET['gspmlist'])) { $spm = new SPMaintenance(); $spm->setValue('machineid', $_GET['mcid']); $spm->createSPMTitleList(); $sel = new selectlist('SPM_ID', $spm->getSPMTitleList(), 'Select Maintenance Plan', 'SPM_ID', 'SPM_Title', 'class="required"', '', '1'); } if (isset($_GET['gprop'])) { $ml->setValue('spmid', $_GET['spmid']); $ml->showGPUI(); } if (isset($_GET['spareqty'])) { $spare = new Spares(); $spare->setValue('spareid', $_GET['sid']); $spare->showSpareStockQty(); } if (isset($_GET['viewlog'])) { $data = array('sa' => $_GET['sa']); ///no of records to limit to if (isset($_GET['mid'])) { $data['mid'] = $_GET['mid']; ///start date } if (isset($_GET['edate'])) { $data['edate'] = $_GET['edate']; //end date } if (isset($_GET['sdate'])) {
<?php require_once 'autoload.php'; $spare = new Spares(); $_SESSION['LAST_ACTIVITY'] = time(); if (isset($_POST['description'])) { //print_r($_POST); if (isset($_POST['description'])) { $spare->setValue('description', $_POST['description']); } if (isset($_POST['Spare_ID'])) { $spare->setValue('spareid', $_POST['Spare_ID']); } if (isset($_POST['supppartno'])) { $spare->setValue('supppartno', $_POST['supppartno']); } if (isset($_POST['mfgpartno'])) { $spare->setValue('mfgpartno', $_POST['mfgpartno']); } if (isset($_POST['opid'])) { $spare->setValue('machineid', $_POST['opid']); } $spare->saveSpare(); } else { if (isset($_POST['Supplier_ID'])) { //print_r($_POST); if (isset($_POST['Supplier_ID'])) { $spare->setValue('supplierid', $_POST['Supplier_ID']); } if (isset($_POST['RSpare_ID'])) { $rspid = $_POST['RSpare_ID'];