function showMachineUI() { $db = Database::getInstance(); $cxn = $db->getConnection(); $selc = '<option value="1">Yes</option><option value="0">No</option></select>'; if ($this->machineid != '') { $q = "SELECT *,DATE_FORMAT(Install_Date,'%d-%m-%Y') as id FROM Machine WHERE Machine_ID={$this->machineid}"; if (!($res = $cxn->query($q))) { exit("error (showMachineUI : {$q}) : {$cxn->error}"); } $r = mysqli_fetch_assoc($res); $this->machinename = $r['Machine_Name']; $this->machineslno = $r['Machine_SLNO']; $this->ncserialno = $r['NC_Serial_NO']; $this->installdatedb = $r['Install_Date']; $this->installdate = $r['id']; $this->showinlogentry = $r['Show_In_Logentry']; $this->supplierid = $r['Supplier_ID']; $this->machinedesc = $r['Machine_Desc']; $this->spindletaper = $r['Spindle_Taper']; $this->atcsize = $r['ATC_Size']; $this->maxrpm = $r['Max_RPM']; $this->tablesize = $r['Table_Size']; $this->stroke = $r['Stroke']; $this->toolclampingforce = $r['Tool_Clamping_Force']; $this->torque = $r['Torque']; $this->typeid = $r['Type_ID']; if ($this->showinlogentry == 1) { $selc = '<option value="1" selected >Yes</option><option value="0">No</option></select>'; } else { $selc = '<option value="1">Yes</option><option value="0" selected>No</option></select>'; } } echo '<fieldset><legend>Machine Details</legend>'; $any = new Anylist(); $any->createList('Machine_Type'); $supp = new Supplier(); $supp->createSupplierList(); $sel = new selectlist('Supplier_ID', $supp->getSupplierList(), 'Select Supplier', 'Supplier_ID', 'Supplier_Name', 'class="required"', $this->supplierid, '1'); $sel2 = new selectlist('Type_ID', $any->anylist, 'Select Equipment Type', 'Type_ID', 'Type_Description', 'class="required"', $this->typeid, '1'); echo '<p><label>Machine Name</label><input id="machinename" name="machinename" class="required" value="' . $this->machinename . '"></p>'; echo '<p><label>Machine Description</label><input id="machinedesc" name="machinedesc" class="required" value="' . $this->machinedesc . '"></p>'; echo '<p><label>Machine Serial Number</label><input id="machineslno" name="machineslno" value="' . $this->machineslno . '"></p>'; echo '<p><label>NC Serial Number</label><input id="ncserialno" name="ncserialno" value="' . $this->ncserialno . '"></p>'; echo '<p><label>Spindle Taper</label><input id="spindletaper" name="spindletaper" value="' . $this->spindletaper . '"></p>'; echo '<p><label>ATC Size</label><input id="atcsize" name="atcsize" value="' . $this->atcsize . '"></p>'; echo '<p><label>Maximum RPM</label><input id="maxrpm" name="maxrpm" value="' . $this->maxrpm . '"></p>'; echo '<p><label>Table Size</label><input id="tablesize" name="tablesize" value="' . $this->tablesize . '"></p>'; echo '<p><label>Axis Strokes</label><input id="stroke" name="stroke" value="' . $this->stroke . '"></p>'; echo '<p><label>Tool Clamping force</label><input id="toolclampingforce" name="toolclampingforce" value="' . $this->toolclampingforce . '"></p>'; echo '<p><label>Torque</label><input id="torque" name="torque" value="' . $this->torque . '"></p>'; echo '<p><label>Date OF Installation</label><input id="installdate" name="installdate" value="' . $this->installdate . '"><input id="installdatedb" type="hidden" name="installdatedb" value="' . $this->installdatedb . '"></p>'; echo '<p><label>Show Machine In Log Entry Page?</label><select id="showinlogentry" name="showinlogentry">' . $selc; echo '</fieldset>'; echo '<input type="submit" class="submit" value="Save Machine Details">'; }
if (isset($_GET['bid'])) { $supp->setBrandID($_GET['bid']); } if (isset($_GET['scopeid'])) { $supp->setValue('scopeidl', $_GET['scopeid']); } if (isset($_GET['onlyapproved'])) { $supp->setValue('onlyapproved', $_GET['onlyapproved']); } if (isset($_GET['class'])) { $class = 'class="required"'; } else { $class = ''; } $supp->createSupplierList(); $sel = new selectlist('Supplier_ID', $supp->getSupplierList(), 'Select Supplier', 'Supplier_ID', 'Supplier_Name', $class, ''); break; case 'brand': $brand = new Brand(); $brand->createBrandList(); $sel = new selectlist('Brand_ID', $brand->getBrandList(), 'Select Brand', 'Brand_ID', 'Brand_Description', '', ''); break; case 'ttype': $ttype = new TType(); $ttype->createTypeList(); if (isset($_GET['ttypeid'])) { $sid = $_GET['ttypeid']; } else { $sid = ''; } $sel = new selectlist('Tool_Type_ID', $ttype->getTypeList(), 'Select Tool Type', 'Tool_Type_ID', 'Tool_Type', '', $sid);
function showSpareInwardUI() { $supp = new Supplier(); $supp->createSupplierList(); echo '<fieldset><legend>Enter Spare Purcjase Details</legend>'; $sel = new selectlist('Supplier_ID', $supp->getSupplierList(), 'Select Supplier', 'Supplier_ID', 'Supplier_Name', 'class="required"', '', '1'); echo '<div id="poid"></div>'; echo '<p><label>Enter Price</label><input id="price" name="price" class="required"></p>'; echo '<p><label>Enter Quantity Purchased</label><input id="qty" name="qty" class="required"></p>'; echo '<p><label>Date Received</label><input id="datereceived" name="datereceived" class="required"><input id="datereceiveddb" name="datereceiveddb" type="hidden"></p>'; echo '<input type="button" id="receive" value="Save Quantity"> '; }