本文整理汇总了PHP中Page::onLoad方法的典型用法代码示例。如果您正苦于以下问题:PHP Page::onLoad方法的具体用法?PHP Page::onLoad怎么用?PHP Page::onLoad使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Page
的用法示例。
在下文中一共展示了Page::onLoad方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onLoad
public function onLoad($param)
{
parent::onLoad($param);
if (!$this->IsPostBack) {
$id = $this->Request["id"];
$cmd = $this->db->createCommand("SELECT i.name FROM hr_install AS i LEFT JOIN hr_component AS c ON c.id_install=i.id WHERE i.id=:id AND c.parentmenu=0");
$cmd->bindValue(":id", $id, PDO::PARAM_INT);
$cmd = $cmd->query();
$data = $cmd->read();
$this->cname->Text = $data["name"];
$xml = "." . DIRECTORY_SEPARATOR . "protected" . DIRECTORY_SEPARATOR . "pages" . DIRECTORY_SEPARATOR . "components" . DIRECTORY_SEPARATOR . $data["name"] . DIRECTORY_SEPARATOR . "config.xml";
if (file_exists($xml)) {
$this->Repeater->DataSource = $this->setDataFromXml($xml);
$this->Repeater->dataBind();
} else {
$this->Apply->setEnabled(false);
$this->Save->setEnabled(false);
}
}
if (isset($this->Request['okMsg'])) {
$this->displayMessage($this->Request['okMsg'], true);
}
if (isset($this->Request['koMsg'])) {
$this->displayMessage($this->Request['koMsg'], false);
}
}
示例2: onLoad
public function onLoad($param)
{
parent::onLoad($param);
if ($this->Request['dispimage_p']) {
$this->getImage_p($this->Request['dispimage_p']);
}
if ($this->Request['dispimage_s1']) {
$this->getImage_s1();
}
if ($this->Request['dispimage_s2']) {
$this->getImage_s2($this->Request['dispimage_s2']);
}
if (!$this->IsPostBack) {
$sql = "SELECT * FROM hr_vp_parking";
$cmd = $this->db->createCommand($sql);
$data = $cmd->query();
$this->Repeater->DataSource = $data->readAll();
$this->Repeater->dataBind();
$sql = "SELECT * FROM hr_vp_subscription ORDER BY id";
$cmd = $this->db->createCommand($sql);
$data = $cmd->query();
$this->Repeater2->DataSource = $data->readAll();
$this->Repeater2->dataBind();
}
}
示例3: onLoad
public function onLoad($param)
{
parent::onLoad($param);
if (!$this->IsPostBack) {
$userId = $this->Application->getUser()->getUserId();
$this->blockRecord('hr_device', $this->Request['id'], $userId);
$this->horuxControllerId->setDataValueField('id');
$this->horuxControllerId->setDataTextField('name');
$this->horuxControllerId->DataSource = $this->Controller;
$this->horuxControllerId->dataBind();
$this->horuxControllerId->setSelectedIndex(0);
$this->parent->setDataValueField('id');
$this->parent->setDataTextField('name');
$this->parent->DataSource = $this->Devices;
$this->parent->dataBind();
$param = $this->Application->getParameters();
$superAdmin = $this->Application->getUser()->getSuperAdmin();
if ($param['appMode'] == 'demo' && $superAdmin == 0) {
$this->Save->setEnabled(false);
$this->Apply->setEnabled(false);
}
$this->id->Value = $this->Request['id'];
$this->setData();
}
}
示例4: onLoad
public function onLoad($param)
{
parent::onLoad($param);
if (!$this->isPostBack) {
$app = $this->getApplication();
$usedId = $app->getUser()->getUserID() == null ? 0 : $app->getUser()->getUserID();
$cmd = $this->db->createCommand("SELECT user_id FROM hr_superusers WHERE id={$usedId}");
$data = $cmd->query();
$dataUser = $data->read();
$userId = $dataUser['user_id'];
$employee = new employee($userId);
$role = $employee->getRole();
if ($role == 'employee' && $userId != $this->Request['userId']) {
$this->Response->redirect($this->Service->constructUrl($this->Request['back']));
}
$this->employee->DataSource = $this->PersonList;
$this->employee->dataBind();
if ($this->employee->getItemCount() && $this->employee->getSelectedValue() == '') {
$this->employee->setSelectedIndex(0);
}
$this->timecode->DataSource = $this->TimeCodeList;
$this->timecode->dataBind();
$this->timecode->setEnabled(false);
if (isset($this->Request['date'])) {
$this->date->Text = $this->Request['date'];
}
if (isset($this->Request['userId'])) {
$this->employee->setSelectedValue($this->Request['userId']);
}
}
}
示例5: onLoad
public function onLoad($param)
{
parent::onLoad($param);
if ($this->isPanelDisplay('dispUserLoggedIn')) {
$this->usersGrid->DataSource = $this->UsersLogged;
$this->usersGrid->dataBind();
}
if ($this->isPanelDisplay('dispLastTracking')) {
$this->trackGrid->DataSource = $this->LastTrack;
$this->trackGrid->dataBind();
}
if ($this->isPanelDisplay('dispLastAlarm')) {
$this->alarmsGrid->DataSource = $this->LastAlarms;
$this->alarmsGrid->dataBind();
}
$app = $this->getApplication();
$db = $app->getModule('horuxDb')->DbConnection;
$sql = "SELECT `key` FROM hr_config";
$cmd = $db->createCommand($sql);
$res = $cmd->query();
$res = $res->read();
$_SESSION['helpKey'] = $res['key'];
$this->Repeater->DataSource = $this->getComponentShortCut();
$this->Repeater->dataBind();
}
示例6: onLoad
public function onLoad($param)
{
parent::onLoad($param);
if (!$this->isPostBack) {
$deviceId = $this->Request["deviceId"];
$cmd = $this->db->createCommand("SELECT * FROM `hr_horux_media` WHERE id_device=:id");
$cmd->bindParameter(":id", $deviceId, PDO::PARAM_STR);
$row = $cmd->query();
$row = $row->read();
require_once 'XML/RPC.php';
$client = new XML_RPC_Client("RPC2", $row["ip"], $row["port"]);
$msg = new XML_RPC_Message("horuxInfoDisplay.getMediaList");
@($response = $client->send($msg));
if ($response) {
if (!$response->faultCode()) {
$v = $response->value();
$result = explode(",", html_entity_decode($v->scalarval()));
$media = array();
foreach ($result as $k => $v) {
$media[] = array("Value" => $v, "Text" => $v);
}
$this->media->DataTextField = 'Text';
$this->media->DataValueField = 'Value';
$this->media->DataSource = $media;
$this->media->dataBind();
if (count($media) > 0) {
$this->media->setSelectedIndex(0);
}
} else {
$content_error = "ERROR - ";
$content_error .= "Code: " . $response->faultCode() . " Reason '" . $response->faultString() . "'<br/>";
}
}
}
}
示例7: onLoad
public function onLoad($param)
{
parent::onLoad($param);
if (!is_writeable("." . DIRECTORY_SEPARATOR . "protected" . DIRECTORY_SEPARATOR . "messages")) {
$this->displayMessage(Prado::localize("The directory {dir} must be writeable", array("dir" => "." . DIRECTORY_SEPARATOR . "protected" . DIRECTORY_SEPARATOR . "messages")), false);
}
}
示例8: onLoad
public function onLoad($param)
{
parent::onLoad($param);
$sql = "SELECT picturepath FROM hr_config WHERE id=1";
$cmd = $this->db->createCommand($sql);
$data = $cmd->query();
$data = $data->read();
if ($data['picturepath'] != "") {
if (!is_writeable('pictures' . DIRECTORY_SEPARATOR . $data['picturepath'])) {
$this->displayMessage(Prado::localize('The directory ./pictures{p} must be writeable to save your logo', array('p' => DIRECTORY_SEPARATOR . $data['picturepath'])), false);
} else {
$this->picturepath = 'pictures' . DIRECTORY_SEPARATOR . $data['picturepath'] . DIRECTORY_SEPARATOR;
}
} else {
if (!is_writeable('.' . DIRECTORY_SEPARATOR . 'pictures')) {
$this->displayMessage(Prado::localize('The directory ./pictures{p} must be writeable to save your logo', array('p' => "")), false);
} else {
$this->picturepath = 'pictures' . DIRECTORY_SEPARATOR;
}
}
if (!$this->isPostBack) {
$this->setData();
$param = $this->Application->getParameters();
$superAdmin = $this->Application->getUser()->getSuperAdmin();
if ($param['appMode'] == 'demo' && $superAdmin == 0) {
$this->tbb->Save->setEnabled(false);
}
}
}
示例9: onLoad
public function onLoad($param)
{
parent::onLoad($param);
$app = $this->getApplication();
$usedId = $app->getUser()->getUserID() == null ? 0 : $app->getUser()->getUserID();
$cmd = $this->db->createCommand("SELECT user_id FROM hr_superusers WHERE id={$usedId}");
$data = $cmd->query();
$dataUser = $data->read();
$this->userId = $dataUser['user_id'];
$this->employee = new employee($this->userId);
if (!$this->isPostBack) {
$this->timecode->DataSource = $this->TimeCodeList;
$this->timecode->dataBind();
$this->id->Value = $this->Request['id'];
// Secure the id to be sure that the id correspond to the employee
$cmd = $this->db->createCommand("SELECT * FROM hr_timux_request WHERE id=:id AND userId=:userId");
$cmd->bindValue(":id", $this->id->Value, PDO::PARAM_STR);
$cmd->bindValue(":userId", $this->userId, PDO::PARAM_STR);
$data = $cmd->query();
$data = $data->readAll();
if (count($data) == 0) {
$pBack = array('koMsg' => Prado::localize('Cannot modify a leave request from an other employee'));
$this->Response->redirect($this->Service->constructUrl('components.timuxuser.leaverequest.leaverequest', $pBack));
}
$this->setData();
}
}
示例10: onLoad
public function onLoad($param)
{
parent::onLoad($param);
if (isset($this->Request['enterkey']) && $this->Request['enterkey'] == 1) {
$authManager = $this->Application->getModule('Auth');
if ($authManager->login(strtolower($this->username->SafeText), $this->password->SafeText)) {
$this->log($this->username->SafeText . " is logged in");
$userID = Prado::getApplication()->getUser()->getUserID();
$cmd = $this->db->createCommand("SELECT defaultPage FROM hr_superuser_group AS sg LEFT JOIN hr_superusers AS s ON s.group_id=sg.id WHERE s.id={$userID}");
$data = $cmd->query();
$dataUser = $data->read();
$defaultPage = $dataUser['defaultPage'];
if ($defaultPage == '') {
$this->Response->redirect($this->Service->constructUrl('controlPanel.ControlPanel', array('lang' => $this->lang->getSelectedValue())));
} else {
$this->Response->redirect($this->Service->constructUrl($defaultPage, array('lang' => $this->lang->getSelectedValue())));
}
//$this->Response->redirect($this->Service->constructUrl('controlPanel.ControlPanel',array('lang'=>$this->lang->getSelectedValue())));
}
}
$this->getClientScript()->registerStyleSheetFile('loginCss', './themes/letux/css/login.css');
$this->username->focus();
if (!$this->IsPostBack) {
$this->lang->DataTextField = 'name';
$this->lang->DataValueField = 'param';
$this->lang->DataSource = $this->Data;
$this->lang->dataBind();
$cmd = $this->db->createCommand("SELECT * FROM hr_install WHERE type='language' AND `default`=1");
$data = $cmd->query();
$data = $data->read();
$this->lang->setSelectedValue($data['param']);
}
}
示例11: onLoad
public function onLoad($param)
{
parent::onLoad($param);
$groupId = $this->Application->getUser()->getGroupID();
$param = $this->Application->getParameters();
if ($this->Request['id'] == 1 && $groupId != 1 && $param['appMode'] == 'saas') {
$pBack = array('koMsg' => Prado::localize("You don't have the right to modify this users group"));
$this->Response->redirect($this->Service->constructUrl('superuser.userGroupList', $pBack));
}
if (!$this->isPostBack) {
$userId = $this->Application->getUser()->getUserId();
$this->blockRecord('hr_superuser_group', $this->Request['id'], $userId);
$this->id->Value = $this->Request['id'];
$this->defaultPage->DataTextField = 'pagename';
$this->defaultPage->DataValueField = 'page';
$this->defaultPage->DataSource = $this->DataPage;
$this->defaultPage->dataBind();
$this->setData();
$this->Session['dataPage'] = array();
$this->DataGrid->DataSource = $this->Data;
$this->DataGrid->dataBind();
$superAdmin = $this->Application->getUser()->getSuperAdmin();
$param = $this->Application->getParameters();
if ($param['appMode'] == 'demo' && $superAdmin == 0) {
$this->tbb->apply->setEnabled(false);
$this->tbb->Save->setEnabled(false);
}
$this->DataGrid->DataSource = $this->Data;
$this->DataGrid->dataBind();
}
}
示例12: onLoad
public function onLoad($param)
{
parent::onLoad($param);
if (!$this->isPostBack) {
$this->accesspoint->DataSource = $this->Accesspoint;
$this->accesspoint->dataBind();
}
}
示例13: onLoad
public function onLoad($param)
{
parent::onLoad($param);
if (!$this->isPostBack) {
$this->id->Value = $this->Request['id'];
$this->setData();
}
}
示例14: onLoad
public function onLoad($param)
{
parent::onLoad($param);
if (!$this->IsPostBack) {
$result = $this->getSystemStatus();
$this->parseResponse($result);
}
}
示例15: onLoad
public function onLoad($param)
{
parent::onLoad($param);
if (!$this->isPostBack) {
$userId = $this->Application->getUser()->getUserId();
$this->blockRecord('hr_vp_period', $this->Request['id'], $userId);
$this->id->Value = $this->Request['id'];
$this->setData();
}
}