本文整理汇总了PHP中sendTo函数的典型用法代码示例。如果您正苦于以下问题:PHP sendTo函数的具体用法?PHP sendTo怎么用?PHP sendTo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sendTo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createSchema
public function createSchema()
{
$data = $this->_data;
if (isset($data['cancel'])) {
$this->view->set('info_message', 'Database creation cancelled');
sendTo($this->name, 'index', $this->_modules);
}
if (isset($data['createdb']) && isset($data['Schema'])) {
set_config('DB_TYPE', $data['Schema']['database_type']);
set_config('DB_USER', $data['Schema']['database_admin_username']);
set_config('DB_HOST', $data['Schema']['database_host']);
set_config('DB_PASSWORD', $data['Schema']['database_admin_password']);
set_config('DB_CREATE', true);
$db = DB::Instance();
if ($db === null) {
echo 'Unable to connect to database<br>';
}
$dict = NewDataDictionary($db);
$sql = $dict->CreateDatabase($data['Schema']['database_name']);
$result = $dict->ExecuteSQLArray($sql);
if ($result != 2) {
$this->view->set('message', $db->ErrorMsg());
$this->setTemplateName('systemerror');
$this->view->set('page_title', $this->getPageName('Creation Error', 'Database'));
} else {
$this->view->set('message', 'Database created');
$this->setTemplateName('systemerror');
$this->view->set('page_title', $this->getPageName('Created', 'Database'));
}
}
}
示例2: view
public function view()
{
if (!$this->loadData()) {
$this->dataError();
sendBack();
}
$id = $this->_data['id'];
$transaction = $this->_uses[$this->modeltype];
if ($transaction->bins->count() > 0) {
sendTo('WHBins', 'index', $this->_modules, array('whlocation_id' => $this->_data['id']));
}
$this->view->set('transaction', $transaction);
$sidebar = new SidebarController($this->view);
$sidebarlist = array();
$sidebarlist['stores'] = array('tag' => 'All Stores', 'link' => array('modules' => $this->_modules, 'controller' => 'WHStores', 'action' => 'index'));
$sidebarlist['locations'] = array('tag' => 'Locations for Store ' . $transaction->whstore, 'link' => array('modules' => $this->_modules, 'controller' => 'WHStores', 'action' => 'view', 'id' => $transaction->whstore_id));
$sidebar->addList('Show', $sidebarlist);
if ($transaction->isBalanceEnabled()) {
$sidebarlist = array();
$sidebarlist['balances'] = array('tag' => 'Show Stock Balances', 'link' => array('modules' => $this->_modules, 'controller' => $this->name, 'action' => 'viewBalances', 'id' => $id));
$sidebar->addList('This Location', $sidebarlist);
}
$this->view->register('sidebar', $sidebar);
$this->view->set('sidebar', $sidebar);
$this->view->set('page_title', $this->getPageName('Location'));
}
示例3: _new
public function _new()
{
$flash = Flash::Instance();
parent::_new();
$gl_params = $this->_uses[$this->modeltype];
$unassigned = $gl_params->unassignedParams();
if (count($unassigned) > 0) {
$this->view->set('unassigned', $unassigned);
} elseif (count($unassigned) == 0 && $this->_data['action'] == 'new') {
$flash->addMessage('All parameters have been assigned');
sendTo($this->name, 'index', $this->_modules);
} elseif ($this->_data['action'] == 'new') {
$flash->addError('Error getting Parameter List');
sendback();
}
if (isset($_POST[$this->modeltype]['paramdesc'])) {
$this->selectlist($_POST[$this->modeltype]['paramdesc']);
} elseif ($gl_params->isLoaded()) {
$this->selectlist($gl_params->paramdesc);
$this->view->set('selected', $gl_params->paramvalue_id);
} else {
$this->selectlist(key($unassigned));
}
$sidebar = new SidebarController($this->view);
$sidebarlist = array();
$sidebarlist['view'] = array('tag' => 'View Parameters', 'link' => array_merge($this->_modules, array('controller' => $this->name, 'action' => 'index')));
$sidebar->addList('Actions', $sidebarlist);
$this->view->register('sidebar', $sidebar);
$this->view->set('sidebar', $sidebar);
}
示例4: save
public function save()
{
$flash = Flash::Instance();
$errors = array();
$db = DB::Instance();
$db->StartTrans();
if (isset($this->_data['permission'])) {
$permissions = $this->_data['permission'];
unset($this->_data['permission']);
} else {
$permissions = array();
}
if (isset($this->_data['admin'])) {
$admin = $this->_data['admin'];
unset($this->_data['admin']);
} else {
$admin = array();
}
if (parent::save('Role')) {
$role = $this->saved_model;
if (isset($this->_data['Role']['users']) && is_array($this->_data['Role']['users'])) {
$users = $this->_data['Role']['users'];
Role::setUsers($role, $users, $errors);
$flash->addErrors($errors);
}
if ($role->setPermissions($permissions, $errors) && $role->setAdmin($admin)) {
$db->CompleteTrans();
sendTo('Roles', 'index', array('admin'));
}
}
// $db->FailTrans();
// $db->CompleteTrans();
$this->refresh();
}
示例5: save
public function save()
{
if (parent::save('EmployeeTrainingPlan')) {
sendTo($this->name, 'index', $this->_modules);
}
$this->refresh();
}
示例6: save
public function save()
{
$flash = Flash::Instance();
$errors = array();
$partyaddress = $this->_uses[$this->modeltype];
if (!empty($this->_data[$this->modeltype][$partyaddress->idField])) {
// This is an update to an existing party address/address
// so check if the address is used by other parties
// - update it if address is only used by this party
// - insert it if the current address is used by other parties and it does not already exist
// - otherwise, no need to do anything here (but see below)
if ($partyaddress->load($this->_data[$this->modeltype][$partyaddress->idField])) {
$partyaddress->checkAddress($this->_data);
} else {
$errors[] = 'Error loading current Address details ' . $db->errorMsg();
}
}
if (isset($this->_data['Address'])) {
// Check if this address exists; if it does, point the PartyAddress to it
// and remove the input address as it does not need inserting/updating
$address = DataObjectFactory::Factory('Address');
$address->check_exists($this->_data['Address']);
if ($address->isLoaded()) {
unset($this->_data['Address']);
$this->_data[$this->modeltype]['address_id'] = $address->{$address->idField};
}
}
if (count($errors) == 0 && parent::save($this->modeltype)) {
sendTo($_SESSION['refererPage']['controller'], $_SESSION['refererPage']['action'], $_SESSION['refererPage']['modules'], isset($_SESSION['refererPage']['other']) ? $_SESSION['refererPage']['other'] : null);
} else {
$flash->addErrors($errors);
$this->refresh();
}
}
示例7: save
public function save()
{
$flash = Flash::Instance();
if (parent::save($this->modeltype)) {
sendTo($this->name, 'index', $this->_modules);
}
$this->refresh();
}
示例8: save
public function save()
{
$flash = Flash::Instance();
if (parent::save('ComplaintVolume')) {
sendTo($this->name, 'index', $this->_modules);
}
$this->refresh();
}
示例9: save
public function save()
{
$flash = Flash::Instance();
if (parent::save('Address')) {
sendTo($_SESSION['refererPage']['controller'], $_SESSION['refererPage']['action'], $_SESSION['refererPage']['modules'], isset($_SESSION['refererPage']['other']) ? $_SESSION['refererPage']['other'] : null);
}
$this->refresh();
}
示例10: save
public function save()
{
$flash = Flash::Instance();
if (parent::save('CSFailureCode')) {
sendTo($this->name, 'index', $this->_modules);
} else {
$this->refresh();
}
}
示例11: save
public function save()
{
if (parent::save('ProjectIssueLine')) {
sendTo('projectissues', 'view', array('projects'), array('id' => $this->saved_model->header_id));
} else {
$this->_new();
$this->_templateName = $this->getTemplateName('new');
}
}
示例12: index
public function index()
{
if (isset($this->_data['data_definition_id'])) {
$other = array('id' => $this->_data['data_definition_id']);
} else {
$other = array();
}
sendTo('datadefinitions', 'view', $this->_modules, $other);
}
示例13: delete
public function delete()
{
parent::delete('ProjectNote');
if (isset($this->_data['project_id'])) {
sendTo('projects', 'view', array('projects'), array('id' => $this->_data['project_id']));
} else {
sendTo('projects', 'index', array('projects'), array('a' => 'b'));
}
}
示例14: save
public function save()
{
$errors = array();
$file = File::Factory($_FILES['file'], $errors, new File());
$file->save();
$ticketAttachment = TicketAttachment::Factory(array('ticket_id' => $this->_data['ticket_id'], 'file_id' => $file->id), $errors, new TicketAttachment());
$ticketAttachment->save();
sendTo('Attachments', 'view', array('ticketing'), array('id' => $ticketAttachment->id));
}
示例15: delete
public function delete()
{
$flash = Flash::Instance();
if (!isModuleAdmin()) {
$flash->addError('Sorry, must be a module admin to delete resource templates.');
sendBack();
}
parent::delete('Resourcetemplate');
sendTo('resourcetemplate', 'index', 'projects');
}