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


PHP Worker::selectID方法代码示例

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


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

示例1: fillData

 public function fillData(ShiftAssignmentView $shiftassignment)
 {
     $this->workerid = $shiftassignment->workerid;
     $this->stationid = $shiftassignment->stationid;
     $this->expoid = $shiftassignment->expoid;
     $this->expo = $shiftassignment->expoTitle;
     $this->station = $shiftassignment->location . " (" . $shiftassignment->stationTitle . ")";
     $this->startTime = $shiftassignment->startTime;
     $this->stopTime = $shiftassignment->stopTime;
     $worker = Worker::selectID($shiftassignment->workerid);
     $this->workerName = $worker->nameString2();
     $this->workerEmail = $worker->email;
     return $this;
 }
开发者ID:ConSked,项目名称:scheduler,代码行数:14,代码来源:MessageData.php

示例2: createShiftCheckInHTMLList

function createShiftCheckInHTMLList($expoid, $stationid)
{
    echo "<div id=\"workerlist_table\">\n";
    echo "<form method=\"POST\" name=\"ShiftCheckIn_form\" action=\"ShiftCheckInAction.php?" . PARAM_LIST_INDEX . "=" . $stationid . "\">\n";
    echo "<table>\n";
    $shiftAssignmentList = ShiftAssignmentView::selectStation($expoid, $stationid);
    $c = count($shiftAssignmentList);
    $workerList = array();
    for ($k = 0; $k < $c; $k++) {
        $workerList[$k] = Worker::selectID($shiftAssignmentList[$k]->workerid);
    }
    usort($workerList, "WorkerCompare");
    echo "<tr><td class=\"rowTitle\" colspan=\"4\">Supervisors</td></tr>\n";
    $supervisors = 0;
    for ($k = 0; $k < $c; $k++) {
        if ($workerList[$k]->isSupervisor() && !$workerList[$k]->isDisabled) {
            $ss = ShiftStatus::mostRecentStatus($workerList[$k]->workerid, $stationid, $expoid);
            if (count($ss) > 0) {
                $statusType = $ss->statusType;
            } else {
                $statusType = NULL;
            }
            makeShiftCheckInListHTMLRows($workerList[$k], $statusType);
            $supervisors++;
        }
    }
    if ($supervisors == 0) {
        echo "<tr><td class=\"fieldError\" colspan=\"4\">There are currently no Supervisors assigned to this station.</td></tr>\n";
    }
    echo "<tr><td class=\"rowTitle\" colspan=\"4\">Crew</td></tr>\n";
    $crew = 0;
    for ($k = 0; $k < $c; $k++) {
        if ($workerList[$k]->isCrewMember() && !$workerList[$k]->isDisabled) {
            $ss = ShiftStatus::mostRecentStatus($workerList[$k]->workerid, $stationid, $expoid);
            if (count($ss) > 0) {
                $statusType = $ss->statusType;
            } else {
                $statusType = NULL;
            }
            makeShiftCheckInListHTMLRows($workerList[$k], $statusType);
            $crew++;
        }
    }
    // $k
    if ($crew == 0) {
        echo "<tr><td class=\"fieldError\" colspan=\"4\">There are currently no Crew assigned to this station.</td></tr>\n";
    }
    echo "</table></form></div><!-- workerlist_table -->\n";
}
开发者ID:ConSked,项目名称:scheduler,代码行数:49,代码来源:ShiftCheckInList.php

示例3: createCheckInStationDashboardHTMLList

function createCheckInStationDashboardHTMLList($expoid)
{
    $stationList = StationJob::selectExpo($expoid);
    $dates = array();
    foreach ($stationList as $s) {
        $stationDateTime = explode(';', swwat_format_shift($s->startTime, $s->stopTime));
        $dates[] = $stationDateTime[0];
    }
    $dates = array_values(array_unique($dates));
    echo "Select Date: <select id=\"" . PARAM_DATE . "\" name=\"" . PARAM_DATE . "\" onchange=\"hideRows()\">\n";
    for ($k = 0; $k < count($dates); $k++) {
        echo "<option value=\"" . $dates[$k] . "\">&nbsp;" . $dates[$k] . "&nbsp;</option>\n";
    }
    echo "<option value=\"All\">&nbsp;All Dates&nbsp;</option>\n";
    echo "</select>\n";
    echo "<p />\n";
    echo "<input type=\"radio\" name=\"role\" value=\"Supervisors\" onclick=\"hideRoles()\" /> Supervisors";
    echo "&nbsp;&nbsp;&nbsp;<input type=\"radio\" name=\"role\" value=\"Crew\" onclick=\"hideRoles()\" /> Crew";
    echo "&nbsp;&nbsp;&nbsp;<input type=\"radio\" name=\"role\" value=\"Both\" checked=\"checked\" onclick=\"hideRoles()\" /> Both\n";
    echo "<p />\n";
    $assignedWorkerList = ShiftAssignmentView::selectExpo($expoid);
    $c = count($assignedWorkerList);
    $max_name_size = 0;
    $max_email_size = 0;
    for ($k = 0; $k < $c; $k++) {
        $worker = Worker::selectID($assignedWorkerList[$k]->workerid);
        $name = $worker->nameString();
        if (strlen($name) > $max_name_size) {
            $max_name_size = strlen($name);
        }
        $email = $worker->email;
        if (strlen($email) > $max_email_size) {
            $max_email_size = strlen($email);
        }
    }
    $max_name_size = 10 * $max_name_size;
    $max_email_size = 10 * $max_email_size;
    $table_size = "75%";
    echo "<div id=\"checkinlist_table\">\n";
    echo "<table width=\"" . $table_size . "\">\n";
    echo "<tr class=\"mainTitle\">\n";
    echo "<td class=\"fieldValue\" colspan=\"5\" onclick=\"ExpandCollapseAll()\">\n";
    echo "<div style=\"float:right\"><div class=\"alldiv\" style=\"display:inline\">Expand All</div>&nbsp;&nbsp;&nbsp;<img id=\"allicon\" src=\"" . PARAM_EXPAND_ICON . "\"/></div>\n";
    echo "</td>\n</tr>\n";
    $jobList = Job::selectExpo($expoid);
    usort($jobList, "JobCompare");
    $_SESSION[PARAM_LIST2] = $jobList;
    $c = count($jobList);
    if ($c > 0) {
        for ($k = 0; $k < $c; $k++) {
            $job = $jobList[$k];
            makeCheckInStationDashboardStationListHTMLRows($job, $k, $expoid, $max_name_size, $max_email_size);
        }
    } else {
        echo "<tr><td class=\"fieldError\" colspan=\"5\">There are currently no stations assigned to this expo.</td></tr>\n";
    }
    echo "</table>\n</div>\n";
}
开发者ID:ConSked,项目名称:scheduler,代码行数:58,代码来源:CheckInStationDashboardList.php

示例4: list

    <link href="css/site.css" rel="stylesheet" type="text/css">
</head>

<body>
<div id="container">

<?php 
$type = NULL;
$index = NULL;
if (isset($_REQUEST[PARAM_LIST_INDEX])) {
    list($type, $index) = explode(':', $_REQUEST[PARAM_LIST_INDEX]);
}
if ($type == 'W') {
    $expo = getExpoCurrent();
    $station = getStationCurrent();
    $worker = Worker::selectID($index);
    setWorkerCurrent($worker);
} else {
    if ($type == 'S') {
        $expo = getExpoCurrent();
        $worker = getWorkerCurrent();
        $station = StationJob::selectID($index);
        setStationCurrent($station);
    }
}
// ok, start the html
include 'section/header.php';
?>

<div id="main">
    <?php 
开发者ID:ConSked,项目名称:scheduler,代码行数:31,代码来源:ShiftStatusViewPage.php

示例5: password_change

 public static function password_change($workerId, $password)
 {
     try {
         $dbh = getPDOConnection();
         $stmt = $dbh->prepare("SELECT isDisabled, externalAuthentication FROM worker WHERE workerid = ?");
         $stmt->execute(array($workerId));
         $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
         if (count($rows) != 1) {
             throw new Exception('Can not find worker account.');
         }
         $isDisabled = $rows[0]['isDisabled'];
         $externalAuthentication = $rows[0]['externalAuthentication'];
         if ($isDisabled == TRUE) {
             throw new Exception('Worker account is disabled.');
         }
         if ($externalAuthentication == TRUE) {
             throw new Exception('This worker account uses external authentication.');
         }
         $dbh->beginTransaction();
         // with new password; resetCode is no longer needed
         $stmt = $dbh->prepare("UPDATE worker SET passwordHash = ?, resetCodeHash = NULL WHERE workerid = ?");
         $stmt->execute(array(hashField($password), $workerId));
         $dbh->commit();
         // we login, proper this time
         logout();
         // paranoia
         session_cache_limiter('nocache');
         session_start();
         $worker = Worker::selectID($workerId);
         $_SESSION[AUTHENTICATED] = $worker;
         $_SESSION[AUTHENTICATED_TEMP] = NULL;
         return;
     } catch (PDOException $pe) {
         // do NOT log password
         logMessage('WorkerLogin::password_change(' . $workerId . ", {$password})", $pe->getMessage());
     }
 }
开发者ID:ConSked,项目名称:scheduler,代码行数:37,代码来源:WorkerLogin.php

示例6: foreach

    $matrix[$j][0] = 'Date';
    $matrix[$j][1] = 'Day of Week';
    $matrix[$j][2] = 'Shift Time';
    $matrix[$j][3] = 'Volunteer Role';
    $matrix[$j][4] = 'Volunteer Name';
    $matrix[$j][5] = 'Shift Name';
    $matrix[$j][6] = true;
    $j++;
    $assignedWorkerList = ShiftAssignmentView::selectJob($expoId, $job->jobid);
    foreach ($assignedWorkerList as $aw) {
        $date = date_format($aw->startTime, 'd-M');
        $weekDay = date_format($aw->startTime, 'l');
        $awDateTime = swwat_format_shift($aw->startTime, $aw->stopTime);
        list($awDate, $shiftTime, $start) = explode(';', $awDateTime);
        $shiftName = $aw->stationTitle . ' - ' . $aw->location;
        $worker = Worker::selectID($aw->workerid);
        $matrix[$j][0] = $date;
        $matrix[$j][1] = $weekDay;
        $matrix[$j][2] = $shiftTime;
        $matrix[$j][3] = $worker->roleString();
        $matrix[$j][4] = $worker->nameString2();
        $matrix[$j][5] = $shiftName;
        $matrix[$j][6] = false;
        $j++;
    }
}
//find column widths
$colwidth = array(0, 0, 0, 0, 0, 0);
for ($j = 0; $j < count($matrix); $j++) {
    for ($k = 0; $k < 6; $k++) {
        if ($colwidth[$k] < $pdf->GetStringWidth($matrix[$j][$k])) {
开发者ID:ConSked,项目名称:scheduler,代码行数:31,代码来源:test_pdf.php


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