本文整理汇总了PHP中nameByNetId函数的典型用法代码示例。如果您正苦于以下问题:PHP nameByNetId函数的具体用法?PHP nameByNetId怎么用?PHP nameByNetId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了nameByNetId函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printCurrentRaiseTable
function printCurrentRaiseTable()
{
global $area;
global $netID;
global $db;
//This query sums up the raises field to give us accurate wage totals.
try {
$logQuery = $db->prepare("SELECT `index`, `netID`, `raise`, FORMAT((SELECT SUM(ew.raise) FROM `employeeRaiseLog` AS ew WHERE ew.date <= ew_outer.date AND ew.netid = ew_outer.netid), 2)\n\t\t\t AS `newWage`, `submitter`, `date`, `comments`, `isSubmitted` FROM `employeeRaiseLog` AS `ew_outer` WHERE `submitter` = :netId AND isSubmitted='0' ORDER BY netID ASC,`date` ASC");
$logQuery->execute(array(':netId' => $netID));
} catch (PDOException $e) {
exit("error in query");
}
while ($curRaise = $logQuery->fetch(PDO::FETCH_ASSOC)) {
echo "<tr><td>";
echo "<input type='checkbox' name='email[" . $curRaise['index'] . "]' id='email[" . $curRaise['index'] . "]' value='1' </td><td>";
echo nameByNetId($curRaise['netID']) . "</td><td>";
echo $curRaise['newWage'] . "</td><td>";
echo $curRaise['raise'] . "</td><td>";
echo $curRaise['comments'] . "</td><td>";
echo date("Y-m-d", strtotime($curRaise['date'])) . "</td><td>";
echo "<input type='button' value='Edit' id='edit" . $curRaise['index'] . "' onclick='javascript:newwindow(\"../editRaise.php?raiseId=" . $curRaise['index'] . "\")' /></td><td>";
echo "<input type='button' value='Delete' id='delete" . $curRaise['index'] . "' onclick='deleteRaise(" . $curRaise['index'] . ")' />";
echo "</td></tr>";
}
}
示例2: printFamousPeople
function printFamousPeople()
{
global $area, $db;
try {
$commendableQuery = $db->prepare("SELECT * FROM `reportCommendable` WHERE `public`='1' AND `area`=:area AND `timeStamp` > (NOW() - INTERVAL 3 WEEK) ORDER BY timeStamp DESC");
$commendableQuery->execute(array(':area' => $area));
} catch (PDOException $e) {
exit("error in query");
}
if ($first = $commendableQuery->fetch(PDO::FETCH_ASSOC)) {
echo "<div class='employee'>";
echo "<img class='employeeImage' src='" . getenv("BYUPIPHOTO") . "?n={$first['employee']}'>";
echo "<div class='employeeName'>" . nameByNetId($first['employee']) . "</div>";
echo "<div class='date'>" . $first['date'] . "</div>";
echo "<div class='comments'>" . $first['reason'] . "</div>";
echo "</div>";
while ($cur = $commendableQuery->fetch(PDO::FETCH_ASSOC)) {
echo "<div class='employee'>";
echo "<img class='employeeImage' src='" . getenv("BYUPIPHOTO") . "?n={$cur['employee']}'>";
echo "<div class='employeeName'>" . nameByNetId($cur['employee']) . "</div>";
echo "<div class='date'>" . $cur['date'] . "</div>";
echo "<div class='comments'>" . $cur['reason'] . "</div>";
echo "</div>";
}
echo "</table>";
} else {
echo "<h2 align='center'>No Commendables awarded in the last week.</h2>";
}
}
示例3: displayTeamsTable
function displayTeamsTable($area)
{
global $db;
try {
$teamsQuery = $db->prepare("SELECT * FROM teams WHERE area=:area ORDER BY name");
$teamsQuery->execute(array(':area' => $area));
} catch (PDOException $e) {
exit("error in query");
}
while ($curTeam = $teamsQuery->fetch(PDO::FETCH_ASSOC)) {
echo "<tr>";
echo "<td>" . $curTeam['name'] . "</td>";
echo "<td>" . nameByNetId($curTeam['lead']) . "</td>";
echo "<td>" . $curTeam['email'] . "</td>";
try {
$membersQuery = $db->prepare("SELECT * FROM `teamMembers` JOIN `employee` ON `teamMembers`.`netID`=`employee`.`netID` WHERE `teamMembers`.`teamID` = :id ORDER BY `employee`.`firstName`");
$membersQuery->execute(array(':id' => $curTeam['ID']));
} catch (PDOException $e) {
exit("error in query");
}
echo "<td>";
while ($cur = $membersQuery->fetch(PDO::FETCH_ASSOC)) {
echo nameByNetId($cur['netID']);
if ($cur['isSupervisor']) {
echo " (Supervisor)";
}
echo "<br/>";
}
echo "</td></tr>";
}
}
示例4: formEmail
function formEmail($postData)
{
echo "Subject: " . getEmailType($postData['type']) . "Executive Notification: ";
echo $postData['subject'];
echo "\nNotification Time: " . $postData['time'];
echo "\nNotification Date: " . date('m/d/Y', strtotime($postData['date']));
echo "\nParent Ticket: INC" . $postData['parentTicket'];
echo "\nPriority: " . $postData['priority'];
echo "\nIncident Coordinator: " . nameByNetId($postData['ic']);
echo "\nProblem Description: " . $postData['desc'];
}
示例5: printEmployees
function printEmployees()
{
global $netID;
global $readPermission;
if ($readPermission) {
echo "<select id='employees' name='employees' onchange>";
employeeFillCurrentArea();
echo "</select>";
} else {
echo nameByNetId($netID);
}
}
示例6: formatEmailBody
function formatEmailBody($supressed)
{
global $netID, $db;
$body = '';
$count = 0;
echo "<br/>";
//This queries for the list of employees you have raises pending for, with each net ID appearing once.
try {
$employeeQuery = $db->prepare("SELECT DISTINCT netID FROM employeeRaiseLog WHERE submitter = :netId AND isSubmitted = '0' ORDER BY netID ASC");
$employeeQuery->execute(array(':netId' => $netID));
} catch (PDOException $e) {
exit("error in query");
}
//This cycles through each net ID producing the section of the email for that net ID
while ($cur = $employeeQuery->fetch(PDO::FETCH_ASSOC)) {
$count = 0;
$toBeAdded = '';
$toBeAdded .= "<b>" . nameByNetId($cur['netID']) . " - BYU ID: " . getEmployeeByuIdByNetId($cur['netID']) . " - Net ID: " . $cur['netID'] . "</b><br/>";
$toBeAdded .= "<table><tr><th>Reason</th><th>Raise</th><th>Date Effective</th></tr>";
//Queries for ALL pending raises for the current net ID that was submitted by you
try {
$logQuery = $db->prepare("SELECT * FROM employeeRaiseLog WHERE submitter = :submitter AND isSubmitted = '0' AND netID = :employee ORDER BY date ASC");
$logQuery->execute(array(':submitter' => $netID, ':employee' => $cur['netID']));
} catch (PDOException $e) {
exit("error in query");
}
//Adds each pending raise to the html table in the email.
while ($raise = $logQuery->fetch(PDO::FETCH_ASSOC)) {
if (!in_array($raise['index'], $supressed)) {
$toBeAdded .= "<tr>";
$toBeAdded .= "<td>" . $raise['comments'] . "</td>";
$toBeAdded .= "<td><b>" . $raise['raise'] . "</b></td>";
$toBeAdded .= "<td>" . date('Y-m-d', strtotime($raise['date'])) . "</td>";
$toBeAdded .= "</tr>";
$count++;
}
//This updates the raise in the database to no longer be pending.
try {
$updateQuery = $db->prepare("UPDATE employeeRaiseLog SET isSubmitted = '1' WHERE `index` = :index");
$updateQuery->execute(array(':index' => $raise['index']));
} catch (PDOException $e) {
exit("error in query");
}
}
$toBeAdded .= "<tr><th>New wage</th><th>" . getEmployeeWageByNetId($cur['netID']) . "</th>";
$toBeAdded .= "</table><br/><br/>";
if ($count > 0) {
$body .= $toBeAdded;
}
}
return $body;
}
示例7: printAvailableMonitors
function printAvailableMonitors()
{
global $db;
try {
$incompleteQuery = $db->prepare("SELECT * FROM silentMonitor WHERE completed ='0' AND `deleted` = '0' ORDER BY submitDate ASC");
$incompleteQuery->execute();
} catch (PDOException $e) {
exit("error in query");
}
while ($cur = $incompleteQuery->fetch(PDO::FETCH_ASSOC)) {
echo '<input type="radio" name="id" id="id" value="' . $cur['index'] . '" />Started on: ' . date("l, M j, Y", strtotime($cur['submitDate'])) . ', for ' . nameByNetId($cur['netID']) . ' <a href="deleteMonitor.php?id=' . $cur['index'] . '">Delete</a><br />';
}
}
示例8: printEmployees
function printEmployees($employee)
{
global $netID;
global $admin;
global $area;
if ($admin) {
echo "<select id='employees' name='employees' onchange>";
echo employeeFillSelected($employee, $area);
echo "</select>";
} else {
echo nameByNetId($netID);
}
}
示例9: sendEmail
function sendEmail($comments, $location)
{
global $area;
global $env;
global $netID;
$employeeName = nameByNetId($netID);
$employeeEmail = getEmployeeEmailByNetId($netID);
$subject = 'Info Change Request';
$emailBody = <<<STRING
\t<b>Info Change Request: </b> <br />{$comments}<br /> <br />
\t<b>Location: </b>{$location}<br /> <br />
\t
\tThank you, <br />
\t{$employeeName}
\t
STRING;
if ($env == 2) {
if ($area == 3) {
//Service Desk
$to = getenv("SDALIAS");
} else {
if ($area == 4) {
//COS
$to = getenv("COSALIAS");
} else {
if ($area == 6) {
// Security Desk
$to = getenv("SECURITYDESKEMAILS");
}
}
}
} else {
$to = getenv("DEVEMAILADDRESS");
}
$headers = 'From: ' . $employeeName . ' <' . $employeeEmail . '>' . "\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'Return-Path: ' . $employeeEmail . "\r\n";
if (mail($to, $subject, $emailBody, $headers)) {
echo '<h2 style="text-align: center;">Email was sent successfully.</h2>';
} else {
echo '<h2 style="text-align: center;">Email failed to be sent.</h2>';
}
}
示例10: printReport
function printReport($employee, $start, $end, $securityProblems, $shiftProblems, $misc, $params)
{
global $area, $admin, $db;
$default = ' 1=1 ';
$params[':area'] = $area;
$params[':start'] = $start;
$params[':end'] = $end;
try {
$securityDeskQuery = $db->prepare("SELECT * FROM `supervisorReportSecurityDesk` WHERE `area` = :area AND `date` >= :start AND `date` <= :end AND (" . $default . $employee . $securityProblems . $shiftProblems . $misc . ")");
$securityDeskQuery->execute($params);
} catch (PDOException $e) {
exit("error in query");
}
if ($first = $securityDeskQuery->fetch(PDO::FETCH_ASSOC)) {
echo "<table>\r\n\t\t\t\t<tr>\r\n\t\t\t\t<th>Employee</th><th>Date</th><th>Shift</th><th>securityProblems</th><th>Shift Problems</th>\r\n\t\t\t\t<th>Misc</th><th></th></tr>";
echo "<tr>";
echo "<td>" . nameByNetId($first['submitter']) . "</td>";
echo "<td>" . $first['date'] . "</td>";
echo "<td>" . $first['startTime'] . " - " . $first['endTime'] . "</td>";
echo "<td>" . $first['securityProblems'] . "</td>";
echo "<td>" . $first['shiftProblems'] . "</td>";
echo "<td>" . $first['misc'] . "</td><td>";
if ($admin) {
echo "<input type='button' value='Edit' onclick=editReport('" . $first['ID'] . "') />";
}
echo "</td></tr>";
while ($cur = $securityDeskQuery->fetch(PDO::FETCH_ASSOC)) {
echo "<tr>";
echo "<td>" . nameByNetId($cur['submitter']) . "</td>";
echo "<td>" . $cur['date'] . "</td>";
echo "<td>" . $cur['startTime'] . " - " . $cur['endTime'] . "</td>";
echo "<td>" . $cur['securityProblems'] . "</td>";
echo "<td>" . $cur['shiftProblems'] . "</td>";
echo "<td>" . $cur['misc'] . "</td><td>";
if ($admin) {
echo "<input type='button' value='Edit' onclick=editReport('" . $cur['ID'] . "') />";
}
echo "</td></tr>";
}
echo "</table>";
} else {
echo "No reports during this period";
}
}
示例11: sendEmail
function sendEmail($employeeNetID, $timeStamp, $supervisor)
{
global $area;
global $env;
$server = '';
$to = '';
if ($env == 0) {
$server = getenv("DEVURL");
} else {
if ($env == 1) {
$server = getenv("STAGEURL");
} else {
if ($env == 2) {
$server = getenv("PRODURL");
}
}
}
$timeStampDate = explode(" ", $timeStamp);
// $timeStampDate[0] = yyyy/mm/dd // $timeStampDate[1] hh:mm:ss
$timeStampTime = explode(":", $timeStampDate[1]);
$formattedTimeStamp = $timeStampDate[0] . '-' . $timeStampTime[0] . '-' . $timeStampTime[1] . '-' . $timeStampTime[2];
$subject = 'Ticket Reviews were submitted for you';
$emailBody = 'Dear ' . nameByNetId($employeeNetID) . ', <br /><br />';
$emailBody .= 'Ticket Reviews were submitted for you by ' . nameByNetId($supervisor) . '. Please view the information in the link below.<br /> <br />';
$emailBody .= '<a href=https://' . $server . '/ticketReview/individualTicketReview.php?employee=' . $employeeNetID . '&timeSubmitted=' . urlencode($formattedTimeStamp) . '>Click here to see your ticket reviews</a><br /><br />Or copy this link in the address bar of your browser.<br />
https://' . $server . '/ticketReview/individualTicketReview.php?employee=' . $employeeNetID . '&timeSubmitted=' . urlencode($formattedTimeStamp) . '<br /><br />Thanks!';
if ($env == 2) {
$to = getEmployeeEmailByNetId($employeeNetID);
} else {
$to = getenv("DEVEMAILADDRESS");
}
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: ' . nameByNetId($supervisor) . ' <' . getEmployeeEmailByNetId($supervisor) . '>' . "\r\n";
$headers .= 'Return-Path: ' . getEmployeeEmailByNetId($supervisor) . "\r\n";
if (mail($to, $subject, $emailBody, $headers)) {
return true;
} else {
return false;
}
}
示例12: getICList
function getICList($selected)
{
global $db;
try {
$permissionQuery = $db->prepare("SELECT * FROM `permissionArea` JOIN `permission` ON `permissionArea`.`permissionId` = `permission`.`permissionId` WHERE shortName='ic'");
$permissionQuery->execute();
} catch (PDOException $e) {
exit("error in query");
}
$perm = $permissionQuery->fetch(PDO::FETCH_ASSOC);
try {
$employeePermissionQuery = $db->prepare("SELECT * FROM employeePermissions JOIN employee ON `employeePermissions`.`netID` = `employee`.`netID` WHERE employeePermissions.permission = :permission ORDER BY `employee`.`firstName`");
$employeePermissionQuery->execute(array(':permission' => $perm['index']));
} catch (PDOException $e) {
exit("error in query");
}
while ($cur = $employeePermissionQuery->fetch(PDO::FETCH_ASSOC)) {
if ($selected == $cur['netID']) {
echo "<option value='" . $cur['netID'] . "' selected>" . nameByNetId($cur['netID']) . "</option>";
} else {
echo "<option value='" . $cur['netID'] . "'>" . nameByNetId($cur['netID']) . "</option>";
}
}
}
示例13: confirmSubmission
</script>
<form id='reportData' method='post' onsubmit="return confirmSubmission()">
<input type="hidden" id="employeeName" name="employeeName" value="<?php
echo nameByNetId($netID);
?>
">
<input type="hidden" id="employeeEmail" name="employeeEmail" value="<?php
echo getEmployeeEmailByNetId($netID);
?>
">
<div id='headInfo'>
<h1>Supervisor Report Form</h1>
<table>
<tr>
<th>NAME: <?php
echo nameByNetId($netID);
?>
</th>
<th colspan='2'>EMAIL: <?php
echo getEmployeeEmailByNetId($netID);
?>
</th><th>Load Draft</th><th>Save as Draft</th><th>Report Finished?</th>
</tr><tr>
<td>DATE: <input type='text' class='datepicker' size='10' id='reportDate' name='reportDate' value="<?php
echo date('Y-m-d', strtotime("today"));
?>
" /></td>
<td>Start Time: <input type="text" name="start" id='start' maxlength=5 size=8 value="<?php
echo date('h:iA');
?>
"/></td>
示例14: catch
//------------TASK TO BE COMPLETED------------------
try {
$tasksQuery = $db->prepare("SELECT * FROM routineTasks WHERE ID=:id");
$tasksQuery->execute(array(':id' => $_REQUEST['id']));
} catch (PDOException $e) {
exit("error in query");
}
$task = $tasksQuery->fetch(PDO::FETCH_ASSOC);
//------------SET VARIABLES---------------------
$title = $task['title'];
$timeDue = $task['timeDue'];
$area = $task['area'];
$completed = '1';
$timeCompleted = date('G:i');
$dateCompleted = date('Y-m-d');
$completedBy = nameByNetId($netID);
//------------------------------------------------
//Query to test whether this task is in the log already ie. its been muted.
try {
$logQuery = $db->prepare("SELECT * FROM routineTaskLog WHERE taskId =:taskId AND (dateMuted IS NOT NULL AND dateCompleted IS NULL)");
$logQuery->execute(array(':taskId' => $taskId));
} catch (PDOException $e) {
exit("error in query");
}
$mutedTask = $logQuery->fetch(PDO::FETCH_ASSOC);
$logID = $mutedTask['ID'];
//queries the database and then add or updates an entry to the TaskLog
try {
$insertQuery = $db->prepare("INSERT INTO routineTaskLog (ID,title,taskId,timeDue,dateDue,area,completed,completedBy,timeCompleted,dateCompleted,comments,guid) VALUES (:id,:title,:taskId,:timeDue,:dateDue,:area,:completed,:by,:timeCompleted,:dateCompleted,:comments,:guid) ON DUPLICATE KEY UPDATE title=:title2,taskId=:taskId2,timeDue=:timeDue2,area=:area2,completed=:completed2,completedBy=:by2,timeCompleted=:timeCompleted2,dateCompleted=:dateCompleted2,comments=:comments2");
$insertQuery->execute(array(':id' => $logID, ':title' => $title, ':taskId' => $taskId, ':timeDue' => $timeDue, ':dateDue' => $dateDue, ':area' => $area, ':completed' => $completed, ':by' => $completedBy, ':timeCompleted' => $timeCompleted, ':dateCompleted' => $dateCompleted, ':comments' => $comments, ':guid' => newGuid(), ':title2' => $title, ':taskId2' => $taskId, ':timeDue2' => $timeDue, ':area2' => $area, ':completed2' => $completed, ':by2' => $completedBy, ':timeCompleted2' => $timeCompleted, ':dateCompleted2' => $dateCompleted, ':comments2' => $comments));
} catch (PDOException $e) {
示例15: printTeamOrganizer
function printTeamOrganizer($area)
{
global $db;
try {
$employeeQuery = $db->prepare("SELECT * FROM employee WHERE area=:area AND active='1' ORDER BY firstName ASC");
$employeeQuery->execute(array(':area' => $area));
} catch (PDOException $e) {
exit("error in query");
}
$nameCount = 1;
while ($cur = $employeeQuery->fetch(PDO::FETCH_ASSOC)) {
try {
$membersQuery = $db->prepare("SELECT * FROM teamMembers WHERE netID = :netId AND `area` = :area");
$membersQuery->execute(array(':netId' => $cur['netID'], ':area' => $area));
$teamCountQuery = $db->prepare("SELECT COUNT(ID) FROM teamMembers WHERE netID = :netId AND `area` = :area");
$teamCountQuery->execute(array(':netId' => $cur['netID'], ':area' => $area));
} catch (PDOException $e) {
exit("error in query");
}
$countResult = $teamCountQuery->fetch(PDO::FETCH_NUM);
$numOfTeamsEmployeeBelongsTo = $countResult[0];
if ($numOfTeamsEmployeeBelongsTo > 0) {
while ($teamMember = $membersQuery->fetch(PDO::FETCH_ASSOC)) {
$teamID = $teamMember['teamID'];
echo "<tr><td>";
echo nameByNetId($cur['netID']);
echo "</td><td>";
echo teamLeadByTeamID($teamID);
echo "</td><td>";
if ($numOfTeamsEmployeeBelongsTo > 1) {
//Make the selects name unique if employee belongs to multiple teams.
echo teamSelectByTeam($teamID, $nameCount, $cur['netID']);
echo "</td><td id='futureTeamLeader_" . $nameCount . "'></td></tr>";
$nameCount++;
} else {
echo teamSelectByTeam($teamID, $nameCount, $cur['netID']);
echo "</td><td id='futureTeamLeader_" . $nameCount . "'></td></tr>";
$nameCount++;
}
}
} else {
$teamID = 0;
echo "<tr><td>";
echo nameByNetId($cur['netID']);
echo "</td><td>";
echo teamLeadByTeamID($teamID);
echo "</td><td>";
echo teamSelectByTeam($teamID, $nameCount, $cur['netID']);
echo "</td><td id='futureTeamLeader_" . $nameCount . "'></td></tr>";
$nameCount++;
}
}
}