function showOpeToolBatchUI() { $db = Database::getInstance(); $cxn = $db->getConnection(); $q = "SELECT * From Ope_Tool_Batch WHERE Batch_ID={$this->batchid} AND Ope_Drawing_ID={$this->operevid}"; if (!($res = $cxn->query($q))) { exit("error (showOpeToolBatchUI) {$q} : {$cxn->error}"); } $r = $res->num_rows; print '<table>'; if ($r == 0) { print '<thead><tr><th class="v">Ope Tool ID</th><th class="v">Tool Description</th><th>Tool Used</th><th class="v">Tool Body Description</th><th>Tool Body Used</th><th class="v">Holder Description</th><th width:"25">Holder Used</th></tr></thead><tbody>'; $qs = "SELECT * FROM Ope_Tool WHERE Ope_Drawing_ID={$this->operevid} AND Deleted!=1"; if (!($ress = $cxn->query($qs))) { echo "error :", $cxn->error; } $i = 0; while ($row = mysqli_fetch_assoc($ress)) { $id = $row['Ope_Tool_ID']; $qt = "SELECT Tool_Desc,Brand_Description From Tool as t inner join Tool_Brand as tb on tb.Brand_ID=t.Brand_ID WHERE Tool_ID={$row['Tool_ID_1']}"; if (!($rest = $cxn->query($qt))) { echo "error :", $cxn->error; } $t = mysqli_fetch_assoc($rest); $qh = "SELECT Holder_Description From Holder WHERE Holder_ID={$row['Holder_ID_1']}"; if (!($resh = $cxn->query($qh))) { echo "error :", $cxn->error; } $h = mysqli_fetch_assoc($resh); $qb = "SELECT Tool_Desc,Brand_Description,Mfg_Part_NO From ToolBody as t inner join Tool_Brand as tb on tb.Brand_ID=t.Brand_ID WHERE ToolBody_ID={$row['ToolBody_ID_1']}"; if (!($resb = $cxn->query($qb))) { echo "error :", $cxn->error; } $tb = mysqli_fetch_assoc($resb); $optid = new Form(array('type' => 'hidden', 'id' => 'opetoolid[' . $i . ']', 'name' => 'opetoolid[' . $i . ']', 'value' => $row['Ope_Tool_ID'])); $tsid = new Form(array('id' => 'toolstockid[' . $i . ']', 'name' => 'toolstockid[' . $i . ']', 'class' => 'required', 'unique' => 'toolstockid')); $tbsid = new Form(array('id' => 'toolbodystockid[' . $i . ']', 'name' => 'toolbodystockid[' . $i . ']')); $hsid = new Form(array('id' => 'holderstockid[' . $i . ']', 'name' => 'holderstockid[' . $i . ']', 'class' => 'required number')); echo <<<_END \t\t\t\t\t\t\t<tr><th class="v">{$optid->ip} {$row['Ope_Tool_ID']}</th> \t\t\t\t\t\t\t\t<th class="v">{$t['Brand_Description']} Make {$t['Tool_Desc']}</th><td>{$tsid->ip}</td> \t\t\t\t\t\t\t\t<th class="v">{$tb['Brand_Description']} Make {$tb['Tool_Desc']}</th><td>{$tbsid->ip}</td> \t\t\t\t\t\t\t\t<th class="v">{$h['Holder_Description']}</th><td>{$hsid->ip}</td></tr> _END; $i++; } } else { ///we are either changing a tool to returning back all tools print '<thead><tr><th class="v">Ope Tool ID</th><th class="v">Tool Description</th><th>Tool Used</th><th>No Of Jobs</th><th>Storage Location</th> <th class="v">Tool Body Description</th><th>Tool Body Used</th><th>Body Storage Location</th> <th class="v">Holder Description</th><th width:"25">Holder Used</th><th>Holder Storage Location</th><th>Remarks</th></tr></thead><tbody>'; $qs = "SELECT * FROM Ope_Tool WHERE Ope_Drawing_ID={$this->operevid} AND Deleted!=1"; if (!($ress = $cxn->query($qs))) { exit("error (showOpeToolBatchUI 2) {$qs} : {$cxn->error}"); } $any = new Anylist(); $i = 0; while ($row = mysqli_fetch_assoc($ress)) { $qt = "SELECT Tool_Desc,Brand_Description From Tool as t inner join Tool_Brand as tb on tb.Brand_ID=t.Brand_ID WHERE Tool_ID={$row['Tool_ID_1']}"; if (!($rest = $cxn->query($qt))) { echo "error :", $cxn->error; } $t = mysqli_fetch_assoc($rest); $qtt = "SELECT * FROM Ope_Tool_Batch WHERE Ope_Tool_ID={$row['Ope_Tool_ID']} AND Cutting_Mins=0 AND Qty=0"; if (!($restt = $cxn->query($qtt))) { echo "error :", $cxn->error; } $tt = mysqli_fetch_assoc($restt); $qt = "SELECT Tool_Desc,Brand_Description From Tool as t inner join Tool_Brand as tb on tb.Brand_ID=t.Brand_ID WHERE Tool_ID={$row['Tool_ID_1']}"; if (!($rest = $cxn->query($qt))) { echo "error :", $cxn->error; } $t = mysqli_fetch_assoc($rest); $qh = "SELECT Holder_Description From Holder WHERE Holder_ID={$row['Holder_ID_1']}"; if (!($resh = $cxn->query($qh))) { echo "error :", $cxn->error; } $h = mysqli_fetch_assoc($resh); $qb = "SELECT Tool_Desc,Brand_Description,Mfg_Part_NO From ToolBody as t inner join Tool_Brand as tb on tb.Brand_ID=t.Brand_ID WHERE ToolBody_ID={$row['ToolBody_ID_1']}"; if (!($resb = $cxn->query($qb))) { echo "error :", $cxn->error; } $tb = mysqli_fetch_assoc($resb); if ($tt['Ope_Tool_Batch_ID'] != '') { $optbid = new Form(array('type' => 'hidden', 'id' => 'opetoolbatchid[' . $i . ']', 'name' => 'opetoolbatchid[' . $i . ']', 'value' => $tt['Ope_Tool_Batch_ID'])); } else { //if there in no tool associated with entry in tool list $optbid = new Form(array('type' => 'hidden', 'id' => 'opetoolid[' . $i . ']', 'name' => 'opetoolid[' . $i . ']', 'value' => $row['Ope_Tool_ID'])); } $tsid = new Form(array('id' => 'toolstockid[' . $i . ']', 'name' => 'toolstockid[' . $i . ']', 'class' => 'required', 'value' => $tt['Tool_Stock_ID'], 'unique' => 'toolstockid', 'size' => "10")); $tbsid = new Form(array('id' => 'toolbodystockid[' . $i . ']', 'name' => 'toolbodystockid[' . $i . ']', 'value' => $tt['Tool_Body_Stock_ID'], 'size' => "10")); $hsid = new Form(array('id' => 'holderstockid[' . $i . ']', 'name' => 'holderstockid[' . $i . ']', 'class' => 'required number', 'value' => $tt['Holder_Stock_ID'], 'unique' => 'holderstockid', 'size' => "10")); $tqty = new Form(array('id' => 'jobqty[' . $i . ']', 'name' => 'jobqty[' . $i . ']', 'class' => 'number', 'value' => '0', 'size' => "10")); $trem = new Form(array('id' => 'remarks[' . $i . ']', 'name' => 'remarks[' . $i . ']')); echo <<<_END \t\t\t\t\t\t\t<tr><th class="v" style="width:30px">{$optbid->ip} {$row['Ope_Tool_ID']}</th> \t\t\t\t\t\t\t\t<th class="v" style="width:100px">{$t['Brand_Description']} Make {$t['Tool_Desc']}</th><td>{$tsid->ip}</td><td>{$tqty->ip}</td> \t\t\t\t\t\t\t\t<td> _END; $any->createList('Tool_Storage'); $sel = new selectlist('Tool_Storage_ID[' . $i . ']', $any->getValue('anylist'), 'Storage Location', 'Tool_Storage_ID', 'Cur_Location', 'class="required"', 2, null); echo <<<_END \t\t\t\t\t\t\t\t</td><th class="v">{$tb['Brand_Description']} Make {$tb['Tool_Desc']}</th><td>{$tbsid->ip}</td><td> _END; $any->createList('Tool_Storage'); $sel = new selectlist('ToolBody_Storage_ID[' . $i . ']', $any->getValue('anylist'), 'Storage Location', 'Tool_Storage_ID', 'Cur_Location', 'class="required"', 2, null); echo <<<_END \t\t\t\t\t\t\t\t</td><th class="v" style="width:50px">{$h['Holder_Description']}</th><td>{$hsid->ip}</td><td> _END; $any->createList('Tool_Storage'); $sel = new selectlist('Holder_Storage_ID[' . $i . ']', $any->getValue('anylist'), 'Storage Location', 'Tool_Storage_ID', 'Cur_Location', 'class="required"', 2, null); echo <<<_END \t\t\t\t\t\t\t\t</td><td>{$trem->ip}</td></tr> _END; $i++; } } $bt = new Form(array('id' => 'save', 'name' => 'save', 'type' => 'button', 'value' => 'Save', 'class' => 'submit')); echo '<tr><td colspan="4" style="text-align:center;">' . $bt->ip . '</td></tr>'; echo '</tbody></table>'; }
function leaveUI() { $db = Database::getInstance(); $cxn = $db->getConnection(); if (isset($_SESSION['operatorid'])) { $this->operatorid = $_SESSION['operatorid']; } else { exit('Not Logged In!!'); } $any = new Anylist(); $any->createList('Leave_Reasons'); echo '<fieldset><legend>Enter Leave Details</legend>'; echo '<p><label>From</label><input id="leavefrom" name="leavefrom" class="required"><input id="leavefromdb" name="leavefromdb" type="hidden"></p>'; echo '<p><label>To</label><input id="leaveto" name="leaveto" class="required"><input id="leavetodb" name="leavetodb" type="hidden"></p>'; $sel = new selectlist('Leave_Reason', $any->getValue('anylist'), 'Select Leave Reason', 'Reason', 'Reason', 'class="required"', '', 1); echo '</fieldset>'; }
function showToolBodyStockUI() { if ($this->toolbodystockid == '') { echo <<<_END \t\t\t<fieldset> \t\t\t\t<legend>Tool Details</legend> \t\t\t\t<p> \t\t\t <label>New Tool Body Quantity</label> \t\t\t <input id="qty" name="qty" size="25" class="number"/> \t\t\t </p> \t\t\t\t<p> \t\t\t <label>Price of Each New Tool</label> \t\t\t <input id="price" name="price" size="25" class="number"/> \t\t\t </p> \t\t\t\t<p> \t\t\t <label>Storage Bin ID</label> \t\t\t <input id="binid" name="binid" size="25" /> \t\t\t </p> \t\t\t\t</fieldset> \t\t\t <p> \t\t\t <input class="submit" type="submit" value="Save"/> \t\t\t </p> _END; } else { $db = Database::getInstance(); $cxn = $db->getConnection(); $q = "SELECT * FROM ToolBody_Stock WHERE ToolBody_Stock_ID={$this->toolbodystockid}"; if (!($res = $cxn->query($q))) { echo "error :", $cxn->error; } else { $row = mysqli_fetch_assoc($res); $any = new Anylist(); echo <<<_END \t\t\t<fieldset> \t\t\t\t<legend>Tool Details</legend> _END; if ($this->typeid != 18) { echo <<<_END \t\t\t\t<p> \t\t\t <label>Cutting Dia (Dc)</label> \t\t\t <input id="cdiameter" name="cdiameter" size="25" class="number" value="{$row['Cutting_Dia']}"/> \t\t\t </p> \t\t\t <p> \t\t\t <label>Shank Diameter (Ds)</label> \t\t\t <input id="sdiameter" name="sdiameter" size="25" class="number" value="{$row['Shank_Dia']}"/> \t\t\t </p> \t\t\t <p> \t\t\t <label>Flute Length (FL)</label> \t\t\t <input id="flutelength" name="flutelength" size="25" class="required number" value="{$row['Tool_FL']}"/> \t\t\t </p> _END; if ($this->typeid != 3) { echo <<<_END \t\t\t\t<p> \t\t\t <label>Neck Diameter (Dn)</label> \t\t\t <input id="ndiameter" name="ndiameter" size="25" class="number" value="{$row['Neck_Dia']}"/> \t\t\t </p> _END; } echo <<<_END \t\t\t <p> \t\t\t <label>Neck Length/Reach (NL)</label> \t\t\t <input id="reach" name="reach" size="25" class="number greaterThan" data-min="flutelength" value="{$row['Neck_Length']}"/> \t\t\t </p> \t\t\t <p> \t\t\t <p> \t\t\t <label>Overall Length (OAL)</label> \t\t\t <input id="tooloal" name="tooloal" size="25" class="number greaterThan" data-min="flutelength" data-min="reach" value="{$row['Tool_OAL']}"/> \t\t\t </p> _END; if ($this->typeid == 9) { echo <<<_END \t\t\t <p> \t\t\t <label>Max Radial Depth (Tmax)</label> \t\t\t <input id="tmax" name="tmax" size="25" class="number" class="required" value="{$row['T_Max']}"/> \t\t\t </p> _END; } } echo <<<_END \t\t\t <label>Price</label> \t\t\t <input id="price" name="price" size="25" class="number" value="{$row['Price']}"/> \t\t\t </p> \t\t\t\t<p> \t\t\t <label>Storage Bin ID</label> \t\t\t <input id="binid" name="binid" size="25" value="{$row['Bin_ID']}"/> \t\t\t </p> \t\t\t <p> \t\t\t <label>Current Location</label> _END; $any->createList('Tool_Storage'); $sel = new selectlist('Tool_Storage_ID', $any->getValue('anylist'), 'Storage Location', 'Tool_Storage_ID', 'Cur_Location', 'class="required"', $row['Cur_Location'], null); echo <<<_END \t\t\t </p> \t\t\t\t<p> \t\t\t <label>Remarks</label> \t\t\t <input id="remarks" name="remarks" size="25" value="{$row['Remarks']}"/> \t\t\t </p> \t\t\t\t</fieldset> \t\t\t <p> \t\t\t <input class="submit" type="submit" value="Save"/> \t\t\t </p> _END; } } }
function showHolderStockUI() { if ($this->holderstockid == '') { echo <<<_END \t\t\t<fieldset> \t\t\t\t<legend>Tool Holder Details</legend> \t\t\t\t<p> \t\t\t <label>New Tool Holder Quantity</label> \t\t\t <input id="qty" name="qty" size="25" class="number"/> \t\t\t </p> \t\t\t\t<p> \t\t\t <label>Price of Each New Holder</label> \t\t\t <input id="price" name="price" size="25" class="number"/> \t\t\t </p> \t\t\t\t</fieldset> \t\t\t <p> \t\t\t <input class="submit" type="submit" value="Save"/> \t\t\t </p> _END; } else { $db = Database::getInstance(); $cxn = $db->getConnection(); $q = "SELECT * FROM Holder_Stock WHERE Holder_Stock_ID={$this->holderstockid}"; if (!($res = $cxn->query($q))) { echo "error :", $cxn->error; } else { $row = mysqli_fetch_assoc($res); $any = new Anylist(); echo <<<_END \t\t\t<fieldset> \t\t\t\t<legend>Holder Location Details</legend> \t\t\t <p> \t\t\t <label>Current Location</label> _END; $any->createList('Tool_Storage'); $sel = new selectlist('Tool_Storage_ID', $any->getValue('anylist'), 'Storage Location', 'Tool_Storage_ID', 'Cur_Location', 'class="required"', $row['Cur_Location'], null); echo <<<_END \t\t\t </p> \t\t\t\t<p> \t\t\t <label>Remarks</label> \t\t\t <input id="remarks" name="remarks" size="25" value="{$row['Remarks']}"/> \t\t\t </p> \t\t\t\t</fieldset> \t\t\t <p> \t\t\t <input class="submit" type="submit" value="Save"/> \t\t\t </p> _END; } } }