本文整理汇总了PHP中Default_Model_Users::addOrUpdateUserModel方法的典型用法代码示例。如果您正苦于以下问题:PHP Default_Model_Users::addOrUpdateUserModel方法的具体用法?PHP Default_Model_Users::addOrUpdateUserModel怎么用?PHP Default_Model_Users::addOrUpdateUserModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Default_Model_Users
的用法示例。
在下文中一共展示了Default_Model_Users::addOrUpdateUserModel方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updatebgstatus
public function updatebgstatus($con, $specimenid, $flag)
{
$db = Zend_Db_Table::getDefaultAdapter();
$screeningmodel = new Default_Model_Empscreening();
$usermodel = new Default_Model_Users();
$candmodel = new Default_Model_Candidatedetails();
if ($con == 'onhold') {
$userdata = array('backgroundchk_status' => 'On hold', 'modifieddate' => gmdate("Y-m-d H:i:s"), 'modifiedby' => $this->getLoginUserId());
$userwhere = "id=" . $specimenid;
if ($flag == 1) {
$usermodel->addOrUpdateUserModel($userdata, $userwhere);
} else {
$candmodel->SaveorUpdateCandidateData($userdata, $userwhere);
}
$data = array('bgcheck_status' => 'On hold', 'modifieddate' => gmdate("Y-m-d H:i:s"), 'modifiedby' => $this->getLoginUserId());
$where = "flag = " . $flag . " AND specimen_id=" . $specimenid;
$screeningmodel->SaveorUpdateDetails($data, $where);
}
if ($con == 'complete') {
$userdata = array('backgroundchk_status' => 'Completed', 'modifieddate' => gmdate("Y-m-d H:i:s"), 'modifiedby' => $this->getLoginUserId());
$userwhere = "id=" . $specimenid;
if ($flag == 1) {
$usermodel->addOrUpdateUserModel($userdata, $userwhere);
} else {
$candmodel->SaveorUpdateCandidateData($userdata, $userwhere);
}
$data = array('bgcheck_status' => 'Complete', 'modifieddate' => gmdate("Y-m-d H:i:s"), 'modifiedby' => $this->getLoginUserId());
$where = "flag = " . $flag . " AND specimen_id=" . $specimenid;
$screeningmodel->SaveorUpdateDetails($data, $where);
}
}
示例2: updatethemeAction
public function updatethemeAction()
{
$this->_helper->layout->disableLayout();
if ($this->getRequest()->isPost()) {
$theme_name = $this->getRequest()->getParam('theme_name');
$usersModel = new Default_Model_Users();
$user_id = sapp_Global::_readSession('id');
$where = array('id = ?' => $user_id);
$data = array('themes' => $theme_name, 'createddate' => gmdate("Y-m-d H:i:s"), 'modifieddate' => gmdate("Y-m-d H:i:s"));
$usersModel->addOrUpdateUserModel($data, $where);
sapp_Global::_writeSession('themes', $theme_name);
$this->_helper->json(array('result' => 'success'));
}
}
示例3: save
//.........这里部分代码省略.........
$state_3 = $this->_request->getParam('state_3');
$city_3 = $this->_request->getParam('city_3');
$contact_type_3 = $this->_request->getParam('contact_type_3');
$emprole = $this->_request->getParam('emprole');
if (empty($websiteExistance)) {
$date = new Zend_Date();
if ($contact_type_1 == 1) {
$agencyEmail = $email_1;
$agencyContactNum = $mobile_1;
$pocfn = $firstname_1;
$pocln = $lastname_1;
} else {
if ($contact_type_2 == 1) {
$agencyEmail = $email_2;
$agencyContactNum = $mobile_2;
$pocfn = $firstname_2;
$pocln = $lastname_2;
} else {
if ($contact_type_3 == 1) {
$agencyEmail = $email_3;
$agencyContactNum = $mobile_3;
$pocfn = $firstname_3;
$pocln = $lastname_3;
}
}
}
$primary_poc_name = ucfirst($pocfn);
/* Create user for the agency */
if ($id == '') {
$pswd = uniqid();
$userdata = array('emprole' => $emprole, 'userstatus' => 'old', 'firstname' => $firstname_1, 'lastname' => $lastname_1, 'userfullname' => $firstname_1 . ' ' . $lastname_1, 'emailaddress' => $agencyEmail, 'contactnumber' => $agencyContactNum, 'emppassword' => md5($pswd), 'isactive' => 1, 'createdby' => $loginUserId, 'createddate' => gmdate("Y-m-d H:i:s"), 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"));
$userWhere = '';
$usersModel = new Default_Model_Users();
$usersTableId = $usersModel->addOrUpdateUserModel($userdata, $userWhere);
$agencyuserid = $usersTableId;
$idcodeModel = new Default_Model_Identitycodes();
$idcode = $idcodeModel->getallcodes('bgcheck');
$userdata = array('employeeId' => $idcode . $usersTableId, 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"));
$userWhere = array('id=?' => $usersTableId);
$usersTableId = $usersModel->addOrUpdateUserModel($userdata, $userWhere);
$options['subject'] = APPLICATION_NAME . ' :: Agency is created';
$options['header'] = 'Greetings from ' . APPLICATION_NAME;
$options['toEmail'] = $agencyEmail;
$options['toName'] = $pocfn . ' ' . $pocln;
$options['message'] = '<div>Dear ' . $pocfn . ',</div>
<div>' . ucfirst($agencyname) . ' agency has been created. The credentials to login to your ' . APPLICATION_NAME . ' account are:
<div>Login ID : ' . $idcode . $agencyuserid . ' </div>
<div>Password : ' . $pswd . '</div>
<div></div>
<div style="padding:20px 0 10px 0;">Please <a href="' . $baseUrl . '/index/popup" target="_blank" style="color:#b3512f;">click here</a> to login and check the agency details.</div>
</div>';
$result = sapp_Global::_sendEmail($options);
$emailids = $agencylistmodel->getAllHRManagementEMails();
foreach ($emailids as $email) {
$options['subject'] = APPLICATION_NAME . ' :: Agency is created';
$options['header'] = 'Agency created';
$options['toEmail'] = $email['groupEmail'];
$options['toName'] = $email['group_name'];
if ($email['group_id'] == 4) {
$salutation = 'Dear HR,';
$options['toName'] = 'HR';
} else {
$salutation = 'Dear Management,';
$options['toName'] = 'Management';
}
$options['message'] = '<div>
示例4: saveProfileDetails
public function saveProfileDetails($viewprofileform)
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
}
if ($viewprofileform->isValid($this->_request->getPost())) {
$id = $this->_request->getParam('id');
$userfullname = $this->_request->getParam('userfullname');
$emailaddress = $this->_request->getParam('emailaddress');
$usersModel = new Default_Model_Users();
$date = new Zend_Date();
$menumodel = new Default_Model_Menu();
$actionflag = '';
$tableid = '';
$data = array('userfullname' => $userfullname, 'emailaddress' => $emailaddress, 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"));
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 = $usersModel->addOrUpdateUserModel($data, $where);
sapp_Global::writeApplicationConstants($emailaddress, APPLICATION_NAME);
if ($Id == 'update') {
$tableid = $id;
$this->_helper->getHelper("FlashMessenger")->addMessage("Profile details updated successfully.");
} else {
$tableid = $Id;
$this->_helper->getHelper("FlashMessenger")->addMessage("Profile details saved successfully.");
}
$this->_redirect('dashboard/viewprofile');
} else {
$messages = $viewprofileform->getMessages();
foreach ($messages as $key => $val) {
foreach ($val as $key2 => $val2) {
$msgarray[$key] = $val2;
break;
}
}
return $msgarray;
}
}
示例5: deleteAction
public function deleteAction()
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
}
$id = $this->_request->getParam('objid');
$messages['message'] = '';
$messages['msgtype'] = '';
$actionflag = 3;
if ($id) {
$employeemodel = new Default_Model_Employee();
$usersModel = new Default_Model_Users();
$menumodel = new Default_Model_Menu();
$empdata = array('isactive' => 5);
$empwhere = array('user_id=?' => $id);
$userdata = array('isactive' => 5);
$userwhere = array('id=?' => $id);
$empId = $employeemodel->SaveorUpdateEmployeeData($empdata, $empwhere);
$userId = $usersModel->addOrUpdateUserModel($userdata, $userwhere);
if ($empId == 'update' && $userId == 'update') {
$menuidArr = $menumodel->getMenuObjID('/employee');
$menuID = $menuidArr[0]['id'];
$result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $id);
$messages['message'] = 'Employee deleted successfully.';
$messages['msgtype'] = 'success';
} else {
$messages['message'] = 'Employee cannot be deleted.';
$messages['msgtype'] = 'error';
}
} else {
$messages['message'] = 'Employee cannot be deleted.';
$messages['msgtype'] = 'error';
}
$this->_helper->json($messages);
}
示例6: save
//.........这里部分代码省略.........
}
}
$oldstatus = $processStatus[0]['process_status'];
$BGStatus = $processStatus[0]['bgcheck_status'];
if ($exists == 'true' && $BGStatus != 'Complete') {
$msgarray['StatusError'] = "The " . $person . " is already assigned to the selected agency. Please re-assign the " . $person . " to another agency.";
$errorflag = "false";
}
}
$oldbgstatusData = $processesmodel->getProcessStatus($specimen_id, $userflag, '', '');
if (!empty($oldbgstatusData)) {
$oldbgstatus = $oldbgstatusData[0]['bgcheck_status'];
} else {
$oldbgstatus = '';
}
}
}
/* END */
}
if ($processesform->isValid($this->_request->getPost()) && $errorflag != 'false') {
$date = new Zend_Date();
$menumodel = new Default_Model_Menu();
$actionflag = '';
$tableid = '';
/* A New process is created for a user whose background check status is in 'Complete' status. Then updating the bg status to 'In process' */
if (($BGStatus == 'Complete' || $oldbgstatus == 'Complete' || $BGStatus == 'On hold' || $oldbgstatus == 'On hold') && $newStatus == 'In process') {
$totalstatusData = array('bgcheck_status' => 'In process', 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"));
$totalstatusWhere = array('specimen_id=?' => $specimen_id, 'flag=?' => $userflag);
$empscreeningModel->SaveorUpdateDetails($totalstatusData, $totalstatusWhere);
/* Updating back ground check status to In process in employees/candidates status */
if ($userflag == 1) {
$empData = array('backgroundchk_status' => 'In process', 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"));
$empWhere = array('id=?' => $specimen_id);
$usermodel->addOrUpdateUserModel($empData, $empWhere);
} else {
$candModel = new Default_Model_Candidatedetails();
$candData = array('backgroundchk_status' => 'In process', 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"));
$candWhere = array('id=?' => $specimen_id);
$candModel->SaveorUpdateUserData($candData, $candWhere);
}
/* END */
/* Mail to HRD, Line 1 and Line 2 managers that the background checks has been re-opened */
if ($BGStatus != 'On hold' && $oldbgstatus != 'On hold') {
$empData = $empscreeningModel->getEmpPersonalData($specimen_id, $userflag);
if ($userflag == 1) {
$username = $empData[0]['name'];
$lmanager1Email = $empData[0]['rmanager_email'];
$lmanager1Name = $empData[0]['reporting_manager'];
} else {
$username = $empData[0]['candidate_name'];
$lmanager1Email = '';
}
$bid = '';
if (isset($empData[0]['businessid'])) {
$bid = $empData[0]['businessid'];
}
if (isset($lmanager1Email) && $lmanager1Email != '') {
$manager1 = array($lmanager1Email);
} else {
$manager1 = array();
}
if (isset($agencyEmail) && $agencyEmail != '') {
$agencyemail1 = array($agencyEmail);
} else {
$agencyemail1 = array();
}
示例7: forcedfullupdateAction
public function forcedfullupdateAction()
{
$baseUrl = BASE_URL;
$baseUrl = rtrim($baseUrl, '/');
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
}
Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . "/layouts/scripts/popup/");
$specimenId = $this->_request->getParam('specimenId');
$empFlag = $this->_request->getParam('empFlag');
$count = intval($this->_request->getParam('count'));
$username = '';
$empscreeningModel = new Default_Model_Empscreening();
$getAllRecords = $empscreeningModel->checkbgstatus($specimenId, $empFlag, 'completedata');
$username = $getAllRecords[0]['username'];
if (isset($getAllRecords[0]['rmanager_email'])) {
$reportmanagerEmail = $getAllRecords[0]['rmanager_email'];
} else {
$reportmanagerEmail = '';
}
if (isset($getAllRecords[0]['reporting_manager'])) {
$reportmanagername = $getAllRecords[0]['reporting_manager'];
} else {
$reportmanagername = '';
}
if ($count == '') {
$this->view->dataArray = $getAllRecords;
}
$close = '';
if ($count != '') {
for ($i = 0; $i < $count; $i++) {
$id = intval($this->_request->getParam('id' . $i));
$explanation = $this->_request->getParam('text' . $i);
$date = new Zend_Date();
$data = array('process_status' => 'Complete', 'explanation' => $explanation, 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"));
$where = array('specimen_id=?' => $specimenId, 'flag=?' => $empFlag, 'process_status=?' => 'In process', 'id=?' => $id);
$detailId = $empscreeningModel->SaveorUpdateDetails($data, $where);
$where = array('specimen_id=?' => $specimenId, 'flag=?' => $empFlag, 'process_status' => 'On hold', 'id=?' => $id);
$detailId = $empscreeningModel->SaveorUpdateDetails($data, $where);
if ($detailId == 'update') {
$tableid = $id;
} else {
$tableid = $detailId;
}
$actionflag = 2;
$menuID = EMPSCREENING;
$result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $specimenId . '-' . $empFlag);
}
$bgdata = array('bgcheck_status' => 'Complete', 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"));
$where = array('specimen_id=?' => $specimenId, 'flag=?' => $empFlag, 'isactive = 1');
$actionflag = 2;
$detailId = $empscreeningModel->SaveorUpdateDetails($bgdata, $where);
/* Updating back ground check status to Completed in employees/candidates status */
if ($empFlag == 1) {
$usermodel = new Default_Model_Users();
$empData = array('backgroundchk_status' => 'Completed', 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"));
$empWhere = array('id=?' => $specimenId);
$usermodel->addOrUpdateUserModel($empData, $empWhere, $specimenId);
} else {
$candModel = new Default_Model_Candidatedetails();
$candData = array('backgroundchk_status' => 'Completed', 'modifiedby' => $loginUserId, 'modifieddate' => gmdate("Y-m-d H:i:s"));
$candWhere = array('id=?' => $specimenId);
$candModel->SaveorUpdateUserData($candData, $candWhere);
}
/* END */
/* Mail to HRD, L1 and L2 managers*/
$personalData = $empscreeningModel->getEmpPersonalData($specimenId, $empFlag);
$bid = '';
if (isset($personalData[0]['businessid'])) {
$bid = $personalData[0]['businessid'];
}
if (isset($reportmanagerEmail) && $reportmanagerEmail != '') {
$manager1 = array($reportmanagerEmail);
} else {
$manager1 = array();
}
if (defined('BG_CHECKS_MNGMNT_' . $bid) && $bid != '') {
$mngmntemailId = explode(",", constant('BG_CHECKS_MNGMNT_' . $bid));
} else {
$mngmntemailId = array();
}
if (defined('BG_CHECKS_HR_' . $bid) && $bid != '') {
$hremailId = explode(",", constant('BG_CHECKS_HR_' . $bid));
} else {
$hremailId = array();
}
$emailArr = array_merge($manager1, $mngmntemailId, $hremailId);
for ($i = 0; $i < sizeof($emailArr); $i++) {
$salutation = 'Dear Sir/Madam,';
if ($i == 0) {
$salutation = 'Dear ' . ucfirst($reportmanagername) . ',';
$options['toName'] = ucfirst($reportmanagername);
} else {
if ($i == 1) {
$salutation = 'Dear Management,';
$options['toName'] = 'Management';
} else {
if ($i == 2) {
$salutation = 'Dear HR,';
//.........这里部分代码省略.........