当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Session_Namespace::lock方法代码示例

本文整理汇总了PHP中Zend_Session_Namespace::lock方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Session_Namespace::lock方法的具体用法?PHP Zend_Session_Namespace::lock怎么用?PHP Zend_Session_Namespace::lock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Session_Namespace的用法示例。


在下文中一共展示了Zend_Session_Namespace::lock方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: indexAction

 public function indexAction()
 {
     // action body
     //create sesesion
     $session_search_user = new Zend_Session_Namespace('search_user');
     if (empty($session_search_user->limit)) {
         $session_search_user->limit = Application_Form_FrmNavigation::getLimit();
         $session_search_user->active = -1;
         $session_search_user->user_type = -1;
         $session_search_user->txtsearch = '';
         $session_search_user->lock();
     }
     //start page nevigation
     $limit = $session_search_user->limit;
     $start = $this->getRequest()->getParam('limit_satrt', 0);
     $db_user = new Application_Model_DbTable_DbUsers();
     $this->view->activelist = $this->activelist;
     $this->view->active = $session_search_user->active;
     $this->view->user_typelist = $this->user_typelist;
     $this->view->user_type = $session_search_user->user_type;
     if ($this->getRequest()->isPost()) {
         $user_seach_data = $this->getRequest()->getPost();
         //set session when submit
         $session_search_user->unlock();
         $session_search_user->limit = $user_seach_data['rows_per_page'];
         $session_search_user->active = $user_seach_data['active'];
         $session_search_user->user_type = $user_seach_data['user_type'];
         $session_search_user->txtsearch = $user_seach_data['txtsearch'];
         $session_search_user->lock();
         //set value for display
         $this->view->txtsearch = $user_seach_data['txtsearch'];
         $this->view->active = $user_seach_data['active'];
         $this->view->user_type = $user_seach_data['user_type'];
         $limit = $user_seach_data['rows_per_page'];
         $users = $db_user->getUserListBy($user_seach_data, $start, $limit);
         $record_count = $db_user->getUserListTotal($user_seach_data);
     } else {
         if ($session_search_user->active > -1 || $session_search_user->user_type > -1 || !empty($session_search_user->txtsearch)) {
             $user_seach_data = array('active' => $session_search_user->active, 'user_type' => $session_search_user->user_type, 'txtsearch' => $session_search_user->txtsearch);
             $users = $db_user->getUserListBy($user_seach_data, $start, $limit);
             $record_count = $db_user->getUserListTotal($user_seach_data);
         } else {
             $users = $db_user->getUserList($start, $limit);
             $record_count = $db_user->getUserListTotal();
         }
     }
     $result = array();
     $row_num = $start;
     foreach ($users as $i => $user) {
         $result[$i] = array('num' => ++$row_num, 'name' => $user['name'], 'id' => $user['id'], 'user_name' => $user['user_name'], 'active' => $this->activelist[$user['active']], 'user_type' => $this->user_typelist[$user['user_type']]);
     }
     $this->view->userlist = Zend_Json::encode($result);
     $page = new Application_Form_FrmNavigation(self::REDIRECT_URL, $start, $limit, $record_count);
     $page->init(self::REDIRECT_URL, $start, $limit, $record_count);
     $this->view->nevigation = $page->navigationPage();
     $this->view->rows_per_page = $page->getRowsPerPage($limit, 'frmlist_users');
     $this->view->result_row = $page->getResultRows();
 }
开发者ID:samlanh,项目名称:currencyms,代码行数:58,代码来源:IndexController.php

示例2: indexAction

 public function indexAction()
 {
     // action body
     //create sesesion
     $session_search_agent = new Zend_Session_Namespace('search_agent');
     if (empty($session_search_agent->limit)) {
         $session_search_agent->limit = Application_Form_FrmNavigation::getLimit();
         $session_search_agent->active = -1;
         $session_search_agent->province = -1;
         $session_search_agent->txtsearch = '';
         $session_search_agent->lock();
     }
     //start page nevigation
     $limit = $session_search_agent->limit;
     $start = $this->getRequest()->getParam('limit_satrt', 0);
     $pro = new Application_Model_DbTable_DbProvinces();
     $this->view->provincelist = $pro->getProvinceList();
     $this->view->province = $session_search_agent->province;
     $db_agent = new Application_Model_DbTable_DbAgents();
     $this->view->activelist = $this->activelist;
     $this->view->active = $session_search_agent->active;
     if ($this->getRequest()->isPost()) {
         $agent_seach_data = $this->getRequest()->getPost();
         //set session when submit
         $session_search_agent->unlock();
         $session_search_agent->limit = $agent_seach_data['rows_per_page'];
         $session_search_agent->active = $agent_seach_data['active'];
         $session_search_agent->province = $agent_seach_data['province'];
         $session_search_agent->txtsearch = $agent_seach_data['txtsearch'];
         $session_search_agent->lock();
         $this->view->province = $agent_seach_data['province'];
         $this->view->txtsearch = $agent_seach_data['txtsearch'];
         $this->view->active = $agent_seach_data['active'];
         $limit = $session_search_agent->limit;
         $agents = $db_agent->getAgentListBy($agent_seach_data, $start, $limit);
         $record_count = $db_agent->getAgentListTotal($agent_seach_data);
     } else {
         if (!empty($session_search_agent->txtsearch) || $session_search_agent->active > -1 || $session_search_agent->province > -1) {
             $agent_seach_data = array('active' => $session_search_agent->active, 'province' => $session_search_agent->province, 'txtsearch' => $session_search_agent->txtsearch);
             $agents = $db_agent->getAgentListBy($agent_seach_data, $start, $limit);
             $record_count = $db_agent->getAgentListTotal($agent_seach_data);
         } else {
             $agents = $db_agent->getAgentList($start, $limit);
             $record_count = $db_agent->getAgentListTotal();
         }
     }
     $result = array();
     $row_num = $start;
     foreach ($agents as $i => $agent) {
         $result[$i] = array('num' => ++$row_num, 'id' => $agent['id'], 'tel' => $agent['tel'], 'name' => $agent['name'], 'proname' => $agent['proname'], 'khan' => $agent['khan'], 'sangkat' => $agent['sangkat'], 'block' => $agent['block']);
     }
     $this->view->agentlist = Zend_Json::encode($result);
     $page = new Application_Form_FrmNavigation(self::REDIRECT_URL, $start, $limit, $record_count);
     $page->init(self::REDIRECT_URL, $start, $limit, $record_count);
     $this->view->nevigation = $page->navigationPage();
     $this->view->rows_per_page = $page->getRowsPerPage($limit, 'frmlist_agent');
     $this->view->result_row = $page->getResultRows();
 }
开发者ID:samlanh,项目名称:currencyms,代码行数:58,代码来源:FundController.php

示例3: submitAction

 /**
  * When the user actually submits their otp, this authenticates it.
  */
 public function submitAction()
 {
     $this->disableLayout();
     $this->disableView();
     Zend_Session::start();
     $mfaSession = new Zend_Session_Namespace('Mfa_Temp_User');
     $user = $mfaSession->Dao;
     if (!isset($user) || !$user) {
         echo JsonComponent::encode(array('status' => 'error', 'message' => 'Session has expired, refresh and try again'));
         return;
     }
     $otpDevice = $this->Mfa_Otpdevice->getByUser($user);
     if (!$otpDevice) {
         throw new Zend_Exception('User does not have an OTP device');
     }
     $token = $this->getParam('token');
     try {
         $valid = $this->ModuleComponent->Otp->authenticate($otpDevice, $token);
     } catch (Zend_Exception $exc) {
         $this->getLogger()->crit($exc->getMessage());
         echo JsonComponent::encode(array('status' => 'error', 'message' => $exc->getMessage()));
         return;
     }
     if ($valid) {
         session_start();
         $authUser = new Zend_Session_Namespace('Auth_User');
         $authUser->setExpirationSeconds(60 * Zend_Registry::get('configGlobal')->session->lifetime);
         $authUser->Dao = $user;
         $authUser->lock();
         $this->getLogger()->debug(__METHOD__ . ' Log in : ' . $user->getFullName());
         echo JsonComponent::encode(array('status' => 'ok'));
     } else {
         echo JsonComponent::encode(array('status' => 'error', 'message' => 'Incorrect token'));
     }
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:38,代码来源:LoginController.php

示例4: offsetSet

 /**
  * Defined by spl ArrayObject.
  * Here we are redefining the action to point to the session namespace
  * 
  * @param string $index
  * @return bool
  */
 public function offsetSet($index, $newval)
 {
     if (self::$_session->isLocked()) {
         self::$_session->unLock();
     }
     self::getSession()->{$index} = $newval;
     self::$_session->lock();
 }
开发者ID:laiello,项目名称:zfx,代码行数:15,代码来源:Session.php

示例5: indexAction

 public function indexAction()
 {
     $this->_helper->layout()->disableLayout();
     ///sopharat disablelayout to display login
     $tr = Application_Form_FrmLanguages::getCurrentlanguage();
     if ($this->getRequest()->isPost()) {
         $formdata = $this->getRequest()->getPost();
         $db_user = new Application_Model_DbTable_DbUsers();
         $email = $formdata['txt_email'];
         $password = $formdata['txt_password'];
         if ($db_user->checkEmail($email)) {
             if ($db_user->userAuthenticate($email, $password)) {
                 $user_id = $db_user->getUserID($email);
                 $user_info = $db_user->getUserInfo($user_id);
                 $arr_acl = $db_user->getArrAcl($user_info['user_type_id']);
                 //in case user have no right to access any module of the system
                 if (!$arr_acl) {
                     $this->view->msg = $tr->translate('LOGIN_FAIL_NO_MODULE');
                 } else {
                     $session_user = new Zend_Session_Namespace('auth');
                     $session_user->unlock();
                     $session_user->user_id = $user_id;
                     $session_user->fullname = $user_info['fullname'];
                     $session_user->user_name = $user_info['username'];
                     $session_user->level = $user_info['user_type_id'];
                     $session_user->user_type = $user_info['user_type'];
                     $session_user->location_id = $user_info['LocationId'];
                     $session_user->email = $email;
                     for ($i = 0; $i < count($arr_acl); $i++) {
                         $arr_module[$i] = $arr_acl[$i]['module'];
                     }
                     $arr_module = array_unique($arr_module);
                     $session_user->arr_acl = $arr_acl;
                     $session_user->arr_module = $arr_module;
                     $session_user->lock();
                     //echo $session_user->user_name;sales/sales-order
                     //echo $session_user->user_id=$user_id;exit();
                     //$_url=($arr_acl[0]!=='')? '/'.$arr_acl[0]['module']:'/default/index/home' ;//before
                     //$_url=($arr_acl[0]!=='')? '/default/index/dashboad':'/default/index/home' ;//after
                     //print_r($arr_acl[0]);
                     //exit();
                     //$this->_redirect("/sales/sales-order");
                     $_url = $arr_acl[0] !== '' ? '/default/index/dashboad' : '/sales/sales-order';
                     //after
                     $this->_redirect($_url);
                 }
             } elseif (!$db_user->checkStatusByEmail($email)) {
                 $this->view->msg = $tr->translate('LOGIN_FAIL_COMFIRM');
             } else {
                 $this->view->msg = $tr->translate('LOGIN_FAIL');
             }
         } else {
             $this->view->msg = $tr->translate('EMAIL_NOT');
         }
     }
 }
开发者ID:pingitgroup,项目名称:stockpingitgroup,代码行数:56,代码来源:IndexController.php

示例6: indexAction

 public function indexAction()
 {
     // action body
     $session_language = new Zend_Session_Namespace('language');
     $lang = $this->getRequest()->getParam('ln');
     $session_language->unlock();
     $session_language->language = $lang;
     $session_language->lock();
     $this->_redirect($_SERVER['HTTP_REFERER']);
     //$this->_response->setRedirect( $_SERVER['HTTP_REFERER'])->sendResponse();
     //exit();
 }
开发者ID:pingitgroup,项目名称:stockpingitgroup,代码行数:12,代码来源:IndexController.php

示例7: indexAction

 public function indexAction()
 {
     // action body
     try {
         $db_tran = new Application_Model_DbTable_DbGlobal();
         //create sesesion
         $session_transfer = new Zend_Session_Namespace('search_acl');
         if (empty($session_transfer->limit)) {
             $session_transfer->limit = Application_Form_FrmNavigation::getLimit();
             $session_transfer->lock();
         }
         $sql = "SELECT `acl_id`,`module`,`controller`,`action`,`status` FROM rsv_acl_acl";
         if ($this->getRequest()->isPost()) {
             $formdata = $this->getRequest()->getPost();
             $session_transfer->unlock();
             $session_transfer->limit = $formdata['rows_per_page'];
             $session_transfer->lock();
         }
         //start page nevigation
         $limit = $session_transfer->limit;
         $start = $this->getRequest()->getParam('limit_satrt', 0);
         $result = $db_tran->getGlobalDbListBy($sql, $start, $limit);
         $record_count = $db_tran->getGlobalDbListTotal($sql);
         $row_num = $start;
         if (empty($result)) {
             $result = array('err' => 1, 'msg' => 'មិន​ទាន់​មាន​ទន្និន័យ​នូវ​ឡើយ​ទេ!');
         }
         //print_r($result); exit;
         $this->view->list = Zend_Json::encode($result);
         $page = new Application_Form_FrmNavigation(self::REDIRECT_URL, $start, $limit, $record_count);
         $page->init(self::REDIRECT_URL, $start, $limit, $record_count);
         $this->view->nevigation = $page->navigationPage();
         $this->view->rows_per_page = $page->getRowsPerPage($limit, 'frmlist');
         $this->view->result_row = $page->getResultRows();
     } catch (Exception $e) {
     }
 }
开发者ID:samlanh,项目名称:currencyms,代码行数:37,代码来源:AclController.php

示例8: returnAction

 public function returnAction()
 {
     $request = $this->getRequest();
     $form = new Application_Form_Returns();
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($request->getPost())) {
             // if form is valid, then save submitted data in a session
             $addRadioFormNamespace = new Zend_Session_Namespace('data');
             $addRadioFormNamespace->postData = $form->getValues();
             $addRadioFormNamespace->lock();
             // redirect to the second stage
             //return $this->_redirect('radio-application/confirm');
         } else {
         }
     }
     $this->view->form = $form;
 }
开发者ID:sharsz01,项目名称:acplZend,代码行数:17,代码来源:ReturnRadioController.php

示例9: authIntercept

 /**
  * When a user logs in, if they have an OTP device we want to override the normal behavior of writing
  * them to the session, and instead write a temporary session entry that will be moved to the expected
  * place only after they successfully pass the OTP challenge.
  */
 public function authIntercept($params)
 {
     $user = $params['user'];
     /** @var Mfa_OtpdeviceModel $otpDeviceModel */
     $otpDeviceModel = MidasLoader::loadModel('Otpdevice', $this->moduleName);
     $otpDevice = $otpDeviceModel->getByUser($user);
     if ($otpDevice) {
         // write temp user into session for asynchronous confirmation
         Zend_Session::start();
         $userSession = new Zend_Session_Namespace('Mfa_Temp_User');
         $userSession->setExpirationSeconds(60 * min(10, Zend_Registry::get('configGlobal')->session->lifetime));
         // "limbo" state should invalidate after 10 minutes
         $userSession->Dao = $user;
         $userSession->lock();
         $resp = JsonComponent::encode(array('dialog' => '/mfa/login/dialog', 'title' => 'Enter One-Time Password', 'options' => array('width' => 250)));
         return array('override' => true, 'response' => $resp);
     } else {
         return array();
     }
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:25,代码来源:Notification.php

示例10: Login

 public function Login($username, $pass)
 {
     $this->conn = new StoredConnections(false);
     $query = "call selectSalt('" . $username . "')";
     $salt = $this->conn->result($query);
     if (!is_array($salt)) {
         $this->test->type = "error";
         $this->test->info = "nouser";
         Zend_Session::destroy(true);
         return $this->test;
     }
     $pasWithSalt = $pass . $salt[0][0];
     $hash = sha1($pasWithSalt);
     $query = "call   selectLoginUser('" . $username . "','" . $hash . "')";
     $loginData = $this->conn->result($query);
     if (!is_array($loginData)) {
         $this->test->type = "error";
         $this->test->info = "nouser";
         Zend_Session::destroy(true);
         return $this->test;
     }
     if ($loginData[0][1] == 0) {
         $this->test->type = "error";
         $this->test->info = "nouser";
         Zend_Session::destroy(true);
         return $this->test;
     }
     $databaseInfo = new Zend_Session_Namespace('DatabaseInfo');
     $databaseInfo->unsetAll();
     $databaseInfo->setExpirationSeconds(2666);
     $databaseInfo->remoteIp = $_SERVER['REMOTE_ADDR'];
     $userData = array();
     $userData[0] = $loginData[0][0];
     $userData[1] = $loginData[0][1];
     $databaseInfo->userData = $userData;
     $databaseInfo->lock();
     $this->test->type = "ok";
     return $this->test;
 }
开发者ID:anhvn,项目名称:bet-script,代码行数:39,代码来源:Login.php

示例11: changepasswordAction

 public function changepasswordAction()
 {
     // action body
     if ($this->getRequest()->isPost()) {
         $session_user = new Zend_Session_Namespace('auth');
         $pass_data = $this->getRequest()->getPost();
         if ($pass_data['password'] == $session_user->pwd) {
             $db_user = new Application_Model_DbTable_DbUsers();
             try {
                 $db_user->changePassword($pass_data['new_password'], $session_user->user_id);
                 $session_user->unlock();
                 $session_user->pwd = $pass_data['new_password'];
                 $session_user->lock();
                 Application_Form_FrmMessage::Sucessfull('ការផ្លាស់ប្តូរដោយជោគជ័យ', self::REDIRECT_URL);
             } catch (Exception $e) {
                 Application_Form_FrmMessage::message('ការផ្លាស់ប្តូរត្រូវបរាជ័យ');
             }
         } else {
             Application_Form_FrmMessage::message('ការផ្លាស់ប្តូរត្រូវបរាជ័យ');
         }
     }
 }
开发者ID:sarankh80,项目名称:lnms,代码行数:22,代码来源:IndexController.php

示例12: testUnsetAllNamespace

 /**
  * test unsetAll keys in default namespace; expect namespace will contain no keys
  *
  * @return void
  */
 public function testUnsetAllNamespace()
 {
     $s = new Zend_Session_Namespace('somenamespace');
     $result = '';
     foreach ($s->getIterator() as $key => $val) {
         $result .= "{$key} === {$val};";
     }
     $this->assertTrue(empty($result), "tearDown failure, found keys in 'somenamespace' namespace: '{$result}'");
     $s->a = 'apple';
     $s->lock();
     $s->unlock();
     $s->p = 'papaya';
     $s->c = 'cherry';
     $s = new Zend_Session_Namespace('somenamespace');
     $result = '';
     foreach ($s->getIterator() as $key => $val) {
         $result .= "{$key} === {$val};";
     }
     $this->assertTrue($result === 'a === apple;p === papaya;c === cherry;', "unsetAll() setup for test failed: '{$result}'");
     $s->unsetAll();
     $result = '';
     foreach ($s->getIterator() as $key => $val) {
         $result .= "{$key} === {$val};";
     }
     $this->assertTrue(empty($result), "unsetAll() did not remove keys from namespace: '{$result}'");
 }
开发者ID:jsnshrmn,项目名称:Suma,代码行数:31,代码来源:SessionTest.php

示例13: header

if (empty($_GET['key']) || empty($_GET['iv'])) {
    //No key exists...we have a problem
    $loggers['audit']->error('Attempted access to student read-only session without key.');
    header('location: https://' . URL_PHP . '/error-external.php?eid=R9001');
    exit;
}
$student = mcrypt_decrypt(MCRYPT_BLOWFISH, hash('md5', HASH_GENERATION_RANDOM_STRING), base64_decode($_GET['key']), MCRYPT_MODE_ECB, base64_decode($_GET['iv']));
$student = unserialize($student);
$log_in = $model->validateUserForReadOnlySession($student);
if (!$log_in) {
    //No student found...we have a problem
    $loggers['audit']->warning("Attempted access to student read-only session for invalid student {$student['student_num']}.");
    header('location: https://' . URL_PHP . '/error-external.php?eid=R9002');
    exit;
}
$loggers['audit']->info('Student read-only session initiated.');
$SESSION = new \Zend_Session_Namespace('student', true);
foreach ($log_in as $key => $value) {
    $SESSION->{$key} = $value;
}
$SESSION->logged_in = md5(uniqid(microtime()) . $_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT']);
$SESSION->user_id = $student['student_num'];
if ($SESSION->corr_lang == "E") {
    $SESSION->corr_lang = "en-CA";
} elseif ($SESSION->corr_lang == "F") {
    $SESSION->corr_lang = "fr-CA";
}
$SESSION->read_only = 1;
$SESSION->lock();
header('location:dashboard.php');
die;
开发者ID:hughnguy,项目名称:php,代码行数:31,代码来源:read-only-session.php

示例14: indexAction

 public function indexAction()
 {
     try {
         $db_tran = new Application_Model_DbTable_Dbpsc();
         //create sesesion
         $session_capital = new Zend_Session_Namespace('search_capital');
         if (empty($session_capital->limit)) {
             $session_capital->limit = Application_Form_FrmNavigation::getLimit();
             $session_capital->type_money = -1;
             $session_capital->staff_name = -1;
             $session_capital->from_date = date('Y-m-d');
             $session_capital->to_date = date('Y-m-d');
             $session_capital->lock();
         }
         //start page nevigation
         $limit = $session_capital->limit;
         $start = $this->getRequest()->getParam('limit_satrt', 0);
         $this->view->from_date = $session_capital->from_date;
         $this->view->to_date = $session_capital->to_date;
         $this->view->staff = $session_capital->staff;
         $cur = new Application_Model_DbTable_DbCurrencies();
         $this->view->currencylist = $cur->getCurrencyList();
         $this->view->type_money = $session_capital->type_money;
         if ($this->getRequest()->isPost()) {
             $formdata = $this->getRequest()->getPost();
             $session_capital->unlock();
             $session_capital->limit = $formdata['rows_per_page'];
             $session_capital->type_money = $formdata['type_money'];
             $session_capital->staff_name = $formdata['staff_name'];
             $session_capital->from_date = $formdata['from_date'];
             $session_capital->to_date = $formdata['to_date'];
             $session_capital->lock();
             $this->view->type_money = $formdata['type_money'];
             $this->view->staff_name = $formdata['staff_name'];
             $this->view->from_date = $session_capital->from_date;
             $this->view->to_date = $session_capital->to_date;
             $limit = $session_capital->limit;
         } else {
             $formdata = array('from_date' => $session_capital->from_date, 'to_date' => $session_capital->to_date, 'type_money' => $session_capital->type_money, 'staff_name' => $session_capital->staff_name);
         }
         $trans = $db_tran->getPscAmountListBy($formdata, $start, $limit);
         $record_count = $db_tran->getAllPscList($formdata);
         $result = array();
         $row_num = $start;
         if (!empty($trans)) {
             foreach ($trans as $i => $tran) {
                 $expired = '';
                 $is_expired = 0;
                 $volum = Application_Model_DbTable_DbGlobal::CurrencyOption($tran['currency_type'], $tran['volum']);
                 $result[$i] = array('num' => ++$row_num, 'id' => $tran['id'], 'staff_name' => $tran['staff_name'], 'currency_type' => $this->curr_type[$tran['currency_type']], 'volum' => number_format($volum) . ' ' . $this->curr_type[$tran['currency_type']], 'psc_amount' => $tran['psc_amount'] . " សន្លឹក", 'total_amount' => number_format($volum * $tran['psc_amount']) . ' ' . $this->curr_type[$tran['currency_type']], 'note' => $tran['note'], 'date' => date_format(date_create($tran['date']), "d/m/Y"), 'img' => $tran['id']);
             }
         } else {
             $result = array('err' => 1, 'msg' => 'មិន​ទាន់​មាន​ទន្និន័យ​នូវ​ឡើយ​ទេ!');
         }
         $this->view->tranlist = Zend_Json::encode($result);
         $page = new Application_Form_FrmNavigation(self::REDIRECT_URL, $start, $limit, $record_count);
         $page->init(self::REDIRECT_URL, $start, $limit, $record_count);
         $this->view->nevigation = $page->navigationPage();
         $this->view->rows_per_page = $page->getRowsPerPage($limit, 'frmlist_mt');
         $this->view->result_row = $page->getResultRows();
         $usr_mod = new Application_Model_DbTable_DbUsers();
         $user_list = $usr_mod->getUserListSelect();
         array_unshift($user_list, array('id' => '-1', "name" => "ជ្រើសរើសឈ្មោះបុគ្គលិក"));
         $this->view->users = $user_list;
         $session_user = new Zend_Session_Namespace('auth');
         $this->view->user_name = $session_user->last_name . ' ' . $session_user->first_name;
         $db_keycode = new Application_Model_DbTable_DbKeycode();
         $this->view->keycode = $db_keycode->getKeyCodeMiniInv();
         $this->view->rpt_list = $db_tran->countAllStaffpcsAmount($formdata);
         $this->view->curr_type = $this->curr_typesimble;
     } catch (Exception $e) {
     }
 }
开发者ID:samlanh,项目名称:currencyms,代码行数:73,代码来源:TransferController.php

示例15: indexAction

 public function indexAction()
 {
     try {
         $db_tran = new Application_Model_DbTable_DbKbank();
         //create sesesion
         $search_kbank = new Zend_Session_Namespace('search_kbank');
         if (empty($search_kbank->limit)) {
             $search_kbank->limit = Application_Form_FrmNavigation::getLimit();
             $search_kbank->type_money = -1;
             $search_kbank->txtsearch = "";
             $search_kbank->from_date = date('Y-m-d');
             $search_kbank->to_date = date('Y-m-d');
             $search_kbank->sender = -1;
             $search_kbank->lock();
         }
         //start page nevigation
         $limit = $search_kbank->limit;
         $start = $this->getRequest()->getParam('limit_satrt', 0);
         $this->view->from_date = $search_kbank->from_date;
         $this->view->to_date = $search_kbank->to_date;
         $this->view->sender_id = $search_kbank->sender;
         $cur = new Application_Model_DbTable_DbCurrencies();
         $this->view->currencylist = $cur->getCurrencyList();
         $this->view->type_money = $search_kbank->type_money;
         $this->view->statuslist = $this->statuslist;
         $this->view->txtsearch = $search_kbank->txtsearch;
         if ($this->getRequest()->isPost()) {
             $formdata = $this->getRequest()->getPost();
             // 				print_r($formdata);
             $search_kbank->unlock();
             $search_kbank->txtsearch = $formdata['txt_search'];
             $search_kbank->limit = $formdata['rows_per_page'];
             $search_kbank->type_money = $formdata['type_money'];
             $search_kbank->from_date = $formdata['from_date'];
             $search_kbank->to_date = $formdata['to_date'];
             $search_kbank->sender = $formdata['sender'];
             $search_kbank->lock();
             $this->view->txtsearch = $formdata['txt_search'];
             $this->view->type_money = $formdata['type_money'];
             $this->view->sender_id = $formdata['sender'];
             $this->view->from_date = $search_kbank->from_date;
             $this->view->to_date = $search_kbank->to_date;
             $limit = $search_kbank->limit;
             $trans = $db_tran->getTransactionListBy($formdata, $start, $limit);
             $record_count = $db_tran->getTransactionListTotal($formdata);
         } else {
             $formdata = array('txt_search' => $search_kbank->txtsearch, 'tran_type' => $search_kbank->tran_type, 'from_date' => $search_kbank->from_date, 'to_date' => $search_kbank->to_date, 'type_money' => $search_kbank->type_money, 'sender' => $search_kbank->sender);
             $trans = $db_tran->getTransactionListBy($formdata, $start, $limit);
             $record_count = $db_tran->getTransactionListTotal($formdata);
         }
         $result = array();
         $row_num = $start;
         if (!empty($trans)) {
             foreach ($trans as $i => $tran) {
                 $expired = '';
                 $is_expired = 0;
                 $amount = $tran['symbol'] . ' ' . number_format($tran['money_inaccount']);
                 $sub_agent = empty($tran['subname']) ? "" : "(" . $tran['subname'] . ")";
                 $inc_no = sprintf("%'010s", $tran['invoice']);
                 $current_date = $search_kbank->to_date;
                 $current_date = date_format(date_create($current_date), "d/m/Y");
                 if ($current_date >= date_format(date_create($tran['end_date']), "d/m/Y")) {
                     $expired = $current_date - date_format(date_create($tran['end_date']), "d/m/Y");
                     if ($expired == 0) {
                         $expired = 'ថ្ងៃនេះ';
                     } else {
                         $expired .= ' ថ្ងៃ';
                     }
                     $is_expired = 1;
                 }
                 $result[$i] = array('num' => ++$row_num, 'id' => $tran['id'], 'sender_name' => $tran['sender_name'], 'tel' => $tran['tel'], 'account_no' => $tran['acc_no'], 'invoice' => $tran['invoice'], 'amount' => $amount, 'start_date' => date_format(date_create($tran['start_date']), "d/m/Y"), 'expired_date' => date_format(date_create($tran['end_date']), "d/m/Y"), 'amount_month' => $tran['amount_month'] . ' ' . $this->pay_term[$tran['pay_term']], 'amount_expired' => $expired, 'is_expired' => $is_expired, 'is_extend' => $tran["is_extend"] == 1 ? "ពន្យា" : "ផ្ញើរ");
             }
         } else {
             $result = array('err' => 1, 'msg' => 'មិន​ទាន់​មាន​ទន្និន័យ​នូវ​ឡើយ​ទេ!');
         }
         $this->view->tranlist = Zend_Json::encode($result);
         $page = new Application_Form_FrmNavigation(self::REDIRECT_URL, $start, $limit, $record_count);
         $page->init(self::REDIRECT_URL, $start, $limit, $record_count);
         $this->view->nevigation = $page->navigationPage();
         $this->view->rows_per_page = $page->getRowsPerPage($limit, 'frmlist_mt');
         $this->view->result_row = $page->getResultRows();
         $sender = new Application_Model_DbTable_DbSender();
         $_sender = $sender->getAllSenderKbank();
         array_unshift($_sender, array('id' => '-1', "name" => "ជ្រើសរើសឈ្មោះអ្នកផ្ញើរ"));
         $this->view->sender = $_sender;
     } catch (Exception $e) {
     }
 }
开发者ID:samlanh,项目名称:currencyms,代码行数:88,代码来源:IndexController.php


注:本文中的Zend_Session_Namespace::lock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。