本文整理汇总了PHP中Default_Model_Countries::fetchAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Default_Model_Countries::fetchAll方法的具体用法?PHP Default_Model_Countries::fetchAll怎么用?PHP Default_Model_Countries::fetchAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Default_Model_Countries
的用法示例。
在下文中一共展示了Default_Model_Countries::fetchAll方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configureorganisationAction
public function configureorganisationAction()
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserRole = $auth->getStorage()->read()->emprole;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
$popConfigPermission = array();
$new_stateId = '';
if (sapp_Global::_checkprivileges(COUNTRIES, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'country');
}
if (sapp_Global::_checkprivileges(STATES, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'state');
}
if (sapp_Global::_checkprivileges(CITIES, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'city');
}
$msgarray = array();
$new_stateId = '';
$new_cityId = '';
$id = $this->getRequest()->getParam('id');
$form = new Default_Form_Organisationinfo();
$orgInfoModel = new Default_Model_Organisationinfo();
$countriesModel = new Default_Model_Countries();
$statesmodel = new Default_Model_States();
$citiesmodel = new Default_Model_Cities();
$wizard_model = new Default_Model_Wizard();
$wizardData = $wizard_model->getWizardData();
$orginfodata = $orgInfoModel->getOrganisationInfo();
$allCountriesData = $countriesModel->fetchAll('isactive=1', 'country')->toArray();
$allStatesData = $statesmodel->fetchAll('isactive=1', 'state')->toArray();
$allCitiesData = $citiesmodel->fetchAll('isactive=1', 'city')->toArray();
$form->setAttrib('action', DOMAIN . 'wizard/configureorganisation');
$flag = 'true';
if (empty($allCountriesData)) {
$msgarray['country'] = 'Countries are not configured yet.';
$flag = 'false';
}
if (empty($allStatesData)) {
$msgarray['state'] = 'States are not configured yet.';
$flag = 'false';
}
if (empty($allCitiesData)) {
$msgarray['city'] = 'Cities are not configured yet.';
$flag = 'false';
}
if (!empty($orginfodata)) {
try {
$data = $orginfodata[0];
$data['org_startdate'] = sapp_Global::change_date($data['org_startdate'], 'view');
$form->populate($data);
$countryId = $data['country'];
$stateId = $data['state'];
$cityId = $data['city'];
$actionpage = 'edit';
if (count($_POST) > 0) {
$countryId = isset($_POST['country']) ? $_POST['country'] : "";
$stateId = isset($_POST['state']) ? $_POST['state'] : "";
$cityId = isset($_POST['city']) ? $_POST['city'] : "";
}
if ($countryId != '') {
$statesData = $statesmodel->getBasicStatesList((int) $countryId);
foreach ($statesData as $res) {
if ($stateId == $res['state_id_org']) {
$new_stateId = $res['state_id_org'] . '!@#' . utf8_encode($res['state']);
}
$form->state->addMultiOption($res['state_id_org'] . '!@#' . utf8_encode($res['state']), utf8_encode($res['state']));
}
if (count($_POST) == 0) {
$stateId = $new_stateId;
}
}
if ($stateId != '') {
$citiesData = $citiesmodel->getBasicCitiesList((int) $stateId);
foreach ($citiesData as $res) {
if ($cityId == $res['city_org_id']) {
$new_cityId = $res['city_org_id'] . '!@#' . utf8_encode($res['city']);
}
$form->city->addMultiOption($res['city_org_id'] . '!@#' . utf8_encode($res['city']), utf8_encode($res['city']));
}
if (count($_POST) == 0) {
$cityId = $new_cityId;
}
}
$form->setDefault('country', $countryId);
$form->setDefault('state', $stateId);
$form->setDefault('city', $cityId);
$this->view->domainValue = $data['domain'];
$this->view->org_image = $data['org_image'];
$this->view->ermsg = '';
$this->view->datarr = $data;
} catch (Exception $e) {
$this->view->ermsg = 'nodata';
}
} else {
sapp_Global::buildlocations($form, $wizardData);
}
$this->view->form = $form;
//.........这里部分代码省略.........
示例2: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('action', BASE_URL . 'businessunits/edit');
$this->setAttrib('id', 'formid');
$this->setAttrib('name', 'businessunits');
$id = new Zend_Form_Element_Hidden('id');
$unitname = new Zend_Form_Element_Text('unitname');
$unitname->setAttrib('maxLength', 50);
$unitname->addFilter(new Zend_Filter_StringTrim());
$unitname->setRequired(true);
$unitname->addValidator('NotEmpty', false, array('messages' => 'Please enter name.'));
$unitname->addValidator("regex", true, array('pattern' => '/^(?![0-9]{4})[a-zA-Z0-9.\\- ?]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid name.')));
$unitname->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_businessunits', 'field' => 'unitname', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive=1')));
$unitname->getValidator('Db_NoRecordExists')->setMessage('Name already exists.');
$unitcode = new Zend_Form_Element_Text('unitcode');
$unitcode->addFilter(new Zend_Filter_StringTrim());
$unitcode->setRequired(true);
$unitcode->setAttrib("maxlength", 4);
$unitcode->addValidator('NotEmpty', false, array('messages' => 'Please enter code.'));
$unitcode->addValidators(array(array('StringLength', false, array('min' => 2, 'max' => 4, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Code must contain at most %max% characters.', Zend_Validate_StringLength::TOO_SHORT => 'Code must contain at least %min% characters.')))));
$unitcode->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[a-zA-Z0-9\\&\'\\.\\s]+$/', 'messages' => array(Zend_Validate_Regex::NOT_MATCH => 'Please enter valid code.')))));
$unitcode->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_businessunits', 'field' => 'unitcode', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive=1')));
$unitcode->getValidator('Db_NoRecordExists')->setMessage('Code already exists.');
$description = new Zend_Form_Element_Textarea('description');
$description->setAttrib('rows', 10);
$description->setAttrib('cols', 50);
$start_date = new ZendX_JQuery_Form_Element_DatePicker('start_date');
$start_date->setAttrib('readonly', 'true');
$start_date->setAttrib('onfocus', 'this.blur()');
$start_date->setOptions(array('class' => 'brdr_none'));
$country = new Zend_Form_Element_Select('country');
$country->setLabel('country');
$country->setRequired(true);
$country->addValidator('NotEmpty', false, array('messages' => 'Please select country.'));
$country->setAttrib('onchange', 'displayParticularState_normal(this,"state","state","city")');
$countryModal = new Default_Model_Countries();
$countriesData = $countryModal->fetchAll('isactive=1', 'country');
$country->addMultiOption('', 'Select country');
foreach ($countriesData->toArray() as $data) {
$country->addMultiOption($data['country_id_org'], $data['country']);
}
$country->setRegisterInArrayValidator(false);
$state = new Zend_Form_Element_Select('state');
$state->setAttrib('onchange', 'displayParticularCity_normal(this,"city","city","")');
$state->setRegisterInArrayValidator(false);
$state->addMultiOption('', 'Select State');
$state->setRequired(true);
$state->addValidator('NotEmpty', false, array('messages' => 'Please select state.'));
$city = new Zend_Form_Element_Select('city');
$city->setAttrib('class', 'selectoption');
$city->setAttrib('onchange', 'displayCityCode(this)');
$city->setRegisterInArrayValidator(false);
$city->addMultiOption('', 'Select City');
$city->setRequired(true);
$city->addValidator('NotEmpty', false, array('messages' => 'Please select city.'));
$address1 = new Zend_Form_Element_Textarea('address1');
$address1->setAttrib('rows', 10);
$address1->setAttrib('cols', 50);
$address1->setRequired(true);
$address1->addValidator('NotEmpty', false, array('messages' => 'Please enter street address.'));
$address2 = new Zend_Form_Element_Textarea('address2');
$address2->setAttrib('rows', 10);
$address2->setAttrib('cols', 50);
$address3 = new Zend_Form_Element_Textarea('address3');
$address3->setAttrib('rows', 10);
$address3->setAttrib('cols', 50);
$timezone = new Zend_Form_Element_Select('timezone');
$timezone->setLabel('timezone');
$timezone->setRequired(true);
$timezone->addValidator('NotEmpty', false, array('messages' => 'Please select time zone.'));
$timezoneModel = new Default_Model_Timezone();
$timezonedata = $timezoneModel->fetchAll('isactive=1', 'timezone');
$timezone->addMultiOption('', 'Select Time zone');
foreach ($timezonedata->toArray() as $data) {
$timezone->addMultiOption($data['id'], $data['timezone'] . ' [' . $data['timezone_abbr'] . ']');
}
$timezone->setRegisterInArrayValidator(false);
$unithead = new Zend_Form_Element_Text('unithead');
$unithead->setLabel('timezone');
$unithead->setAttrib('maxlength', '50');
$unithead->addValidator("regex", true, array('pattern' => '/^[a-zA-Z.\\- ?]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid name.')));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$submit->setLabel('Save');
$this->addElements(array($id, $unitname, $unitcode, $description, $start_date, $country, $state, $city, $address1, $address2, $address3, $timezone, $unithead, $submit));
$this->setElementDecorators(array('ViewHelper'));
$this->setElementDecorators(array('UiWidgetElement'), array('start_date'));
}
示例3: editpopupAction
public function editpopupAction()
{
Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . "/layouts/scripts/popup/");
$orgInfoModel = new Default_Model_Organisationinfo();
$getorgData = $orgInfoModel->getorgrecords();
$deptModel = new Default_Model_Departments();
if (!empty($getorgData)) {
$orgdata = '';
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
}
$msgarray = array();
$flag = 'true';
$bunitid = $this->getRequest()->getParam('unitId');
$id = intVal($this->getRequest()->getParam('id'));
$countriesModel = new Default_Model_Countries();
$statesmodel = new Default_Model_States();
$citiesmodel = new Default_Model_Cities();
$timezonemodel = new Default_Model_Timezone();
$businessunitsmodel = new Default_Model_Businessunits();
$allTimezoneData = $timezonemodel->fetchAll('isactive=1', 'timezone')->toArray();
$allCountriesData = $countriesModel->fetchAll('isactive=1', 'country')->toArray();
$allStatesData = $statesmodel->fetchAll('isactive=1', 'state')->toArray();
$allCitiesData = $citiesmodel->fetchAll('isactive=1', 'city')->toArray();
$allBusinessunitsData = $businessunitsmodel->fetchAll('isactive=1', 'unitname')->toArray();
$deptModel = new Default_Model_Departments();
$deptform = new Default_Form_departments();
$deptform->setAction(BASE_URL . 'departments/editpopup/id/' . $id . '/unitId/' . $bunitid);
$country = $getorgData[0]['country'];
if (isset($_POST['country'])) {
$country = $_POST['country'];
}
$state = $getorgData[0]['state'];
if (isset($_POST['state'])) {
$state = $_POST['state'];
}
$city = $getorgData[0]['city'];
if (isset($_POST['city'])) {
$city = $_POST['city'];
}
$address = $getorgData[0]['address1'];
//department head data
$managementUsersData = $deptModel->getDepartmenttHead('');
foreach ($managementUsersData as $mgmtdata) {
$deptform->depthead->addMultiOption($mgmtdata['user_id'], $mgmtdata['userfullname']);
}
if (isset($country) && $country != 0 && $country != '') {
$deptform->setDefault('country', $country);
$statesData = $statesmodel->getBasicStatesList($country);
foreach ($statesData as $res) {
$deptform->state->addMultiOption($res['state_id_org'], utf8_encode($res['state']));
}
if (isset($state) && $state != 0 && $state != '') {
$deptform->setDefault('state', $state);
}
}
if (isset($state) && $state != 0 && $state != '') {
$citiesData = $citiesmodel->getBasicCitiesList($state);
foreach ($citiesData as $res) {
$deptform->city->addMultiOption($res['city_org_id'], utf8_encode($res['city']));
}
if (isset($city) && $city != 0 && $city != '') {
$deptform->setDefault('city', $city);
}
}
if (isset($address) && $address != '') {
$deptform->address1->setValue($address);
}
$close = '';
$controllername = 'departments';
$deptData = array();
if ($id) {
$data = $deptModel->getSingleDepartmentData($id);
if (!empty($data)) {
$deptform->populate($data);
$deptform->submit->setLabel('Update');
$st_date = sapp_Global::change_date($data['startdate'], 'view');
$deptform->setDefault('start_date', $st_date);
$deptform->setDefault('start_date', $st_date);
$deptform->state->clearMultiOptions();
$deptform->city->clearMultiOptions();
$countryId = $data['country'];
if (isset($_POST['country'])) {
$countryId = $_POST['country'];
}
$stateId = $data['state'];
if (isset($_POST['state'])) {
$stateId = $_POST['state'];
}
$cityId = $data['city'];
if (isset($_POST['city'])) {
$cityId = $_POST['city'];
}
if ($countryId != '') {
$statesmodel = new Default_Model_States();
$statesData = $statesmodel->getBasicStatesList($countryId);
foreach ($statesData as $res) {
$deptform->state->addMultiOption($res['state_id_org'], utf8_encode($res['state']));
}
//.........这里部分代码省略.........
示例4: editAction
public function editAction()
{
$orgInfoModel = new Default_Model_Organisationinfo();
$getorgData = $orgInfoModel->getorgrecords();
$popConfigPermission = array();
if (!empty($getorgData)) {
$orgdata = '';
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserRole = $auth->getStorage()->read()->emprole;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
if (sapp_Global::_checkprivileges(TIMEZONE, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'timezone');
}
if (sapp_Global::_checkprivileges(COUNTRIES, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'country');
}
if (sapp_Global::_checkprivileges(STATES, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'state');
}
if (sapp_Global::_checkprivileges(CITIES, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'city');
}
$msgarray = array();
$flag = 'true';
$id = $this->getRequest()->getParam('id');
$callval = $this->getRequest()->getParam('call');
if ($callval == 'ajaxcall') {
$this->_helper->layout->disableLayout();
}
$countriesModel = new Default_Model_Countries();
$statesmodel = new Default_Model_States();
$citiesmodel = new Default_Model_Cities();
$timezonemodel = new Default_Model_Timezone();
$allTimezoneData = $timezonemodel->fetchAll('isactive=1', 'timezone')->toArray();
$allCountriesData = $countriesModel->fetchAll('isactive=1', 'country')->toArray();
$allStatesData = $statesmodel->fetchAll('isactive=1', 'state')->toArray();
$allCitiesData = $citiesmodel->fetchAll('isactive=1', 'city')->toArray();
$businessunitsform = new Default_Form_businessunits();
$businessunitsmodel = new Default_Model_Businessunits();
$orgInfoModel = new Default_Model_Organisationinfo();
$deptModel = new Default_Model_Departments();
$deptform = new Default_Form_departments();
$deptData = array();
$msgarray = array();
$businessunitsform->setAttrib('action', DOMAIN . 'businessunits/edit');
$country = $getorgData[0]['country'];
if (isset($_POST['country'])) {
$country = $_POST['country'];
}
$state = $getorgData[0]['state'];
if (isset($_POST['state'])) {
$state = $_POST['state'];
}
$city = $getorgData[0]['city'];
if (isset($_POST['city'])) {
$city = $_POST['city'];
}
$address = $getorgData[0]['address1'];
if (isset($country) && $country != 0 && $country != '') {
$businessunitsform->setDefault('country', $country);
$statesData = $statesmodel->getBasicStatesList($country);
foreach ($statesData as $res) {
$businessunitsform->state->addMultiOption($res['state_id_org'], utf8_encode($res['state']));
}
if (isset($state) && $state != 0 && $state != '') {
$businessunitsform->setDefault('state', $state);
}
}
if (isset($state) && $state != 0 && $state != '') {
$citiesData = $citiesmodel->getBasicCitiesList($state);
foreach ($citiesData as $res) {
$businessunitsform->city->addMultiOption($res['city_org_id'], utf8_encode($res['city']));
}
if (isset($city) && $city != 0 && $city != '') {
$businessunitsform->setDefault('city', $city);
}
}
if (isset($address) && $address != '') {
$businessunitsform->address1->setValue($address);
}
if (is_numeric($id) && $id > 0) {
$data = $businessunitsmodel->getSingleUnitData($id);
if (!empty($data)) {
$businessunitsform->setAttrib('action', DOMAIN . 'businessunits/edit/id/' . $id);
$businessunitsform->populate($data);
$businessunitsform->submit->setLabel('Update');
$st_date = sapp_Global::change_date($data["startdate"], 'view');
$businessunitsform->setDefault('start_date', $st_date);
$businessunitsform->state->clearMultiOptions();
$businessunitsform->city->clearMultiOptions();
$businessunitsform->state->addMultiOption('', utf8_encode("Select State"));
$businessunitsform->city->addMultiOption('', utf8_encode("Select City"));
$countryId = $data['country'];
if (isset($_POST['country'])) {
$countryId = $_POST['country'];
}
$stateId = $data['state'];
//.........这里部分代码省略.........
示例5: departmentsAction
public function departmentsAction()
{
$form = new Default_Form_departmentsreport();
$reportsmodel = new Default_Model_Reports();
$msgarray = array();
$selectColumns = array();
$searchQuery = '';
$deptname = intval($this->_request->getParam('deptname'));
$dcode = intval($this->_request->getParam('dcode'));
$bunitname = $this->_request->getParam('bunitname');
$startdate = $this->_request->getParam('startdate');
$country = $this->_request->getParam('country');
$pageno = intval($this->_request->getParam('pageno', 1));
$perpage = intval($this->_request->getParam('perpage', PERPAGE));
if ($perpage == 0) {
$perpage = PERPAGE;
}
$by = $this->_request->getParam('by', 'Desc');
$sortby = $this->_request->getParam('sortby', 'd.modifieddate');
$columnby = $this->_request->getParam('columnby');
$columnsortby = $this->_request->getParam('columnsortby');
$funorder = '';
$checkedheaders = $this->_request->getParam('checkedheaders');
$gr = $this->_request->getParam('generatereport');
if ($gr == 'pdf' || $gr == 'excel') {
$bunitname = intval($this->_request->getParam('hiddenbuname'));
$dcode = intval($this->_request->getParam('hiddendeptcode'));
$deptname = intval($this->_request->getParam('hiddendeptname'));
}
if ($checkedheaders != '') {
$selectColumns = explode(',', $checkedheaders);
}
if ($columnby != '') {
$by = $columnby;
}
if ($columnsortby != '') {
$sortby = $columnsortby;
}
if ($deptname != '') {
$searchQuery .= 'd.id = "' . $deptname . '" AND ';
}
if (isset($bunitname) && $bunitname != '') {
$searchQuery .= 'd.unitid = "' . $bunitname . '" AND ';
}
if ($dcode != '') {
$searchQuery .= 'd.id = "' . $dcode . '" AND ';
}
if ($country != '') {
$searchQuery .= 'd.country = ' . $country . ' AND ';
}
if ($startdate != '') {
$startdate = sapp_Global::change_date($startdate, 'database');
$searchQuery .= 'DATE(d.startdate) = "' . $startdate . '" AND ';
}
$searchQuery = rtrim($searchQuery, " AND");
$selectColumnLabels = array();
$DepartmentLabelsArr = array('deptname' => 'Department', 'deptcode' => 'Code', 'unitname' => 'Business Unit', 'startdate' => 'Started on', 'empcount' => '# Emp', 'address' => 'Address', 'ccity' => 'City', 'sstate' => 'State', 'ccountry' => 'Country', 'status' => 'Status');
$countryModal = new Default_Model_Countries();
$countriesData = $countryModal->fetchAll('isactive=1', 'country')->toArray();
if (!empty($countriesData)) {
$form->country->addMultiOption('', 'All');
foreach ($countriesData as $data) {
$form->country->addMultiOption($data['country_id_org'], $data['country']);
}
} else {
$form->country->addMultiOption('', 'Select Country');
$msgarray['country'] = 'Countries are not configured yet';
}
if (empty($selectColumns)) {
$selectColumns = array('deptname', 'deptcode', 'unitname', 'startdate', 'empcount', 'address', 'ccity', 'sstate', 'ccountry', 'status');
$selectColumnLabels = $DepartmentLabelsArr;
} else {
foreach ($DepartmentLabelsArr as $key => $val) {
foreach ($selectColumns as $column) {
if ($column == $key) {
$selectColumnLabels[$key] = $val;
}
}
}
}
/* Column sort for city state country */
if ($sortby == 'unitname') {
$buOrder = $reportsmodel->getBusinessunitOrder($by);
if (!empty($buOrder)) {
$inId = implode(',', $buOrder);
$funorder = 'FIND_IN_SET(d.unitid,"' . $inId . '")';
}
}
if ($sortby == 'ccity') {
$cityorder = $reportsmodel->getCityOrder($by);
if (!empty($cityorder)) {
$inId = implode(',', $cityorder);
$funorder = 'FIND_IN_SET(d.city,"' . $inId . '")';
}
}
if ($sortby == 'sstate') {
$stateorder = $reportsmodel->getStateOrder($by);
if (!empty($stateorder)) {
$inId = implode(',', $stateorder);
$funorder = 'FIND_IN_SET(d.state,"' . $inId . '")';
//.........这里部分代码省略.........
示例6: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('id', 'formid');
$this->setAttrib('enctype', 'multipart/form-data');
$this->setAttrib('name', 'organisationinfo');
$this->setAttrib('action', DOMAIN . 'organisationinfo/edit');
$id = new Zend_Form_Element_Hidden('id');
$orgname = new Zend_Form_Element_Text('organisationname');
$orgname->setAttrib('maxLength', 50);
$orgname->addFilter(new Zend_Filter_StringTrim());
$orgname->setRequired(true);
$orgname->addValidator('NotEmpty', false, array('messages' => 'Please enter organization name.'));
$orgname->addValidator("regex", true, array('pattern' => '/^[a-zA-Z0-9.\\- ?]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid organization name.')));
$domain = new Zend_Form_Element_Multiselect('domain');
$domain->setLabel('domain')->setMultiOptions(array('1' => 'Admin/Secretarial', '2' => 'Customer Service/ Call Centre/ BPO', '3' => 'Finance & Accounts', '4' => 'Human Resources', '5' => 'IT', '6' => 'Legal', '7' => 'Marketing & Communications', '8' => 'Purchase/ Logistics/ Supply Chain', '9' => 'Sales/ Business Development', '10' => 'Sales & Marketing & Advertisement'));
$org_image_value = new Zend_Form_Element_Hidden('org_image_value');
$imgerr = new Zend_Form_Element_Hidden('imgerr');
$imgerrmsg = new Zend_Form_Element_Hidden('imgerrmsg');
$orgdescription = new Zend_Form_Element_Textarea('orgdescription');
$orgdescription->setAttrib('rows', 10);
$orgdescription->setAttrib('cols', 50);
$website = new Zend_Form_Element_Text('website');
$website->setAttrib('maxLength', 50);
$website->addFilter(new Zend_Filter_StringTrim());
$website->setRequired(true);
$website->addValidator('NotEmpty', false, array('messages' => 'Please enter website.'));
$website->addValidator(new Zend_Validate_Uri());
$totalemployees = new Zend_Form_Element_Select('totalemployees');
$totalemployees->setRegisterInArrayValidator(false);
$totalemployees->setMultiOptions(array('1' => '20-50', '2' => '51-100', '3' => '101-500', '4' => '501 -1000', '5' => '> 1000'));
$totalemployees->setRequired(true);
$totalemployees->addValidator('NotEmpty', false, array('messages' => 'Please enter total employees.'));
$org_startdate = new ZendX_JQuery_Form_Element_DatePicker('org_startdate');
$org_startdate->setAttrib('readonly', 'true');
$org_startdate->setAttrib('onfocus', 'this.blur()');
$org_startdate->setOptions(array('class' => 'brdr_none'));
$phonenumber = new Zend_Form_Element_Text('phonenumber');
$phonenumber->addFilter(new Zend_Filter_StringTrim());
$phonenumber->setAttrib('maxLength', 15);
$phonenumber->addValidators(array(array('StringLength', false, array('min' => 10, 'max' => 15, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Phone number must contain at most %max% characters.', Zend_Validate_StringLength::TOO_SHORT => 'Phone number must contain at least %min% characters.')))));
$phonenumber->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[0-9-]+$/i', 'messages' => array('regexNotMatch' => 'Please enter valid phone number.')))));
$secondaryphone = new Zend_Form_Element_Text('secondaryphone');
$secondaryphone->setAttrib('maxLength', 15);
$secondaryphone->addFilter(new Zend_Filter_StringTrim());
$secondaryphone->addValidators(array(array('StringLength', false, array('min' => 10, 'max' => 15, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Secondary phone number must contain at most %max% characters.', Zend_Validate_StringLength::TOO_SHORT => 'Secondary phone number must contain at least %min% characters.')))));
$secondaryphone->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[0-9-]+$/i', 'messages' => array('regexNotMatch' => 'Please enter valid phone number.')))));
$faxnumber = new Zend_Form_Element_Text('faxnumber');
$faxnumber->setAttrib('maxLength', 15);
$faxnumber->addFilter(new Zend_Filter_StringTrim());
$faxnumber->addValidators(array(array('StringLength', false, array('min' => 10, 'max' => 15, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Fax number must contain at most %max% characters.', Zend_Validate_StringLength::TOO_SHORT => 'Fax number must contain at least %min% characters.')))));
$faxnumber->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[0-9-]+$/i', 'messages' => array('regexNotMatch' => 'Please enter valid fax number.')))));
$country = new Zend_Form_Element_Select('country');
$country->setLabel('country');
$country->setRequired(true);
$country->addValidator('NotEmpty', false, array('messages' => 'Please select country.'));
$country->setAttrib('onchange', 'displayParticularState(this,"state","state","")');
$countryModal = new Default_Model_Countries();
$countriesData = $countryModal->fetchAll('isactive=1', 'country');
$country->addMultiOption('', 'Select country');
foreach ($countriesData->toArray() as $data) {
$country->addMultiOption($data['country_id_org'], $data['country']);
}
$country->setRegisterInArrayValidator(false);
$state = new Zend_Form_Element_Select('state');
$state->setAttrib('class', 'selectoption');
$state->setAttrib('onchange', 'displayParticularCity(this,"city","city","")');
$state->setRegisterInArrayValidator(false);
$state->addMultiOption('', 'Select State');
$state->setRequired(true);
$state->addValidator('NotEmpty', false, array('messages' => 'Please select state.'));
$city = new Zend_Form_Element_Select('city');
$city->setAttrib('class', 'selectoption');
$city->setAttrib('onchange', 'displayCityCode(this)');
$city->setRegisterInArrayValidator(false);
$city->addMultiOption('', 'Select City');
$city->setRequired(true);
$city->addValidator('NotEmpty', false, array('messages' => 'Please select city.'));
$address1 = new Zend_Form_Element_Textarea('address1');
$address1->setAttrib('rows', 10);
$address1->setAttrib('cols', 50);
$address2 = new Zend_Form_Element_Textarea('address2');
$address2->setAttrib('rows', 10);
$address2->setAttrib('cols', 50);
$address3 = new Zend_Form_Element_Textarea('address3');
$address3->setAttrib('rows', 10);
$address3->setAttrib('cols', 50);
$description = new Zend_Form_Element_Textarea('description');
$description->setAttrib('rows', 10);
$description->setAttrib('cols', 50);
$designation = new Zend_Form_Element_Text('designation');
$designation->setAttrib('maxLength', 50);
$designation->addFilter(new Zend_Filter_StringTrim());
$designation->addValidator("regex", true, array('pattern' => '/^[a-zA-Z.\\- ?]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid designation.')));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$submit->setLabel('Save');
$this->addElements(array($id, $orgname, $imgerrmsg, $imgerr, $org_image_value, $domain, $orgdescription, $website, $totalemployees, $org_startdate, $phonenumber, $secondaryphone, $faxnumber, $country, $state, $city, $address1, $address2, $address3, $description, $designation, $submit));
//$email,$secondaryemail,
$this->setElementDecorators(array('ViewHelper'));
//.........这里部分代码省略.........
示例7: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('id', 'formid');
$this->setAttrib('enctype', 'multipart/form-data');
$this->setAttrib('name', 'organisationinfo');
$this->setAttrib('action', DOMAIN . 'organisationinfo/edit');
$id = new Zend_Form_Element_Hidden('id');
$orgname = new Zend_Form_Element_Text('organisationname');
$orgname->setAttrib('maxLength', 50);
$orgname->addFilter(new Zend_Filter_StringTrim());
$orgname->setRequired(true);
$orgname->addValidator('NotEmpty', false, array('messages' => 'Please enter organization name.'));
$orgname->addValidator("regex", true, array('pattern' => '/^[a-zA-Z0-9.\\- ?]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid organization name.')));
$domain = new Zend_Form_Element_Multiselect('domain');
$domain->setRequired(true);
$domain->addValidator('NotEmpty', false, array('messages' => 'Please select domain.'));
$domain->setLabel('domain')->setMultiOptions(array('1' => 'Admin/Secretarial', '2' => 'Customer Service/ Call Centre/ BPO', '3' => 'Finance & Accounts', '4' => 'Human Resources', '5' => 'IT', '6' => 'Legal', '7' => 'Marketing & Communications', '8' => 'Purchase/ Logistics/ Supply Chain', '9' => 'Sales/ Business Development', '10' => 'Sales & Marketing & Advertisement'));
$org_image_value = new Zend_Form_Element_Hidden('org_image_value');
$imgerr = new Zend_Form_Element_Hidden('imgerr');
$imgerrmsg = new Zend_Form_Element_Hidden('imgerrmsg');
$orgdescription = new Zend_Form_Element_Textarea('orgdescription');
$orgdescription->setAttrib('rows', 10);
$orgdescription->setAttrib('cols', 50);
$orgdescription->setRequired(true);
$orgdescription->addValidator('NotEmpty', false, array('messages' => 'Please enter organization description.'));
$website = new Zend_Form_Element_Text('website');
$website->setAttrib('maxLength', 50);
$website->addFilter(new Zend_Filter_StringTrim());
$website->setRequired(true);
$website->addValidator('NotEmpty', false, array('messages' => 'Please enter website.'));
$website->addValidator(new Zend_Validate_Uri());
$totalemployees = new Zend_Form_Element_Select('totalemployees');
$totalemployees->setRegisterInArrayValidator(false);
$totalemployees->setMultiOptions(array('1' => '20-50', '2' => '51-100', '3' => '101-500', '4' => '501 -1000', '5' => '> 1000'));
$totalemployees->setRequired(true);
$totalemployees->addValidator('NotEmpty', false, array('messages' => 'Please enter total employees.'));
$org_startdate = new ZendX_JQuery_Form_Element_DatePicker('org_startdate');
$org_startdate->setAttrib('readonly', 'true');
$org_startdate->setAttrib('onfocus', 'this.blur()');
$org_startdate->setOptions(array('class' => 'brdr_none'));
$phonenumber = new Zend_Form_Element_Text('phonenumber');
$phonenumber->addFilter(new Zend_Filter_StringTrim());
$phonenumber->setRequired(true);
$phonenumber->setAttrib('maxLength', 15);
$phonenumber->addValidator('NotEmpty', false, array('messages' => 'Please enter phone number.'));
$phonenumber->addValidators(array(array('StringLength', false, array('min' => 10, 'max' => 15, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Phone number must contain at most %max% characters.', Zend_Validate_StringLength::TOO_SHORT => 'Phone number must contain at least %min% characters.')))));
$phonenumber->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[0-9-]+$/i', 'messages' => array('regexNotMatch' => 'Please enter valid phone number.')))));
$secondaryphone = new Zend_Form_Element_Text('secondaryphone');
$secondaryphone->setAttrib('maxLength', 15);
$secondaryphone->addFilter(new Zend_Filter_StringTrim());
$secondaryphone->addValidators(array(array('StringLength', false, array('min' => 10, 'max' => 15, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Secondary phone number must contain at most %max% characters.', Zend_Validate_StringLength::TOO_SHORT => 'Secondary phone number must contain at least %min% characters.')))));
$secondaryphone->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[0-9-]+$/i', 'messages' => array('regexNotMatch' => 'Please enter valid phone number.')))));
$faxnumber = new Zend_Form_Element_Text('faxnumber');
$faxnumber->setAttrib('maxLength', 15);
$faxnumber->addFilter(new Zend_Filter_StringTrim());
$faxnumber->addValidators(array(array('StringLength', false, array('min' => 10, 'max' => 15, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Fax number must contain at most %max% characters.', Zend_Validate_StringLength::TOO_SHORT => 'Fax number must contain at least %min% characters.')))));
$faxnumber->addValidators(array(array('validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array('pattern' => '/^[0-9-]+$/i', 'messages' => array('regexNotMatch' => 'Please enter valid fax number.')))));
$country = new Zend_Form_Element_Select('country');
$country->setLabel('country');
$country->setRequired(true);
$country->addValidator('NotEmpty', false, array('messages' => 'Please select country.'));
$country->setAttrib('onchange', 'displayParticularState(this,"state","state","")');
$countryModal = new Default_Model_Countries();
$countriesData = $countryModal->fetchAll('isactive=1', 'country');
$country->addMultiOption('', 'Select country');
foreach ($countriesData->toArray() as $data) {
$country->addMultiOption($data['country_id_org'], $data['country']);
}
$country->setRegisterInArrayValidator(false);
$state = new Zend_Form_Element_Select('state');
$state->setAttrib('class', 'selectoption');
$state->setAttrib('onchange', 'displayParticularCity(this,"city","city","")');
$state->setRegisterInArrayValidator(false);
$state->addMultiOption('', 'Select State');
$state->setRequired(true);
$state->addValidator('NotEmpty', false, array('messages' => 'Please select state.'));
$city = new Zend_Form_Element_Select('city');
$city->setAttrib('class', 'selectoption');
$city->setAttrib('onchange', 'displayCityCode(this)');
$city->setRegisterInArrayValidator(false);
$city->addMultiOption('', 'Select City');
$city->setRequired(true);
$city->addValidator('NotEmpty', false, array('messages' => 'Please select city.'));
$address1 = new Zend_Form_Element_Textarea('address1');
$address1->setAttrib('rows', 10);
$address1->setAttrib('cols', 50);
$address1->setRequired(true);
$address1->addValidator('NotEmpty', false, array('messages' => 'Please enter main branch address.'));
$address2 = new Zend_Form_Element_Textarea('address2');
$address2->setAttrib('rows', 10);
$address2->setAttrib('cols', 50);
$address3 = new Zend_Form_Element_Textarea('address3');
$address3->setAttrib('rows', 10);
$address3->setAttrib('cols', 50);
$description = new Zend_Form_Element_Textarea('description');
$description->setAttrib('rows', 10);
$description->setAttrib('cols', 50);
$orghead = new Zend_Form_Element_Select('orghead');
$orghead->setLabel('orghead');
//.........这里部分代码省略.........
示例8: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('id', 'formid');
$this->setAttrib('name', 'frm_sinterview_rounds');
$id = new Zend_Form_Element_Hidden('id');
$req_id = new Zend_Form_Element_Select("req_id");
$req_id->setRegisterInArrayValidator(false);
$req_id->setRequired(true);
$req_id->setAttrib("class", "formDataElement");
$req_id->addValidator('NotEmpty', false, array('messages' => 'Please select requisition id.'));
$req_id->setAttrib('title', 'Interviewer');
$req_id->setAttrib('onchange', 'displayParticularCandidates(this,"")');
$candidate_name = new Zend_Form_Element_Select('candidate_name');
$candidate_name->setAttrib('title', 'Candidate Name');
$candidate_name->addFilter(new Zend_Filter_StringTrim());
$candidate_name->setRequired(true);
$candidate_name->addValidator('NotEmpty', false, array('messages' => 'Please select candidate.'));
$candidate_name->addMultiOption('', 'Select candidate');
$candidate_name->setRegisterInArrayValidator(false);
$interviewer_id = new Zend_Form_Element_Select("interviewer_id");
$interviewer_id->setRegisterInArrayValidator(false);
$interviewer_id->setAttrib("class", "formDataElement");
$interviewer_id->setAttrib('title', 'Interviewer');
$interview_mode = new Zend_Form_Element_Select("interview_mode");
$interview_mode->setRegisterInArrayValidator(true);
$interview_mode->setAttrib("class", "formDataElement");
$interview_mode->addMultiOptions(array('' => 'Select Interview Type', 'In person' => 'In person', 'Phone' => 'Phone', 'Video conference' => 'Video conference'));
$interview_mode->setAttrib('title', 'Interview Type');
$int_location = new Zend_Form_Element_Text('int_location');
$int_location->setAttrib('maxLength', 100);
$int_location->setAttrib('title', 'Location');
$int_location->addFilter(new Zend_Filter_StringTrim());
$job_title = new Zend_Form_Element_Text('job_title');
$job_title->setAttrib('readonly', 'readonly');
$country = new Zend_Form_Element_Select('country');
$country->setLabel('country');
$country->setAttrib('onchange', 'displayParticularState_normal(this,"state","state","city")');
$country->setRegisterInArrayValidator(false);
$countryModal = new Default_Model_Countries();
$countriesData = $countryModal->fetchAll('isactive=1', 'country');
$country->addMultiOption('', 'Select country');
foreach ($countriesData->toArray() as $data) {
$country->addMultiOption(trim($data['country_id_org']), $data['country']);
}
$state = new Zend_Form_Element_Select('state');
$state->setAttrib('onchange', 'displayParticularCity_normal(this,"city","city","")');
$state->setRegisterInArrayValidator(false);
$state->addMultiOption('', 'Select State');
$city = new Zend_Form_Element_Select('city');
$city->setAttrib('class', 'selectoption');
$city->setAttrib('onchange', 'displayCityCode(this)');
$city->setRegisterInArrayValidator(false);
$city->addMultiOption('', 'Select City');
$interview_time = new Zend_Form_Element_Text('interview_time');
$interview_time->setAttrib('title', 'Interview Time');
$interview_time->setAttrib('readonly', 'readonly');
$interview_time->setAttrib('onfocus', 'this.blur()');
$interview_time->setAttrib('class', 'time');
$interview_time->addFilter(new Zend_Filter_StringTrim());
$interview_date = new Zend_Form_Element_Text('interview_date');
$interview_date->setAttrib('readonly', 'readonly');
$interview_date->setAttrib('onfocus', 'this.blur()');
$interview_date->setAttrib('title', 'Interview Date');
$interview_date->addFilter(new Zend_Filter_StringTrim());
$interview_round = new Zend_Form_Element_Text('interview_round');
$interview_round->setAttrib('title', 'Interview Round');
$interview_round->addFilter(new Zend_Filter_StringTrim());
$interview_round->setAttrib('maxlength', 45);
$interview_feedback = new Zend_Form_Element_Textarea('interview_feedback');
$interview_feedback->setAttrib('rows', 10);
$interview_feedback->setAttrib('cols', 50);
$interview_feedback->setAttrib('maxlength', 300);
$interview_feedback->setAttrib('title', 'Feedback.');
$interview_comments = new Zend_Form_Element_Textarea('interview_comments');
$interview_comments->setAttrib('rows', 10);
$interview_comments->setAttrib('cols', 50);
$interview_comments->setAttrib('maxlength', 300);
$interview_comments->setAttrib('title', 'Comments.');
$round_status = new Zend_Form_Element_Select('round_status');
$round_status->setRegisterInArrayValidator(false);
$round_status->setLabel('Round status');
$round_status->addMultiOptions(array('' => 'Select status', 'Schedule for next round' => 'Schedule for next round', 'Qualified' => 'Qualified', 'Selected' => 'Selected', 'Disqualified' => 'Disqualified', 'Incompetent' => 'Incompetent', 'Ineligible' => 'Ineligible', 'Candidate no show' => 'Candidate no show'));
$hid_round_status_val = Zend_Controller_Front::getInstance()->getRequest()->getParam('hid_round_status', null);
$interview_status = new Zend_Form_Element_Select('interview_status');
$interview_status->setLabel('Interview status')->setMultiOptions(array('' => 'Select status', 'In process' => 'In process', 'Completed' => 'Complete', 'On hold' => 'On hold'));
$interview_status->setRegisterInArrayValidator(false);
$cand_status = new Zend_Form_Element_Select('cand_status');
$cand_status->setLabel('Candidate status')->setMultiOptions(array('' => 'Select status'));
$cand_status->setRegisterInArrayValidator(false);
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
$intrvid_val = Zend_Controller_Front::getInstance()->getRequest()->getParam('intrvid', null);
if ($loginuserGroup == MANAGER_GROUP || $loginuserGroup == EMPLOYEE_GROUP || $loginuserGroup == SYSTEMADMIN_GROUP || ($loginuserGroup == HR_GROUP || $loginuserGroup == MANAGEMENT_GROUP) && $intrvid_val == $loginUserId) {
$round_status->setRequired(true);
$round_status->addValidator('NotEmpty', false, array('messages' => 'Please select status.'));
$interview_comments->setRequired(true);
//.........这里部分代码省略.........
示例9: edit_oldAction
public function edit_oldAction()
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserRole = $auth->getStorage()->read()->emprole;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
$popConfigPermission = array();
$empid = '';
$orgheadsData = array();
$oldOrgHead = '';
$new_stateId = '';
$actionpage = '';
if (sapp_Global::_checkprivileges(PREFIX, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'prefix');
}
if (sapp_Global::_checkprivileges(IDENTITYCODES, $loginuserGroup, $loginuserRole, 'edit') == 'Yes') {
array_push($popConfigPermission, 'identitycodes');
}
if (sapp_Global::_checkprivileges(JOBTITLES, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'jobtitles');
}
if (sapp_Global::_checkprivileges(POSITIONS, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'position');
}
if (sapp_Global::_checkprivileges(COUNTRIES, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'country');
}
if (sapp_Global::_checkprivileges(STATES, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'state');
}
if (sapp_Global::_checkprivileges(CITIES, $loginuserGroup, $loginuserRole, 'add') == 'Yes') {
array_push($popConfigPermission, 'city');
}
if (sapp_Global::_checkprivileges(EMPLOYEE, $loginuserGroup, $loginuserRole, 'edit') == 'Yes') {
array_push($popConfigPermission, 'employee');
}
$msgarray = array();
$new_stateId = '';
$new_cityId = '';
$id = $this->getRequest()->getParam('id');
$form = new Default_Form_Organisationinfo();
$user_model = new Default_Model_Usermanagement();
$orgInfoModel = new Default_Model_Organisationinfo();
$countriesModel = new Default_Model_Countries();
$statesmodel = new Default_Model_States();
$citiesmodel = new Default_Model_Cities();
$role_model = new Default_Model_Roles();
$prefixModel = new Default_Model_Prefix();
$identity_code_model = new Default_Model_Identitycodes();
$jobtitlesModel = new Default_Model_Jobtitles();
$employeeModal = new Default_Model_Employee();
$positionsmodel = new Default_Model_Positions();
$identity_codes = $identity_code_model->getIdentitycodesRecord();
$role_data = $role_model->getRolesList_orginfo();
$allCountriesData = $countriesModel->fetchAll('isactive=1', 'country')->toArray();
$allStatesData = $statesmodel->fetchAll('isactive=1', 'state')->toArray();
$allCitiesData = $citiesmodel->fetchAll('isactive=1', 'city')->toArray();
$flag = 'true';
$emp_identity_code = isset($identity_codes[0]) ? $identity_codes[0]['employee_code'] : "";
if ($emp_identity_code != '') {
$emp_id = $emp_identity_code . str_pad($user_model->getMaxEmpId($emp_identity_code), 4, '0', STR_PAD_LEFT);
} else {
$emp_id = '';
$msgarray['employeeId'] = 'Identity codes are not configured yet.';
$flag = 'false';
}
$form->employeeId->setValue($emp_id);
$form->emprole->addMultiOptions(array('' => 'Select Role') + $role_data);
if (empty($allCountriesData)) {
$msgarray['country'] = 'Countries are not configured yet.';
$flag = 'false';
}
if (empty($role_data)) {
$msgarray['emprole'] = 'Roles are not added yet.';
$flag = 'false';
}
if (empty($allStatesData)) {
$msgarray['state'] = 'States are not configured yet.';
$flag = 'false';
}
if (empty($allCitiesData)) {
$msgarray['city'] = 'Cities are not configured yet.';
$flag = 'false';
}
$prefixData = $prefixModel->getPrefixList();
$form->prefix_id->addMultiOption('', 'Select Prefix');
if (!empty($prefixData)) {
foreach ($prefixData as $prefixres) {
$form->prefix_id->addMultiOption($prefixres['id'], $prefixres['prefix']);
}
} else {
$msgarray['prefix_id'] = 'Prefixes are not configured yet.';
}
$jobtitleData = $jobtitlesModel->getJobTitleList();
if (!empty($jobtitleData)) {
foreach ($jobtitleData as $jobtitleres) {
$form->jobtitle_id->addMultiOption($jobtitleres['id'], $jobtitleres['jobtitlename']);
}
//.........这里部分代码省略.........
示例10: addpopupAction
public function addpopupAction()
{
Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . "/layouts/scripts/popup/");
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
}
$id = $this->getRequest()->getParam('id');
$callval = $this->getRequest()->getParam('call');
$countriesform = new Default_Form_countries();
$countriesmodel = new Default_Model_Countries();
$countriesform->setAction(BASE_URL . 'countries/addpopup');
$controllername = 'countries';
if ($this->getRequest()->getPost()) {
$id = $this->_request->getParam('id');
$errorflag = "true";
$msgarray = array();
$dbcountry = '';
$dbcountryid = '';
$country = $this->_request->getParam('country');
$othercountry = $this->_request->getParam('othercountry');
$countrycode = $this->_request->getParam('countrycode');
$citizenship = $this->_request->getParam('citizenship');
if ($country == 'other') {
if ($othercountry == '') {
$msgarray['othercountry'] = "Please enter other country";
$errorflag = "false";
} else {
$isduplicatecountrynameArr = $countriesmodel->getDuplicateCountryName($othercountry);
if ($isduplicatecountrynameArr[0]['count'] > 0) {
$errorflag = "false";
$msgarray['othercountry'] = "Country already exists";
$msgarray['othercountryname'] = $othercountry;
} else {
if (!preg_match('/^[^ ][a-z0-9 ]*$/i', $othercountry)) {
$errorflag = "false";
$msgarray['othercountry'] = "Please enter valid country name.";
$msgarray['othercountryname'] = $othercountry;
} else {
$dbcountry = $othercountry;
$errorflag = "true";
}
}
}
} else {
$countrynamearr = $countriesmodel->getCountryCode($country);
if (!empty($countrynamearr)) {
$dbcountry = $countrynamearr[0]['country_name'];
$dbcountryid = $countrynamearr[0]['id'];
$errorflag = "true";
} else {
$msgarray['country'] = $dbcountry . " already added";
$errorflag = "false";
}
}
if ($countriesform->isValid($this->_request->getPost()) && $errorflag == "true") {
$date = new Zend_Date();
$actionflag = '';
$tableid = '';
if ($country == 'other') {
if ($othercountry != '' && $countrycode != '') {
$countryID = $countriesmodel->SaveMainCountryData($othercountry, $countrycode);
}
}
$data = array('country' => trim($dbcountry), 'countrycode' => trim($countrycode), 'citizenship' => NULL, 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"), 'country_id_org' => $dbcountryid != '' ? $dbcountryid : $countryID);
if ($id != '') {
$where = array('id=?' => $id);
$actionflag = 2;
} else {
$data['createdby'] = $loginUserId;
$data['createddate'] = gmdate("Y-m-d H:i:s");
$data['isactive'] = 1;
$where = '';
$actionflag = 1;
}
$Id = $countriesmodel->SaveorUpdateCountryData($data, $where);
$tableid = $Id;
$menuID = COUNTRIES;
$result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $tableid);
$countryData = $countriesmodel->fetchAll('isactive = 1', 'country')->toArray();
$opt = '';
foreach ($countryData as $record) {
$opt .= sapp_Global::selectOptionBuilder($record['country_id_org'], $record['country']);
}
$this->view->countryData = $opt;
$this->view->eventact = 'added';
$close = 'close';
$this->view->popup = $close;
} else {
$messages = $countriesform->getMessages();
foreach ($messages as $key => $val) {
foreach ($val as $key2 => $val2) {
$msgarray[$key] = $val2;
break;
}
}
$this->view->msgarray = $msgarray;
}
}
$this->view->ermsg = '';
//.........这里部分代码省略.........
示例11: viewpopupAction
public function viewpopupAction()
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . "/layouts/scripts/popup/");
$cand_model = new Default_Model_Candidatedetails();
$requi_model = new Default_Model_Requisition();
$jobtitleModel = new Default_Model_Jobtitles();
$intrvwModel = new Default_Model_Interviewdetails();
$interview_round_model = new Default_Model_Interviewrounddetails();
$user_model = new Default_Model_Usermanagement();
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
$jobtitle = '';
$deptid = $this->getRequest()->getParam('deptid');
if ($deptid == '') {
$deptid = $this->getRequest()->getParam('deptidform');
}
$intId = $this->getRequest()->getParam('unitId');
$roundId = $this->getRequest()->getParam('id');
$ir_form = new Default_Form_Interviewrounds();
$elements = $ir_form->getElements();
//giving only for hr,management and super admin
if ($loginuserGroup == HR_GROUP || $loginuserGroup == '' || $loginuserGroup == MANAGEMENT_GROUP) {
$ir_form->round_status->addMultiOptions(array('Decision pending' => 'Decision pending', 'On hold' => 'On hold'));
}
if (count($elements) > 0) {
foreach ($elements as $key => $element) {
if ($key != "Cancel" && $key != "Edit" && $key != "Delete" && $key != "Attachments") {
$element->setAttrib("disabled", "disabled");
}
}
}
$intData = $intrvwModel->getReqByintrvwID($intId);
$roundData = $interview_round_model->getSingleRoundData($roundId);
$this->view->ermsg = '';
$edit_flag = 'no';
if ($roundData['interviewer_id'] == $loginUserId) {
$edit_flag = 'yes';
}
if ($loginuserGroup == MANAGER_GROUP || $loginuserGroup == HR_GROUP || $loginuserGroup == MANAGEMENT_GROUP || $loginuserGroup == '' || $loginuserGroup == EMPLOYEE_GROUP || $loginuserGroup == SYSTEMADMIN_GROUP) {
$countryId = $roundData['int_country'];
$stateId = $roundData['int_state'];
$cityId = $roundData['int_city'];
$country_name = '';
$state_name = '';
$city_name = '';
if ($countryId && $stateId) {
$statesmodel = new Default_Model_States();
$citiesmodel = new Default_Model_Cities();
$countryModal = new Default_Model_Countries();
$countriesData = $countryModal->fetchAll('isactive=1', 'country');
foreach ($countriesData as $cdata) {
if ($roundData['int_country'] == $cdata['country_id_org']) {
$country_name = $cdata['country'];
break;
}
}
$statesData = $statesmodel->getBasicStatesList($countryId);
$citiesData = $citiesmodel->getBasicCitiesList($stateId);
foreach ($statesData as $res) {
$ir_form->state->addMultiOption($res['state_id_org'], utf8_encode($res['state']));
if ($roundData['int_state'] == $res['state_id_org']) {
$state_name = $res['state'];
}
}
foreach ($citiesData as $res) {
$ir_form->city->addMultiOption($res['city_org_id'], utf8_encode($res['city']));
if ($roundData['int_city'] == $res['city_org_id']) {
$city_name = $res['city'];
}
}
}
$interviewer_data = $user_model->getUserDataById($roundData['interviewer_id']);
$jobttlArr = $jobtitleModel->getsingleJobTitleData($interviewer_data['jobtitle_id']);
if (!empty($jobttlArr) && $jobttlArr != 'norows') {
$jobtitle = ', ' . $jobttlArr[0]['jobtitlename'];
$data['jobtitlename'] = $jobttlArr[0]['jobtitlename'];
}
$ir_form->interviewer_id->addMultiOptions(array('' => $interviewer_data['userfullname'] . $jobtitle));
$roundData['interview_date'] = sapp_Global::change_date($roundData['interview_date'], 'view');
$roundData['interview_time'] = sapp_Global::change_time($roundData['interview_time'], 'view');
$ir_form->populate($roundData);
$this->view->form = $ir_form;
$this->view->intId = $intId;
$this->view->deptid = $deptid;
$this->view->roundId = $roundId;
$this->view->ermsg = '';
$this->view->country_name = $country_name;
$this->view->state_name = $state_name;
$this->view->city_name = $city_name;
$this->view->edit_flag = $edit_flag;
} else {
$this->view->ermsg = 'nodata';
//.........这里部分代码省略.........
示例12: addinterview
/**
* This function acts as a service for adding a interview.
* @param array $params_arr = array of parameters
* @return array Array of results.
*/
public function addinterview($params_arr)
{
$result = array();
$status = 0;
$message = "No access to add interview.";
if (isset($params_arr['role_id']) && $params_arr['role_id'] != '' && isset($params_arr['group_id']) && $params_arr['group_id'] != '' && isset($params_arr['userid']) && $params_arr['userid'] != '') {
$role_id = $params_arr['role_id'];
$group_id = $params_arr['group_id'];
$userid = $params_arr['userid'];
if ($role_id == SUPERADMINROLE || $group_id == MANAGEMENT_GROUP || $group_id == HR_GROUP) {
$privilege_flag = sapp_Global::_checkprivileges(SCHEDULEINTERVIEWS, $group_id, $role_id, 'add');
if ($privilege_flag == 'Yes') {
$status = 1;
$message = "success";
$req_model = new Default_Model_Requisition();
$countryModal = new Default_Model_Countries();
$req_data = $req_model->getReqForInterviews();
$req_options = $requisition_options = array();
$countries_options = $cntry_options = array();
foreach ($req_data as $req) {
$req_options[$req['id']] = $req['requisition_code'] . ' - ' . $req['jobtitlename'];
}
$requisition_options = array('' => 'Select Requisition ID') + $req_options;
$countriesData = $countryModal->fetchAll('isactive=1', 'country');
foreach ($countriesData->toArray() as $data) {
$cntry_options[trim($data['country_id_org'])] = $data['country'];
}
$countries_options = array('' => 'Select country') + $cntry_options;
$interview_type_options = array('' => 'Select Interview Type', 'In person' => 'In person', 'Phone' => 'Phone', 'Video conference' => 'Video conference');
if (empty($req_options) && count($req_options) == 0) {
$status = 0;
$message = "No approved requisitions.";
} else {
if (empty($cntry_options) && count($cntry_options) == 0) {
$status = 0;
$message = "Countries are not configured yet.";
} else {
$result['req_id'] = $requisition_options;
$result['country'] = $countries_options;
$result['interview_mode'] = $interview_type_options;
}
}
}
}
}
return array('status' => $status, 'message' => $message, 'result' => $result);
}