本文整理汇总了PHP中Clients::getClientFromUsername方法的典型用法代码示例。如果您正苦于以下问题:PHP Clients::getClientFromUsername方法的具体用法?PHP Clients::getClientFromUsername怎么用?PHP Clients::getClientFromUsername使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Clients
的用法示例。
在下文中一共展示了Clients::getClientFromUsername方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loginClient
function loginClient()
{
$username = $_REQUEST['client_username_log'];
$password = $_REQUEST['client_password_log'];
$client = new Clients();
$session = new Sessions();
$client->setClientUsername($username);
$data = $client->getClientFromUsername();
//echo count($data);
if (count($data) > 0) {
$client->extractor($data);
if (strcmp($client->clientPassword(), md5($password)) == 0) {
$session->setClientLoginSessions($client->clientId(), $client->clientTitle(), $client->clientFirstName(), $client->clientLastName());
if ($_SESSION['booked'] != '') {
echo 'booked';
//die('booked');
} else {
echo 2;
//die('accounts');
}
} else {
echo 3;
}
} else {
Common::jsonError("Login Error");
}
}
示例2: loginClient
function loginClient()
{
$username = $_REQUEST['client_username_log'];
$password = $_REQUEST['client_password_log'];
$client = new Clients();
$session = new Sessions();
$client->setClientUsername($username);
$data = $client->getClientFromUsername();
if (count($data) > 0) {
$client->extractor($data);
if (strcmp($client->clientPassword(), md5($password)) == 0) {
$session->setClientLoginSessions($client->clientId(), $client->clientTitle(), $client->clientFirstName(), $client->clientLastName());
Common::jsonSuccess("Success");
} else {
Common::jsonError("Login Error");
}
} else {
Common::jsonError("Login Error");
}
}