function showDimensionRow($data = array())
    {
        $db = Database::getInstance();
        $cxn = $db->getConnection();
        if (isset($data['id'])) {
            $i = $data['id'];
        } else {
            $i = 0;
        }
        //counter
        if (isset($data['zone'])) {
            $zone = $data['zone'];
        } else {
            $zone = '';
        }
        //zone
        if (isset($data['bno'])) {
            $bno = $data['bno'];
        } else {
            $bno = '';
        }
        //baloon no
        if (isset($data['ddes'])) {
            $ddes = $data['ddes'];
        } else {
            $ddes = '';
        }
        //dimn desription
        if (isset($data['ddid'])) {
            $ddid = $data['ddid'];
        } else {
            $ddid = '';
        }
        //description id
        if (isset($data['did'])) {
            $did = $data['did'];
        } else {
            $did = '';
        }
        //dimension id
        if (isset($data['insttypeid'])) {
            $insttypeid = $data['insttypeid'];
        } else {
            $insttypeid = '';
        }
        //instrunment type
        if (isset($data['bdimn'])) {
            $bdimn = $data['bdimn'];
        } else {
            $bdimn = '';
        }
        //basic dimension
        if (isset($data['tl'])) {
            $tl = $data['tl'];
        } else {
            $tl = '';
        }
        //tol lower
        if (isset($data['tu'])) {
            $tu = $data['tu'];
        } else {
            $tu = '';
        }
        //tol upper
        if (isset($data['instid'])) {
            $instid = $data['instid'];
        } else {
            $instid = '';
        }
        //instrument id
        if (isset($data['commid'])) {
            $commid = $data['commid'];
        } else {
            $commid = '';
        }
        //dimn commnet id
        if (isset($data['rem'])) {
            $rem = $data['rem'];
        } else {
            $rem = '';
        }
        //obseration remarks
        if (isset($data['go'])) {
            $go = $data['go'];
        } else {
            $go = '';
        }
        //go field entry
        if (isset($data['nogo'])) {
            $nogo = $data['nogo'];
        } else {
            $nogo = '';
        }
        //nogo field entry
        if (isset($data['obser'])) {
            $obser = $data['obser'];
        } else {
            $obser = '';
        }
        //observation field entry
        if (isset($data['obsid'])) {
            $obsid = $data['obsid'];
        } else {
            $obsid = '';
        }
        //observation field entry
        if (isset($data['cd'])) {
            if ($data['cd'] == 1) {
                $cd = 'class="required number"';
                $ci = 'class="required"';
            } else {
                $cd = '';
                $ci = '';
            }
        }
        //is it a compulsary dimension
        $dd = new DimnDescription();
        $dd->createDimnDescList();
        $in = new Instrument();
        $in->setValue('showall', 1);
        $in->setValue('typeid', $insttypeid);
        $in->setValue('instloc', '1');
        $in->createInstrumentList();
        echo <<<_END
\t\t<tr><td><input id="dimensionid[{$i}]" name="dimensionid[{$i}]" value="{$did}" type="hidden" >
_END;
        if ($obsid != '') {
            echo <<<_END
\t<input id="observationid[{$i}]" name="observationid[{$i}]" value="{$obsid}" type="hidden" >
_END;
        }
        echo <<<_END
\t\t{$bno}</td><td>{$zone}</td><td>{$ddes}</td><td>{$bdimn}<input id="bdimn[{$i}]" value="{$bdimn}" type="hidden"></td>
\t\t<td>{$tl}<input id="tl[{$i}]" value="{$tl}" type="hidden"></td><td>{$tu} <input id="tu[{$i}]" value="{$tu}" type="hidden"></td><td>
_END;
        $sel = new selectlist('instrumentid[' . $i . ']', $in->getInstrumentList(), 'Select Instrument', 'Instrument_ID', 'inst', $ci, $instid, '');
        echo '</td><td>';
        $q = "SELECT * FROM Dimn_Comment WHERE Desc_ID={$ddid}";
        if (!($res = $cxn->query($q))) {
            echo "error :", $cxn->error;
            exit;
        }
        if ($res->num_rows == 0) {
            echo <<<_END
\t\t<input id="observation[{$i}]" name="observation[{$i}]" value="{$obser}" {$cd} class="ob" >
_END;
        } else {
            $comm = new DimnComment();
            $comm->createDimnCommentList($ddid);
            $sel = new selectlist('comment[' . $i . ']', $comm->getDimncommentList(), 'Select Comment', 'Comment_ID', 'Comment', '$cd', $commid, '');
        }
        if (in_array($insttypeid, $this->instidlist)) {
            echo <<<_END
\t<input id="go[{$i}]" name="go[{$i}]" class="g" value="{$go}"><input id="nogo[{$i}]" name="nogo[{$i}]" class="r" value="{$nogo}">
_END;
        }
        echo <<<_END
</td><td><input id="remarks[{$i}]" name="remarks[{$i}]" max:"50" value="{$rem}"></td></tr>

_END;
    }
示例#2
0
     if (isset($_GET['class'])) {
         $class = 'class="required"';
     } else {
         $class = '';
     }
     if (isset($_GET['showcnc'])) {
         $mc->setValue('showcnc', '1');
     }
     $mc->createMachineList();
     $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'])) {
示例#3
0
<?php

require_once 'autoload.php';
date_default_timezone_set('Asia/Kolkata');
$ins = new Instrument();
if (isset($_POST['slno'])) {
    //print_r($_POST);
    if (isset($_POST['slno'])) {
        $ins->setValue('slno', $_POST['slno']);
    }
    if (isset($_POST['Instrument_ID'])) {
        $ins->setValue('instrumentid', $_POST['Instrument_ID']);
    }
    if (isset($_POST['Instrument_Type_ID'])) {
        $ins->setValue('typeid', $_POST['Instrument_Type_ID']);
    }
    if (isset($_POST['instrumentdesc'])) {
        $ins->setValue('instrumentdesc', $_POST['instrumentdesc']);
    }
    if (isset($_POST['caldatedb'])) {
        $ins->setValue('calibrationdate', $_POST['caldatedb']);
    }
    if (isset($_POST['frequency'])) {
        $ins->setValue('frequency', $_POST['frequency']);
    }
    if (isset($_POST['make'])) {
        $ins->setValue('make', $_POST['make']);
    }
    if (isset($_POST['range'])) {
        $ins->setValue('range', $_POST['range']);
    }