当前位置: 首页>>代码示例>>PHP>>正文


PHP template::display方法代码示例

本文整理汇总了PHP中template::display方法的典型用法代码示例。如果您正苦于以下问题:PHP template::display方法的具体用法?PHP template::display怎么用?PHP template::display使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在template的用法示例。


在下文中一共展示了template::display方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 /**
  * run - display template and edit data
  *
  * @access public
  */
 public function run()
 {
     $tpl = new template();
     //Only admins
     if ($_SESSION['userdata']['role'] == 'admin') {
         if (isset($_GET['id']) === true) {
             $id = (int) $_GET['id'];
             $msgKey = '';
             if ($this->hasTickets($id) === true) {
                 $msgKey = 'CLIENT_HAS_TICKETS';
             } else {
                 if (isset($_POST['del']) === true) {
                     $this->deleteClient($id);
                     $msgKey = 'CLIENT_DELETED';
                 }
             }
             //Assign vars
             $tpl->assign('client', $this->getClient($id));
             $tpl->assign('msg', $msgKey);
             $tpl->display('clients.delClient');
         } else {
             $tpl->display('general.error');
         }
     } else {
         $tpl->display('general.error');
     }
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:32,代码来源:class.delClient.php

示例2: run

 public function run()
 {
     $tpl = new template();
     $id = (int) $_GET['id'];
     $users = new users();
     $clients = new clients();
     if ($id && $id > 0) {
         $lead = $this->getLead($id);
         $contact = $this->getLeadContact($id);
         $values = array('user' => $contact['email'], 'password' => '', 'firstname' => '', 'lastname' => '', 'phone' => $contact['phone'], 'role' => 3, 'clientId' => $lead['clientId']);
         if (isset($_POST['save'])) {
             if (isset($_POST['user']) && isset($_POST['firstname']) && isset($_POST['lastname'])) {
                 $hasher = new PasswordHash(8, TRUE);
                 $values = array('user' => $_POST['user'], 'password' => $hasher->HashPassword($_POST['password']), 'firstname' => $_POST['firstname'], 'lastname' => $_POST['lastname'], 'phone' => $_POST['phone'], 'role' => $_POST['role'], 'clientId' => $_POST['clientId']);
                 if ($users->usernameExist($values['user']) !== true) {
                     $users->addUser($values);
                     $tpl->setNotification('USER_CREATED', 'success');
                 } else {
                     $tpl->setNotification('USERNAME_EXISTS', 'error');
                 }
             } else {
                 $tpl->setNotification('MISSING_FIELDS', 'error');
             }
         }
         $tpl->assign('values', $values);
         $tpl->assign('clients', $clients->getAll());
         $tpl->assign('roles', $users->getRoles());
         $tpl->display('leads.convertToUser');
     } else {
         $tpl->display('general.error');
     }
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:32,代码来源:class.convertToUser.php

示例3: run

 public function run()
 {
     $tpl = new template();
     $id = (int) $_GET['id'];
     if ($id > 0) {
         $lead = $this->getLead($id);
         // Comments
         $comments = new comments();
         if (isset($_POST['comment']) === true) {
             $values = array('text' => $_POST['text'], 'date' => date("Y-m-d H:i:s"), 'userId' => $_SESSION['userdata']['id'], 'moduleId' => $id, 'commentParent' => $_POST['father']);
             $comments->addComment($values, 'lead');
         }
         // files
         $file = new files();
         if (isset($_POST['upload'])) {
             if (isset($_FILES['file'])) {
                 $file->upload($_FILES, 'lead', $id);
                 $tpl->setNotification('FILE_UPLOADED', 'success');
             } else {
                 $tpl->setNotification('NO_FILE', 'error');
             }
         }
         $files = new files();
         $tpl->assign('files', $files->getFilesByModule('lead', $id));
         $tpl->assign('comments', $comments->getComments('lead', $id));
         $tpl->assign('contactInfo', $this->getLeadContact($id));
         $tpl->assign('lead', $lead);
     } else {
         $tpl->display('general.error');
     }
     $tpl->display('leads.showLead');
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:32,代码来源:class.showLead.php

示例4: run

 /**
  * run - display template and edit data
  *
  * @access public
  */
 public function run()
 {
     $tpl = new template();
     $user = new users();
     //Only admins
     if ($user->isAdmin($_SESSION['userdata']['id'])) {
         $msgKey = '';
         if (isset($_POST['save']) === true) {
             $values = array('name' => $_POST['name'], 'street' => $_POST['street'], 'zip' => $_POST['zip'], 'city' => $_POST['city'], 'state' => $_POST['state'], 'country' => $_POST['country'], 'phone' => $_POST['phone'], 'internet' => $_POST['internet'], 'email' => $_POST['email']);
             if ($values['name'] !== '') {
                 if ($this->isClient($values) !== true) {
                     $this->addClient($values);
                     $tpl->setNotification('ADD_CLIENT_SUCCESS', 'success');
                 } else {
                     $tpl->setNotification('CLIENT_EXISTS', 'error');
                 }
             } else {
                 $tpl->setNotification('NO_NAME', 'error');
             }
             $tpl->assign('values', $values);
         }
         $tpl->display('clients.newClient');
     } else {
         $tpl->display('general.error');
     }
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:31,代码来源:class.newClient.php

示例5: run

 /**
  * run - display template and edit data
  *
  * @access public
  */
 public function run()
 {
     $tpl = new template();
     //Only admins
     if ($_SESSION['userdata']['role'] == 'admin') {
         if (isset($_GET['id']) === true) {
             $id = (int) $_GET['id'];
             $row = $this->getClient($id);
             $msgKey = '';
             $values = array('name' => $row['name'], 'street' => $row['street'], 'zip' => $row['zip'], 'city' => $row['city'], 'state' => $row['state'], 'country' => $row['country'], 'phone' => $row['phone'], 'internet' => $row['internet'], 'email' => $row['email']);
             if (isset($_POST['save']) === true) {
                 $values = array('name' => $_POST['name'], 'street' => $_POST['street'], 'zip' => $_POST['zip'], 'city' => $_POST['city'], 'state' => $_POST['state'], 'country' => $_POST['country'], 'phone' => $_POST['phone'], 'internet' => $_POST['internet'], 'email' => $_POST['email']);
                 if ($values['name'] !== '') {
                     $this->editClient($values, $id);
                     $tpl->setNotification('EDIT_CLIENT_SUCCESS', 'success');
                 } else {
                     $tpl->setNotification('NO_NAME', 'error');
                 }
             }
             $tpl->assign('values', $values);
             $tpl->display('clients.editClient');
         } else {
             $tpl->display('general.error');
         }
     } else {
         $tpl->display('general.error');
     }
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:33,代码来源:class.editClient.php

示例6: run

 /**
  * run - display template and edit data
  *
  * @access public
  *
  */
 public function run()
 {
     $tpl = new template();
     //Only Admins
     if ($_SESSION['userdata']['role'] == 'admin') {
         if (isset($_GET['id']) === true) {
             $id = (int) $_GET['id'];
             $user = $this->getUser($id);
             $msgKey = '';
             //Delete User
             if (isset($_POST['del']) === true) {
                 $this->deleteUser($id);
                 $msgKey = 'USER_DELETED';
             }
             //Assign variables
             $tpl->assign('msg', $msgKey);
             $tpl->assign('user', $user);
             $tpl->display('users.delUser');
         } else {
             $tpl->display('general.error');
         }
     } else {
         $tpl->display('general.error');
     }
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:31,代码来源:class.delUser.php

示例7: run

    public function run()
    {
        $tpl = new template();
        $file = 'config/configuration.php';
        if (file_exists($file) === true) {
            if (substr(decoct(fileperms($file)), 2) != 777) {
                $tpl->assign('info', 'configuration.php nicht beschreibbar');
            }
            $config = new config();
            $values = array('sitename' => $config->sitename, 'dbHost' => $config->dbHost, 'dbUser' => $config->dbUser, 'dbDatabase' => $config->dbDatabase, 'dbPassword' => $config->dbPassword, 'userFilePath' => $config->userFilePath, 'maxFileSize' => $config->maxFileSize, 'email' => $config->email, 'adminUserName' => $config->adminUserName, 'adminUserPassword' => $config->adminUserPassword, 'adminFirstname' => $config->adminFirstname, 'adminLastname' => $config->adminLastname, 'adminEmail' => $config->adminEmail, 'sessionpassword' => $config->sessionpassword);
            if (isset($_POST['save'])) {
                $fileContent = '<?php
							class config
							{
								/* General */
								public $sitename = "' . htmlspecialchars($_POST['sitename']) . '";
								/* Database */
								public $dbHost="' . htmlspecialchars($_POST['host']) . '";
								public $dbUser="' . htmlspecialchars($_POST['username']) . '";
								public $dbPassword="' . htmlspecialchars($_POST['password']) . '";
								public $dbDatabase="' . htmlspecialchars($_POST['database']) . '";
								
								public $adminUserName = "' . htmlspecialchars($_POST['adminUserName']) . '";
								public $adminUserPassword = "' . htmlspecialchars($_POST['adminUserPassword']) . '";
								public $adminFirstname = "' . htmlspecialchars($_POST['adminFirstname']) . '";
								public $adminLastname = "' . htmlspecialchars($_POST['adminLastname']) . '";
								public $adminEmail = "' . htmlspecialchars($_POST['adminEmail']) . '";
								
								/* Fileupload */
								public $userFilePath="' . htmlspecialchars($_POST['path']) . '";
								public $maxFileSize = "' . htmlspecialchars($_POST['filesize']) . '";
								
								/* Sessions */
								public $sessionpassword = "' . $values['sessionpassword'] . '";
								
								/* Email */
								public $email = "' . htmlspecialchars($_POST['email']) . '";
							
							}
							?>';
                if (substr(decoct(fileperms($file)), 2) == 777) {
                    $fp = fopen($file, "w+");
                    fputs($fp, $fileContent);
                    fclose($fp);
                    $values = array('sitename' => htmlspecialchars($_POST['sitename']), 'dbHost' => htmlspecialchars($_POST['host']), 'dbUser' => htmlspecialchars($_POST['username']), 'dbPassword' => htmlspecialchars($_POST['password']), 'dbDatabase' => htmlspecialchars($_POST['database']), 'userFilePath' => htmlspecialchars($_POST['path']), 'maxFileSize' => htmlspecialchars($_POST['filesize']), 'email' => htmlspecialchars($_POST['email']), 'adminUserName' => htmlspecialchars($_POST['adminUserName']), 'adminUserPassword' => htmlspecialchars($_POST['adminUserPassword']), 'adminFirstname' => htmlspecialchars($_POST['adminFirstname']), 'adminLastname' => htmlspecialchars($_POST['adminLastname']), 'adminEmail' => htmlspecialchars($_POST['adminEmail']), 'sessionpassword' => $values['sessionpassword']);
                    $tpl->assign('info', 'Einstellungen gespeichert');
                } else {
                    $tpl->assign('info', 'configuration.php nicht beschreibbar');
                }
            }
            $tpl->assign('values', $values);
            $tpl->display('setting.editSettings');
        } else {
            $tpl->display('general.error');
        }
    }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:56,代码来源:class.editSettings.php

示例8: run

 /**
  * run - display template and edit data
  *
  * @access public
  *
  */
 public function run()
 {
     $tpl = new template();
     if (isset($_GET['id']) === true) {
         $id = (int) $_GET['id'];
         $row = $this->getRole($id);
         $infoKey = '';
         //Get relations to menue
         $menues = $this->getDefaultMenu($id);
         //Build values array
         $values = array('roleName' => $row['roleName'], 'roleDescription' => $row['roleDescription'], 'menu' => $menues, 'sysOrg' => $row['sysOrg'], 'template' => $row['template']);
         if (isset($_POST['save'])) {
             if (isset($_POST['menu'])) {
                 $menu = $_POST['menu'];
             } else {
                 $menu[0] = '';
             }
             $values = array('roleName' => $_POST['roleName'], 'roleDescription' => $_POST['roleDescription'], 'menu' => $menu, 'sysOrg' => $_POST['sysOrg'], 'template' => $_POST['template']);
             if ($values['roleName'] !== '') {
                 $helper = new helper();
                 if ($this->roleAliasExist($values['roleName'], $id) === false) {
                     if ($values['roleDescription'] !== '') {
                         $this->editRole($values, $id);
                         $infoKey = '<p>Erfolgreich bearbeitet</p>';
                         $row = $this->getRole($id);
                         //Get relations to menue
                         $menues = $this->getDefaultMenu($id);
                         //Build values array
                         $values = array('roleName' => $row['roleName'], 'roleDescription' => $row['roleDescription'], 'menu' => $menues, 'sysOrg' => $row['sysOrg'], 'template' => $row['template']);
                     } else {
                         $infoKey = 'Keine Beschreibung angegeben';
                     }
                 } else {
                     $infoKey = 'Rolle existiert bereits';
                 }
             } else {
                 $infoKey = 'Keinen Rollen-Alias angegeben';
             }
         }
         //Assign vars
         $tpl->assign('info', $infoKey);
         $tpl->assign('values', $values);
         $tpl->assign('templates', $this->getAllTemplates());
         $tpl->assign('sysOrgs', $this->getAllSystemOrganisations());
         $tpl->assign('menu', $this->getWholeMenu());
         $tpl->display('setting.editRole');
     } else {
         $tpl->display('general.error');
     }
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:56,代码来源:class.editRole.php

示例9: run

 /**
  * run - display template and edit data
  *
  * @access public
  */
 public function run()
 {
     $tpl = new template();
     //Only admins and employees
     if ($_SESSION['userdata']['role'] == 'admin' || $_SESSION['userdata']['role'] == 'employee') {
         if ($_SESSION['userdata']['role'] == 'admin') {
             $tpl->assign('admin', true);
         }
         $tpl->assign('allClients', $this->getAll());
         $tpl->display('clients.showAll');
     } else {
         $tpl->display('general.error');
     }
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:19,代码来源:class.showAll.php

示例10: run

 /**
  * run - display template and edit data
  *
  * @access public
  *
  */
 public function run()
 {
     $tpl = new template();
     //Only Admins
     if ($_SESSION['userdata']['role'] == 'admin') {
         //Assign vars
         $tpl->assign('allUsers', $this->getAll());
         $tpl->assign('admin', true);
         $tpl->assign('roles', $this->getRoles());
         $tpl->display('users.showAll');
     } else {
         $tpl->display('general.error');
     }
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:20,代码来源:class.showAll.php

示例11: run

 public function run()
 {
     $tpl = new template();
     $id = (int) $_GET['id'];
     if ($id > 0) {
         if (isset($_POST['save'])) {
             $values = array('street' => $_POST['street'], 'zip' => $_POST['zip'], 'city' => $_POST['city'], 'state' => $_POST['state'], 'country' => $_POST['country'], 'phone' => $_POST['phone'], 'internet' => $_POST['internet']);
             $this->addLeadContact($values, $id);
             $tpl->setNotification('EDIT_SUCCESS', 'success');
         }
     } else {
         $tpl->display('general.error');
     }
     $tpl->display('leads.addLeadContact');
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:15,代码来源:class.addLeadContact.php

示例12: run

 public function run()
 {
     $tpl = new template();
     $login = new login(session::getSID());
     $tpl->assign('login', $login);
     $tpl->display('general.header');
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:7,代码来源:class.header.php

示例13: run

 /**
  * run - display template and edit data
  *
  * @access public
  *
  */
 public function run()
 {
     $tpl = new template();
     $tpl->assign('role', $_SESSION['userdata']['role']);
     $tpl->assign('allProjects', $this->getUserProjects());
     $tpl->display('projects.showAll');
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:13,代码来源:class.showAll.php

示例14: run

 public function run()
 {
     $tpl = new template();
     $language = new language();
     $language->setModule('leads');
     $language->readIni();
     if (isset($_POST['save'])) {
         if (isset($_POST['name']) && isset($_POST['money']) && isset($_POST['referralSource'])) {
             $refValue = '';
             if ($_POST['referralValueOther'] != '') {
                 $refValue = $_POST['referralValueOther'];
             } else {
                 if ($_POST['referralSource'] == 5 && $_POST['referralValueClient'] > 0) {
                     $refValue = $_POST['referralValueClient'];
                 }
             }
             $values = array('name' => $_POST['name'], 'refSource' => $_POST['referralSource'], 'refValue' => $refValue, 'potentialMoney' => $_POST['money'], 'creatorId' => $_SESSION['userdata']['id']);
             $contact = array('name' => $_POST['clientName'], 'street' => $_POST['street'], 'zip' => $_POST['zip'], 'city' => $_POST['city'], 'state' => $_POST['state'], 'country' => $_POST['country'], 'phone' => $_POST['phone'], 'email' => $_POST['email'], 'internet' => $_POST['internet']);
             if ($this->isLead($values['name']) !== true) {
                 $leadId = $this->addLead($values);
                 $this->addLeadContact($contact, $leadId);
                 $tpl->setNotification('EDIT_SUCCESS', 'success');
             } else {
                 $tpl->setNotification('LEAD_EXISTS', 'error');
             }
         } else {
             $tpl->setNotification('MISSING_FIELDS', 'error');
         }
     }
     $client = new clients();
     $tpl->assign('referralSources', $this->getReferralSources());
     $tpl->assign('clients', $client->getAll());
     $tpl->display('leads.addLead');
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:34,代码来源:class.addLead.php

示例15: run

 /**
  * run - display template and edit data
  *
  * @access public
  *
  */
 public function run()
 {
     $tpl = new template();
     //Assign vars
     $tpl->assign('allSystemOrgs', $this->getAllSystemOrganisations());
     $tpl->display('setting.showAllSystemOrg');
 }
开发者ID:DevelopIdeas,项目名称:leantime,代码行数:13,代码来源:class.showAllSystemOrg.php


注:本文中的template::display方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。