public function createMachine($name) { if ($this->exists($name)) { return false; } $machine = new Machine($name); $machine->save(); $this->addMachine($machine->getName()); return $machine; }
public static function start() { $machine = new Machine(); $machine->ensure(); $mysql_name = env('container') . '_mysql'; $mysql = new Mysql($mysql_name); $mysql->ensure(); $web_name = basename(self::getProjectDir()); $web_name .= '_web'; $web = new Web($web_name); $web->ensure(); }
<?php $actives = array(false, false, false); if (preg_match('#^\\S*\\@machine\\%20product\\_id\\:\\(\\)$#', Yii::app()->request->requestUri)) { $actives[1] = true; } else { if (preg_match('#^\\S*\\@machine\\%20responsible_username\\:\\(\\=\\=\\%7B' . Yii::app()->user->username . '\\%7D\\)$#', Yii::app()->request->requestUri)) { $actives[2] = true; } else { $actives[0] = true; } } $this->widget('zii.widgets.CMenu', array('id' => 'sub-menu', 'items' => array(array('label' => Yii::t('Machine', 'Assigned'), 'url' => array('/machine'), 'active' => $actives[0]), array('label' => Yii::t('Machine', 'Unassigned'), 'url' => array('/machine/index/q/@machine product_id:()'), 'active' => $actives[1]), array('label' => Yii::t('TOAST', 'Responsible By Me'), 'url' => array('/machine/index/q/@machine responsible_username:(=={' . Yii::app()->user->username . '})'), 'active' => $actives[2])))); ?> <div class="search"> <?php $this->Widget('application.extensions.querybuilder.QueryBuilderWidget', array('name' => 'search', 'options' => array('action' => Yii::app()->getBaseUrl(true) . '/#table#/index', 'cTable' => 'machine', 'queryListUrl' => Yii::app()->getBaseUrl(true) . '/query/getlist', 'createQueryUrl' => Yii::app()->getBaseUrl(true) . '/query/create', 'updateQueryUrl' => Yii::app()->getBaseUrl(true) . '/query/update', 'deleteQueryUrl' => Yii::app()->getBaseUrl(true) . '/query/delete', 'tables' => array('machine' => array('label' => '测试机', 'items' => array('id' => array('label' => 'ID', 'type' => 'text', 'operators' => array('==' => '等于', '-=' => '不等于', '>=' => '大于等于', '>' => '大于', '<' => '小于', '<=' => '小于等于', '=' => '包含', '!=' => '不包含')), 'name' => array('label' => '主机域名', 'type' => 'text', 'operators' => array('' => '含有', '-' => '不含有')), 'type' => array('label' => '类型', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => Machine::model()->getTypeOptions()), 'product_id' => array('label' => '所属产品', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => Product::getAllProductsList()), 'project_name' => array('label' => '所属项目', 'type' => 'text', 'operators' => array('' => '含有', '-' => '不含有')), 'agent_version' => array('label' => 'Agent版本', 'type' => 'text', 'operators' => array('' => '含有', '-' => '不含有')), 'responsible_username' => array('label' => '负责人', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => Yii::app()->user->getUsernameOpts()), 'status' => array('label' => '状态', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => Machine::model()->getStatusOptions()), 'update_time' => array('label' => '最后更新时间', 'type' => 'text', 'operators' => array('' => '等于', '-' => '不等于', '>=' => '大于等于', '>' => '大于', '<' => '小于', '<=' => '小于等于')))))))); ?> </div> </div> <div class="main-list"> <div class="link-bar"> <span class="machine-new icon-link"><?php echo CHtml::link(Yii::t("TOAST", "Add"), 'javascript:void(0);', array('id' => 'add-machine')); ?> </span> </div> <?php $this->widget('GridView', array('id' => 'vMachines', 'dataProvider' => $vMachineProvider, 'htmlOptions' => array('class' => 'widget-view'), 'enablePageSize' => true, 'selectionChanged' => 'js:function(id){ var selectedID = $.fn.yiiGridView.getSelection(id); if(selectedID.toString().match(/\\d+/)) location.href = getRootPath() + "/machine/view/id/" + selectedID;
echo "<th>Control unit id</th>"; echo "<th>Machine and mode"; echo "<th>Status"; echo "<th>Queue"; echo "<th>Last finished task"; echo "</thead>"; $qUnits = mysql_query("SELECT * FROM control_unit"); while ($unit = mysql_fetch_object($qUnits)) { echo "<tr><td>" . $unit->id; $qTasks = mysql_query("SELECT * FROM control_tasks WHERE control_unit_id =" . $unit->id) or die(mysql_error()); if (mysql_num_rows($qTasks) == 0) { echo "<td>/"; } else { echo "<td>"; while ($task = mysql_fetch_object($qTasks)) { $machine = Machine::FromId($task->machine_id); $mode = Mode::FromId($task->mode_id); echo $machine->description(); echo $mode ? " with " . $mode->name() : ""; echo "<br>"; } } $queue = new TaskQueue($unit->id); echo "<td>"; if ($queue->has_active_task()) { $active = $queue->get_active_task(); echo "running"; echo "<span title='" . date("G:i d/m/Y", $active->start_time()) . "'> started " . time_ago($active->start_time()) . " ago</span>"; } else { echo "not running"; }
<?php session_start(); //Script de création d'un Container pour un User donné //import // web require_once $_SERVER['DOCUMENT_ROOT'] . '/VirtualDemande/model/DAL/MachineDAL.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/VirtualDemande/model/DAL/UtilisateurDAL.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/VirtualDemande/model/DAL/Table_logDAL.php'; // guaca require_once $_SERVER['DOCUMENT_ROOT'] . '/VirtualDemande/model/DAL/Guacamole_ConnectionDAL.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/VirtualDemande/model/DAL/Guacamole_Connection_ParameterDAL.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/VirtualDemande/model/DAL/Guacamole_Connection_PermissionDAL.php'; //Définition d'un objet Table_log pour faire des insert de log $newLog = new Table_log(); $newMachine = new Machine(); //=====Vérification de ce qui est renvoyé par le formulaire $validName = filter_input(INPUT_POST, 'nameContainer', FILTER_VALIDATE_REGEXP, array("options" => array("regexp" => "#^[a-zA-Z]+\$#"))); //sera utile pour insert et ws, nameContainer if (!is_null($validName) && $validName != false) { $newMachine->setNom($validName); } else { $newLog->setLevel("ERROR"); $newLog->setLoginUtilisateur($loginUtilisateur); $newLog->setMsg("Le nom rentrer n'est pas correct, echec de création"); $newLog->setDateTime(date('Y/m/d G:i:s')); $validTableLog = Table_logDAL::insertOnDuplicate($newLog); exit; } $validDesc = filter_input(INPUT_POST, 'descriptionContainer', FILTER_SANITIZE_STRING); //utile pour insert
/********************************************************************************* * Description: TODO: To be written. * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. * All Rights Reserved. * Contributor(s): ______________________________________.. ********************************************************************************/ require_once 'XTemplate/xtpl.php'; require_once 'data/Tracker.php'; require_once 'modules/Machines/Machine.php'; require_once 'modules/Machines/Forms.php'; global $app_strings; global $app_list_strings; global $mod_strings; global $current_user; global $sugar_version, $sugar_config; $focus = new Machine(); if (isset($_REQUEST['record'])) { $focus->retrieve($_REQUEST['record']); } if (isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') { $focus->id = ""; } $prefillArray = array('priority' => 'priority', 'name' => 'name', 'description' => 'description'); foreach ($prefillArray as $requestKey => $focusVar) { if (isset($_REQUEST[$requestKey]) && is_null($focus->{$focusVar})) { $focus->{$focusVar} = urldecode($_REQUEST[$requestKey]); } } echo "\n<p>\n"; echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_MODULE_NAME'] . ": " . $focus->name, true); echo "\n</p>\n";
$do_upload = $upload->upload($new_arr[$key]); } } } if ($do_upload) { $message = '<p>' . $upload->upload_success() . '</p>'; print "{$message}"; } else { $message = $upload->show_errors(); print "{$message}"; } } } } else { if (isset($_GET['mlog'])) { $mc = new Machine(); $mc->setMachineID($_GET['mid']); $mc->showMachineLog(); } if (isset($_GET['actlid'])) { $ml->setValue('activitylogid', $_GET['actlid']); $ml->showMaintenanceUI(); } if (isset($_GET['session'])) { checksession('activitylog.html'); } if (isset($_GET['ui'])) { $ml->setValue('mainttypeid', $_GET['mtid']); $ml->setValue('machineid', $_GET['mcid']); $ml->showMaintenanceUI(); }
?> <div class="span1" style="padding-top: 60px"> <button class="btn move-up">↑</button><br/><br/> <button class="btn move-down">↓</button> </div> </div> </div> <!-- case fields end --> </div> <div id="env-fields"> <div class="row-fluid"> <?php echo CHtml::activeLabel($job, 'machine_id', array('class' => 'span2')); echo '<div class="span10" id="machine-selector">'; $this->widget('application.extensions.combobox.InputComboBox', array('model' => $job, 'attribute' => 'machine_id', 'data' => Machine::model()->getMachineOptions(), 'options' => array('onSelect' => '', 'onChange' => '', 'allowText' => false, 'showStyle' => true), 'htmlOptions' => array('class' => 'focus span12', 'style' => 'margin-left: 0', 'placeholder' => Yii::t('Job', 'Machine Tip')))); echo '</div>'; ?> </div> <div class="row-fluid"> <?php echo CHtml::activeLabel($job, 'sudoer', array('class' => 'span2')); echo CHtml::activeTextField($job, 'sudoer', array('class' => 'focus span4')); echo CHtml::activeLabel($job, 'timeout', array('class' => 'span2')); echo CHtml::activeTextField($job, 'timeout', array('class' => 'focus span3')); echo CHtml::tag('label', array('class' => 'span1'), Yii::t('Run', 'Minutes')); ?> </div> <div class="row-fluid"> <?php echo CHtml::activeLabel($job, 'crucial', array('class' => 'span2'));
<?php require_once 'autoload.php'; $mach = new Machine(); if (isset($_POST['machinename'])) { //print_r($_POST); if (isset($_POST['Machine_ID'])) { $mach->setValue('machineid', $_POST['Machine_ID']); } if (isset($_POST['Supplier_ID'])) { $mach->setValue('supplierid', $_POST['Supplier_ID']); } if (isset($_POST['Type_ID'])) { $mach->setValue('typeid', $_POST['Type_ID']); } if (isset($_POST['machinename'])) { $mach->setValue('machinename', $_POST['machinename']); } if (isset($_POST['machineslno'])) { $mach->setValue('machineslno', $_POST['machineslno']); } if (isset($_POST['ncserialno'])) { $mach->setValue('ncserialno', $_POST['ncserialno']); } if (isset($_POST['installdate'])) { $mach->setValue('installdate', $_POST['installdate']); } if (isset($_POST['installdatedb'])) { $mach->setValue('installdatedb', $_POST['installdatedb']); } if (isset($_POST['showinlogentry'])) {
function showSPMUI() { $db = Database::getInstance(); $cxn = $db->getConnection(); if ($this->spmid != '') { $q = "SELECT * FROM Scheduled_PM WHERE SPM_ID={$this->spmid}"; if (!($res = $cxn->query($q))) { exit("error (showSPMUI) : {$cxn->error}"); } $r = mysqli_fetch_assoc($res); $this->machineid = $r['Machine_ID']; $this->spmtitle = $r['SPM_Title']; $this->spmtol = $r['SPM_Tol']; $this->spminterval = $r['SPM_Interval']; } echo '<fieldset><legend>Scheduled Preventive Maintenance Details</legend>'; if ($this->spmid != '') { $mc = new Machine(); $mc->createMachineList(); $sel = new selectlist('EMachine_ID', $mc->getMachineList(), 'Select Machine', 'Machine_ID', 'mnslno', 'class="required"', $this->machineid, '1'); } echo '<p><label>Maintenance Title</label><input id="spmtitle" name="spmtitle" class="required" value="' . $this->spmtitle . '"/></p>'; echo '<p><label>Maintenance Interval in Days</label><input id="spminterval" name="spminterval" class="required" value="' . $this->spminterval . '"/></p>'; echo '<p><label>Tolerance in Days</label><input id="spmtol" name="spmtol" class="required" value="' . $this->spmtol . '"/></p>'; echo '<fieldset><legend>Maintanance activites for this Schedule</legend>'; echo '<input type="button" id="addrow" value="Add New Activity"><p/>'; if ($this->spmid != '') { self::listSPMDesc(); } else { echo '<table class="pcd" id="spmt">'; echo '<tr><th>Description</th></tr>'; $this->showSPMrow(0); echo '</table>'; } echo '</fieldset>'; echo '<fieldset><legend>Geometric Parameters to be Checked</legend>'; echo '<input type="button" id="addgprow" value="Add Selected Parameter to List"><p/>'; $any = new Anylist(); $any->createList('Geometric_Parameter'); $sel = new selectlist('GP_ID', $any->anylist, 'Select Geometric Properties to Check', 'GP_ID', 'Parameter', '', '', ''); echo '<input id="gpidlist" name="gpidlist" type="hidden">'; if ($this->spmid != '') { $this->listGPIDs(); } echo '<div id="gplist"></div>'; echo '</fieldset>'; echo '</fieldset>'; echo '<input class="submit" type="submit" value="Save Sechduled Maintenance"/>'; }
fclose($fo); fclose($fi); $job->set('logfile', $filename); $job->save(); textResponse(200); })->conditions(array('jobid' => '[0-9]')); /* Jobs - Finish a job (with buildstatus and buildreason) */ $app->post('/jobs/:jobid/finish', 'isAllowed', function ($jobid) use($app) { if (!isset($_POST['buildstatus']) || !isset($_POST['buildreason'])) { textResponse(400, 'Post data missing'); } $job = new Job($jobid); if ($job === false) { textResponse(204); } $machine = new Machine(Session::getMachineId()); if (!$machine->hasJob($job->getJobId())) { textResponse(403, 'Job not assigned to you'); } $job->unset('machine'); $job->set('buildstatus', $_POST['buildstatus']); $job->set('buildreason', $_POST['buildreason']); $job->moveToQueue('archivequeue'); jsonResponse(200, $job->getJobData()); })->conditions(array('jobid' => '[0-9]')); /* Jobgroup - List details of jobgroup */ $app->get('/group/:groupid/', 'isAllowed', function ($groupid) use($app) { $jobgroup = new Jobgroup($groupid); if (!$jobgroup->exists()) { textResponse(404, 'Jobgroup not found'); }
/** * Cannon constructor. * @param Machine $machine */ public function __construct(Machine $machine) { $this->address = $machine->getAddress(); $this->port = $machine->getPort(); }
case 'command_id': $oldCommand = Command::model()->findByPk($diffAttr->old); if ($oldCommand) { $diffAttr->old = $oldCommand->name; } $newCommand = Command::model()->findByPk($diffAttr->new); if ($newCommand) { $diffAttr->new = $newCommand->name; } break; case 'machine_id': $oldMachine = Machine::model()->findByPk($diffAttr->old); if ($oldMachine) { $diffAttr->old = $oldMachine->name; } $newMachine = Machine::model()->findByPk($diffAttr->new); if ($newMachine) { $diffAttr->new = $newMachine->name; } break; case 'crucial': $crucials = Job::model()->getCrucialOptions(); $diffAttr->old = isset($crucials[$diffAttr->old]) ? $crucials[$diffAttr->old] : NULL; $diffAttr->new = isset($crucials[$diffAttr->new]) ? $crucials[$diffAttr->new] : NULL; break; } if ($diffAttr->old === NULL) { $diffAttr->old = '[NULL]'; } if ($diffAttr->new === NULL) { $diffAttr->new = '[NULL]';
function showActivityUI() { $db = Database::getInstance(); $cxn = $db->getConnection(); if ($this->activitylogid == '') { $qm = "SELECT DATE_FORMAT(End_Date_Time,'%d-%m-%Y %h:%i%p') as edtt,End_Date_Time FROM ActivityLog WHERE Machine_ID={$this->machineid} AND Activity_ID NOT IN(10,15) ORDER By End_Date_Time DESC LIMIT 1"; if (!($resm = $cxn->query($qm))) { exit("error (showActivityUI) {$qm} : {$cxn->error}"); } $rowm = mysqli_fetch_assoc($resm); if ($this->activityid == 8) { echo <<<_END \t \t\t\t\t<p> \t \t\t\t\t<label>Start Date and Time</label> \t \t\t\t\t<input id="sdt" name="sdt" class="required" value="{$rowm['edtt']}"/> \t \t\t\t\t<input id="sdtdb" name="sdtdb" type="hidden" value="{$rowm['End_Date_Time']}"> \t \t\t\t\t</p> \t \t\t\t\t<p> \t \t\t\t\t<label>End Date and Time</label> \t \t\t\t\t<input id="edt" name="edt" class="required"/> \t \t\t\t\t<input id="edtdb" name="edtdb" type="hidden"> \t \t\t\t\t</p> \t \t\t\t\t<p> \t \t\t\t\t<label>Remarks</label> \t \t\t\t\t<textarea id="remarks" name="remarks" rows="5" cols="40" maxlength="300"> </textarea> \t \t\t\t\t</p> \t \t\t\t\t</fieldset> \t\t\t\t <input class="submit" type="submit" value="Save"/> _END; exit; } $q = "SELECT Batch_Remarks FROM Batch_NO as bn \n\t\t\t\tINNER JOIN BNo_MI_Challans as bmc ON bmc.Batch_ID=bn.Batch_ID\n\t\t\t\tINNER JOIN MI_Drg_Qty as midq ON midq.Mi_Drg_Qty_ID=bmc.Mi_Drg_Qty_ID\n\t\t\t\tWHERE bn.Batch_ID={$this->batchid}"; if (!($res = $cxn->query($q))) { echo "error (showActivityUI2) {$q} :", $cxn->error; exit; } $row = mysqli_fetch_assoc($res); if (in_array($this->activityid, $this->production)) { echo <<<_END \t\t\t\t\t<p>Batch Remarks {$row['Batch_Remarks']}</p> \t\t\t\t\t<fieldset> \t\t\t\t\t\t<legend>Activity Details</legend> \t \t\t\t\t<p> \t \t\t\t\t<label>Start Date and Time</label> \t \t\t\t\t<input id="sdt" name="sdt" class="required" value="{$rowm['edtt']}"/> \t \t\t\t\t<input id="sdtdb" name="sdtdb" type="hidden" value="{$rowm['End_Date_Time']}"> \t \t\t\t\t</p> \t \t\t\t\t<p> \t \t\t\t\t<label>End Date and Time</label> \t \t\t\t\t<input id="edt" name="edt" class="required"/> \t \t\t\t\t<input id="edtdb" name="edtdb" type="hidden"> \t \t\t\t\t</p> _END; if ($this->operationid != '') { $qo = "SELECT Program_NO FROM Operation WHERE Operation_ID={$this->operationid}"; if (!($reso = $cxn->query($qo))) { echo "error (showActivityUI3) {$qo} :", $cxn->error; exit; } $rowo = mysqli_fetch_assoc($reso); $this->programno = $rowo['Program_NO']; } echo <<<_END \t \t\t\t\t<p> \t \t\t\t\t<label>Program No</label> \t \t\t\t\t<input id="programno" name="programno" class="required" value="{$this->programno}"/> \t \t\t\t\t</p> \t \t\t\t\t<p> \t \t\t\t\t<label>Quantity</label> \t \t\t\t\t<input id="quantity" name="quantity" class="required number"/> \t \t\t\t\t</p> \t \t\t\t\t<p> \t \t\t\t\t<label>Remarks</label> \t \t\t\t\t<textarea id="remarks" name="remarks" rows="5" cols="40" maxlength="300"> </textarea> \t \t\t\t\t</p> \t \t\t\t\t</fieldset> _END; } if (in_array($this->activityid, $this->nonproduction)) { echo <<<_END \t\t\t\t\t<p>Batch Remarks {$row['Batch_Remarks']}</p> \t\t\t\t\t<fieldset> \t\t\t\t\t<legend>Activity Details</legend> \t \t\t\t\t<p> \t \t\t\t\t<label>Operation Details</label> \t \t\t\t\t<input id="operationdesc" name="operationdesc" class="required"/> \t \t\t\t\t</p> \t \t\t\t\t<p> \t \t\t\t\t<label>Start Date and Time</label> \t \t\t\t\t<input id="sdt" name="sdt" class="required" value="{$rowm['edtt']}"/> \t \t\t\t\t<input id="sdtdb" name="sdtdb" type="hidden" value="{$rowm['End_Date_Time']}"> \t \t\t\t\t</p> \t \t\t\t\t<p> \t \t\t\t\t<label>End Date and Time</label> \t \t\t\t\t<input id="edt" name="edt" class="required"/> \t \t\t\t\t<input id="edtdb" name="edtdb" type="hidden"> \t \t\t\t\t</p> \t \t\t\t\t<p> \t \t\t\t\t<label>Program No</label> \t \t\t\t\t<input id="programno" name="programno" class="required"/> \t \t\t\t\t</p> \t \t\t\t\t<p> \t \t\t\t\t<label>Quantity</label> \t \t\t\t\t<input id="quantity" name="quantity" class="required number"/> \t \t\t\t\t</p> \t \t\t\t\t<p> \t \t\t\t\t<label>Remarks</label> \t \t\t\t\t<textarea id="remarks" name="remarks" rows="5" cols="40" maxlength="300"> </textarea> \t \t\t\t\t</p> \t \t\t\t\t</fieldset> _END; } } else { $q = "SELECT Activity_ID,Operator_ID FROM ActivityLog WHERE Activity_Log_ID={$this->activitylogid}"; if (!($res = $cxn->query($q))) { echo "error :", $cxn->error; exit; } $row = mysqli_fetch_assoc($res); $this->activityid = $row['Activity_ID']; if ($_SESSION['operatorid'] != $row['Operator_ID'] && !in_array($_SESSION['operatorid'], $this->editauth)) { print "Error You Can Edit only Your Log!!"; exit; } if (in_array($this->activityid, $this->production)) { $qe = "SELECT cust.Customer_ID,Machine_ID,comp.Drawing_ID,ope.Operation_ID,Batch_ID,Operator_ID,prod.Program_NO,Quantity,Remarks,actl.Activity_ID,\n\t\t\t\t\t\tDATE_FORMAT(Start_Date_Time,'%d-%m-%Y %h:%i%p') as sdte,Start_Date_Time,DATE_FORMAT(End_Date_Time,'%d-%m-%Y %h:%i%p') as edte,End_Date_Time FROM ActivityLog as actl \n\t\t\t\t\t\tINNER JOIN Production AS prod ON prod.Activity_Log_ID=actl.Activity_Log_ID\n\t\t\t\t\t\tINNER JOIN Operation as ope ON ope.Operation_ID=prod.Operation_ID\n\t\t\t\t\t\tINNER JOIN Component as comp ON comp.Drawing_ID=ope.Drawing_ID\n\t\t\t\t\t\tINNER JOIN Customer as cust ON cust.Customer_ID=comp.Customer_ID WHERE actl.Activity_Log_ID={$this->activitylogid}"; //print("<br>$qe"); if (!($rese = $cxn->query($qe))) { echo "error :", $cxn->error; exit; } $rowe = mysqli_fetch_assoc($rese); $ac = new Activity(); $ac->setActivityID($rowe['Activity_ID']); $ac->createActivityList(); $sel = new selectlist('Activity_ID', $ac->getActivityList(), 'Select Activity', 'Activity_ID', 'Activity_Name', 'class="required"', $rowe['Activity_ID'], '1'); $mc = new Machine(); $mc->createMachineList(); $sel = new selectlist('Machine_ID', $mc->getMachineList(), 'Select Machine', 'Machine_ID', 'mnslno', 'class="required"', $rowe['Machine_ID'], '1'); $cust = new Customer(); $cust->createCustomerList(); $sel = new selectlist('Customer_ID', $cust->getCustomerList(), 'Select Customer', 'Customer_ID', 'Customer_Name_Short', 'class="required"', $rowe['Customer_ID'], '1'); $part = new Part(); $part->createPartList($rowe['Customer_ID']); $req = 'class=required'; echo '<div id="drawe">'; $selc = new selectlist('Drawing_ID', $part->getPartList(), 'Select Drawing', 'Drawing_ID', 'name', 'class="required"', $rowe['Drawing_ID'], '1'); echo '</div>'; $ope = new Operation(); $ope->createOperationList($rowe['Drawing_ID']); echo '<div id="operatione">'; $sel = new selectlist('Operation_ID', $ope->getOperationList(), 'Select Operation', 'Operation_ID', 'Operation_Desc', 'class="required"', $rowe['Operation_ID'], '1'); echo '</div>'; $operator = new Operator(); $operator->createOperatorList(); $sel = new selectlist("Operator_ID", $operator->getOperatorList(), 'Select Name', 'Operator_ID', 'Operator_Name', 'class="required"', $rowe['Operator_ID'], '1'); $bn = new Batch(); $bn->setPartID($rowe['Drawing_ID']); $bn->createBatchList(); echo '<div id="batche">'; $sel = new selectlist('Batch_ID', $bn->getBatchList(), 'Select Batch', 'Batch_ID', 'Mfg_Batch_NO', 'class="required"', $rowe['Batch_ID'], '1'); echo '</div>'; echo <<<_END \t\t\t\t\t\t<fieldset> \t\t\t\t\t\t<legend>Activity Details</legend> \t\t \t\t\t\t<p> \t\t \t\t\t\t<label>Start Date and Time</label> \t\t \t\t\t\t<input id="sdt" name="sdt" rclass="equired" value="{$rowe['sdte']}"/> \t\t \t\t\t\t<input id="sdtdb" name="sdtdb" type="hidden" value="{$rowe['Start_Date_Time']}"> \t\t \t\t\t\t</p> \t\t \t\t\t\t<p> \t\t \t\t\t\t<label>End Date and Time</label> \t\t \t\t\t\t<input id="edt" name="edt" class="required" value="{$rowe['edte']}"/> \t\t \t\t\t\t<input id="edtdb" name="edtdb" type="hidden" value="{$rowe['End_Date_Time']}"> \t\t \t\t\t\t</p> \t\t \t\t\t\t<p> \t\t \t\t\t\t<label>Program No</label> \t\t \t\t\t\t<input id="programno" name="programno" class="required" value="{$rowe['Program_NO']}"/> \t\t \t\t\t\t</p> \t\t \t\t\t\t<p> \t\t \t\t\t\t<label>Quantity</label> \t\t \t\t\t\t<input id="quantity" name="quantity" class="required number" value="{$rowe['Quantity']}"/> \t\t \t\t\t\t</p> \t\t \t\t\t\t<p> \t\t \t\t\t\t<label>Remarks</label> \t\t \t\t\t\t<textarea id="remarks" name="remarks" rows="5" cols="40" maxlength="300">{$rowe['Remarks']}</textarea> \t\t \t\t\t\t</p> \t\t \t\t\t\t</fieldset> _END; } if (in_array($this->activityid, $this->nonproduction)) { $qe = "SELECT cust.Customer_ID,Machine_ID,comp.Drawing_ID,Operation_Description,Batch_ID,Operator_ID,prod.Program_NO,Quantity,Remarks,actl.Activity_ID,\n\t\t\t\t\t\tDATE_FORMAT(Start_Date_Time,'%d-%m-%Y %h:%i%p') as sdte,Start_Date_Time,DATE_FORMAT(End_Date_Time,'%d-%m-%Y %h:%i%p') as edte,End_Date_Time FROM ActivityLog as actl \n\t\t\t\t\t\tINNER JOIN NonProduction AS prod ON prod.Activity_Log_ID=actl.Activity_Log_ID\n\t\t\t\t\t\tINNER JOIN Component as comp ON comp.Drawing_ID=prod.Drawing_ID\n\t\t\t\t\t\tINNER JOIN Customer as cust ON cust.Customer_ID=comp.Customer_ID WHERE actl.Activity_Log_ID={$this->activitylogid}"; //print("<br>$qe"); if (!($rese = $cxn->query($qe))) { echo "error :", $cxn->error; exit; } $rowe = mysqli_fetch_assoc($rese); $ac = new Activity(); $ac->setActivityID($rowe['Activity_ID']); $ac->createActivityList(); $sel = new selectlist('Activity_ID', $ac->getActivityList(), 'Select Activity', 'Activity_ID', 'Activity_Name', 'class="required"', $rowe['Activity_ID']); $mc = new Machine(); $mc->createMachineList(); $sel = new selectlist('Machine_ID', $mc->getMachineList(), 'Select Machine', 'Machine_ID', 'mnslno', 'class="required"', $rowe['Machine_ID']); $cust = new Customer(); $cust->createCustomerList(); $sel = new selectlist('Customer_ID', $cust->getCustomerList(), 'Select Customer', 'Customer_ID', 'Customer_Name_Short', 'class="required"', $rowe['Customer_ID']); $part = new Part(); $part->createPartList($rowe['Customer_ID']); $req = 'class=required'; echo '<div id="drawe">'; $selc = new selectlist('Drawing_ID', $part->getPartList(), 'Select Drawing', 'Drawing_ID', 'name', 'class="required"', $rowe['Drawing_ID']); echo '</div>'; $operator = new Operator(); $operator->createOperatorList(); $sel = new selectlist("Operator_ID", $operator->getOperatorList(), 'Select Name', 'Operator_ID', 'Operator_Name', 'class="required"', $rowe['Operator_ID']); $bn = new Batch(); $bn->setPartID($rowe['Drawing_ID']); $bn->createBatchList(); echo '<div id="batche">'; $sel = new selectlist('Batch_ID', $bn->getBatchList(), 'Select Batch', 'Batch_ID', 'Mfg_Batch_NO', 'class="required"', $rowe['Batch_ID']); echo '</div>'; echo <<<_END \t\t\t\t\t\t<fieldset> \t\t\t\t\t\t<legend>Activity Details</legend> \t\t \t\t\t\t<p> \t\t \t\t\t\t<label>Operation Details</label> \t\t \t\t\t\t<input id="operationdesc" name="operationdesc" class="required" value="{$rowe['Operation_Description']}"/> \t\t \t\t\t\t</p> \t\t \t\t\t\t<p> \t\t \t\t\t\t<label>Start Date and Time</label> \t\t \t\t\t\t<input id="sdt" name="sdt" rclass="equired" value="{$rowe['sdte']}"/> \t\t \t\t\t\t<input id="sdtdb" name="sdtdb" type="hidden" value="{$rowe['Start_Date_Time']}"> \t\t \t\t\t\t</p> \t\t \t\t\t\t<p> \t\t \t\t\t\t<label>End Date and Time</label> \t\t \t\t\t\t<input id="edt" name="edt" class="required" value="{$rowe['edte']}"/> \t\t \t\t\t\t<input id="edtdb" name="edtdb" type="hidden" value="{$rowe['End_Date_Time']}"> \t\t \t\t\t\t</p> \t\t \t\t\t\t<p> \t\t \t\t\t\t<label>Program No</label> \t\t \t\t\t\t<input id="programno" name="programno" class="required" value="{$rowe['Program_NO']}"/> \t\t \t\t\t\t</p> \t\t \t\t\t\t<p> \t\t \t\t\t\t<label>Quantity</label> \t\t \t\t\t\t<input id="quantity" name="quantity" class="required number" value="{$rowe['Quantity']}"/> \t\t \t\t\t\t</p> \t\t \t\t\t\t<p> \t\t \t\t\t\t<label>Remarks</label> \t\t \t\t\t\t<textarea id="remarks" name="remarks" rows="5" cols="40" maxlength="300">{$rowe['Remarks']}</textarea> \t\t \t\t\t\t</p> \t\t \t\t\t\t</fieldset> _END; } if ($this->activityid == 8) { $qe = "SELECT Remarks,actl.Activity_ID,Machine_ID,Operator_ID,Idle_ID,\n\t\t\t\t\t\tDATE_FORMAT(Start_Date_Time,'%d-%m-%Y %h:%i%p') as sdte,Start_Date_Time,DATE_FORMAT(End_Date_Time,'%d-%m-%Y %h:%i%p') as edte,End_Date_Time FROM ActivityLog as actl \n\t\t\t\t\t\tINNER JOIN NonProduction AS prod ON prod.Activity_Log_ID=actl.Activity_Log_ID\n\t\t\t\t\t\tWHERE actl.Activity_Log_ID={$this->activitylogid}"; //print("<br>$qe"); if (!($rese = $cxn->query($qe))) { echo "error :", $cxn->error; exit; } $rowe = mysqli_fetch_assoc($rese); $ac = new Activity(); $ac->setActivityID($rowe['Activity_ID']); $ac->createActivityList(); $sel = new selectlist('Activity_ID', $ac->getActivityList(), 'Select Activity', 'Activity_ID', 'Activity_Name', 'class="required"', $rowe['Activity_ID']); $mc = new Machine(); $mc->createMachineList(); $sel = new selectlist('Machine_ID', $mc->getMachineList(), 'Select Machine', 'Machine_ID', 'mnslno', 'class="required"', $rowe['Machine_ID']); self::createReasonList(); $sel = new selectlist('Idle_ID', self::getReasonList(), 'Select Idle Reason', 'Idle_ID', 'Idle_Reason', 'class="required"', $rowe['Idle_ID'], '1'); $operator = new Operator(); $operator->createOperatorList(); $sel = new selectlist("Operator_ID", $operator->getOperatorList(), 'Select Name', 'Operator_ID', 'Operator_Name', 'class="required"', $rowe['Operator_ID']); echo <<<_END \t\t\t\t\t\t<fieldset> \t\t\t\t\t\t<legend>Activity Details</legend> \t\t \t\t\t\t<p> \t\t \t\t\t\t<label>Start Date and Time</label> \t\t \t\t\t\t<input id="sdt" name="sdt" rclass="equired" value="{$rowe['sdte']}"/> \t\t \t\t\t\t<input id="sdtdb" name="sdtdb" type="hidden" value="{$rowe['Start_Date_Time']}"> \t\t \t\t\t\t</p> \t\t \t\t\t\t<p> \t\t \t\t\t\t<label>End Date and Time</label> \t\t \t\t\t\t<input id="edt" name="edt" class="required" value="{$rowe['edte']}"/> \t\t \t\t\t\t<input id="edtdb" name="edtdb" type="hidden" value="{$rowe['End_Date_Time']}"> \t\t \t\t\t\t</p> \t\t \t\t\t\t<p> \t\t \t\t\t\t<label>Remarks</label> \t\t \t\t\t\t<textarea id="remarks" name="remarks" rows="5" cols="40" maxlength="300">{$rowe['Remarks']}</textarea> \t\t \t\t\t\t</p> \t\t \t\t\t\t</fieldset> _END; } self::showLogimages(); } echo <<<_END \t\t\t\t <input class="submit" type="submit" value="Save"/> _END; }
// out $char = chr($this->_read($this->_memory[$i + 1])); echo $char; $i += 2; break; case 20: // in $a = $this->_memory[$i + 1]; $c = ord(fgetc($in)); // windows sends \r\n upon enter, ignore the 13 if ($c == 13) { // get the ascii 10 $c = ord(fgetc($in)); } $this->_write($a, $c); $i += 2; break; case 21: // noop $i++; break; default: die("unknown op: {$op}"); break; } } } } $m = new Machine(); $m->load('challenge.bin'); $m->run();
// result += "<br />" + data.ip; // if(data.id && data.style) // result = "<div class=\"" + data.style + "\">" + result + "</div>"; // return result; // }', // 'formatSelection' => 'js:function(data){ // return (data.hostname || data.name); // }', // 'initSelection' => 'js:function (element, callback) { // var id = $("#VCommandRun_machine_id").val(); // var name = $("#VCommandRun_machine_name").val(); // callback({id: id, hostname: name}); // }', // ) // )); $this->widget('application.extensions.combobox.InputComboBox', array('model' => $lastRunInfo, 'attribute' => 'machine_id', 'data' => Machine::model()->getMachineOptions(), 'options' => array('onSelect' => '', 'allowText' => false, 'showStyle' => true), 'htmlOptions' => array('class' => 'focus span9', 'placeholder' => Yii::t('Command', 'Machine Placeholder')))); ?> </div> <div class="row-fluid"> <?php echo CHtml::activeLabel($lastRunInfo, 'sudoer', array('class' => 'span2')); echo CHtml::activeTextField($lastRunInfo, 'sudoer', array('class' => 'focus span9')); ?> </div> <div class="row-fluid"> <?php echo CHtml::activeLabel($lastRunInfo, 'timeout', array('class' => 'span2')); echo CHtml::activeTextField($lastRunInfo, 'timeout', array('class' => 'focus span8')); echo CHtml::tag('div', array('class' => 'span2'), Yii::t('Run', 'Minutes')); ?> </div>
redirect_to(array('location' => 'machine.php' . (isset($_REQUEST['id']) ? "?id=" . intval($_REQUEST['id']) : ""), 'status' => 'One or more required fields are missing. Please check your input and try again.')); } //ensure that this facility exists. try { $facility = new Facility($database, $_POST['machine']['facility_id']); } catch (Exception $e) { redirect_to(array('location' => 'machine.php' . (isset($_REQUEST['id']) ? "?id=" . intval($_REQUEST['id']) : ""), 'status' => 'This facility does not exist.', 'class' => 'error')); } //ensure that this machine type exists. try { $machineType = new MachineType($database, $_POST['machine']['machine_type_id']); } catch (Exception $e) { redirect_to(array('location' => 'machine.php' . (isset($_REQUEST['id']) ? "?id=" . intval($_REQUEST['id']) : ""), 'status' => 'This machine type does not exist.', 'class' => 'error')); } try { $machine = new Machine($database, intval($_REQUEST['id'])); } catch (Exception $e) { redirect_to(array('location' => 'machine.php' . (isset($_REQUEST['id']) ? "?id=" . intval($_REQUEST['id']) : ""), 'status' => 'This machine does not exist.', 'class' => 'error')); } $machineID = $machine->create_or_update($_POST['machine']); if ($machineID) { redirect_to(array('location' => 'machine.php?action=view&id=' . intval($machineID), 'status' => 'Successfully ' . (intval($_REQUEST['id']) == 0 ? 'created' : 'updated') . ' machine.', 'class' => 'success')); } else { redirect_to(array('location' => 'machine.php' . (isset($_REQUEST['id']) ? "?id=" . intval($_REQUEST['id']) : ""), 'status' => 'An error occurred while ' . (intval($_REQUEST['id']) == 0 ? 'creating' : 'updating') . ' this machine. Please try again.', 'class' => 'error')); } } elseif ($_REQUEST['action'] == 'get_parameters' && isset($_REQUEST['id']) && is_numeric($_REQUEST['id'])) { // return a js response instantiating all the parameters and values for this machine. $machineParameters = $database->stdQuery("SELECT `machine_type_attributes`.`name`, `machine_parameters`.`value` FROM `machine_type_attributes` LEFT OUTER JOIN `machine_parameters` ON `machine_type_attributes`.`id` = `machine_parameters`.`machine_type_attribute_id` WHERE `machine_parameters`.`machine_id` = " . intval($_REQUEST['id'])); $parametersOutput = array(); while ($parameter = mysqli_fetch_assoc($machineParameters)) { @($value = unserialize($parameter['value']));
} $bn->createBatchList(); $sel = new selectlist('Batch_ID', $bn->getBatchList(), 'Select Batch', 'Batch_ID', 'Mfg_Batch_NO', '', '', '1'); break; case 'activity': //activity list $ac = new Activity(); if (isset($_GET['aid'])) { $ac->setActivityID($_GET['aid']); } $ac->createActivityList(); $sel = new selectlist('Activity_ID', $ac->getActivityList(), 'Select Activity', 'Activity_ID', 'Activity_Name', 'class="required"', '', '1'); break; case 'machine': //machine list $mc = new Machine(); if (isset($_GET['mid'])) { $mc->setMachineID($_GET['mid']); } 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':
<?php require_once 'autoload.php'; $mc = new Machine(); if (isset($_GET['typeid'])) { $mc->setValue('typeid', $_GET['typeid']); $mc->showEquipmentList(); } if (isset($_GET['type'])) { $any = new Anylist(); $any->createList('Machine_Type'); $sel2 = new selectlist('Type_ID', $any->anylist, 'Select Equipment Type', 'Type_ID', 'Type_Description', 'class="required"', '', '1'); } ?>
* * All copies of the Covered Code must include on each user interface screen: * (i) the "Powered by SugarCRM" logo and * (ii) the SugarCRM copyright notice * in the same form as they appear in the distribution. See full license for * requirements. * * The Original Code is: SugarCRM Open Source * The Initial Developer of the Original Code is SugarCRM, Inc. * Portions created by SugarCRM are Copyright (C) 2004-2006 SugarCRM, Inc.; * All Rights Reserved. * Contributor(s): ______________________________________. ********************************************************************************/ /********************************************************************************* * Description: TODO: To be written. * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. * All Rights Reserved. * Contributor(s): ______________________________________.. ********************************************************************************/ require_once 'modules/Machines/Machine.php'; $focus = new Machine(); if (!isset($_REQUEST['record'])) { sugar_die("A record number must be specified to delete the machine."); } $focus->retrieve($_REQUEST['record']); if (!$focus->ACLAccess('Delete')) { ACLController::displayNoAccess(true); sugar_cleanup(true); } $focus->mark_deleted($_REQUEST['record']); header("Location: index.php?module=" . $_REQUEST['return_module'] . "&action=" . $_REQUEST['return_action'] . "&record=" . $_REQUEST['return_id']);
public static function findByName($nom) { $data = BaseSingleton::select('SELECT machine.id as id, ' . 'machine.utilisateur_id as utilisateur_id, ' . 'machine.distrib_alias_id as distrib_alias_id, ' . 'machine.nom as nom, ' . 'machine.cpu_id as cpu_id, ' . 'machine.ram_id as ram_id, ' . 'machine.stockage_id as stockage_id, ' . 'machine.description as description, ' . 'machine.date_creation as date_creation, ' . 'machine.date_expiration as date_expiration, ' . 'machine.etat as etat ' . ' FROM machine' . ' WHERE LOWER(machine.nom) = LOWER(?)', array('s', &$nom)); $machine = new Machine(); if (sizeof($data) > 0) { $machine->hydrate($data[0]); } else { $machine = null; } return $machine; }