public function pjActionGetClient()
 {
     $this->setAjax(true);
     if ($this->isXHR()) {
         $pjClientModel = pjClientModel::factory()->where('user_id', $_SESSION['admin_user']['id']);
         if (isset($_GET['q']) && !empty($_GET['q'])) {
             $q = pjObject::escapeString($_GET['q']);
             $pjClientModel->where('t1.c_email LIKE', "%{$q}%");
             $pjClientModel->orWhere('t1.c_name LIKE', "%{$q}%");
         }
         if (isset($_GET['status']) && !empty($_GET['status']) && in_array($_GET['status'], array('T', 'F'))) {
             $pjClientModel->where('t1.status', $_GET['status']);
         }
         $column = 'c_name';
         $direction = 'ASC';
         if (isset($_GET['direction']) && isset($_GET['column']) && in_array(strtoupper($_GET['direction']), array('ASC', 'DESC'))) {
             $column = $_GET['column'];
             $direction = strtoupper($_GET['direction']);
         }
         $total = $pjClientModel->findCount()->getData();
         $rowCount = isset($_GET['rowCount']) && (int) $_GET['rowCount'] > 0 ? (int) $_GET['rowCount'] : 10;
         $pages = ceil($total / $rowCount);
         $page = isset($_GET['page']) && (int) $_GET['page'] > 0 ? intval($_GET['page']) : 1;
         $offset = ((int) $page - 1) * $rowCount;
         if ($page > $pages) {
             $page = $pages;
         }
         $data = array();
         $data = $pjClientModel->select("t1.id, t1.c_email, t1.c_name, t1.status, (SELECT COUNT(TO.client_id) FROM `" . pjOrderModel::factory()->getTable() . "` AS `TO` WHERE `TO`.client_id=t1.id) AS cnt_orders")->orderBy("{$column} {$direction}")->limit($rowCount, $offset)->findAll()->getData();
         pjAppController::jsonResponse(compact('data', 'total', 'pages', 'page', 'rowCount', 'column', 'direction'));
     }
     exit;
 }
    public function pjActionGetExtra()
    {
        $this->setAjax(true);
        if ($this->isXHR()) {
            $pjExtraModel = pjExtraModel::factory()->join('pjMultiLang', "t2.foreign_id = t1.id AND t2.model = 'pjExtra' AND t2.locale = '" . $this->getLocaleId() . "' AND t2.field = 'name'", 'left')->where('user_id', $_SESSION['admin_user']['id']);
            if (isset($_GET['q']) && !empty($_GET['q'])) {
                $q = pjObject::escapeString($_GET['q']);
                $pjExtraModel->where('t2.content LIKE', "%{$q}%");
            }
            $column = 'name';
            $direction = 'ASC';
            if (isset($_GET['direction']) && isset($_GET['column']) && in_array(strtoupper($_GET['direction']), array('ASC', 'DESC'))) {
                $column = $_GET['column'];
                $direction = strtoupper($_GET['direction']);
            }
            $total = $pjExtraModel->findCount()->getData();
            $rowCount = isset($_GET['rowCount']) && (int) $_GET['rowCount'] > 0 ? (int) $_GET['rowCount'] : 20;
            $pages = ceil($total / $rowCount);
            $page = isset($_GET['page']) && (int) $_GET['page'] > 0 ? intval($_GET['page']) : 1;
            $offset = ((int) $page - 1) * $rowCount;
            if ($page > $pages) {
                $page = $pages;
            }
            $data = $pjExtraModel->select('t1.*, t2.content AS name, 
						  (SELECT COUNT(t3.product_id) FROM `' . pjProductExtraModel::factory()->getTable() . '` AS t3 WHERE t3.extra_id=t1.id) as products')->orderBy("{$column} {$direction}")->limit($rowCount, $offset)->findAll()->getData();
            foreach ($data as $k => $v) {
                $v['price'] = pjUtil::formatCurrencySign($v['price'], $this->option_arr['o_currency']);
                $data[$k] = $v;
            }
            pjAppController::jsonResponse(compact('data', 'total', 'pages', 'page', 'rowCount', 'column', 'direction'));
        }
        exit;
    }
 /**
  * Initialize
  *
  * @access public
  * @return void
  */
 public function init()
 {
     if (isset($GLOBALS['CONFIG']['plugins'])) {
         pjObject::import('Plugin', $GLOBALS['CONFIG']['plugins']);
     }
     $Dispatcher = new pjDispatcher();
     $Dispatcher->dispatch($_GET, array());
     $this->controller = $Dispatcher->getController();
 }
 public function pjActionGetLocale()
 {
     $this->setAjax(true);
     if ($this->isXHR()) {
         if (isset($_GET['locale']) && (int) $_GET['locale'] > 0) {
             pjAppController::setFields($_GET['locale']);
             $this->set('category_arr', pjCategoryModel::factory()->select('t1.*, t2.content AS name')->join('pjMultiLang', "t2.model='pjCategory' AND t2.foreign_id=t1.id AND t2.field='name' AND t2.locale='" . pjObject::escapeString($_GET['locale']) . "'", 'left outer')->where('t1.status', 'T')->orderBy('`order` ASC')->findAll()->getData());
             $this->set('extra_arr', pjExtraModel::factory()->select('t1.*, t2.content AS name')->join('pjMultiLang', "t2.model='pjExtra' AND t2.foreign_id=t1.id AND t2.field='name' AND t2.locale='" . pjObject::escapeString($_GET['locale']) . "'", 'left outer')->orderBy('name ASC')->findAll()->getData());
         }
     }
 }
        ?>
</div><?php 
        if (pjObject::getPlugin('pjPaypal') !== NULL) {
            $controller->requestAction(array('controller' => 'pjPaypal', 'action' => 'pjActionForm', 'params' => $tpl['params']));
        }
        break;
    case 'authorize':
        ?>
               // <?php 
        include PJ_VIEWS_PATH . 'pjFront/elements/api_test.php';
        ?>
                <div class="fdSystemMessage"><?php 
        echo $front_messages[2];
        ?>
</div><?php 
        if (pjObject::getPlugin('pjAuthorize') !== NULL) {
            $controller->requestAction(array('controller' => 'pjAuthorize', 'action' => 'pjActionForm', 'params' => $tpl['params']));
        }
        break;
    case 'bank':
        ?>
		//<?php 
        include PJ_VIEWS_PATH . 'pjFront/elements/api_test.php';
        ?>
                <div class="fdSystemMessage">
			<?php 
        $system_msg = str_replace("[STAG]", "<a href='#' class='fdStartOver'>", $front_messages[3]);
        $system_msg = str_replace("[ETAG]", "</a>", $system_msg);
        echo $system_msg;
        ?>
			<br /><br />
 public function pjActionGetVoucher()
 {
     $this->setAjax(true);
     if ($this->isXHR()) {
         $pjVoucherModel = pjVoucherModel::factory()->where('user_id', $_SESSION['admin_user']['id']);
         if (isset($_GET['q']) && !empty($_GET['q'])) {
             $q = pjObject::escapeString($_GET['q']);
             $pjVoucherModel->where('t1.code LIKE', "%{$q}%");
         }
         $column = 'code';
         $direction = 'ASC';
         if (isset($_GET['direction']) && isset($_GET['column']) && in_array(strtoupper($_GET['direction']), array('ASC', 'DESC'))) {
             $column = $_GET['column'];
             $direction = strtoupper($_GET['direction']);
         }
         $total = $pjVoucherModel->findCount()->getData();
         $rowCount = isset($_GET['rowCount']) && (int) $_GET['rowCount'] > 0 ? (int) $_GET['rowCount'] : 10;
         $pages = ceil($total / $rowCount);
         $page = isset($_GET['page']) && (int) $_GET['page'] > 0 ? intval($_GET['page']) : 1;
         $offset = ((int) $page - 1) * $rowCount;
         if ($page > $pages) {
             $page = $pages;
         }
         $data = array();
         $data = $pjVoucherModel->select('t1.*')->orderBy("{$column} {$direction}")->limit($rowCount, $offset)->findAll()->getData();
         foreach ($data as $k => $v) {
             if ($v['type'] == 'percent') {
                 $v['discount'] = $v['discount'] . '%';
             } else {
                 $v['discount'] = pjUtil::formatCurrencySign($v['discount'], $this->option_arr['o_currency']);
             }
             $v['datetime_valid'] = '';
             switch ($v['valid']) {
                 case 'fixed':
                     $v['datetime_valid'] = date($this->option_arr['o_date_format'], strtotime($v['date_from'])) . ' ' . __('lblFrom', true) . ' ' . date($this->option_arr['o_time_format'], strtotime($v['time_from'])) . ' ' . __('lblTo', true) . ' ' . date($this->option_arr['o_time_format'], strtotime($v['time_to']));
                     break;
                 case 'period':
                     $v['datetime_valid'] = __('lblFrom', true) . ' ' . date($this->option_arr['o_date_format'], strtotime($v['date_from'])) . ' ' . __('lblTo', true) . ' ' . date($this->option_arr['o_date_format'], strtotime($v['date_to']));
                     break;
                 case 'recurring':
                     $days = __('voucher_days', true, false);
                     $v['datetime_valid'] = __('lblEvery', true) . ' ' . $days[$v['every']] . ' ' . __('lblFrom', true) . ' ' . date($this->option_arr['o_time_format'], strtotime($v['time_from'])) . ' ' . __('lblTo', true) . ' ' . date($this->option_arr['o_time_format'], strtotime($v['time_to']));
                     break;
             }
             $data[$k] = $v;
         }
         pjAppController::jsonResponse(compact('data', 'total', 'pages', 'page', 'rowCount', 'column', 'direction'));
     }
     exit;
 }
 public function pjActionGetLocation()
 {
     $this->setAjax(true);
     if ($this->isXHR()) {
         $pjLocationModel = pjLocationModel::factory()->join('pjMultiLang', "t2.foreign_id = t1.id AND t2.model = 'pjLocation' AND t2.locale = '" . $this->getLocaleId() . "' AND t2.field = 'name'", 'left')->join('pjMultiLang', "t3.foreign_id = t1.id AND t3.model = 'pjLocation' AND t3.locale = '" . $this->getLocaleId() . "' AND t3.field = 'address'", 'left')->where('user_id', $_SESSION['admin_user']['id']);
         if (isset($_GET['q']) && !empty($_GET['q'])) {
             $q = pjObject::escapeString($_GET['q']);
             $pjLocationModel->where('t2.content LIKE', "%{$q}%");
             $pjLocationModel->orWhere('t3.content LIKE', "%{$q}%");
         }
         $column = 'name';
         $direction = 'ASC';
         if (isset($_GET['direction']) && isset($_GET['column']) && in_array(strtoupper($_GET['direction']), array('ASC', 'DESC'))) {
             $column = $_GET['column'];
             $direction = strtoupper($_GET['direction']);
         }
         $total = $pjLocationModel->findCount()->getData();
         $rowCount = isset($_GET['rowCount']) && (int) $_GET['rowCount'] > 0 ? (int) $_GET['rowCount'] : 20;
         $pages = ceil($total / $rowCount);
         $page = isset($_GET['page']) && (int) $_GET['page'] > 0 ? intval($_GET['page']) : 1;
         $offset = ((int) $page - 1) * $rowCount;
         if ($page > $pages) {
             $page = $pages;
         }
         $data = $pjLocationModel->select('t1.*, t2.content AS name, t3.content AS address')->orderBy("{$column} {$direction}")->limit($rowCount, $offset)->findAll()->getData();
         pjAppController::jsonResponse(compact('data', 'total', 'pages', 'page', 'rowCount', 'column', 'direction'));
     }
     exit;
 }
 public function pjActionGetUser()
 {
     $this->setAjax(true);
     if ($this->isXHR()) {
         $pjUserModel = pjUserModel::factory()->where('t1.user_id', $_SESSION['admin_user']['id'])->orWhere('t1.id', $_SESSION['admin_user']['id']);
         if (isset($_GET['q']) && !empty($_GET['q'])) {
             $q = pjObject::escapeString($_GET['q']);
             $pjUserModel->where('t1.email LIKE', "%{$q}%");
             $pjUserModel->orWhere('t1.name LIKE', "%{$q}%");
         }
         if (isset($_GET['status']) && !empty($_GET['status']) && in_array($_GET['status'], array('T', 'F'))) {
             $pjUserModel->where('t1.status', $_GET['status']);
         }
         $column = 'name';
         $direction = 'ASC';
         if (isset($_GET['direction']) && isset($_GET['column']) && in_array(strtoupper($_GET['direction']), array('ASC', 'DESC'))) {
             $column = $_GET['column'];
             $direction = strtoupper($_GET['direction']);
         }
         $total = $pjUserModel->findCount()->getData();
         $rowCount = isset($_GET['rowCount']) && (int) $_GET['rowCount'] > 0 ? (int) $_GET['rowCount'] : 10;
         $pages = ceil($total / $rowCount);
         $page = isset($_GET['page']) && (int) $_GET['page'] > 0 ? intval($_GET['page']) : 1;
         $offset = ((int) $page - 1) * $rowCount;
         if ($page > $pages) {
             $page = $pages;
         }
         $data = array();
         $data = $pjUserModel->select('t1.id, t1.email, t1.name, t1.created, t1.status, t1.is_active, t1.role_id, t2.role')->join('pjRole', 't2.id=t1.role_id', 'left')->orderBy("{$column} {$direction}")->limit($rowCount, $offset)->findAll()->getData();
         foreach ($data as $k => $v) {
             $v['created'] = date($this->option_arr['o_date_format'], strtotime($v['created'])) . ', ' . date($this->option_arr['o_time_format'], strtotime($v['created']));
             $data[$k] = $v;
         }
         pjAppController::jsonResponse(compact('data', 'total', 'pages', 'page', 'rowCount', 'column', 'direction'));
     }
     exit;
 }
    public function pjActionGetCategory()
    {
        $this->setAjax(true);
        if ($this->isXHR()) {
            $pjCategoryModel = pjCategoryModel::factory()->join('pjMultiLang', "t2.foreign_id = t1.id AND t2.model = 'pjCategory' AND t2.locale = '" . $this->getLocaleId() . "' AND t2.field = 'name'", 'left')->where('user_id', $_SESSION['admin_user']['id']);
            if (isset($_GET['q']) && !empty($_GET['q'])) {
                $q = pjObject::escapeString($_GET['q']);
                $pjCategoryModel->where('t2.content LIKE', "%{$q}%");
            }
            if (isset($_GET['status']) && !empty($_GET['status']) && in_array($_GET['status'], array('T', 'F'))) {
                $pjCategoryModel->where('t1.status', $_GET['status']);
            }
            $column = 'order';
            $direction = 'ASC';
            if (isset($_GET['direction']) && isset($_GET['column']) && in_array(strtoupper($_GET['direction']), array('ASC', 'DESC'))) {
                $column = $_GET['column'];
                $direction = strtoupper($_GET['direction']);
            }
            $total = $pjCategoryModel->findCount()->getData();
            $rowCount = isset($_GET['rowCount']) && (int) $_GET['rowCount'] > 0 ? (int) $_GET['rowCount'] : 20;
            $pages = ceil($total / $rowCount);
            $page = isset($_GET['page']) && (int) $_GET['page'] > 0 ? intval($_GET['page']) : 1;
            $offset = ((int) $page - 1) * $rowCount;
            if ($page > $pages) {
                $page = $pages;
            }
            $data = $pjCategoryModel->select('t1.*, t2.content AS name, 
						  (SELECT COUNT(TPC.product_id) FROM `' . pjProductCategoryModel::factory()->getTable() . '` AS TPC WHERE TPC.category_id=t1.id) AS cnt_products')->orderBy("`{$column}` {$direction}")->limit($rowCount, $offset)->findAll()->getData();
            pjAppController::jsonResponse(compact('data', 'total', 'pages', 'page', 'rowCount', 'column', 'direction'));
        }
        exit;
    }
 public function pjActionConfirmPaypal()
 {
     $this->setAjax(true);
     if (pjObject::getPlugin('pjPaypal') === NULL) {
         $this->log('Paypal plugin not installed');
         exit;
     }
     $pjOrderModel = pjOrderModel::factory();
     $order_arr = $pjOrderModel->join('pjClient', "t2.id=t1.client_id", 'left outer')->select('t1.*, t2.c_title, t2.c_email, t2.c_name, t2.c_phone, t2.c_company, t2.c_address_1, t2.c_address_2, t2.c_country, t2.c_state, t2.c_city, t2.c_zip, t2.c_notes')->find($_POST['custom'])->getData();
     if (count($order_arr) == 0) {
         $this->log('No such booking');
         pjUtil::redirect($this->option_arr['o_thankyou_page']);
     }
     $params = array('txn_id' => @$order_arr['txn_id'], 'paypal_address' => $this->option_arr['o_paypal_address'], 'deposit' => @$order_arr['total'], 'currency' => $this->option_arr['o_currency'], 'key' => md5($this->option_arr['private_key'] . PJ_SALT));
     $response = $this->requestAction(array('controller' => 'pjPaypal', 'action' => 'pjActionConfirm', 'params' => $params), array('return'));
     if ($response !== FALSE && $response['status'] === 'OK') {
         $this->log('Booking confirmed');
         $pjOrderModel->reset()->setAttributes(array('id' => $pjOrderModel['id']))->modify(array('status' => $this->option_arr['o_payment_status'], 'txn_id' => $response['transaction_id'], 'processed_on' => ':NOW()'));
         pjOrderPaymentModel::factory()->setAttributes(array('order_id' => $order_arr['id'], 'payment_type' => 'online'))->modify(array('status' => 'paid'));
         pjAppController::addOrderDetails($order_arr, $this->getLocaleId());
         pjFront::pjActionConfirmSend($this->option_arr, $order_arr, PJ_SALT, 'payment');
     } elseif (!$response) {
         $this->log('Authorization failed');
     } else {
         $this->log('Booking not confirmed');
     }
     pjUtil::redirect($this->option_arr['o_thankyou_page']);
 }
 public function pjActionGetOrder()
 {
     $this->setAjax(true);
     if ($this->isXHR()) {
         $pjOrderModel = pjOrderModel::factory()->join('pjClient', "t2.id=t1.client_id", 'left outer')->where('t1.user_id', $_SESSION['admin_user']['id']);
         if (isset($_GET['q']) && !empty($_GET['q'])) {
             $q = pjObject::escapeString($_GET['q']);
             $pjOrderModel->where("(t1.id = '{$q}' OR t1.uuid = '{$q}' OR t1.c_name LIKE '%{$q}%' OR t1.c_email LIKE '%{$q}%')");
         }
         $lc_arr = explode(',', $_GET['location_id']);
         if (empty($_GET['fromDate']) && empty($_GET['toDate'])) {
             if (isset($_GET['status']) && !empty($_GET['status']) && in_array($_GET['status'], array('confirmed', 'cancelled', 'pending'))) {
                 $pjOrderModel->where('t1.status', $_GET['status']);
             }
             if (isset($_GET['client_id']) && (int) $_GET['client_id'] > 0) {
                 $pjOrderModel->where('t1.client_id', $_GET['client_id']);
             }
             if (isset($_GET['type']) && !empty($_GET['type'])) {
                 $pjOrderModel->where('t1.type', $_GET['type']);
             }
             if (isset($_GET['location_id']) && !empty($_GET['location_id'])) {
                 $condition = '';
                 foreach ($lc_arr as $row) {
                     $condition .= 't1.location_id=' . $row . ' OR ';
                 }
                 $condition = substr($condition, 0, strlen($condition) - 4);
                 $pjOrderModel->where($condition);
             }
         } else {
             $formDate = date('Y-m-d', strtotime($_GET['fromDate']));
             $toDate = date('Y-m-d', strtotime($_GET['toDate']));
             if (isset($_GET['status']) && !empty($_GET['status'])) {
                 $pjOrderModel->where('t1.status', $_GET['status']);
                 $pjOrderModel->where("date(t1.p_dt) BETWEEN '" . $formDate . "' AND '" . $toDate . "'");
             }
             if (isset($_GET['client_id']) && (int) $_GET['client_id'] > 0) {
                 $pjOrderModel->where('t1.client_id', $_GET['client_id']);
                 $pjOrderModel->where("date(t1.p_dt) BETWEEN '" . $formDate . "' AND '" . $toDate . "'");
             }
             if (isset($_GET['type']) && !empty($_GET['type'])) {
                 $pjOrderModel->where('t1.type', $_GET['type']);
                 $pjOrderModel->where("date(t1.p_dt) BETWEEN '" . $formDate . "' AND '" . $toDate . "'");
             }
             if (isset($_GET['location_id']) && !empty($_GET['location_id'])) {
                 $condition = '';
                 foreach ($lc_arr as $row) {
                     $condition .= 't1.location_id=' . $row . ' OR ';
                 }
                 $condition = substr($condition, 0, strlen($condition) - 4);
                 $pjOrderModel->where($condition);
                 $pjOrderModel->where("date(t1.p_dt) BETWEEN '" . $formDate . "' AND '" . $toDate . "'");
             }
         }
         $column = 'created';
         $direction = 'DESC';
         if (isset($_GET['direction']) && isset($_GET['column']) && in_array(strtoupper($_GET['direction']), array('ASC', 'DESC'))) {
             $column = $_GET['column'];
             $direction = strtoupper($_GET['direction']);
         }
         $total = $pjOrderModel->findCount()->getData();
         $rowCount = isset($_GET['rowCount']) && (int) $_GET['rowCount'] > 0 ? (int) $_GET['rowCount'] : 10;
         $pages = ceil($total / $rowCount);
         $page = isset($_GET['page']) && (int) $_GET['page'] > 0 ? intval($_GET['page']) : 1;
         $offset = ((int) $page - 1) * $rowCount;
         if ($page > $pages) {
             $page = $pages;
         }
         $data = array();
         $data = $pjOrderModel->select('t1.*, t2.c_name as client_name')->orderBy("{$column} {$direction}")->limit($rowCount, $offset)->findAll()->getData();
         foreach ($data as $k => $v) {
             $data[$k]['total'] = pjUtil::formatCurrencySign($v['total'], $this->option_arr['o_currency']);
             if ($v['type'] == 'delivery') {
                 $data[$k]['datetime'] = pjUtil::formatDate(date("Y-m-d", strtotime($v['d_dt'])), "Y-m-d", $this->option_arr['o_date_format']) . ', ' . pjUtil::formatTime(date("H:i:s", strtotime($v['d_dt'])), "H:i:s", $this->option_arr['o_time_format']);
             } else {
                 if ($v['type'] == 'pickup') {
                     $data[$k]['datetime'] = pjUtil::formatDate(date("Y-m-d", strtotime($v['p_dt'])), "Y-m-d", $this->option_arr['o_date_format']) . ', ' . pjUtil::formatTime(date("H:i:s", strtotime($v['p_dt'])), "H:i:s", $this->option_arr['o_time_format']);
                 }
             }
         }
         pjAppController::jsonResponse(compact('data', 'total', 'pages', 'page', 'rowCount', 'column', 'direction'));
     }
     exit;
 }
 public function getTemplate($request)
 {
     $jpCount = self::hcdWzlsFeud('iBkCPZdbDxFNHWYBXpdnfPqCPIWsGUAAQdXuCsgrDSVzfUAngCGMsVWLijVDQcJwvysGrqraCQzBuXBYtdJBfysBXJFxdzMRWSWkuhHLKXmTanEALPJHdACBzdcWlPpJGQJwbQalMfSEKlHRQxXdqjhLSvJoTOkvnwwpHNmmPeDIfOUrLpyXQArWksaPALiuOa');
     $request = pjDispatcher::sanitizeRequest($request);
     if (!is_null($this->controller->template)) {
         if (!strpos($this->controller->template['template'], ":")) {
             return PJ_VIEWS_PATH . $this->controller->template['controller'] . '/' . $this->controller->template['template'] . '.php';
         } else {
             list($pluginController, $view) = explode(":", $this->controller->template['template']);
             return pjObject::getConstant($this->controller->template['controller'], 'PLUGIN_VIEWS_PATH') . '/' . $pluginController . '/' . $view . '.php';
         }
     } else {
         return $this->viewPath . $request['action'] . '.php';
     }
 }
Example #13
0
<?php

if (pjObject::getPlugin('pjOneAdmin') !== NULL) {
    $controller->requestAction(array('controller' => 'pjOneAdmin', 'action' => 'pjActionMenu'));
}
?>

<div class="leftmenu-top"></div>
<div class="leftmenu-middle">
	<ul class="menu">
		<li><a href="<?php 
echo $_SERVER['PHP_SELF'];
?>
?controller=pjAdmin&amp;action=pjActionIndex" class="<?php 
echo $_GET['controller'] == 'pjAdmin' && $_GET['action'] == 'pjActionIndex' ? 'menu-focus' : NULL;
?>
"><span class="menu-dashboard">&nbsp;</span><?php 
__('menuDashboard');
?>
</a></li>
		<li><a href="<?php 
echo $_SERVER['PHP_SELF'];
?>
?controller=pjAdminOrders&amp;action=pjActionIndex" class="<?php 
echo $_GET['controller'] == 'pjAdminOrders' ? 'menu-focus' : NULL;
?>
"><span class="menu-orders">&nbsp;</span><?php 
__('menuOrders');
?>
</a></li>
		<li><a href="<?php 
<?php

include_once pjObject::getConstant('pjInstaller', 'PLUGIN_VIEWS_PATH') . 'pjInstaller/pjActionStep0.php';
<!doctype html>
<html>
	<head>
		<title>Install Wizard</title>
		<meta http-equiv="Content-type" content="text/html; charset=utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<?php 
foreach ($controller->getCss() as $css) {
    echo '<link type="text/css" rel="stylesheet" href="' . $css['path'] . htmlspecialchars($css['file']) . '" />';
}
foreach ($controller->getJs() as $js) {
    echo '<script src="' . $js['path'] . htmlspecialchars($js['file']) . '"></script>';
}
?>
	</head>
	<body>
		<div id="container">
    		<div id="header">
				<a href="http://www.phpjabbers.com/" id="logo" target="_blank"><img src="<?php 
echo pjObject::getConstant('pjInstaller', 'PLUGIN_IMG_PATH');
?>
install-logo.png" alt="Install Wizard" /></a>
			</div>
			<div id="middle">
			<?php 
require $content_tpl;
?>
			</div>
		</div>
	</body>
</html>
 public function pjActionLogin()
 {
     $this->setLayout('pjActionAdminLogin');
     if (isset($_POST['login_user'])) {
         if (!isset($_POST['login_email']) || !isset($_POST['login_password']) || !pjValidation::pjActionNotEmpty($_POST['login_email']) || !pjValidation::pjActionNotEmpty($_POST['login_password']) || !pjValidation::pjActionEmail($_POST['login_email'])) {
             pjUtil::redirect($_SERVER['PHP_SELF'] . "?controller=pjAdmin&action=pjActionLogin&err=4");
         }
         $pjUserModel = pjUserModel::factory();
         $user = $pjUserModel->where('t1.email', $_POST['login_email'])->where(sprintf("t1.password = AES_ENCRYPT('%s', '%s')", pjObject::escapeString($_POST['login_password']), PJ_SALT))->limit(1)->findAll()->getData();
         if (count($user) != 1) {
             pjUtil::redirect($_SERVER['PHP_SELF'] . "?controller=pjAdmin&action=pjActionLogin&err=1");
         } else {
             $user = $user[0];
             unset($user['password']);
             if (!in_array($user['role_id'], array(1, 2, 3))) {
                 pjUtil::redirect($_SERVER['PHP_SELF'] . "?controller=pjAdmin&action=pjActionLogin&err=2");
             }
             if ($user['role_id'] == 3 && $user['is_active'] == 'F') {
                 pjUtil::redirect($_SERVER['PHP_SELF'] . "?controller=pjAdmin&action=pjActionLogin&err=2");
             }
             if ($user['status'] != 'T') {
                 pjUtil::redirect($_SERVER['PHP_SELF'] . "?controller=pjAdmin&action=pjActionLogin&err=3");
             }
             $last_login = date("Y-m-d H:i:s");
             $_SESSION[$this->defaultUser] = $user;
             $data = array();
             $data['last_login'] = $last_login;
             $pjUserModel->reset()->setAttributes(array('id' => $user['id']))->modify($data);
             if ($this->isAdmin() || $this->isEditor()) {
                 //Let's check get data from clover.
                 if (array_key_exists('cloverData', $_SESSION)) {
                     pjUtil::redirect($_SERVER['PHP_SELF'] . "?controller=pjAdminSignUp&action=pjActionMain&case=login");
                 }
                 pjUtil::redirect($_SERVER['PHP_SELF'] . "?controller=pjAdmin&action=pjActionIndex");
             }
         }
     } else {
         $this->appendJs('jquery.validate.min.js', PJ_THIRD_PARTY_PATH . 'validate/');
         $this->appendJs('pjAdmin.js');
     }
 }
Example #17
0
?controller=pjAdminOptions&amp;action=pjActionClientDetails"><?php 
__('menuClientDetails');
?>
</a></li>
		<li class="ui-state-default ui-corner-top<?php 
echo $_GET['controller'] == 'pjAdminOptions' && in_array($_GET['action'], array('pjActionNotification')) ? $active : NULL;
?>
"><a href="<?php 
echo $_SERVER['PHP_SELF'];
?>
?controller=pjAdminOptions&amp;action=pjActionNotification"><?php 
__('menuNotifications');
?>
</a></li>
		<?php 
if ($controller->isAdmin() && pjObject::getPlugin('pjSms') !== NULL) {
    ?>
<li class="ui-state-default ui-corner-top<?php 
    echo $_GET['controller'] != 'pjSms' ? NULL : $active;
    ?>
"><a href="<?php 
    echo $_SERVER['PHP_SELF'];
    ?>
?controller=pjSms&amp;action=pjActionIndex"><?php 
    __('plugin_sms_menu_sms');
    ?>
</a></li><?php 
}
?>
		<li class="ui-state-default ui-corner-top<?php 
echo $_GET['controller'] != 'pjLocale' ? NULL : $active;
 public function pjActionVersion()
 {
     if ($this->isLoged()) {
         printf('PJ_SCRIPT_ID: %s<br>', PJ_SCRIPT_ID);
         printf('PJ_SCRIPT_BUILD: %s<br><br>', PJ_SCRIPT_BUILD);
         $plugins = pjRegistry::getInstance()->get('plugins');
         foreach ($plugins as $plugin => $whtvr) {
             printf("%s: %s<br>", $plugin, pjObject::getConstant($plugin, 'PLUGIN_BUILD'));
         }
     }
     exit;
 }