public function pjActionInstall()
 {
     $this->checkLogin();
     if ($this->isAdmin()) {
         $user_id = $_SESSION['admin_user']['id'];
         $locale_arr = pjLocaleModel::factory()->select('t1.*, t2.title')->join('pjLocaleLanguage', 't2.iso=t1.language_iso', 'left outer')->orderBy('t1.sort ASC')->findAll()->getData();
         $pjMerchantModel = pjMerchantModel::factory()->where('user_id', $user_id)->findAll()->getData();
         $user = array('user_id' => $user_id, 'merchant_name' => $pjMerchantModel[0]['merchant_name']);
         $this->set('locale_arr', $locale_arr);
         $this->set('user_arr', $user);
         $this->appendJs('pjAdminOptions.js');
     } else {
         $this->set('status', 2);
     }
 }
 public function pjActionUpdate()
 {
     $this->checkLogin();
     if ($this->isAdmin()) {
         if (isset($_POST['merchant_update'])) {
             pjMerchantModel::factory()->where('merchant_id', $_POST['id'])->limit(1)->modifyAll($_POST);
             pjUtil::redirect(PJ_INSTALL_URL . "index.php?controller=pjAdminMerchant&action=pjActionIndex&err=AU01");
         } else {
             $arr = pjMerchantModel::factory()->find($_GET['id'])->getData();
             if (count($arr) === 0) {
                 pjUtil::redirect(PJ_INSTALL_URL . "index.php?controller=pjAdminMerchant&action=pjActionIndex&err=AU08");
             }
             $this->set('arr', $arr);
             $this->set('role_arr', pjRoleModel::factory()->orderBy('t1.id ASC')->findAll()->getData());
             $this->appendJs('jquery.validate.min.js', PJ_THIRD_PARTY_PATH . 'validate/');
             $this->appendJs('pjAdminMerchant.js');
         }
     } else {
         $this->set('status', 2);
     }
 }