本文整理汇总了PHP中users::getEmployees方法的典型用法代码示例。如果您正苦于以下问题:PHP users::getEmployees方法的具体用法?PHP users::getEmployees怎么用?PHP users::getEmployees使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类users
的用法示例。
在下文中一共展示了users::getEmployees方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
//.........这里部分代码省略.........
$dateFrom = mktime(0, 0, 0, date("m"), '1', date("Y"));
$dateFrom = date("Y-m-d", $dateFrom);
$dateTo = date("Y-m-d 00:00:00");
$kind = 'all';
$userId = 'all';
if (isset($_POST['kind']) && $_POST['kind'] != '') {
$kind = $_POST['kind'];
}
if (isset($_POST['userId']) && $_POST['userId'] != '') {
$userId = $_POST['userId'];
}
if (isset($_POST['dateFrom']) && $_POST['dateFrom'] != '') {
$dateFrom = $helper->timestamp2date($_POST['dateFrom'], 4);
}
if (isset($_POST['dateTo']) && $_POST['dateTo'] != '') {
$dateTo = $helper->timestamp2date($_POST['dateTo'], 4);
}
if (isset($_POST['invEmpl']) === true) {
$invEmplCheck = $_POST['invEmpl'];
if ($invEmplCheck == 'on') {
$invEmplCheck = '1';
} else {
$invEmplCheck = '0';
}
} else {
$invEmplCheck = '0';
}
if (isset($_POST['invComp']) === true) {
$invCompCheck = $_POST['invComp'];
if ($invCompCheck == 'on') {
$invCompCheck = '1';
} else {
$invCompCheck = '0';
}
} else {
$invCompCheck = '0';
}
$user = new users();
$employees = $user->getEmployees();
$timesheets = new timesheets();
$projects = new projects();
$tpl->assign('employeeFilter', $userId);
$tpl->assign('employees', $employees);
$tpl->assign('dateFrom', $helper->timestamp2date($dateFrom, 2));
$tpl->assign('dateTo', $helper->timestamp2date($dateTo, 2));
$tpl->assign('actKind', $kind);
$tpl->assign('kind', $timesheets->kind);
$tpl->assign('invComp', $invCompCheck);
$tpl->assign('invEmpl', $invEmplCheck);
$tpl->assign('helper', $helper);
$tpl->assign('projectFilter', $projectFilter);
$tpl->assign('allTimesheets', $timesheets->getAll($projectFilter, $kind, $dateFrom, $dateTo, $userId, $invEmplCheck, $invCompCheck));
/* 'name' = :name AND
'username' = :username AND
'password' = :password AND
'host' = :host AND
'kind' = :kind */
if (isset($_POST['accountSubmit'])) {
$values = array('name' => $_POST['accountName'], 'username' => $_POST['username'], 'password' => $_POST['password'], 'host' => $_POST['host'], 'kind' => $_POST['kind']);
$this->addAccount($values, $id);
}
//Assign vars
$ticket = new tickets();
$tpl->assign('imgExtensions', array('jpg', 'jpeg', 'png', 'gif', 'psd', 'bmp', 'tif', 'thm', 'yuv'));
$tpl->assign('projectTickets', $this->getProjectTickets($id));
$tpl->assign('projectPercentage', $projectPercentage);
$tpl->assign('openTickets', $opentickets['openTickets']);
$tpl->assign('project', $project);
$files = $file->getFilesByModule('project', $id);
$tpl->assign('files', $files);
$tpl->assign('numFiles', count($files));
$bookedHours = $this->getProjectBookedHours($id);
if ($bookedHours['totalHours'] != '') {
$booked = round($bookedHours['totalHours'], 3);
} else {
$booked = 0;
}
$tpl->assign('bookedHours', $booked);
$bookedDollars = $this->getProjectBookedDollars($id);
if ($bookedDollars['totalDollars'] != '') {
$dollars = round($bookedDollars['totalDollars'], 3);
} else {
$dollars = 0;
}
$tpl->assign('bookedDollars', $dollars);
$tpl->assign("bookedHoursArray", $this->getProjectBookedHoursArray($id));
// die($id);
$comment = $comments->getComments('project', $_GET['id']);
$tpl->assign('comments', $comment);
$tpl->assign('numComments', $comments->countComments('project', $_GET['id']));
$tpl->assign('state', $this->state);
$tpl->assign('helper', $helper);
$tpl->assign('role', $_SESSION['userdata']['role']);
$accounts = $this->getProjectAccounts($id);
$tpl->assign('accounts', $accounts);
$tpl->display('projects.showProject');
} else {
$tpl->display('general.error');
}
}
示例2: run
//.........这里部分代码省略.........
$projectObj = new projects();
$user = new users();
$language = new language();
$language->setModule('tickets');
$lang = $language->readIni();
$projects = $projectObj->getUserProjects("open");
$msgKey = '';
if (isset($_POST['save'])) {
$values = array('headline' => $_POST['headline'], 'type' => $_POST['type'], 'description' => $_POST['description'], 'priority' => $_POST['priority'], 'projectId' => $_POST['project'], 'editorId' => implode(',', $_POST['editorId']), 'userId' => $_SESSION['userdata']['id'], 'date' => $helper->timestamp2date(date("Y-m-d H:i:s"), 2), 'dateToFinish' => $_POST['dateToFinish'], 'status' => 3, 'browser' => $_POST['browser'], 'os' => $_POST['os'], 'resolution' => $_POST['resolution'], 'version' => $_POST['version'], 'url' => $_POST['url'], 'editFrom' => $_POST['editFrom'], 'editTo' => $_POST['editTo']);
if ($values['headline'] === '') {
$tpl->setNotification('ERROR_NO_HEADLINE', 'error');
} elseif ($values['description'] === '') {
$tpl->setNotification('ERROR_NO_DESCRIPTION', 'error');
} elseif ($values['projectId'] === '') {
$tpl->setNotification('ERROR_NO_PROJECT', 'error');
} else {
$values['date'] = $helper->timestamp2date($values['date'], 4);
$values['dateToFinish'] = $helper->timestamp2date($values['dateToFinish'], 4);
$values['editFrom'] = $helper->timestamp2date($values['editFrom'], 4);
$values['editTo'] = $helper->timestamp2date($values['editTo'], 4);
// returns last inserted id
$id = $this->addTicket($values);
//Take the old value to avoid nl character
$values['description'] = $_POST['description'];
$values['date'] = $helper->timestamp2date($values['date'], 2);
$values['dateToFinish'] = $helper->timestamp2date($values['dateToFinish'], 2);
$values['editFrom'] = $helper->timestamp2date($values['editFrom'], 2);
$values['editTo'] = $helper->timestamp2date($values['editTo'], 2);
$msgKey = 'TICKET_ADDED';
$tpl->setNotification('TICKET_ADDED', 'success');
//Fileupload
if (htmlspecialchars($_FILES['file']['name']) != '') {
$upload = new fileupload();
$upload->initFile($_FILES['file']);
if ($upload->error == '') {
// hash name on server for security reasons
$newname = md5($id . time());
//Encrypt filename on server
$upload->renameFile($newname);
if ($upload->upload() === true) {
$fileValues = array('encName' => $upload->file_name, 'realName' => $upload->real_name, 'date' => date("Y-m-d H:i:s"), 'ticketId' => $id, 'userId' => $_SESSION['userdata']['id']);
$this->addFile($fileValues);
} else {
$msgKey = 'ERROR_FILEUPLOAD_' . $upload->error . '';
}
} else {
$msgKey = 'ERROR_FILEUPLOAD_' . $upload->error . '';
}
}
/*
//Send mail
$mail = new mailer();
$row = $projectObj->getProject($values['projectId']);
$mail->setSubject(''.$lang['ZYPRO_NEW_TICKET'].' "'.$row['name'].'" ');
$username = $user->getUser($_SESSION['userdata']['id']);
$url = 'http://'.$_SERVER['HTTP_HOST'].'/index.php?act=tickets.showTicket&id='.$id.'';
$mailMsg = "".$lang['NEW_TICKET_MAIL_1']." ".$id." ".$lang['NEW_TICKET_MAIL_2']." ".$username['lastname']." ".$username['firstname']." ".$lang['NEW_TICKET_MAIL_3']." ".$row['name']." ".$lang['NEW_TICKET_MAIL_4']." ".$url." ".$lang['NEW_TICKET_MAIL_5']."";
$mail->setText($mailMsg);
if(is_numeric($values['editorId']) === false ){
$mails = $user->getMailRecipients($values['projectId']);
}else{
$mails = $user->getSpecificMailRecipients($id);
}
$to = array();
foreach($mails as $row){
array_push($to, $row['user']);
}
$mail->sendMail($to);
*/
}
$tpl->assign('values', $values);
}
$tpl->assign('role', $_SESSION['userdata']['role']);
$tpl->assign('availableUsers', $this->getAvailableUsersForTicket());
$tpl->assign('type', $this->getType());
// var_dump($tpl->get)'getAll')
$tpl->assign('info', $msgKey);
$tpl->assign('projects', $projects);
$tpl->assign('objTickets', $this);
$tpl->assign('employees', $user->getEmployees());
$tpl->display('tickets.newTicket');
}
示例3: run
/**
* run - display template and edit data
*
* @access public
*/
public function run()
{
$tpl = new template();
//Only admins and employees
$projects = new projects();
$helper = new helper();
if ($_SESSION['userdata']['role'] == 'admin') {
}
if (isset($_POST['saveInvoice']) === true) {
$invEmpl = '';
$invComp = '';
if (isset($_POST['invoicedEmpl']) === true) {
$invEmpl = $_POST['invoicedEmpl'];
}
if (isset($_POST['invoicedComp']) === true) {
$invComp = $_POST['invoicedComp'];
}
$this->updateInvoices($invEmpl, $invComp);
}
$invEmplCheck = '0';
$invCompCheck = '0';
$projectFilter = '';
$dateFrom = mktime(0, 0, 0, date("m"), '1', date("Y"));
$dateTo = mktime(0, 0, 0, date("m"), date("t"), date("Y"));
$dateFrom = date("Y-m-d", $dateFrom);
$dateTo = date("Y-m-d 00:00:00", $dateTo);
$kind = 'all';
$userId = 'all';
if (isset($_POST['projectFilter']) && $_POST['projectFilter'] != '') {
$projectFilter = $_POST['projectFilter'];
}
if (isset($_POST['kind']) && $_POST['kind'] != '') {
$kind = $_POST['kind'];
}
if (isset($_POST['userId']) && $_POST['userId'] != '') {
$userId = $_POST['userId'];
}
if (isset($_POST['dateFrom']) && $_POST['dateFrom'] != '') {
$dateFrom = $helper->timestamp2date($_POST['dateFrom'], 4);
}
if (isset($_POST['dateTo']) && $_POST['dateTo'] != '') {
$dateTo = $helper->timestamp2date($_POST['dateTo'], 4);
}
if (isset($_POST['invEmpl']) === true) {
$invEmplCheck = $_POST['invEmpl'];
if ($invEmplCheck == 'on') {
$invEmplCheck = '1';
} else {
$invEmplCheck = '0';
}
} else {
$invEmplCheck = '0';
}
if (isset($_POST['invComp']) === true) {
$invCompCheck = $_POST['invComp'];
if ($invCompCheck == 'on') {
$invCompCheck = '1';
} else {
$invCompCheck = '0';
}
} else {
$invCompCheck = '0';
}
if (isset($_POST['export'])) {
$values = array('project' => $projectFilter, 'kind' => $kind, 'userId' => $userId, 'dateFrom' => $dateFrom, 'dateTo' => $dateTo, 'invEmplCheck' => $invEmplCheck, 'invCompCheck' => $invCompCheck);
$this->export($values);
}
$user = new users();
$employees = $user->getEmployees();
$tpl->assign('employeeFilter', $userId);
$tpl->assign('employees', $employees);
$tpl->assign('dateFrom', $helper->timestamp2date($dateFrom, 2));
$tpl->assign('dateTo', $helper->timestamp2date($dateTo, 2));
$tpl->assign('actKind', $kind);
$tpl->assign('kind', $this->kind);
$tpl->assign('invComp', $invCompCheck);
$tpl->assign('invEmpl', $invEmplCheck);
$tpl->assign('helper', $helper);
$tpl->assign('projectFilter', $projectFilter);
$tpl->assign('allProjects', $projects->getAll());
$tpl->assign('allTimesheets', $this->getAll($projectFilter, $kind, $dateFrom, $dateTo, $userId, $invEmplCheck, $invCompCheck));
$tpl->display('timesheets.showAll');
}