本文整理汇总了PHP中user::checkExist方法的典型用法代码示例。如果您正苦于以下问题:PHP user::checkExist方法的具体用法?PHP user::checkExist怎么用?PHP user::checkExist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类user
的用法示例。
在下文中一共展示了user::checkExist方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: forgotPass_exec
public function forgotPass_exec($data)
{
$response_array = array();
$email = $data['email'];
// CHECK EMAIL IN SYSTEM
$emailExist = user::checkExist("user_accounts", "email = '{$email}'");
if (!$emailExist) {
$response_array['r'] = "false";
$response_array['msg'] = "<div><strong>{$email}</strong> is not registered email.</div>";
} else {
// CHECK ACCOUNT STATUS
$userdata = $this->db->select("user_accounts", "*", "email = '{$email}'", "fetch");
$activate = $userdata['activate'];
if ($activate == 0) {
$response_array['r'] = "false";
$response_array['msg'] = "<div><strong>{$email}</strong> is not activate. Please request your activation link (if you don't receive activation email) by clicking '<b>Don't receive activation email? Click here.</b>' link below. </div>";
} else {
// RESET PASSWORD
// SEND PASSWORD TO AGENT
$response_array['r'] = "true";
$response_array['msg'] = "{$userdata}";
}
}
return $response_array;
}
示例2: loginAuth
public static function loginAuth($from)
{
//check token remember me
//check session
$db = new database(DBTYPE, DBHOST, DBNAME, DBUSER, DBPASS);
if (cookie::exists(TOKEN_NAME)) {
$token = cookie::get(TOKEN_NAME);
$checkExist = user::checkExist("users_session", "token = '{$token}'");
if ($checkExist) {
$sessionData = $db->select("users_session", "*", "token = '{$token}'", "fetch");
$agent_id = $sessionData['agent_id'];
user::login($agent_id);
$userData = $db->select("user_accounts", "*", "agent_id = '{$agent_id}'", "fetch");
if ($from == 'login') {
self::accountCheck($userData);
redirect::to("dashboard");
} else {
self::accountCheck($userData);
}
} else {
user::logout();
}
} elseif (session::exist(AGENT_LOGIN_SESSION) && session::exist(AGENT_SESSION_NAME)) {
$agent_id = session::get(AGENT_SESSION_NAME);
$check_agentExist = user::checkExist("user_accounts", "agent_id = '{$agent_id}'");
$userData = $db->select("user_accounts", "*", "agent_id = '{$agent_id}'", "fetch");
if (!$check_agentExist) {
user::logout();
}
user::login($agent_id);
if ($from == 'login') {
self::accountCheck($userData);
redirect::to("dashboard");
} else {
self::accountCheck($userData);
}
} else {
if ($from != 'login') {
user::logout();
}
}
}
示例3: success
function success($agent_id = NULL)
{
$this->breadcrumb->add("Successful", "join/success");
$this->view->breadcrumbs = $this->breadcrumb->get();
if (isset($agent_id)) {
$verify = user::checkExist("user_accounts", "agent_id = '{$agent_id}'");
if (!$verify) {
redirect::to();
exit;
} else {
$data = user::getUserData("agent_id", $agent_id);
$this->view->userdata = $data;
$this->view->js = array('join/js/success.js');
$this->view->render('join/success');
}
} else {
redirect::to();
exit;
}
}
示例4: s
public function s($sponsor)
{
$userData = user::checkExist("user_accounts", "agent_id = '{$sponsor}' or username = '{$sponsor}'");
if ($userData == 1) {
$getUserData = $this->db->select("user_accounts", "agent_id, username", "agent_id = '{$sponsor}' or username = '{$sponsor}'", "fetch");
$chkCookie = cookie::exists(COOKIE_SPONSOR_NAME);
if ($chkCookie) {
$cookieName = cookie::get(COOKIE_SPONSOR_NAME);
if ($cookieName != $getUserData['agent_id']) {
cookie::delete(COOKIE_SPONSOR_NAME);
cookie::set(COOKIE_SPONSOR_NAME, $getUserData['agent_id'], COOKIE_EXPIRY);
}
} else {
cookie::set(COOKIE_SPONSOR_NAME, $getUserData['agent_id'], COOKIE_EXPIRY);
}
} else {
cookie::delete(COOKIE_SPONSOR_NAME);
}
redirect::to(BASE_PATH, TRUE);
}
示例5: success
function success($supplier_username = NULL)
{
$this->breadcrumb->add("Registration", "supp/register");
$this->breadcrumb->add("Successful", "supp/success");
$this->view->breadcrumbs = $this->breadcrumb->get();
if (isset($supplier_username)) {
$verify = user::checkExist("supplier", "username = '{$supplier_username}'");
if (!$verify) {
redirect::to();
exit;
} else {
$data = user::getSupplierData("username", $supplier_username);
$this->view->userdata = $data;
$this->view->js = array('supp/js/success.js');
$this->view->render('supp/success');
}
} else {
redirect::to();
exit;
}
}
示例6: __construct
function __construct()
{
session::init();
$this->breadcrumb = new breadcrumb();
$this->view = new view();
$this->_userProfileImages = IMAGES_PATH . "user-default.png";
if (session::exist(AGENT_SESSION_NAME) and session::exist(AGENT_LOGIN_SESSION)) {
$agent_id = session::get(AGENT_SESSION_NAME);
$userData = new user();
// USERDATA
$this->_userData = $userData->getUserData('agent_id', $agent_id);
$user = $this->_userData;
// USER ACC. TYPE
$userAccType = user::getAccType($user['acc_type']);
$this->_userAccType = $userAccType['label'];
// PROFILE IMAGE
$profileImageExist = user::checkExist("user_images", "agent_id = '{$agent_id}' AND profile = '1'");
if ($profileImageExist) {
$image = user::getUserImages($agent_id, TRUE);
$this->_userProfileImages = IMAGES_PATH . "users/" . $image['filename'];
}
// AVAILABLE COMMISSION
$this->_availableCommission = user::getAvailableComm($agent_id);
// BADGE
$countAccPaymentBadge = user::countBadge("user_payment", "status = '0'");
$this->_accPaymentBadge = $countAccPaymentBadge > 0 ? $countAccPaymentBadge : "";
$countWithdrawalBadge = user::countBadge("user_withdrawal", "status = '0' OR status = '1'");
$this->_withdrawalBadge = $countWithdrawalBadge > 0 ? $countWithdrawalBadge : "";
// $countMessageBadge = user::countBadge("user_messages", "agent_id = '$agent_id' AND status = '0'");
// $this->_messageBadge = ($countMessageBadge > 0) ? $countMessageBadge : "";
}
$this->view->_userData = $this->_userData;
$this->view->_userAccType = $this->_userAccType;
$this->view->_userProfileImages = $this->_userProfileImages;
$this->view->_availableCommission = $this->_availableCommission;
// BADGE
$this->view->_accPaymentBadge = $this->_accPaymentBadge;
$this->view->_withdrawalBadge = $this->_withdrawalBadge;
// $this->view->_messageBadge = $this->_messageBadge;
}
示例7: getSponsorId
public function getSponsorId($agent_id)
{
$owner_ID = session::get(AGENT_SESSION_NAME);
$mydata = $this->db->select("user_accounts", "agent_id,username", "agent_id = '{$owner_ID}'", "fetch");
$cond = "(agent_id LIKE '%{$agent_id}%' OR username LIKE '%{$agent_id}%') AND (lv1 = '{$owner_ID}' OR lv2 = '{$owner_ID}' OR lv3 = '{$owner_ID}' OR lv4 = '{$owner_ID}' OR lv5 = '{$owner_ID}' OR lv6 = '{$owner_ID}' OR lv7 = '{$owner_ID}' OR lv8 = '{$owner_ID}' OR lv9 = '{$owner_ID}' OR lv10 = '{$owner_ID}') LIMIT 0,10";
$usersData = $this->db->select("user_accounts", "agent_id, username", $cond);
if (strpos($mydata['agent_id'], $agent_id) !== FALSE or strpos($mydata['username'], $agent_id) !== FALSE) {
$usersData[] = $mydata;
}
foreach ($usersData as $key => $value) {
$userID = $value['agent_id'];
$imageExist = user::checkExist("user_images", "agent_id = '{$userID}' and profile = '1'");
if ($imageExist) {
$image = user::getUserImages($userID, TRUE);
$imagePath = IMAGES_PATH . "users/" . $image['filename'];
} else {
$imagePath = IMAGES_PATH . "user-default.png";
}
$usersData[$key]['image'] = $imagePath;
}
return $usersData;
}
示例8: complete
function complete()
{
$userdata = $this->user;
$agent_id = $userdata['agent_id'];
$paymentComplete = TRUE;
$db = new database(DBTYPE, DBHOST, DBNAME, DBUSER, DBPASS);
$hasPayment = user::checkExist("user_payment", "agent_id = '{$agent_id}'");
$paymentDetails = $db->select("user_payment", "payment_date, payment_time, from_acc, to_acc, payment_type", "agent_id = '{$agent_id}'", "fetch");
if ($paymentDetails != FALSE) {
foreach ($paymentDetails as $key => $value) {
if (empty($value)) {
$paymentComplete = FALSE;
}
}
} else {
$paymentComplete = FALSE;
}
if (!$hasPayment or !$paymentComplete) {
redirect::to("setup/payment");
}
$this->breadcrumb->add("Complete", "setup/complete");
$this->view->breadcrumbs = $this->breadcrumb->get();
$this->view->js = array('setup/js/setup.js');
$this->view->render('setup/complete', 'backoffice');
}
示例9: checkPin
public function checkPin($data)
{
$response_array = array();
$agent_id = $data['pin'];
$userExist = user::checkExist("user_accounts", "agent_id = '{$agent_id}'");
if (!$userExist) {
$response_array['r'] = "false";
$response_array['msg'] = "<div><b>Advertisement Pin</b> not valid!</div>";
} else {
$userdata = $this->db->select("user_accounts", "*", "agent_id = '{$agent_id}'", "fetch");
$header = "<table class='table table-bordered table-condensed'><thead><tr class='active'><th class='text-center' width='50'>#</th><th class='text-center' width='150'>Available Pin</th><th class='text-center' width='200'>Pin Code</th><th class='text-center'>Acc. Type</th><th class='text-center' width='150'>Action</th></tr></thead><tbody>";
$content = "";
$footer = "</tbody></table>";
$acc_type = $userdata['acc_type'];
$activate = $userdata['activate'];
$payment = $userdata['payment'];
$available_pin = $userdata['available_pin'];
if ($acc_type == "pb" or $acc_type == "aa" or $activate == 0 or $payment != 2) {
$response_array['r'] = "false";
$response_array['msg'] = "<div><b>Advertisement Pin</b> not valid!</div>";
} elseif ($available_pin == 0) {
$response_array['r'] = "false";
$response_array['msg'] = "<div>Insufficient <b>Advertisement Pin</b> balance!</div>";
} else {
// CONSTRUCT CONTENT
$highlight = $userdata['acc_type'] == "ep" ? "warning" : NULL;
$pin_code = $userdata['agent_id'];
$accType = user::getAccType($acc_type);
$accType = $accType['label'];
$content .= "<tr class='text-center {$highlight}'>";
$content .= "<td>1</td>";
$content .= "<td>{$available_pin}</td>";
$content .= "<td>{$pin_code}</td>";
$content .= "<td>{$accType}</td>";
$content .= "<td><button class='btnSelect btn btn-primary btn-xs' type='button' data-pin='{$pin_code}'>Select</button></td>";
$content .= "</tr>";
$result = $header . $content . $footer;
$response_array['r'] = "true";
$response_array['msg'] = $result;
}
}
return $response_array;
}
示例10: addagent_success
public function addagent_success($agent_id)
{
$this->breadcrumb->add("Geneology", "mynetwork/geneology");
$this->breadcrumb->add("Add Agent", "mynetwork/addagent");
$this->breadcrumb->add("Successful", "mynetwork/addagent_success");
$this->view->breadcrumbs = $this->breadcrumb->get();
if (isset($agent_id)) {
$verify = user::checkExist("user_accounts", "agent_id = '{$agent_id}'");
if (!$verify) {
redirect::to("mynetwork/geneology");
exit;
} else {
$data = user::getUserData("agent_id", $agent_id);
$this->view->userdata = $data;
$this->view->js = array('mynetwork/js/addagent_success.js');
$this->view->render('mynetwork/addagent_success', "backoffice");
}
} else {
redirect::to();
exit;
}
}
示例11: advertisementList
public function advertisementList()
{
$self_address = BASE_PATH . "management/advertisement";
if (!isset($_REQUEST['s'])) {
$_GET['s'] = NULL;
}
if (!isset($_REQUEST['p'])) {
$_GET['p'] = 1;
}
$header = "<table class='table table-bordered table-condensed'><thead><tr><th class='text-center' width='50px'>#</th><th class='text-center' width='150px'>Ads ID</th><th class='text-center' width='150px'>Ads Pin</th><th class='text-center' >Supplier Name</th><th class='text-center' >Ads Name</th><th class='text-center' width='150px'>Document Date</th><th class='text-center' width='150px'>Receive Date</th><th class='text-center' width='150px'>Status</th><th class='text-center' width='150px'>Start Date</th><th class='text-center' width='150px'>Expiry Date</th><th class='text-center' width='300px'></th></tr></thead><tbody>";
$content = "";
$pagination = "";
$listExist = user::checkExist("advertisement_view");
if (!$listExist) {
$content .= "<tr><td class ='text-center' colspan='11'>No advertisement record.</td></tr>";
} else {
if (isset($_REQUEST['s'])) {
$s = $_GET['s'];
if ($_GET['s'] != "") {
$searchItm = $s;
$searchSQL = " AND (ads_name LIKE '%{$searchItm}%') OR (supplier_id LIKE '%{$searchItm}%') OR (ads_id LIKE '%{$searchItm}%')";
$get_search = "&s={$searchItm}";
} else {
$searchItm = NULL;
$searchSQL = NULL;
$get_search = NULL;
}
} else {
$searchItm = NULL;
$searchSQL = NULL;
$get_search = NULL;
}
$page = $_GET['p'];
$current_page = $page;
$prev_page = $current_page - 1;
$next_page = $current_page + 1;
$max_result = 15;
$from = $current_page * $max_result - $max_result;
if (isset($_REQUEST['sid']) and isset($_REQUEST['aid'])) {
$aid = $_GET['aid'];
$sid = $_GET['sid'];
$cond = "agent_id = '{$aid}' AND supplier_id = '{$sid}'";
} else {
$cond = "agent_id != 'NULL'";
}
if ($searchItm == NULL) {
$advertisementList_full = $this->db->select("advertisement_view", "*", "{$cond} ORDER BY id DESC");
} else {
$advertisementList_full = $this->db->select("advertisement_view", "*", "{$cond} {$searchSQL} ORDER BY id DESC");
}
//
$total_row = count($advertisementList_full);
$total_pages = ceil($total_row / $max_result);
$pagination .= "<ul class='pagination pagination-sm'>";
if ($current_page > 1) {
$pagination .= "<li><a href='{$self_address}?p={$prev_page}{$get_search}'><span class='fa fa-angle-double-left fa-fw'></span> Back</a></li>";
} else {
$pagination .= "<li class='disabled'><a href='#'><span class='fa fa-angle-double-left fa-fw'></span> Back</a></li>";
}
if ($current_page >= 7) {
$pagination .= "<li><a href='{$self_address}?p=1{$get_search}'>1</a></li>";
$pagination .= "<li class='disabled'><a href='#'>..</a></li>";
}
for ($i = max(1, $current_page - 5); $i <= min($current_page + 5, $total_pages); $i++) {
if ($current_page == $i) {
$pagination .= "<li class='active'><a href='#'>{$i}</a></li>";
} else {
$pagination .= "<li><a href='{$self_address}?p={$i}{$get_search}'>{$i}</a></li>";
}
}
if ($current_page < $total_pages - 5) {
$pagination .= "<li class='disabled'><a href='#'>..</a></li>";
$pagination .= "<li><a href='{$self_address}?p={$total_pages}{$get_search}'>{$total_pages}</a></li>";
}
if ($current_page < $total_pages) {
$pagination .= "<li><a href='{$self_address}?p={$next_page}{$get_search}'>Next <span class='fa fa-angle-double-right fa-fw'></span></a></li>";
} else {
$pagination .= "<li class='disabled'><a href='#'>Next <span class='fa fa-angle-double-right fa-fw'></span></a></li>";
}
$pagination .= "</ul>";
if ($searchItm == NULL) {
$advertisementList_limit = $this->db->select("advertisement_view", "*", "{$cond} ORDER BY id DESC LIMIT {$from},{$max_result}");
} else {
$advertisementList_limit = $this->db->select("advertisement_view", "*", "{$cond} {$searchSQL} ORDER BY id DESC LIMIT {$from},{$max_result}");
}
if ($total_row == 0) {
$content .= "<tr><td class ='text-center' colspan='11'>No advertisement record.</td></tr>";
$pagination = NULL;
} else {
if ($total_row <= $max_result) {
$pagination = NULL;
}
$x = $from + 1;
foreach ($advertisementList_limit as $value) {
// CONSTRUCT CONTENT
$ads_id = $value['ads_id'];
$ads_pin = $value['ads_pin'] ? "Yes" : "No";
$supplier_data = user::getSupplierData("supplier_id", $value['supplier_id']);
$supplier_name = "<a href='" . BASE_PATH . "management/supplier?s=" . $supplier_data['comp_name'] . "'>" . $supplier_data['comp_name'] . "</a>";
$ads_name = $value['ads_name'];
//.........这里部分代码省略.........
示例12: getWithdrawalStatement
public function getWithdrawalStatement($agent_id)
{
$self_address = BASE_PATH . "comm/withdrawal";
$header = "<table class='table table-bordered table-condensed'><thead><tr><th class='text-center' width='50'>#</th><th class='text-center' width='150'>Date Request</th><th class='text-center'>Acount Details</th><th class='text-center' width='150'>Amount</th><th class='text-center' width='300'>Remarks</th><th class='text-center' width='150'>Status</th><th class='text-center' width='100'>Action</th></tr></thead> <tbody>";
$content = "";
$pagination = "";
$recordExist = user::checkExist("user_withdrawal", "agent_id = '{$agent_id}'");
if (!$recordExist) {
$content .= "<tr><td class ='text-center' colspan='7'>No withdrawal record.</td></tr>";
} else {
$filterItm = $_GET['f'] != "" ? $_GET['f'] : NULL;
if ($filterItm != NULL) {
$filter = "AND date_request LIKE '%{$filterItm}%'";
} else {
$filter = NULL;
}
$page = $_GET['p'];
$current_page = $page;
$prev_page = $current_page - 1;
$next_page = $current_page + 1;
$max_result = 30;
$from = $current_page * $max_result - $max_result;
$withdrawalList_full = $this->db->select("user_withdrawal", "*", "agent_id = '{$agent_id}' {$filter} ORDER BY id DESC");
$total_row = count($withdrawalList_full);
$total_pages = ceil($total_row / $max_result);
$pagination .= "<ul class='pagination pagination-sm'>";
$filterLink = $filterItm != NULL ? "&s={$filterItm}" : NULL;
if ($current_page > 1) {
$pagination .= "<li><a href='{$self_address}?p={$prev_page}{$filterLink}'><span class='fa fa-angle-double-left fa-fw'></span> Back</a></li>";
} else {
$pagination .= "<li class='disabled'><a href='#'><span class='fa fa-angle-double-left fa-fw'></span> Back</a></li>";
}
if ($current_page >= 7) {
$pagination .= "<li><a href='#'>1</a></li>";
$pagination .= "<li class='disabled'><a href='#'>..</a></li>";
}
for ($i = max(1, $current_page - 5); $i <= min($current_page + 5, $total_pages); $i++) {
if ($current_page == $i) {
$pagination .= "<li class='active'><a href='#'>{$i}</a></li>";
} else {
$pagination .= "<li><a href='{$self_address}?p={$i}{$filterLink}'>{$i}</a></li>";
}
}
if ($current_page < $total_pages - 5) {
$pagination .= "<li class='disabled'><a href='#'>..</a></li>";
$pagination .= "<li><a href='#'>{$total_pages}</a></li>";
}
if ($current_page < $total_pages) {
$pagination .= "<li><a href='{$self_address}?p={$next_page}{$filterLink}'>Next <span class='fa fa-angle-double-right fa-fw'></span></a></li>";
} else {
$pagination .= "<li class='disabled'><a href='#'>Next <span class='fa fa-angle-double-right fa-fw'></span></a></li>";
}
$pagination .= "</ul>";
$withdrawalList_limit = $this->db->select("user_withdrawal", "*", "agent_id = '{$agent_id}' {$filter} ORDER BY id DESC LIMIT {$from},{$max_result}");
if ($total_row == 0) {
$content .= "<tr><td class ='text-center' colspan='7'>No withdrawal record.</td></tr>";
$pagination = NULL;
} else {
if ($total_row <= $max_result) {
$pagination = NULL;
}
$x = $from + 1;
$total_withdrawal = 0;
foreach ($withdrawalList_limit as $value) {
// CONSTRUCT CONTENT
$id = $value['id'];
$datetime = date("d M Y-h:i A", strtotime($value['date_request']));
$date_request = str_replace("-", "<br/>", $datetime);
$holder_name = $value['holder_name'];
$bank_name = strtoupper($value['bank_name']);
$acc_no = $value['acc_no'];
$account_details = $holder_name . "<br/>" . $bank_name . " - " . $acc_no;
$amount = $value['amount'];
$remarks = $value['remarks'];
$status_code = $value['status'];
$date_review = date("d M Y", strtotime($value['date_review']));
switch ($status_code) {
case "-1":
$status = "<abbr title='Withdrawal request rejected.'><span class='label label-danger'>Rejected</span></abbr><br/>{$date_review}";
$action = "";
break;
case "1":
$status = "<abbr title='Withdrawal request in process.'><span class='label label-info'>Process</span></abbr><br/>{$date_review}";
$action = "";
break;
case "2":
$status = "<abbr title='Payment complete.'><span class='label label-success'>Success</span></abbr><br/>{$date_review}";
$action = "";
break;
default:
$status = "<abbr title='Waiting for review process.'><span class='label label-warning'>Pending</span></abbr>";
$action = "<a class='btn btn-link btn-cancel-withdraw' data-no='{$x}' data-id='{$id}' href='" . BASE_PATH . "comm/cancelWithdraw'>Cancel</a>";
break;
}
$content .= "<tr class='text-center'>";
$content .= "<td>{$x}</td>";
$content .= "<td>{$date_request}</td>";
$content .= "<td>{$account_details}</td>";
$content .= "<td>RM" . number_format($amount) . "</td>";
$content .= "<td>{$remarks}</td>";
//.........这里部分代码省略.........
示例13: ajaxSupplierList
public function ajaxSupplierList()
{
$self_address = BASE_PATH . "supplier";
$header = "<table class='table table-bordered table-condensed'><thead><tr><th class='text-center' width='50px'>#</th><th class='text-center' width='100px'>Type</th><th class='text-center' width='250px'>Name</th><th class='text-center' width='150px'>Category</th><th class='text-center' width='150px'>State, Country</th><th class='text-center' width='400px'>Business Desc</th><th class='text-center' width='150px'>Advertisement</th><th class='text-center' width='150px'>Status</th><th class='text-center' width='250px'>Action</th></tr></thead><tbody>";
$content = "";
$pagination = "";
$agent_id = session::get(AGENT_SESSION_NAME);
$listExist = user::checkExist("user_suppliers", "agent_id = '{$agent_id}'");
if (!$listExist) {
$content .= "<tr><td class ='text-center' colspan='9'>No supplier record.</td></tr>";
} else {
if (isset($_REQUEST['s'])) {
$s = $_GET['s'];
if ($_GET['s'] != "") {
$searchItm = $s;
$searchSQL = " AND (comp_name LIKE '%{$searchItm}%')";
$get_search = "&s={$searchItm}";
} else {
$searchItm = NULL;
$searchSQL = NULL;
$get_search = NULL;
}
} else {
$searchItm = NULL;
$searchSQL = NULL;
$get_search = NULL;
}
$page = $_GET['p'];
$current_page = $page;
$prev_page = $current_page - 1;
$next_page = $current_page + 1;
$max_result = 15;
$from = $current_page * $max_result - $max_result;
if ($searchItm == NULL) {
$supplierList_full = $this->db->select("user_suppliers", "*", "agent_id = '{$agent_id}' ORDER BY id DESC");
} else {
$supplierList_full = $this->db->select("user_suppliers", "*", "agent_id = '{$agent_id}' {$searchSQL} ORDER BY id DESC");
}
//
$total_row = count($supplierList_full);
$total_pages = ceil($total_row / $max_result);
$pagination .= "<ul class='pagination pagination-sm'>";
if ($current_page > 1) {
$pagination .= "<li><a href='{$self_address}?p={$prev_page}{$get_search}'><span class='fa fa-angle-double-left fa-fw'></span> Back</a></li>";
} else {
$pagination .= "<li class='disabled'><a href='#'><span class='fa fa-angle-double-left fa-fw'></span> Back</a></li>";
}
if ($current_page >= 7) {
$pagination .= "<li><a href='{$self_address}?p=1{$get_search}'>1</a></li>";
$pagination .= "<li class='disabled'><a href='#'>..</a></li>";
}
for ($i = max(1, $current_page - 5); $i <= min($current_page + 5, $total_pages); $i++) {
if ($current_page == $i) {
$pagination .= "<li class='active'><a href='#'>{$i}</a></li>";
} else {
$pagination .= "<li><a href='{$self_address}?p={$i}{$get_search}'>{$i}</a></li>";
}
}
if ($current_page < $total_pages - 5) {
$pagination .= "<li class='disabled'><a href='#'>..</a></li>";
$pagination .= "<li><a href='{$self_address}?p={$total_pages}{$get_search}'>{$total_pages}</a></li>";
}
if ($current_page < $total_pages) {
$pagination .= "<li><a href='{$self_address}?p={$next_page}{$get_search}'>Next <span class='fa fa-angle-double-right fa-fw'></span></a></li>";
} else {
$pagination .= "<li class='disabled'><a href='#'>Next <span class='fa fa-angle-double-right fa-fw'></span></a></li>";
}
$pagination .= "</ul>";
if ($searchItm == NULL) {
$supplierList_limit = $this->db->select("user_suppliers", "*", "agent_id = '{$agent_id}' ORDER BY id DESC LIMIT {$from},{$max_result}");
} else {
$supplierList_limit = $this->db->select("user_suppliers", "*", "agent_id = '{$agent_id}' {$searchSQL} ORDER BY id DESC LIMIT {$from},{$max_result}");
}
if ($total_row == 0) {
$content .= "<tr><td class ='text-center' colspan='9'>No supplier record.</td></tr>";
$pagination = NULL;
} else {
if ($total_row <= $max_result) {
$pagination = NULL;
}
$x = $from + 1;
foreach ($supplierList_limit as $value) {
// CONSTRUCT CONTENT
$supplier_id = $value['supplier_id'];
switch ($value['type']) {
case 1:
$type = "Paid";
$color = "bg-highlight";
break;
default:
$type = "Free";
$color = NULL;
break;
}
$name = ucwords(strtolower($value['comp_name']));
$categotyData = $this->db->select("category", "*", "id = '" . $value['category'] . "'", "fetch");
$category = $categotyData['category'] . " - " . $categotyData['subcategory'];
if ($value['comp_state'] == "oth") {
$state = $value['state_other'];
} else {
//.........这里部分代码省略.........
示例14: join_exec
public function join_exec($data)
{
$response_array = array();
$agent = new user();
$data['fullname'] = strtoupper($data['fullname']);
$data['agent_id'] = $agent->generateID();
$data['tmp_password'] = strtoupper(hash::create('crc32', uniqid(), HASH_PASSWORD_KEY));
$data['activate_code'] = $agent->generateActivationCode($data['email']);
$acc_type = $data['acc_type'];
switch ($acc_type) {
case "pb":
$ads_pin_limit = "na";
$available_pin = 0;
break;
case "aa":
$ads_pin_limit = "na";
$available_pin = 0;
break;
case "ed":
$ads_pin_limit = 10;
$available_pin = 10;
break;
case "ep":
$ads_pin_limit = 40;
$available_pin = 40;
break;
default:
$ads_pin_limit = "unlimited";
$available_pin = 40;
break;
}
$data['ads_pin_limit'] = $ads_pin_limit;
$data['available_pin'] = $available_pin;
$checkEmail = $agent->checkEmail($data['email']);
$checkCEmail = $agent->checkCdata($data['email'], $data['cemail']);
$checkUsername = $data['chkusername'];
$sponsor_id = $data['sponsor_id'];
$checkSponsodID = user::checkExist("user_accounts", "agent_id = '{$sponsor_id}'");
if (!$checkCEmail) {
$response_array['r'] = "false";
$response_array['msg'] = "<div><b>Confirm Email</b> not match!</div>";
} elseif (!$checkEmail) {
$response_array['r'] = "false";
$response_array['msg'] = "<div><b>Email</b> already exist!</div>";
} elseif ($checkUsername == 0) {
$response_array['r'] = "false";
$response_array['msg'] = "<div>Please <b>Check Username</b> availability!<div>";
} elseif ($checkUsername == '-1') {
$response_array['r'] = "false";
$response_array['msg'] = "<div><b>Username</b> not available! Please choose another username.<div>";
} elseif (!$checkSponsodID) {
$response_array['r'] = "false";
$response_array['msg'] = "<div><b>Refferal ID</b> not valid! Please ask Refferal ID from the person who introduce you to 1STG Programs. If you don't have any refferal, you can directly <a href='" . BASE_PATH . "contact'>contact us</a> for an assistance.<div>";
} else {
unset($data['cemail']);
unset($data['chkusername']);
$link = BASE_PATH . 'join/verify?a=' . $data['activate_code'] . '&s=' . $data['username'];
$agent_id = $data['sponsor_id'];
$upline_id = $agent->generateUpline($agent_id);
$newUplineData = $this->newUplineData($upline_id);
foreach ($newUplineData as $key => $value) {
$data[$key] = $value;
}
// Insert into Database
$this->db->insert("user_accounts", $data);
// Generate Email BODY
$html = file_get_contents(BASE_PATH . 'email_template/activation');
$html = htmlspecialchars($html);
$html = str_replace('[USERNAME]', ucfirst($data['username']), $html);
$html = str_replace('[ACTIVATION_CODE]', $link, $html);
$html = html_entity_decode($html);
$body = $html;
// Send Email
$mailer = new mailer();
$mailer->IsSMTP();
// set mailer to use SMTP
$mailer->Port = EMAIL_PORT;
$mailer->Host = EMAIL_HOST;
// specify main and backup server
$mailer->SMTPAuth = true;
// turn on SMTP authentication
$mailer->Username = NOREPLY_EMAIL;
// SMTP username
$mailer->Password = NOREPLY_PASS;
// SMTP password
$mailer->From = NOREPLY_EMAIL;
$mailer->FromName = SUPPORT_NAME;
$mailer->AddAddress($data['email']);
$mailer->IsHTML(true);
$mailer->Subject = "Email verification to " . $data['email'];
$mailer->Body = $body;
if (!$mailer->Send()) {
$response_array['r'] = "false";
$response_array['msg'] = "Mailer Error: " . $mailer->ErrorInfo;
} else {
$response_array['r'] = "true";
$response_array['msg'] = BASE_PATH . "join/success/" . $data['agent_id'];
}
}
return $response_array;
//.........这里部分代码省略.........
示例15: agentUpgrade
function agentUpgrade()
{
$agent_id = $_REQUEST['agent_id'] ? $_GET['agent_id'] : redirect::to("management/agentList");
$validateID = user::checkExist("user_accounts", "agent_id = {$agent_id}");
if (!$validateID) {
redirect::to("management/agentList");
} else {
$userData = user::getUserData("agent_id", $agent_id);
}
$this->view->userdata = $userData;
$this->view->user_acc_type = user::getAccType($userData['acc_type']);
$this->view->acc_type_list = user::getAccType();
$this->view->paymentMethodList = user::getPaymentMethod();
$this->view->bankList = user::getBanks();
$this->breadcrumb->add("Agent List", "management/agentList");
$this->breadcrumb->add("Agent Upgrade - " . $userData['fullname'], "management/agentUpgrade");
$this->view->breadcrumbs = $this->breadcrumb->get();
$this->view->js = array('management/js/agentUpgrade.js');
$this->view->render('management/agentUpgrade', 'backoffice');
}