Esempio n. 1
0
 function showTrainingPlanUI()
 {
     $db = Database::getInstance();
     $cxn = $db->getConnection();
     $operator = new Operator();
     $operator->createOperatorList();
     $qu = new Question();
     if ($this->planid != '') {
         $q = "SELECT *,DATE_FORMAT(Training_Start_Date,'%d-%m-%Y') as sdt,DATE_FORMAT(Training_End_Date,'%d-%m-%Y') as edt,\n\t(SELECT GROUP_CONCAT(Trainee_ID) FROM Plan_Trainee as pt WHERE pt.Training_Plan_ID={$this->planid}) as trainees FROM Training_Plan as tp \n\tWHERE Training_Plan_ID={$this->planid}";
         if (!($res = $cxn->query($q))) {
             exit("error (showTrainingPlanUI): {$cxn->error}");
         }
         $n = $res->num_rows;
         if ($n > 0) {
             $r = mysqli_fetch_assoc($res);
             $this->trainer = $r['Trainer_Name'];
             $this->startdatedb = $r['Training_Start_Date'];
             $this->startdate = $r['sdt'];
             $this->enddatedb = $r['Training_End_Date'];
             $this->enddate = $r['edt'];
             $this->trainees = $r['trainees'];
             $this->plandesc = $r['Training_Desc'];
             $this->questionid = $r['Question_ID'];
             $this->evaluaterid = $r['Evaluater_ID'];
         }
     }
     echo '<fieldset><legend>Training Details</legend>';
     echo '<p><label>Trainer Name</label><input id="trainer" name="trainer" class="required" value="' . $this->trainer . '"></p>';
     $sel = new selectlist("Evaluater_ID", $operator->getOperatorList(), 'Select Name', 'Operator_ID', 'Operator_Name', 'class="required"', $this->evaluaterid, '1');
     echo '<p><label>Training Start Date</label><input id="startdate" name="startdate" class="required" value="' . $this->startdate . '"><input id="startdatedb" name="startdatedb" type="hidden" value="' . $this->startdatedb . '"></p>';
     echo '<p><label>Training End Date</label><input id="enddate" name="enddate" class="required" value="' . $this->enddate . '"><input id="enddatedb" name="enddatedb" type="hidden" value="' . $this->enddatedb . '"></p>';
     echo '<p><label>Training Description</label><textarea id="plandesc" name="plandesc" cols="45" rows="5" class="required">' . $this->plandesc . '</textarea></p>';
     echo '</fieldset>';
     echo '<fieldset><legend>Select Trainees</legend>';
     $operator->createOperatorGrid($this->trainees);
     echo '</fieldset>';
 }
Esempio n. 2
0
     $sel = new selectlist($id, $part->getPartList(), 'Select Part No', 'Drawing_ID', 'name', $req, '');
     break;
 case 'operator':
     $operator = new Operator();
     if (isset($_GET['insp'])) {
         $operator->setInsp();
     }
     if (isset($_GET['class'])) {
         $class = "class=required";
     } else {
         $class = '';
     }
     if (isset($_GET['method'])) {
         $operator->createOperatorList();
         if ($_GET['method'] == 'grid') {
             $operator->createOperatorGrid();
         }
     } else {
         $operator->createOperatorList();
         $sel = new selectlist("Operator_ID", $operator->getOperatorList(), 'Select Name', 'Operator_ID', 'Operator_Name', $class, '', '1');
     }
     break;
 case 'operation':
     $ope = new Operation();
     if (isset($_GET['req'])) {
         $req = 'class=required';
     } else {
         $req = '';
     }
     if (isset($_GET['id'])) {
         $id = $_GET['id'];
Esempio n. 3
0
    function showMeetingUI()
    {
        $db = Database::getInstance();
        $cxn = $db->getConnection();
        $operator = new Operator();
        $operator->createOperatorList();
        if ($this->meetingid != '') {
            $q = "SELECT *,DATE_FORMAT(Meeting_Date,'%d-%m-%Y') as mdt,Participants FROM Meeting\n\tWHERE Meeting_ID={$this->meetingid}";
            if (!($res = $cxn->query($q))) {
                exit("error (showMeetingUI): {$cxn->error}");
            }
            $n = $res->num_rows;
            if ($n > 0) {
                $r = mysqli_fetch_assoc($res);
                $this->conductedby = $r['Conductedby'];
                $this->meetingdatedb = $r['Meeting_Date'];
                $this->participants = $r['Participants'];
                $this->meetingdatedb = $r['Meeting_Date'];
                $this->meetingdate = $r['mdt'];
                $this->agenda = $r['Agenda'];
                $this->participants = $r['Participants'];
                $qp = "SELECT * FROM Meeting_Points WHERE Meeting_ID={$this->meetingid}";
                if (!($resp = $cxn->query($qp))) {
                    exit("error (showMeetingUI2) {$qp}: {$cxn->error}");
                }
                $i = 0;
                while ($rr = mysqli_fetch_assoc($resp)) {
                    $this->pointsdiscussed[$i] = $rr['Point_Discussed'];
                    $this->meetingpointid[$i] = $rr['Meeting_Point_ID'];
                    $i++;
                }
            }
        }
        echo '<fieldset><legend>Meeting Details</legend>';
        $sel = new selectlist("Conductedby", $operator->getOperatorList(), 'Meeting Conducted By', 'Operator_ID', 'Operator_Name', 'class="required"', $this->conductedby, '1');
        echo '<p><label>Meeting Date</label><input id="meetingdate" name="meetingdate" class="required" value="' . $this->meetingdate . '"><input id="meetingdatedb" name="meetingdatedb" type="hidden" value="' . $this->meetingdatedb . '"></p>';
        echo '<p><label>Meeting Agenda</label><textarea id="agenda" name="agenda" cols="45" rows="5" class="required">' . $this->agenda . '</textarea></p>';
        echo '<p><label>Meeting Participants</label></p>';
        $operator->createOperatorGrid($this->participants);
        echo '</fieldset>';
        echo '<table id="points" width="100%" class="u"><tr><th align="center">Points Discussed</th><th>';
        echo '<th><input type="button" id="addpoint" value="Add Row"></th></tr>';
        if (isset($this->meetingpointid)) {
            $i = 0;
            $j = count($this->pointsdiscussed);
            while ($i < $j) {
                echo '<tr><td colspan="2"><textarea id="pointsdiscussed[' . $i . ']" name="pointsdiscussed[' . $i . ']"  rows="3" cols="40" class="required">' . $this->pointsdiscussed[$i] . '</textarea></td>
			<input type="hidden" id="meetingpointid[' . $i . ']" name="meetingpointid[' . $i . ']" value="' . $this->meetingpointid[$i] . '"></tr>';
                $i++;
            }
        } else {
            echo '<tr><td colspan="2"><textarea id="pointsdiscussed[0]" name="pointsdiscussed[0]"  rows="3" cols="40" class="required"></textarea></td></tr>';
        }
        echo '</table>';
    }