Ejemplo n.º 1
0
    function showInstrumentUI()
    {
        $db = Database::getInstance();
        $cxn = $db->getConnection();
        $ity = new InstrumentType();
        $ity->createInstrumentTypeList();
        $islno = $idesc = $caldate = $calfreq = $make = $range = $error = $lc = $rem = $ityid = $caldatedb = $cloc = '';
        if ($this->instrumentid != '') {
            $q = "SELECT * FROM Instrument WHERE Instrument_ID={$this->instrumentid}";
            if (!($res = $cxn->query($q))) {
                exit("error : {$cxn->error}");
            }
            $row = mysqli_fetch_assoc($res);
            $islno = $row['Instrument_SLNO'];
            $idesc = $row['Instrument_Description'];
            $calfreq = $row['Calibration_Frequency'];
            $make = $row['Make'];
            $range = $row['Instrument_Range'];
            $error = $row['Acceptable_Error'];
            $lc = $row['Least_Count'];
            $rem = $row['Remarks'];
            $ityid = $row['Instrument_Type_ID'];
            $cloc = $row['Current_Location'];
            $qc = "SELECT *,DATE_FORMAT(Calibration_Date,'%d-%m-%Y') as cd FROM Calibration_History WHERE Instrument_ID={$this->instrumentid}";
            if (!($rcd = $cxn->query($qc))) {
                exit("error : {$cxn->error}");
            }
            $n = $rcd->num_rows;
        }
        $any = new Anylist();
        $any->Createlist('Instrument_Location');
        echo <<<_END
\t\t\t<label>Instrument Type</label>
_END;
        $sel = new selectlist('Instrument_Type_ID', $ity->getInstrumentTypeList(), 'Select Instrument Type', 'Instrument_Type_ID', 'Instrument', 'class="required"', $ityid, '');
        echo <<<_END
\t\t\t<p>
\t\t\t<label>Instrument Serial NO</label>
\t\t\t<input id="slno" name="slno" value="{$islno}">
\t\t\t</p>
\t\t\t<p>
\t\t\t<label>Instrument Description</label>
\t\t\t<input id="instrumentdesc" name="instrumentdesc" value="{$idesc}" class="required">
\t\t\t</p>
\t\t\t<p>
\t\t\t<label>Calibration Frequency</label>
\t\t\t<input id="frequency" name="frequency" value="{$calfreq}">
\t\t\t</p>
\t\t\t<p>
\t\t\t<label>Instrument Make</label>
\t\t\t<input id="make" name="make" value="{$make}" class="required">
\t\t\t</p>
\t\t\t<p>
\t\t\t<label>Instrument Range</label>
\t\t\t<input id="range" name="range" value="{$range}" >
\t\t\t</p>
\t\t\t<p>
\t\t\t<label>Acceptable Error</label>
\t\t\t<input id="acceptableerror" name="acceptableerror" value="{$error}" >
\t\t\t</p>
\t\t\t<p>
\t\t\t<label>Instrument Least Count</label>
\t\t\t<input id="leastcount" name="leastcount" value="{$lc}">
\t\t\t</p>
\t\t\t<p>
\t\t\t<label>Remarks</label>
\t\t\t<input id="remarks" name="remarks" value="{$rem}">
\t\t\t</p>
\t\t\t<p>
\t\t\t<label>Current Location</label>

_END;
        $sel = new selectlist('Location_ID', $any->anylist, 'Select Instrument Location', 'Location_ID', 'Location', 'class="required"', $cloc, '');
        echo '<p><label>Calibration Date</label><input id="calibrationdate" name="calibrationdate" ><input type="hidden" id="caldatedb" name="caldatedb"></p>';
        echo '<p><label>Calibration Certificate No</label><input id="certno" name="certno"></p>';
        echo '<p><label>Calibration Remarks</label><input id="calremarks" name="calremarks"></p>';
        if (isset($n)) {
            echo '<p><label>Calibration History</label>';
            echo '<table class="tl"><tr><th>Calibration Date</th><th>Certificate No.</th><th>Remarks</th></tr>';
            while ($rc = mysqli_fetch_assoc($rcd)) {
                echo '<tr><td>' . $rc['cd'] . '</td><td>' . $rc['Certificate_NO'] . '</td><td>' . $rc['Remarks'] . '</td></tr>';
            }
            echo '</table>';
        }
        echo '</p>';
    }
Ejemplo n.º 2
0
     $sel = new selectlist('Machine_ID', $mc->getMachineList(), 'Select Machine', 'Machine_ID', 'mnslno', $class, '', '1');
     break;
 case 'instrument':
     //machine list
     $ins = new Instrument();
     if (isset($_GET['typeid'])) {
         $ins->setValue('typeid', $_GET['typeid']);
     }
     $ins->createInstrumentList();
     $sel = new selectlist('Instrument_ID', $ins->getInstrumentList(), 'Select Instrument', 'Instrument_ID', 'inst', '', '');
     break;
 case 'instype':
     //machine list
     $inst = new InstrumentType();
     $inst->createInstrumentTypeList();
     $sel = new selectlist('Instrument_Type_ID', $inst->getInstrumentTypeList(), 'Select Instrument Type', 'Instrument_Type_ID', 'Instrument', 'class="required"', '', '');
     break;
 case 'skillgroup':
     //machine list
     $sg = new SkillGroup();
     $sg->createSkillGroupList();
     if (isset($_GET['class'])) {
         $class = 'class="required"';
     } else {
         $class = '';
     }
     $sel = new selectlist('Skill_Group_ID', $sg->getSkillGroupList(), 'Select Skill Group', 'Skill_Group_ID', 'Group_Desc', $class, '', '1');
     break;
 case 'auth':
     //machine list
     $au = new Authority();
Ejemplo n.º 3
0
    function addDimensionRow($data = array())
    {
        $tf = "0";
        $pd1 = "";
        $pd0 = "Checked";
        $cd1 = "";
        $cd0 = "Checked";
        $sd1 = '';
        $sd0 = 'Checked';
        if (isset($data['id'])) {
            $i = $data['id'];
        } else {
            $i = 0;
        }
        if (isset($data['zone'])) {
            $zone = $data['zone'];
        } else {
            $zone = '';
        }
        if (isset($data['critical'])) {
            $critical = $data['critical'];
        } else {
            $critical = '';
        }
        if (isset($data['bno'])) {
            $bno = $data['bno'];
        } else {
            $bno = '';
        }
        if (isset($data['ddid'])) {
            $ddid = $data['ddid'];
        } else {
            $ddid = '';
        }
        if (isset($data['instid'])) {
            $instid = $data['instid'];
        } else {
            $instid = '';
        }
        if (isset($data['bdimn'])) {
            $bdimn = $data['bdimn'];
        } else {
            $bdimn = '';
        }
        if (isset($data['tl'])) {
            $tl = $data['tl'];
        } else {
            $tl = '';
        }
        if (isset($data['tu'])) {
            $tu = $data['tu'];
        } else {
            $tu = '';
        }
        if (isset($data['stgdimn'])) {
            if ($data['stgdimn'] == 1) {
                $sd1 = "Checked";
                $sd0 = '';
            }
        }
        if (isset($data['cdimn'])) {
            if ($data['cdimn'] == 1) {
                $cd1 = "Checked";
                $cd0 = '';
            }
        }
        if (isset($data['prod'])) {
            if ($data['prod'] == 1) {
                $pd1 = "Checked";
                $pd0 = '';
            }
        }
        if (isset($data['did'])) {
            $did = '<input type="hidden" id="dimensionid[' . $i . ']" name="dimensionid[' . $i . ']" value="' . $data['did'] . '">';
            $del = '<input type="checkbox" name="deldimn[' . $i . ']" id="deldimn[' . $i . ']" value="1" />';
        } else {
            $did = '';
            $del = '';
        }
        $a = new Anylist();
        $a->createList('Dimn_Criticality');
        if ($i == null) {
            $i = 0;
        }
        $dd = new DimnDescription();
        $dd->createDimnDescList();
        $in = new InstrumentType();
        $in->createInstrumentTypeList();
        echo <<<_END
\t\t<tr><td><input name="baloonno[{$i}]" id="baloonno[{$i}]" class="required" unique="baloonno" size="5" value="{$bno}">{$did}</td>
\t\t<td><input id="zone[{$i}]" name="zone[{$i}]" value="{$zone}"></td><td>
_END;
        $sel = new selectlist('dimndesc[' . $i . ']', $dd->getDimnDescList(), 'Select Dimension Comment', 'Desc_ID', 'Dimn_Desc', 'class="required"', $ddid, '');
        echo <<<_END
\t\t</td><td><input name="basicdimn[{$i}]" id="basicdimn[{$i}]" class="required" size="7" value="{$bdimn}"></td>
\t\t<td><input name="tollower[{$i}]" id="tollower[{$i}]" size="5" class="number" value="{$tl}"/></td>
\t\t<td><input name="tolupper[{$i}]" id="tolupper[{$i}]" size="5" class="number greaterThan" data-min="tollower\\[{$i}\\]" value="{$tu}"/></td><td>
_END;
        $sel = new selectlist('instrumenttypeid[' . $i . ']', $in->getInstrumentTypeList(), 'Select Instrument Type', 'Instrument_Type_ID', 'Instrument', 'class="required"', $instid, '');
        echo '</td><td>';
        $sel = new selectlist('critical[' . $i . ']', $a->anylist, 'Select Characteristic', 'Criticality_ID', 'Criticality', '', $critical, '');
        echo <<<_END
\t\t</td><td><input type="radio" name="stagedimn[{$i}]" value="1" {$sd1}/>Y
\t\t<input type="radio" name="stagedimn[{$i}]" value="0" {$sd0}/>N</td>
\t\t<td><input type="radio" name="proddimn[{$i}]" id="proddimn[{$i}]" value="1" {$pd1}/>Y
\t\t<input type="radio" name="proddimn[{$i}]" id="proddimn[{$i}]" value="0" {$pd0}/>N</td>
\t\t<td><input type="radio" name="compulsary[{$i}]" id="compulsary[{$i}]" value="1" {$cd1} />Y
\t\t<input type="radio" name="compulsary[{$i}]" id="compulsary[{$i}]" value="0" {$cd0}/>N</td><td>{$del}</td></tr>
_END;
    }