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


PHP sapp_Global::generateSiteConstants方法代码示例

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


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

示例1: save

 public function save($systempreferenceform)
 {
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
     }
     if ($systempreferenceform->isValid($this->_request->getPost())) {
         $trDb = Zend_Db_Table::getDefaultAdapter();
         // starting transaction
         $trDb->beginTransaction();
         try {
             $systempreferencemodel = new Default_Model_Sitepreference();
             $id = (int) $this->_request->getParam('id');
             $id = abs($id);
             $dateformatid = $this->_request->getParam('dateformatid');
             $timeformatid = $this->_request->getParam('timeformatid');
             $timezoneid = $this->_request->getParam('timezoneid');
             $currencyid = $this->_request->getParam('currencyid');
             $passwordid = $this->_request->getParam('passwordid');
             $description = $this->_request->getParam('description');
             $date = new Zend_Date();
             $menumodel = new Default_Model_Menu();
             $actionflag = '';
             $tableid = '';
             $data = array('dateformatid' => $dateformatid, 'timeformatid' => $timeformatid, 'timezoneid' => $timezoneid, 'currencyid' => $currencyid, 'passwordid' => $passwordid, 'description' => $description, 'modifiedby' => $loginUserId, 'modifieddate' => $date->get('yyyy-MM-dd HH:mm:ss'));
             if ($id != '') {
                 $data['createdby'] = $loginUserId;
                 $data['createddate'] = $date->get('yyyy-MM-dd HH:mm:ss');
                 $data['isactive'] = 1;
                 $where = '';
                 $actionflag = 2;
             } else {
                 $data['createdby'] = $loginUserId;
                 $data['createddate'] = $date->get('yyyy-MM-dd HH:mm:ss');
                 $data['isactive'] = 1;
                 $where = '';
                 $actionflag = 1;
             }
             $update_arr = array('isactive' => 0, 'modifieddate' => $date->get('yyyy-MM-dd HH:mm:ss'), 'modifiedby' => $loginUserId);
             $systempreferencemodel->SaveorUpdateSystemPreferanceData($update_arr, 'isactive = 1');
             $Id = $systempreferencemodel->SaveorUpdateSystemPreferanceData($data, $where);
             if ($id != '') {
                 $tableid = $id;
                 $tableid = $tableid + 1;
                 $this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Site preferences updated successfully."));
             } else {
                 $tableid = $Id;
                 $this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Site preferences added successfully."));
             }
             $menuidArr = $menumodel->getMenuObjID('/sitepreference');
             $menuID = $menuidArr[0]['id'];
             $result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $tableid);
             sapp_Global::generateSiteConstants();
             $trDb->commit();
         } catch (Exception $e) {
             $trDb->rollBack();
             $this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Something went wrong,please try again later."));
         }
         $this->_redirect('sitepreference');
     } else {
         $messages = $systempreferenceform->getMessages();
         foreach ($messages as $key => $val) {
             foreach ($val as $key2 => $val2) {
                 $msgarray[$key] = $val2;
                 break;
             }
         }
         return $msgarray;
     }
 }
开发者ID:rajbrt,项目名称:sentrifugo,代码行数:70,代码来源:SitepreferenceController.php

示例2: savesitepreference

 public function savesitepreference($wizardpreferenceform, $wizardData)
 {
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
     }
     if ($wizardpreferenceform->isValid($this->_request->getPost())) {
         $trDb = Zend_Db_Table::getDefaultAdapter();
         $trDb->beginTransaction();
         try {
             $systempreferencemodel = new Default_Model_Sitepreference();
             $currencymodel = new Default_Model_Currency();
             $orgInfoModel = new Default_Model_Organisationinfo();
             $wizard_model = new Default_Model_Wizard();
             $IdentityCodesModel = new Default_Model_Identitycodes();
             $employmentstatusmodel = new Default_Model_Employmentstatus();
             $countriesmodel = new Default_Model_Countries();
             $statesmodel = new Default_Model_States();
             $citiesmodel = new Default_Model_Cities();
             $othercurrencyname = $this->_request->getParam('othercurrencyname');
             $othercurrencycode = $this->_request->getParam('othercurrencycode');
             $id = (int) $this->_request->getParam('id');
             $currencyid = (int) $this->_request->getParam('currencyid');
             $organisationid = (int) $this->_request->getParam('organisationid');
             $empcodeid = (int) $this->_request->getParam('empcodeid');
             $dateformatid = $this->_request->getParam('dateformatid');
             $timeformatid = $this->_request->getParam('timeformatid');
             $timezoneid = $this->_request->getParam('timezoneid');
             $currencyname = $this->_request->getParam('currencyname');
             // $currencycode = $this->_request->getParam('currencycode');
             $passwordid = $this->_request->getParam('passwordid');
             $perm_country = $this->_request->getParam('perm_country');
             $perm_stateparam = $this->_request->getParam('perm_state');
             $perm_stateArr = explode("!@#", $this->_request->getParam('perm_state'));
             $perm_state = $perm_stateArr[0];
             $perm_cityparam = $this->_request->getParam('perm_city');
             $perm_cityArr = explode("!@#", $this->_request->getParam('perm_city'));
             $perm_city = $perm_cityArr[0];
             $employee_code = $this->_request->getParam('employee_code');
             $workcodename = $this->_request->getParam('workcodename');
             $date = new Zend_Date();
             $menumodel = new Default_Model_Menu();
             /*
              * Save or Update - Currency name in currency table based on currency ID
              */
             if ($currencyname == 'other') {
                 $othercurrencydata = array('currencyname' => trim($othercurrencyname), 'currencycode' => trim($othercurrencycode), 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"), 'createdby' => $loginUserId, 'createddate' => gmdate("Y-m-d H:i:s"));
                 $currencywhere = '';
                 $CurrencyId = $currencymodel->SaveorUpdateCurrencyData($othercurrencydata, $currencywhere);
             }
             /*
              * End 
              */
             /*
              * Start -  Updating and Inserting Site Preference Data after fetching currency id
              */
             if ($id != '') {
                 $where = array('id' => $id);
                 // $actionflag = 2;
             } else {
                 $where = '';
                 //$actionflag = 1;
             }
             $siteprference_data = array('dateformatid' => $dateformatid, 'timeformatid' => $timeformatid, 'timezoneid' => $timezoneid, 'currencyid' => $currencyname == 'other' ? $CurrencyId : $currencyname, 'passwordid' => $passwordid, 'createdby' => $loginUserId, 'createddate' => $date->get('yyyy-MM-dd HH:mm:ss'), 'modifiedby' => $loginUserId, 'modifieddate' => $date->get('yyyy-MM-dd HH:mm:ss'), 'isactive' => 1);
             $site_update_arr = array('isactive' => 0, 'modifieddate' => $date->get('yyyy-MM-dd HH:mm:ss'), 'modifiedby' => $loginUserId);
             $systempreferencemodel->SaveorUpdateSystemPreferanceData($site_update_arr, 'isactive = 1');
             $Id = $systempreferencemodel->SaveorUpdateSystemPreferanceData($siteprference_data, $where);
             sapp_Global::generateSiteConstants();
             /*
              *  End
              */
             /*
              * Updating Country,state and city based on organisation id
              */
             // Inserting into main_countries if not added
             $countryExistsArr = $countriesmodel->getActiveCountryName($perm_country);
             if (empty($countryExistsArr)) {
                 $countrynamearr = $countriesmodel->getCountryCode($perm_country);
                 if (!empty($countrynamearr)) {
                     $country_data = array('country' => trim($countrynamearr[0]['country_name']), 'countrycode' => trim($countrynamearr[0]['country_code']), 'citizenship' => NULL, 'createdby' => $loginUserId, 'createddate' => $date->get('yyyy-MM-dd HH:mm:ss'), 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"), 'country_id_org' => $perm_country, 'isactive' => 1);
                     $Country_Id = $countriesmodel->SaveorUpdateCountryData($country_data, '');
                 }
             }
             // Inserting into main_state if not added
             $State_Id = $statesmodel->SaveorUpdateStatesData($perm_country, $perm_stateArr[1], $perm_state, $loginUserId);
             // Inserting into main_cities if not added
             $City_Id = $citiesmodel->SaveorUpdateCitiesData($perm_country, $perm_state, $perm_cityArr[1], $perm_city, $loginUserId);
             $location_data = array('country' => $perm_country, 'state' => $perm_state, 'city' => $perm_city, 'createdby' => $loginUserId, 'createddate' => $date->get('yyyy-MM-dd HH:mm:ss'), 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"), 'isactive' => 1);
             if ($organisationid != '') {
                 $locwhere = array('id=?' => $organisationid);
                 $LocationId = $orgInfoModel->SaveorUpdateData($location_data, $locwhere);
             }
             $LocationId = $wizard_model->SaveorUpdateWizardData($location_data, '');
             /*
              * End
              */
             /*
              * Start - Updating Employee Code
              */
             $empcode_data = array('employee_code' => trim($employee_code), 'modifiedBy' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"));
//.........这里部分代码省略.........
开发者ID:rajbrt,项目名称:sentrifugo,代码行数:101,代码来源:WizardController.php


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