本文整理汇总了PHP中Worker::selectUsername方法的典型用法代码示例。如果您正苦于以下问题:PHP Worker::selectUsername方法的具体用法?PHP Worker::selectUsername怎么用?PHP Worker::selectUsername使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Worker
的用法示例。
在下文中一共展示了Worker::selectUsername方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: file_get_contents
// gc hint
try {
$fileString = file_get_contents($_FILES[$name]['tmp_name']);
$fileWorkerArray = NULL;
if (TRUE) {
$fileWorkerArray = FiveDegreesCSV::parse($fileString);
$fileString = NULL;
// gc hint
}
$workerArray = array();
$unknownArray = array();
foreach ($fileWorkerArray as $fileWorker) {
$error = $fileWorker->getError();
if (is_null($error)) {
try {
$worker = Worker::selectUsername($fileWorker->email);
if (!is_null($worker)) {
if (FALSE != array_search($worker->workerid, $checkWorkers)) {
$errorMessage .= "<tr><td>{$fileWorker->index}</td><td>{$fileWorker->email}</td><td>already assigned</td><td>no email</td><td>OK!</td></tr>\n";
} else {
$workerArray[] = $worker;
$errorMessage .= "<tr><td>{$fileWorker->index}</td><td>{$fileWorker->email}</td><td>account exists</td><td>email sent</td><td>OK!</td></tr>\n";
}
continue;
}
$unknownArray[] = newInviteFromFile($fileWorker);
$errorMessage .= "<tr><td>{$fileWorker->index}</td><td>{$fileWorker->email}</td><td>invite issued</td><td>email sent</td><td>OK!</td></tr>\n";
} catch (PDOException $ex) {
// set on a per-line basis $_SESSION[PARAM_MESSAGE] = $ex + $error
$errorMessage .= "<tr><td>{$fileWorker->index}</td><td>{$fileWorker->email}</td><td>bad data</td><td>no email</td><td>databse failure</td></tr>\n";
$msg = $ex->getMessage();
示例2: array
// parse via whitespace
$invitationArray = Invitation::loadEmails($emails);
$existingWorkers = Worker::selectExpo($expo->expoid);
$checkWorkers = array();
foreach ($existingWorkers as $worker) {
$checkWorkers[] = $worker->workerid;
}
$existingWorkers = NULL;
$workerArray = array();
$unknownArray = array();
$index = 0;
foreach ($invitationArray as $invitation) {
$index += 1;
try {
if (!empty($invitation->email)) {
$worker = Worker::selectUsername($invitation->email);
if (!is_null($worker)) {
if (FALSE != array_search($worker->workerid, $checkWorkers)) {
$errorMessage .= "<tr><td>{$index}</td><td>{$invitation->email}</td><td>already assigned</td><td>no email</td><td>OK!</td></tr>\n";
} else {
$workerArray[] = $worker;
$errorMessage .= "<tr><td>{$index}</td><td>{$invitation->email}</td><td>account exists</td><td>email sent</td><td>OK!</td></tr>\n";
}
continue;
}
$unknownArray[] = $invitation;
$errorMessage .= "<tr><td>{$index}</td><td>{$invitation->email}</td><td>invite issued</td><td>email sent</td><td>OK!</td></tr>\n";
}
} catch (PDOException $ex) {
$errorMessage .= "<tr><td>{$index}</td><td>{$invitation->email}</td><td>bad data</td><td>no email</td><td>databse failure</td></tr>\n";
$msg = $ex->getMessage();
示例3: swwat_parse_enum
}
/*try
{
$sms = swwat_parse_enum(html_entity_decode($_POST[PARAM_SMS_SERVICE]), SMSEnum::$SMS_ARRAY, true);
if (0 == strcmp(SMSEnum::$NONE, $sms))
{
$sms = NULL;
}
}
catch (ParseSWWATException $ex)
{
$sms = NULL;
}
$worker->smsemail = (is_null($worker->phone) || is_null($sms)) ? NULL : $worker->phone . "@" . $sms;*/
if (!is_null($worker->email)) {
$check = Worker::selectUsername($worker->email);
if (!is_null($check)) {
$_SESSION[PARAM_MESSAGE] = "Registration was unsuccessful. This email is already registered.\n\n" . "Are you looking to <a href='/pages/WorkerLoginPage.php'>Reset Password</a>?\n";
header('Location: RegistrationPage.php');
include 'RegistrationPage.php';
return;
}
$check = NULL;
// gc hint
}
if (is_null($worker->email) || is_null($worker->firstName) || is_null($worker->lastName)) {
$_SESSION[PARAM_MESSAGE] = "Registration was unsuccessful. First name, last name, and email are required.";
header('Location: RegistrationPage.php');
include 'RegistrationPage.php';
return;
}