protected function saveData() { $cmd = $this->db->createCommand(SQL::SQL_MOD_ACCESS_LEVEL); $cmd->bindValue(":id", $this->id->Value, PDO::PARAM_INT); $cmd->bindValue(":name", $this->name->SafeText, PDO::PARAM_STR); $cmd->bindValue(":full_access", $this->fullAccess->Checked, PDO::PARAM_STR); $cmd->bindValue(":non_working_day", $this->nonWorkingDayAccess->Checked, PDO::PARAM_STR); $cmd->bindValue(":monday_default", $this->mondayDefault->Checked, PDO::PARAM_STR); $cmd->bindValue(":comment", $this->comment->SafeText, PDO::PARAM_STR); $res2 = $cmd->execute(); $cmd = $this->db->createCommand(SQL::SQL_REMOVE_ACCESS_TIME); $cmd->bindValue(":id", $this->id->Value, PDO::PARAM_INT); $res = $cmd->execute(); $this->timeArray = $this->getViewState('timeArray', array()); foreach ($this->timeArray as $time) { $this->saveTimeData($time['day'], $time['hourStart'], $time['duration'], $this->Request['id'], $time['pinCode'], $time['exitingOnly'], $time['specialRelayPlan']); } $this->log("Modify the access level: " . $this->name->SafeText); if ($res) { $cmd = $this->db->createCommand("SELECT * FROM hr_device WHERE accessPoint=1"); $data = $cmd->query(); $row = $data->readAll(); foreach ($row as $r) { $sa = new TStandAlone(); $sa->addStandalone('add', $r['id'], 'reinit'); } } return $res || $res2; }
protected function saveData() { $from = $this->dateToSql($this->from->SafeText); if ($this->until->SafeText != "") { $until = $this->dateToSql($this->until->SafeText); } else { $until = $from; } $cmd = $this->db->createCommand(SQL::SQL_ADD_NONWORKINGDAY); $cmd->bindValue(":name", $this->name->SafeText, PDO::PARAM_STR); $cmd->bindValue(":from", $from, PDO::PARAM_STR); $cmd->bindValue(":until", $until, PDO::PARAM_STR); $cmd->bindValue(":comment", $this->comment->SafeText, PDO::PARAM_STR); $cmd->bindValue(":color", $this->color->SafeText, PDO::PARAM_STR); $period = ""; if ($this->allday->getChecked()) { $period = 'allday'; } if ($this->morning->getChecked()) { $period = 'morning'; } if ($this->afternoon->getChecked()) { $period = 'afternoon'; } $cmd->bindValue(":period", $period, PDO::PARAM_STR); $this->log("Add the non working day: " . $this->name->SafeText); $res = $cmd->execute(); if ($res) { $cmd = $this->db->createCommand("SELECT * FROM hr_device WHERE accessPoint=1"); $data = $cmd->query(); $row = $data->readAll(); foreach ($row as $r) { $sa = new TStandAlone(); $sa->addStandalone('add', $r['id'], 'reinit'); } } return $res; }
protected function addStandalone($function, $idgroup) { $sa = new TStandAlone(); $sa->addStandalone($function, $idgroup, 'UserAttributionGroup'); }
protected function addStandalone($function, $userId) { $sa = new TStandAlone(); $sa->addStandalone($function, $userId, 'UserListMod'); }
protected function addStandalone($function, $idkey) { $sa = new TStandAlone(); $sa->addStandalone($function, $idkey, 'UserAttributionKey'); }
public function onDelete($sender, $param) { $cbs = $this->findControlsByType("TActiveCheckBox"); $nDelete = 0; $koMsg = ''; $cbChecked = 0; foreach ($cbs as $cb) { if ((bool) $cb->getChecked() && $cb->Value != "0") { $cbChecked++; } } if ($cbChecked == 0) { $koMsg = Prado::localize('Select one item'); } else { foreach ($cbs as $cb) { if ((bool) $cb->getChecked() && $cb->Value != "0") { $sa = new TStandAlone(); $sa->addStandalone("sub", $cb->Value, 'timuxAddSubReason'); $cmd = $this->db->createCommand("DELETE FROM hr_timux_timecode WHERE id=:id"); $cmd->bindValue(":id", $cb->Value); if ($cmd->execute()) { $nDelete++; } //$this->log("Delete the key: ".$data['serialNumber']); } } } if ($koMsg !== '') { $pBack = array('koMsg' => $koMsg); } else { $pBack = array('okMsg' => Prado::localize('{n} time code was deleted', array('n' => $nDelete))); } $this->Response->redirect($this->Service->constructUrl('components.timuxadmin.timecode.timecode', $pBack)); }
protected function addStandalone($function, $idkey) { $sa = new TStandAlone(); $sa->addStandalone($function, $idkey, 'KeyMod'); }
protected function saveData() { $cmd = $this->db->createCommand("UPDATE `hr_timux_timecode` SET\n `name`=:name ,\n `abbreviation`=:abbreviation,\n `type`=:type,\n `useMinMax`=:useMinMax,\n `minHour`=:minHour,\n `maxHour`=:maxHour,\n `defaultHoliday` =:defaultHoliday,\n `defaultOvertime` =:defaultOvertime,\n `formatDisplay` =:formatDisplay,\n `signtype`=:signtype,\n `timeworked`=:timeworked,\n `deviceDisplay`=:deviceDisplay,\n `color`=:color,\n `inputDBE`=:inputDBE\n WHERE id=:id\n ;"); $cmd->bindValue(":type", $this->type->getSelectedValue(), PDO::PARAM_STR); $cmd->bindValue(":name", $this->name->SafeText, PDO::PARAM_STR); $cmd->bindValue(":deviceDisplay", $this->deviceDisplay->SafeText, PDO::PARAM_STR); $cmd->bindValue(":abbreviation", $this->abbreviation->SafeText, PDO::PARAM_STR); $cmd->bindValue(":color", $this->color->SafeText, PDO::PARAM_STR); if ($this->type->getSelectedValue() == 'load') { $cmd->bindValue(":inputDBE", $this->inputBDE->getSelectedValue(), PDO::PARAM_STR); } else { $cmd->bindValue(":inputDBE", 0, PDO::PARAM_STR); } $useMinMax = false; if ($this->useMinMax->getChecked()) { $useMinMax = true; } else { $this->minHour->Text = 0; $this->maxHour->Text = 0; } $timeworked = false; if ($this->timeworked->getChecked()) { $timeworked = true; } $cmd->bindValue(":timeworked", $timeworked, PDO::PARAM_STR); $cmd->bindValue(":useMinMax", $useMinMax, PDO::PARAM_STR); $cmd->bindValue(":minHour", $this->minHour->SafeText, PDO::PARAM_STR); $cmd->bindValue(":maxHour", $this->maxHour->SafeText, PDO::PARAM_STR); $cmd->bindValue(":id", $this->id->Value, PDO::PARAM_STR); $checkO = 0; if ($this->defaultOvertime->getChecked()) { $checkO = 1; } $cmd->bindValue(":defaultOvertime", $checkO, PDO::PARAM_STR); $checkH = 0; if ($this->defaultHoliday->getChecked()) { $checkH = 1; } $cmd->bindValue(":defaultHoliday", $checkH, PDO::PARAM_STR); $format = "hour"; if ($this->formatHour->getChecked()) { $format = 1; } if ($this->formatDay->getChecked()) { $format = 2; } $cmd->bindValue(":formatDisplay", $format, PDO::PARAM_STR); if ($checkO == 1) { $cmdU = $this->db->createCommand("UPDATE `hr_timux_timecode` SET\n `defaultOvertime` =0\n ;"); $cmdU->execute(); } if ($checkH == 1) { $cmdU = $this->db->createCommand("UPDATE `hr_timux_timecode` SET\n `defaultHoliday` =0\n ;"); $cmdU->execute(); } $cmd->bindValue(":signtype", $this->signtype->getSelectedValue(), PDO::PARAM_STR); $res = $cmd->execute(); if ($this->signtype->getSelectedValue() != 'none') { $sa = new TStandAlone(); $sa->addStandalone("sub", $this->id->Value, 'timuxAddSubReason'); $sa->addStandalone("add", $this->id->Value, 'timuxAddSubReason'); } return $res; }
protected function saveData($action) { $date = date('Y-m-d'); $time = date('H:i:s'); $sign = $action; $lastId = false; $cmd = $this->db->createCommand("INSERT INTO `hr_timux_booking` (\n `tracking_id` ,\n `action`,\n `roundBooking`,\n `actionReason`,\n `internet`\n )\n VALUES (\n :tracking_id,\n :action,\n :roundBooking,\n :actionReason,\n 1\n );"); if ($action == 254 && $this->timecode->getSelectedValue() || $action == 255 && $this->timecodeIn->getSelectedValue()) { $oldAction = $action; if ($action == 254) { $timecodeValue = $this->timecode->getSelectedValue(); } else { $timecodeValue = $this->timecodeIn->getSelectedValue(); } $action = 100; $cmd2 = $this->db->createCommand("SELECT * FROM hr_timux_timecode WHERE id=" . $timecodeValue); $data2 = $cmd2->query(); $data2 = $data2->read(); //$$ if ($data2['type'] == 'load') { $action = 255; $sign = "_IN"; $cmd3 = $this->db->createCommand("SELECT tb.action FROM hr_timux_booking AS tb LEFT JOIN hr_tracking AS t ON tb.tracking_id=t.id WHERE t.id_user="******" ORDER BY t.date DESC, t.time DESC, tb.tracking_id DESC LIMIT 0,1"); $cmd3 = $cmd3->query(); $data3 = $cmd3->read(); if ($data3) { if ($data3['action'] == "255") { // last booking was an already an entry, we have to insert an exit $cmd4 = $this->db->createCommand("INSERT INTO `hr_tracking` (\n `id_user` ,\n `time`,\n `date`,\n `is_access`,\n `extData`\n )\n VALUES (\n :id_user,\n :time,\n :date,\n '1',\n 'hr_timux_booking'\n );"); $cmd4->bindValue(":id_user", $this->userId, PDO::PARAM_STR); $cmd4->bindValue(":time", $time, PDO::PARAM_STR); $cmd4->bindValue(":date", $date, PDO::PARAM_STR); $res1 = $cmd4->execute(); $cmd5 = $this->db->createCommand("INSERT INTO `hr_timux_booking` (\n `tracking_id` ,\n `action`,\n `roundBooking`,\n `actionReason`,\n `internet`\n )\n VALUES (\n :tracking_id,\n 254,\n :roundBooking,\n :actionReason,\n 1\n );"); $cmd5->bindValue(":tracking_id", $this->db->LastInsertID, PDO::PARAM_STR); $cmd5->bindValue(":roundBooking", $time, PDO::PARAM_STR); $cmd5->bindValue(":actionReason", "0", PDO::PARAM_STR); $res1 = $cmd5->execute(); } } $cmd4 = $this->db->createCommand("INSERT INTO `hr_tracking` (\n `id_user` ,\n `time`,\n `date`,\n `is_access`,\n `extData`\n )\n VALUES (\n :id_user,\n :time,\n :date,\n '1',\n 'hr_timux_booking'\n );"); $cmd4->bindValue(":id_user", $this->userId, PDO::PARAM_STR); $cmd4->bindValue(":time", $time, PDO::PARAM_STR); $cmd4->bindValue(":date", $date, PDO::PARAM_STR); $res1 = $cmd4->execute(); $lastId = $this->db->LastInsertID; $cmd2 = $this->db->createCommand("INSERT INTO `hr_timux_booking_bde` (\n\t\t\t\t\t\t `tracking_id` ,\n\t\t\t\t\t\t `user_id`,\n\t\t\t\t\t\t `device_id`,\n\t\t\t\t\t\t `date`,\n\t\t\t\t\t\t `time`,\n\t\t\t\t\t\t `code`,\n\t\t\t\t\t\t `BDE1`\n\t\t\t\t\t\t )\n\t\t\t\t\t\t VALUES (\n\t\t\t\t\t\t :tracking_id,\n\t\t\t\t\t\t :user_id,\n\t\t\t\t\t\t :device_id,\n\t\t\t\t\t\t :date,\n\t\t\t\t\t\t :time,\n\t\t\t\t\t\t 155,\n\t\t\t\t\t\t :bde1\n\t\t\t\t\t\t );"); $cmd2->bindValue(":tracking_id", $lastId, PDO::PARAM_STR); $cmd2->bindValue(":user_id", $this->userId, PDO::PARAM_STR); $cmd2->bindValue(":device_id", 0, PDO::PARAM_STR); $cmd2->bindValue(":date", $date, PDO::PARAM_STR); $cmd2->bindValue(":time", $time, PDO::PARAM_STR); $cmd2->bindValue(":bde1", $data2['abbreviation'], PDO::PARAM_STR); $cmd2->execute(); } else { $sign = "_OUT"; } if ($oldAction == 255) { $sign = "_IN"; } $cmd->bindValue(":action", $action, PDO::PARAM_STR); if ($action != 255) { if ($data2['signtype'] == 'both') { $actionReason = $timecodeValue . $sign; } else { $actionReason = $timecodeValue; } } else { $actionReason = 0; } $cmd->bindValue(":actionReason", $actionReason, PDO::PARAM_STR); } else { $actionReason = 0; $cmd->bindValue(":action", $action, PDO::PARAM_STR); $cmd->bindValue(":actionReason", $actionReason, PDO::PARAM_STR); } if (!$lastId) { $cmd6 = $this->db->createCommand("INSERT INTO `hr_tracking` (\n `id_user` ,\n `time`,\n `date`,\n `is_access`,\n `extData`\n )\n VALUES (\n :id_user,\n :time,\n :date,\n '1',\n 'hr_timux_booking'\n );"); $cmd6->bindValue(":id_user", $this->userId, PDO::PARAM_STR); $cmd6->bindValue(":time", $time, PDO::PARAM_STR); $cmd6->bindValue(":date", $date, PDO::PARAM_STR); $res1 = $cmd6->execute(); $lastId = $this->db->LastInsertID; } $cmd->bindValue(":tracking_id", $lastId, PDO::PARAM_STR); $cmd->bindValue(":roundBooking", $time, PDO::PARAM_STR); $res1 = $cmd->execute(); $sa = new TStandAlone(); $sa->addStandalone('add', $this->userId, 'UserListMod'); return $lastId; }
public function onUnAttribute($sender, $param) { $cbs = $this->findControlsByType("TActiveCheckBox"); $nUnAttributed = 0; $koMsg = ''; $cbChecked = 0; foreach ($cbs as $cb) { if ((bool) $cb->getChecked() && $cb->Value != "0") { $cbChecked++; } } if ($cbChecked == 0) { $koMsg = Prado::localize('Select one item'); } else { foreach ($cbs as $cb) { if ((bool) $cb->getChecked() && $cb->Value != "0") { $cmd = $this->db->createCommand("SELECT * FROM hr_openTime_attribution WHERE id=:id"); $cmd->bindValue(":id", $cb->Value); $data = $cmd->query(); $data = $data->read(); $deviceId = $data['id_device']; $cmd = $this->db->createCommand(SQL::SQL_DELETE_OPEN_TIME_ATTRIBUTION); $cmd->bindValue(":id", $cb->Value); if ($cmd->execute()) { $nUnAttributed++; $horuxService = new THoruxService(); $horuxService->onStopDevice($deviceId); $horuxService->onStartDevice($deviceId); $sa = new TStandAlone(); $sa->addStandalone("add", $deviceId, 'reinit'); } } } } if ($koMsg !== '') { $pBack = array('id' => $this->id->Value, 'koMsg' => $koMsg); $this->Response->redirect($this->Service->constructUrl('openTime.attribute', $pBack)); } else { $pBack = array('id' => $this->Request['id'], 'okMsg' => Prado::localize('{n} open time was unattributed', array('n' => $nUnAttributed))); $this->Response->redirect($this->Service->constructUrl('openTime.attribute', $pBack)); } }
public function onDelete($sender, $param) { $cbs = $this->findControlsByType("TActiveCheckBox"); $nDelete = 0; $koMsg = ''; $cbChecked = 0; foreach ($cbs as $cb) { if ((bool) $cb->getChecked() && $cb->Value != "0") { $cbChecked++; } } if ($cbChecked == 0) { $koMsg = Prado::localize('Select one item'); } else { foreach ($cbs as $cb) { if ((bool) $cb->getChecked() && $cb->Value != "0") { $cmd = $this->db->createCommand(SQL::SQL_GET_ACCESS_LEVEL_ID); $cmd->bindValue(":id", $cb->Value); $cmd = $cmd->query(); $data = $cmd->read(); $this->log("Delete the access level: " . $data['name']); $cmd = $this->db->createCommand(SQL::SQL_REMOVE_ACCESS_LEVEL); $cmd->bindValue(":id", $cb->Value); if ($cmd->execute()) { $nDelete++; } $cmd = $this->db->createCommand(SQL::SQL_REMOVE_ACCESS_TIME); $cmd->bindValue(":id", $cb->Value); $cmd->execute(); } } if ($nDelete > 0) { $cmd = $this->db->createCommand("SELECT * FROM hr_device WHERE accessPoint=1"); $data = $cmd->query(); $row = $data->readAll(); foreach ($row as $r) { $sa = new TStandAlone(); $sa->addStandalone('add', $r['id'], 'reinit'); } } } if ($koMsg !== '') { $pBack = array('koMsg' => $koMsg); } else { $pBack = array('okMsg' => Prado::localize('{n} access level was deleted', array('n' => $nDelete))); } $this->Response->redirect($this->Service->constructUrl('accessLevel.accessLevelList', $pBack)); }
public function saveData() { parent::saveData(); $cmd = $this->db->createCommand(SQL::SQL_UPDATE_GANTNERTERMINAL); $cmd->bindValue(":ipOrDhcp", $this->ipOrDhcp->SafeText, PDO::PARAM_STR); $cmd->bindValue(":checkBooking", $this->checkBooking->SafeText, PDO::PARAM_STR); $cmd->bindValue(":userMemory", $this->userMemory->getSelectedValue(), PDO::PARAM_STR); $cmd->bindValue(":accessMemory", $this->accessMemory->getSelectedValue(), PDO::PARAM_STR); $cmd->bindValue(":subscriberNumber", $this->subscriberNumber->SafeText, PDO::PARAM_STR); $cmd->bindValue(":plantNumber", $this->plantNumber->SafeText, PDO::PARAM_STR); $cmd->bindValue(":mainCompIdCard", $this->mainCompIdCard->SafeText, PDO::PARAM_STR); $cmd->bindValue(":bookingCodeSumWinSwitchOver", $this->bookingCodeSumWinSwitchOver->SafeText, PDO::PARAM_STR); $cmd->bindValue(":switchOverLeap", $this->switchOverLeap->SafeText, PDO::PARAM_STR); $cmd->bindValue(":waitingTimeInput", $this->waitingTimeInput->SafeText, PDO::PARAM_STR); $cmd->bindValue(":monitoringTime", $this->monitoringTime->SafeText, PDO::PARAM_STR); $cmd->bindValue(":monitorinChangingTime", $this->monitorinChangingTime->SafeText, PDO::PARAM_STR); $cmd->bindValue(":cardReaderType", $this->cardReaderType->getSelectedValue(), PDO::PARAM_STR); $cmd->bindValue(":maxDoorOpenTime", $this->maxDoorOpenTime->SafeText, PDO::PARAM_STR); $cmd->bindValue(":warningTimeDoorOpenTime", $this->warningTimeDoorOpenTime->SafeText, PDO::PARAM_STR); $cmd->bindValue(":unlockingTime", $this->unlockingTime->SafeText, PDO::PARAM_STR); $cmd->bindValue(":relay1", $this->relay1->getSelectedValue(), PDO::PARAM_STR); $cmd->bindValue(":timeRelay1", $this->timeRelay1->SafeText, PDO::PARAM_STR); $cmd->bindValue(":relay2", $this->relay2->getSelectedValue(), PDO::PARAM_STR); $cmd->bindValue(":timeRelay2", $this->timeRelay2->SafeText, PDO::PARAM_STR); $cmd->bindValue(":relay3", $this->relay3->getSelectedValue(), PDO::PARAM_STR); $cmd->bindValue(":timeRelay3", $this->timeRelay3->SafeText, PDO::PARAM_STR); $cmd->bindValue(":relay4", $this->relay3->getSelectedValue(), PDO::PARAM_STR); $cmd->bindValue(":timeRelay4", $this->timeRelay3->SafeText, PDO::PARAM_STR); $cmd->bindValue(":opto1", $this->opto1->getSelectedValue(), PDO::PARAM_STR); $cmd->bindValue(":opto2", $this->opto2->getSelectedValue(), PDO::PARAM_STR); $cmd->bindValue(":opto3", $this->opto3->getSelectedValue(), PDO::PARAM_STR); $cmd->bindValue(":opto4", $this->opto4->getSelectedValue(), PDO::PARAM_STR); $cmd->bindValue(":enterExitInfo", $this->enterExitInfo->getSelectedValue(), PDO::PARAM_STR); $f1 = $this->autoUnlocking->getChecked() ? 1 : 0; $cmd->bindValue(":autoUnlocking", $f1, PDO::PARAM_STR); $f2 = $this->lockUnlockCommand->getChecked() ? 1 : 0; $cmd->bindValue(":lockUnlockCommand", $f2, PDO::PARAM_STR); $cmd->bindValue(":holdUpPINCode", $this->holdUpPINCode->SafeText, PDO::PARAM_STR); $f3 = $this->twoPersonAccess->getChecked() ? 1 : 0; $cmd->bindValue(":twoPersonAccess", $f3, PDO::PARAM_STR); $cmd->bindValue(":barriereRepeatedAccess", $this->barriereRepeatedAccess->SafeText, PDO::PARAM_STR); $f4 = $this->antiPassActive->getChecked() ? 1 : 0; $cmd->bindValue(":antiPassActive", $f4, PDO::PARAM_STR); $cmd->bindValue(":relayExpanderControl", $this->relayExpanderControl->getSelectedValue(), PDO::PARAM_STR); $cmd->bindValue(":doorOpenTimeUnit", $this->doorOpenTimeUnit->getSelectedValue(), PDO::PARAM_STR); $cmd->bindValue(":optionalCompanyID1", $this->optionalCompanyID1->SafeText, PDO::PARAM_STR); $cmd->bindValue(":optionalCompanyID2", $this->optionalCompanyID2->SafeText, PDO::PARAM_STR); $cmd->bindValue(":optionalCompanyID3", $this->optionalCompanyID3->SafeText, PDO::PARAM_STR); $cmd->bindValue(":optionalCompanyID4", $this->optionalCompanyID4->SafeText, PDO::PARAM_STR); $cmd->bindValue(":optionalCompanyID5", $this->optionalCompanyID5->SafeText, PDO::PARAM_STR); $cmd->bindValue(":optionalCompanyID6", $this->optionalCompanyID6->SafeText, PDO::PARAM_STR); $cmd->bindValue(":optionalCompanyID7", $this->optionalCompanyID7->SafeText, PDO::PARAM_STR); $cmd->bindValue(":optionalCompanyID8", $this->optionalCompanyID8->SafeText, PDO::PARAM_STR); $cmd->bindValue(":optionalCompanyID9", $this->optionalCompanyID9->SafeText, PDO::PARAM_STR); $cmd->bindValue(":optionalCompanyID10", $this->optionalCompanyID10->SafeText, PDO::PARAM_STR); $cmd->bindValue(":optionalCardStructur", $this->optionalCardStructur->SafeText, PDO::PARAM_STR); $cmd->bindValue(":optionalGantnerNationalCode", $this->optionalGantnerNationalCode->SafeText, PDO::PARAM_STR); $cmd->bindValue(":optionalGantnerCustomerCode1", $this->optionalGantnerCustomerCode1->SafeText, PDO::PARAM_STR); $cmd->bindValue(":optionalGantnerCustomerCode2", $this->optionalGantnerCustomerCode2->SafeText, PDO::PARAM_STR); $cmd->bindValue(":optionalGantnerCustomerCode3", $this->optionalGantnerCustomerCode3->SafeText, PDO::PARAM_STR); $cmd->bindValue(":optionalGantnerCustomerCode4", $this->optionalGantnerCustomerCode4->SafeText, PDO::PARAM_STR); $cmd->bindValue(":optionalGantnerCustomerCode5", $this->optionalGantnerCustomerCode5->SafeText, PDO::PARAM_STR); $cmd->bindValue(":optionalReaderInitialisation", $this->optionalReaderInitialisation->SafeText, PDO::PARAM_STR); $cmd->bindValue(":optionalTableCardType", $this->optionalTableCardType->SafeText, PDO::PARAM_STR); $cmd->bindValue(":id", $this->id->Value, PDO::PARAM_STR); $cmd->Execute(); $horuxService = new THoruxService(); $horuxService->onStopDevice($id); $horuxService->onStartDevice($id); $sa = new TStandAlone(); $sa->addStandalone("add", $this->id->Value, 'reinit'); return true; }
protected function addStandalone($function, $idgroup) { $sa = new TStandAlone(); $sa->addStandalone($function, $idgroup, 'UserGroupMod'); }
public function saveData() { parent::saveData(); if ($this->lastId !== false) { $cmd = $this->db->createCommand(SQL::SQL_ADD_GANTNERTERMINAL); $cmd->bindValue(":id_device", $this->lastId, PDO::PARAM_STR); $cmd->bindValue(":ipOrDhcp", $this->ipOrDhcp->SafeText, PDO::PARAM_STR); $isAutoRestart = $this->isAutoRestart->getChecked(); $cmd->bindValue(":isAutoRestart", $isAutoRestart, PDO::PARAM_STR); $autoRestart = $this->autoRestartHour->SafeText . ":" . $this->autoRestartMinute->SafeText . ":00"; $cmd->bindValue(":autoRestart", $autoRestart, PDO::PARAM_STR); $cmd->bindValue(":displayTimeout", $this->displayTimeout->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputTimeout", $this->inputTimeout->SafeText, PDO::PARAM_STR); $cmd->bindValue(":brightness", $this->brightness->getSelectedValue(), PDO::PARAM_STR); $udpServer = $this->udpServer->getChecked(); $cmd->bindValue(":udpServer", $udpServer, PDO::PARAM_STR); $cmd->bindValue(":autoBooking", $this->autoBooking->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":checkBooking", $this->checkBooking->SafeText, PDO::PARAM_STR); $language = array(); if ($this->ar->getChecked()) { $language[] = 'ar'; } if ($this->de->getChecked()) { $language[] = 'de'; } if ($this->en->getChecked()) { $language[] = 'en'; } if ($this->fr->getChecked()) { $language[] = 'fr'; } if ($this->it->getChecked()) { $language[] = 'it'; } if ($this->fa->getChecked()) { $language[] = 'fa'; } if ($this->pl->getChecked()) { $language[] = 'pl'; } if ($this->ro->getChecked()) { $language[] = 'ro'; } if ($this->es->getChecked()) { $language[] = 'es'; } if ($this->cs->getChecked()) { $language[] = 'cs'; } $language = implode(',', $language); $cmd->bindValue(":language", $language, PDO::PARAM_STR); $cmd->bindValue(":inputDBECheck1", $this->inputDBECheck1->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":inputDBECheck2", $this->inputDBECheck2->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":inputDBECheck3", $this->inputDBECheck3->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":inputDBECheck4", $this->inputDBECheck4->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":inputDBECheck5", $this->inputDBECheck5->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":inputDBECheck6", $this->inputDBECheck6->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":inputDBECheck7", $this->inputDBECheck7->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":inputDBECheck8", $this->inputDBECheck8->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":inputDBECheck9", $this->inputDBECheck9->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":inputDBECheck10", $this->inputDBECheck10->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":inputDBECheck11", $this->inputDBECheck11->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":inputDBECheck12", $this->inputDBECheck12->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":inputDBECheck13", $this->inputDBECheck13->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":inputDBECheck14", $this->inputDBECheck14->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":inputDBECheck15", $this->inputDBECheck15->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":inputDBECheck16", $this->inputDBECheck16->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":inputDBECheck17", $this->inputDBECheck17->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":inputDBECheck18", $this->inputDBECheck18->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":inputDBECheck19", $this->inputDBECheck19->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":inputDBECheck20", $this->inputDBECheck20->getChecked(), PDO::PARAM_STR); $cmd->bindValue(":inputDBEText1", $this->inputDBEText1->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEText2", $this->inputDBEText2->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEText3", $this->inputDBEText3->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEText4", $this->inputDBEText4->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEText5", $this->inputDBEText5->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEText6", $this->inputDBEText6->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEText7", $this->inputDBEText7->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEText8", $this->inputDBEText8->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEText9", $this->inputDBEText9->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEText10", $this->inputDBEText10->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEText11", $this->inputDBEText11->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEText12", $this->inputDBEText12->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEText13", $this->inputDBEText13->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEText14", $this->inputDBEText14->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEText15", $this->inputDBEText15->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEText16", $this->inputDBEText16->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEText17", $this->inputDBEText17->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEText18", $this->inputDBEText18->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEText19", $this->inputDBEText19->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEText20", $this->inputDBEText20->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEFormat1", $this->inputDBEDisplay1->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEFormat2", $this->inputDBEDisplay2->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEFormat3", $this->inputDBEDisplay3->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEFormat4", $this->inputDBEDisplay4->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEFormat5", $this->inputDBEDisplay5->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEFormat6", $this->inputDBEDisplay6->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEFormat7", $this->inputDBEDisplay7->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEFormat8", $this->inputDBEDisplay8->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEFormat9", $this->inputDBEDisplay9->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEFormat10", $this->inputDBEDisplay10->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEFormat11", $this->inputDBEDisplay11->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEFormat12", $this->inputDBEDisplay12->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEFormat13", $this->inputDBEDisplay13->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEFormat14", $this->inputDBEDisplay14->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEFormat15", $this->inputDBEDisplay15->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEFormat16", $this->inputDBEDisplay16->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEFormat17", $this->inputDBEDisplay17->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEFormat18", $this->inputDBEDisplay18->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEFormat19", $this->inputDBEDisplay19->SafeText, PDO::PARAM_STR); $cmd->bindValue(":inputDBEFormat20", $this->inputDBEDisplay20->SafeText, PDO::PARAM_STR); $cmd->Execute(); $inputData = $this->getViewState('inputData'); $type = 'fixed'; $key = 1; if ($this->leftFixed->SafeText != '' && $this->leftFixedDlg->getSelectedValue() != '') { $cmd = $this->db->createCommand(SQL::SQL_ADD_KEY); $cmd->bindValue(":id", $this->lastId, PDO::PARAM_STR); $cmd->bindValue(":type", $type, PDO::PARAM_STR); $cmd->bindValue(":key", $key, PDO::PARAM_STR); $cmd->bindValue(":text", $this->leftFixed->SafeText, PDO::PARAM_STR); $cmd->bindValue(":dialog", $this->leftFixedDlg->getSelectedValue(), PDO::PARAM_STR); if (isset($inputData[$type][$key])) { $cmd->bindValue(":params", $inputData[$type][$key], PDO::PARAM_STR); } else { $cmd->bindValue(":params", '', PDO::PARAM_STR); } $cmd->Execute(); } $key = 2; if ($this->leftMiddleFixed->SafeText != '' && $this->leftMiddleFixedDlg->getSelectedValue() != '') { $cmd = $this->db->createCommand(SQL::SQL_ADD_KEY); $cmd->bindValue(":id", $this->lastId, PDO::PARAM_STR); $cmd->bindValue(":type", $type, PDO::PARAM_STR); $cmd->bindValue(":key", $key, PDO::PARAM_STR); $cmd->bindValue(":text", $this->leftMiddleFixed->SafeText, PDO::PARAM_STR); $cmd->bindValue(":dialog", $this->leftMiddleFixedDlg->getSelectedValue(), PDO::PARAM_STR); if (isset($inputData[$type][$key])) { $cmd->bindValue(":params", $inputData[$type][$key], PDO::PARAM_STR); } else { $cmd->bindValue(":params", '', PDO::PARAM_STR); } $cmd->Execute(); } $key = 3; if ($this->rightMiddleFixed->SafeText != '' && $this->rightMiddleFixedDlg->getSelectedValue() != '') { $cmd = $this->db->createCommand(SQL::SQL_ADD_KEY); $cmd->bindValue(":id", $this->lastId, PDO::PARAM_STR); $cmd->bindValue(":type", $type, PDO::PARAM_STR); $cmd->bindValue(":key", $key, PDO::PARAM_STR); $cmd->bindValue(":text", $this->rightMiddleFixed->SafeText, PDO::PARAM_STR); $cmd->bindValue(":dialog", $this->rightMiddleFixedDlg->getSelectedValue(), PDO::PARAM_STR); if (isset($inputData[$type][$key])) { $cmd->bindValue(":params", $inputData[$type][$key], PDO::PARAM_STR); } else { $cmd->bindValue(":params", '', PDO::PARAM_STR); } $cmd->Execute(); } $key = 4; if ($this->rightFixed->SafeText != '' && $this->rightFixedDlg->getSelectedValue() != '') { $cmd = $this->db->createCommand(SQL::SQL_ADD_KEY); $cmd->bindValue(":id", $this->lastId, PDO::PARAM_STR); $cmd->bindValue(":type", $type, PDO::PARAM_STR); $cmd->bindValue(":key", $key, PDO::PARAM_STR); $cmd->bindValue(":text", $this->rightFixed->SafeText, PDO::PARAM_STR); $cmd->bindValue(":dialog", $this->rightFixedDlg->getSelectedValue(), PDO::PARAM_STR); if (isset($inputData[$type][$key])) { $cmd->bindValue(":params", $inputData[$type][$key], PDO::PARAM_STR); } else { $cmd->bindValue(":params", '', PDO::PARAM_STR); } $cmd->Execute(); } $type = 'soft'; $key = 1; if ($this->leftTopSoft->SafeText != '' && $this->leftTopSoftDlg->getSelectedValue() != '') { $cmd = $this->db->createCommand(SQL::SQL_ADD_KEY); $cmd->bindValue(":id", $this->lastId, PDO::PARAM_STR); $cmd->bindValue(":type", $type, PDO::PARAM_STR); $cmd->bindValue(":key", $key, PDO::PARAM_STR); $cmd->bindValue(":text", $this->leftTopSoft->SafeText, PDO::PARAM_STR); $cmd->bindValue(":dialog", $this->leftTopSoftDlg->getSelectedValue(), PDO::PARAM_STR); if (isset($inputData[$type][$key])) { $cmd->bindValue(":params", $inputData[$type][$key], PDO::PARAM_STR); } else { $cmd->bindValue(":params", '', PDO::PARAM_STR); } $cmd->Execute(); } $key = 2; if ($this->leftMiddleSoft->SafeText != '' && $this->leftMiddleSoftDlg->getSelectedValue() != '') { $cmd = $this->db->createCommand(SQL::SQL_ADD_KEY); $cmd->bindValue(":id", $this->lastId, PDO::PARAM_STR); $cmd->bindValue(":type", $type, PDO::PARAM_STR); $cmd->bindValue(":key", $key, PDO::PARAM_STR); $cmd->bindValue(":text", $this->leftMiddleSoft->SafeText, PDO::PARAM_STR); $cmd->bindValue(":dialog", $this->leftMiddleSoftDlg->getSelectedValue(), PDO::PARAM_STR); if (isset($inputData[$type][$key])) { $cmd->bindValue(":params", $inputData[$type][$key], PDO::PARAM_STR); } else { $cmd->bindValue(":params", '', PDO::PARAM_STR); } $cmd->Execute(); } $key = 3; if ($this->leftBottomSoft->SafeText != '' && $this->leftBottomSoftDlg->getSelectedValue() != '') { $cmd = $this->db->createCommand(SQL::SQL_ADD_KEY); $cmd->bindValue(":id", $this->lastId, PDO::PARAM_STR); $cmd->bindValue(":type", $type, PDO::PARAM_STR); $cmd->bindValue(":key", $key, PDO::PARAM_STR); $cmd->bindValue(":text", $this->leftBottomSoft->SafeText, PDO::PARAM_STR); $cmd->bindValue(":dialog", $this->leftBottomSoftDlg->getSelectedValue(), PDO::PARAM_STR); if (isset($inputData[$type][$key])) { $cmd->bindValue(":params", $inputData[$type][$key], PDO::PARAM_STR); } else { $cmd->bindValue(":params", '', PDO::PARAM_STR); } $cmd->Execute(); } $key = 4; if ($this->rightTopSoft->SafeText != '' && $this->rightTopSoftDlg->getSelectedValue() != '') { $cmd = $this->db->createCommand(SQL::SQL_ADD_KEY); $cmd->bindValue(":id", $this->lastId, PDO::PARAM_STR); $cmd->bindValue(":type", $type, PDO::PARAM_STR); $cmd->bindValue(":key", $key, PDO::PARAM_STR); $cmd->bindValue(":text", $this->rightTopSoft->SafeText, PDO::PARAM_STR); $cmd->bindValue(":dialog", $this->rightTopSoftDlg->getSelectedValue(), PDO::PARAM_STR); if (isset($inputData[$type][$key])) { $cmd->bindValue(":params", $inputData[$type][$key], PDO::PARAM_STR); } else { $cmd->bindValue(":params", '', PDO::PARAM_STR); } $cmd->Execute(); } $key = 5; if ($this->rightMiddleSoft->SafeText != '' && $this->rightMiddleSoftDlg->getSelectedValue() != '') { $cmd = $this->db->createCommand(SQL::SQL_ADD_KEY); $cmd->bindValue(":id", $this->lastId, PDO::PARAM_STR); $cmd->bindValue(":type", $type, PDO::PARAM_STR); $cmd->bindValue(":key", $key, PDO::PARAM_STR); $cmd->bindValue(":text", $this->rightMiddleSoft->SafeText, PDO::PARAM_STR); $cmd->bindValue(":dialog", $this->rightMiddleSoftDlg->getSelectedValue(), PDO::PARAM_STR); if (isset($inputData[$type][$key])) { $cmd->bindValue(":params", $inputData[$type][$key], PDO::PARAM_STR); } else { $cmd->bindValue(":params", '', PDO::PARAM_STR); } $cmd->Execute(); } $key = 6; if ($this->rightBottomSoft->SafeText != '' && $this->rightBottomSoftDlg->getSelectedValue() != '') { $cmd = $this->db->createCommand(SQL::SQL_ADD_KEY); $cmd->bindValue(":id", $this->lastId, PDO::PARAM_STR); $cmd->bindValue(":type", $type, PDO::PARAM_STR); $cmd->bindValue(":key", $key, PDO::PARAM_STR); $cmd->bindValue(":text", $this->rightBottomSoft->SafeText, PDO::PARAM_STR); $cmd->bindValue(":dialog", $this->rightBottomSoftDlg->getSelectedValue(), PDO::PARAM_STR); if (isset($inputData[$type][$key])) { $cmd->bindValue(":params", $inputData[$type][$key], PDO::PARAM_STR); } else { $cmd->bindValue(":params", '', PDO::PARAM_STR); } $cmd->Execute(); } $horuxService = new THoruxService(); $horuxService->onStopDevice($id); $horuxService->onStartDevice($id); $sa = new TStandAlone(); $sa->addStandalone("add", $this->lastId, 'timuxReinit'); return true; } else { return false; } }
protected function addStandaloneKey($function, $keyId) { $sa = new TStandAlone(); $sa->addStandalone($function, $keyId, 'UserAttributionKey'); }