本文整理匯總了PHP中DaoFactory::CompanyMst方法的典型用法代碼示例。如果您正苦於以下問題:PHP DaoFactory::CompanyMst方法的具體用法?PHP DaoFactory::CompanyMst怎麽用?PHP DaoFactory::CompanyMst使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DaoFactory
的用法示例。
在下文中一共展示了DaoFactory::CompanyMst方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: perform
/**
*
* @see Ethna_ActionClass::perform()
*/
function perform()
{
$days = $this->config->get('license_warning_days');
try {
$licenseDao = DaoFactory::LicenseMst();
$userDao = DaoFactory::UserMst();
$companyDao = DaoFactory::CompanyMst();
sort($days, SORT_NUMERIC);
$result = array();
foreach ($days as $day) {
$params = array('day' => $day);
$res = $licenseDao->LicenseMST_GetLicenseValidDays($params)->fetchAll(PDO::FETCH_ASSOC);
$result = array_merge($result, $res);
}
foreach ($result as $value) {
$send_email[$value['COMPANY_ID']][] = array('TERMINAL_ID' => $value['TERMINAL_ID'], 'END_YMD' => $value['END_YMD']);
}
//send e-mail
$headers = "From: {$this->config->get('admin_email_address')}";
foreach ($send_email as $company => $arr) {
$invalid_terminal_list = '';
foreach ($arr as $key => $value) {
$invalid_terminal_list .= "\n{$value['TERMINAL_ID']}\t\t\t{$value['END_YMD']}";
}
//get admin user's e-mail address and language
$companyInfo = $companyDao->Retrieve('COMPANY_ID = ?', array($company));
//$companyInfo['CONTACT']
$userInfo = $userDao->Retrieve("LOGIN_ID = 'admin' AND COMPANY_ID = ? ", array($company));
//$userInfo['E_MAIL']
//$userInfo['DEFAULT_LOCALE'] zh-Hans-CN en_US ja_JP
if ($userInfo['DEFAULT_LOCALE'] == 'zh-Hans-CN') {
$this->backend->getController()->setLocale('zh-Hans-CN');
$subject = _et($this->config->get('system_name')) . "終端證書即將到期";
$send_message = "\n{$companyInfo['COMPANY_NAME']} \n{$companyInfo['CONTACT']} 您好!\n \t\n非常感謝您使用我們的{$this->config->get('app_name')}服務。\n您的以下終端的證書即將過期,為了不影響業務請盡快到證書管理頁麵購買新的證書。\n\n終端\t\t\t到期日\n" . $invalid_terminal_list . "\n\n新的證書可以從後台管理係統的證書管理頁麵購買,也可以直接到AsShop購買。\n如有任何問題請隨即和我們取得聯係。\n\n服務總站 http://www.asx4.net\nAsWiki\t\thttps://wiki.asx4.net\nAsHelp \thttps://support.asx4.net\nAsShop\thttps://ec.asx4.net\n \t\n";
} elseif ($userInfo['DEFAULT_LOCALE'] == 'ja_JP') {
$this->backend->getController()->setLocale('ja_JP');
$subject = _et($this->config->get('system_name')) . "端末のライセンスの期限が近づいています";
$send_message = "\n{$companyInfo['COMPANY_NAME']} \n{$companyInfo['CONTACT']} 様\n \t\n{$this->config->get('app_name')}をご利用いただきまして誠にありがとうございます。\n下記の端末のライセンスの期限が近づいています。業務に影響を與えないように早めに新しいライセンスをご購入ください。\n\n端末ID\t\t\t期限\n" . $invalid_terminal_list . "\n\nライセンスは管理畫麵のライセンスマスタ畫麵か、AsShopからご購入いただけます。\nご不明な點がございましたら、お問い合わせください。\n\nサービスホーム http://www.asx4.net\nAsWiki \t\t\t\thttps://wiki.asx4.net\nAsHelp \t\t\t\thttps://support.asx4.net\nAsShop \t\t\t\thttps://ec.asx4.net \n \t\n";
} else {
$this->backend->getController()->setLocale('en_US');
$subject = _et($this->config->get('system_name')) . " Terminal will be out of license soon";
$send_message = "\n{$companyInfo['COMPANY_NAME']} \nHi {$companyInfo['CONTACT']}\n \t\nThanks for using our {$this->config->get('app_name')} service. \nThe following terminal will be out of license soon. Please buy new license as soon as possible.\n\nTerminal ID\t\t\tValid Until\n" . $invalid_terminal_list . "\n\nYou can buy new licenses from the LICENSE MANAGEMENT page in our admin system or buy form the AsShop directly.\nIf you have any question, please don't hesitate to contact us.\n\nService Home\t\thttp://www.asx4.net\nAsWiki \t\t\thttps://wiki.asx4.net\nAsHelp \t\t\thttps://support.asx4.net\nAsShop \t\t\thttps://ec.asx4.net\n";
}
mb_send_mail($userInfo['E_MAIL'], $subject, $send_message, $headers);
}
} catch (Exception $e) {
$this->logger->log(LOG_ERR, $e->getMessage());
die($e->getMessage());
}
}
示例2: perform
/**
* 會社マスタのデータをJSON形式で返す
* @access public
* @return array 會社マスタ
* @see Admin_ActionClass::perform()
*/
public function perform()
{
// get session params
$company_id = $this->session->get('company_id');
try {
// set dao params
$params = array('company_id' => $company_id);
// get detail
$detail = DaoFactory::CompanyMst()->Retrieve(' company_id = ? ', array('company_id' => $company_id));
$output = array();
$output['COMPANY_ID'] = $company_id;
$output['COMPANY_NAME'] = $detail['COMPANY_NAME'];
$output['ADDRESS'] = $detail['ADDRESS'];
$output['CONTACT'] = $detail['CONTACT'];
$output['COMPANY_TEL'] = $detail['COMPANY_TEL'];
$output['MAIL'] = $detail['MAIL'];
$output['SHIMEBI'] = $detail['SHIMEBI'];
$output['IS_TANA_BANGO_MUST'] = $detail['IS_TANA_BANGO_MUST'];
$output['IS_TANTOSYA_MUST'] = $detail['IS_TANTOSYA_MUST'];
if ('' != $detail['STOCK_MOVE_RCV_WAYS']) {
$arr = explode(',', $detail['STOCK_MOVE_RCV_WAYS']);
} else {
$arr = array();
}
foreach ($arr as $value) {
$output['STOCK_MOVE_RCV_WAYS[' . $value . ']'] = 1;
}
// set output
$output['totalData'] = array();
$output['listData'] = $output;
$output['pagerData'] = array();
} catch (Exception $e) {
// 致命的なエラーが発生
$this->logger->log(LOG_DEBUG, $e->getTraceAsString());
return array('500', $e->getMessage());
}
return array('json', $output);
}
示例3: perform
/**
* 會社マスタの保存が成功したかJSON形式で返す
* @access public
* @see Admin_ActionClass::perform()
*/
function perform()
{
// get request params
$stock_move_rcv_ways = $this->af->get('stock_move_rcv_ways');
$company_name = $this->af->get('company_name');
$address = $this->af->get('address');
$contact = $this->af->get('contact');
$company_tel = $this->af->get('company_tel');
$mail = $this->af->get('mail');
$is_tana_bango_must = $this->af->get('is_tana_bango_must');
$is_tantosya_must = $this->af->get('is_tantosya_must');
// get session params
$company_id = $this->session->get('company_id');
$stock_move_rcv_ways = implode(',', array_keys($stock_move_rcv_ways));
// dao
$CompanyMstDao = DaoFactory::CompanyMst();
try {
// mod params
$open_jikoku = "{$open_jikoku_h}:{$open_jikoku_m}";
$close_jikoku = "{$close_jikoku_h}:{$close_jikoku_m}";
// start transaction
$CompanyMstDao->BeginTransaction();
// set dao params
$params = array('company_name' => $company_name, 'address' => $address, 'contact' => $contact, 'company_tel' => $company_tel, 'mail' => $mail, 'stock_move_rcv_ways' => $stock_move_rcv_ways, 'is_tana_bango_must' => $is_tana_bango_must, 'is_tantosya_must' => $is_tantosya_must, 'UID' => $user_id, 'PGM' => get_class());
// update
$CompanyMstDao->Update($params, ' company_id = ? ', array($company_id));
// commit transaction
$CompanyMstDao->CommitTransaction();
} catch (Exception $e) {
// rollback
$CompanyMstDao->AbortTransaction();
$this->logger->log(LOG_DEBUG, $e->getTraceAsString());
return array(500, $e->getMessage());
}
exit;
}
示例4: perform
function perform()
{
//パラメータ取得
$company_name = $this->af->get('company_name');
$address = $this->af->get('address');
$contact = $this->af->get('contact');
$tel = $this->af->get('tel');
$mail = $this->af->get('mail');
$psw = $this->af->get('psw');
$psw2 = $this->af->get('psw2');
$uuid = $this->af->get('uuid');
$locale = $this->af->get('locale');
if ($locale == "zh-Hans") {
$default_locale = "zh-Hans-CN";
} elseif ($locale == "ja") {
$default_locale = "ja_JP";
} else {
$default_locale = "en_US";
}
$params = array('company_name' => $company_name, 'address' => $address, 'contact' => $contact, 'company_tel' => $tel, 'mail' => $mail, 'UID' => 'terminal', 'PGM' => get_class());
try {
//fixme
$dao = DaoFactory::CompanyMst();
$wdao = DaoFactory::WarehouseMst();
$tdao = DaoFactory::TerminalMst();
$sdao = DaoFactory::StaffMst();
$tudao = DaoFactory::TerminalUdidMst();
$dao->BeginTransaction();
$company_id = $dao->getNewCompanyId();
$argu = array('company_id' => $company_id, 'example_id' => $this->config->get('template_company_id'), 'uuid' => $uuid, 'upd_uid' => 'terminal', 'upd_pgm' => get_class());
$dao->addNewCompanyForApi($argu);
$where = ' COMPANY_ID = ? ';
$bind = array($company_id);
$dao->Update($params, $where, $bind);
$wdao->Update(array('address' => $address, 'warehouse_tel' => $tel, 'contact' => $contact, 'UID' => 'terminal', 'PGM' => get_class()), $where, $bind);
$sdao->Update(array('staff_tel' => $tel, 'UID' => 'terminal', 'PGM' => get_class()), $where, $bind);
$tdao->Update(array('password' => $psw, 'UID' => 'terminal', 'PGM' => get_class()), $where, $bind);
$tudao->Update(array('terminal_id' => $terminal_id, 'udid' => $udid, 'UID' => 'terminal', 'PGM' => get_class()), $where, $bind);
DaoFactory::UserMst()->Update(array('user_pwd' => $psw, 'UID' => 'terminal', 'PGM' => get_class(), 'E_MAIL' => $mail, 'DEFAULT_LOCALE' => $default_locale), $where, $bind);
$warehouse_id = $wdao->getMaxWarehouseIdByCompany(array('company_id' => $company_id));
$terminal_id = $tdao->getMaxTerminalIdByCompany(array('company_id' => $company_id));
$staff_id = $sdao->getMaxStaffIdByCompany(array('company_id' => $company_id));
//commit
$dao->CommitTransaction();
} catch (Exception $e) {
// 致命的なエラーが発生
$dao->AbortTransaction();
$this->logger->log(LOG_DEBUG, $e->getTraceAsString());
return array('500', $e->getMessage());
}
mb_language('uni');
if ($locale == 'ja') {
$subject = "{$this->config->get('system_name')}利用開始のご案內";
$message = "\r\n{$company_name} \r\n{$contact} 様\r\n\r\nこの度は「{$this->config->get('system_name')}」サービスにご登録いただきまして、誠にありがとうございます。\r\n本メールは iPhone/iPod touch の {$this->config->get('app_name')}アプリからアカウント申請を行っていただいた方に自動送信されています。\r\n本メールの心當たりがない場合は、本メールの破棄と弊社までご連絡頂ますようお願い申し上げます。\r\n\r\nアカウント申請後は {$this->config->get('app_name')}アプリのログイン畫麵にて申請時に入力したパスワードでログインが可能です。\r\n新規でご登録していただいたアカウントには端末1台2ヶ月まで無料ご利用いただけます。\r\n別の端末でログインするには、管理畫麵から端末追加登録とライセンス購入する必要がございます。\r\nライセンスのご購入はライセンスマスタ管理畫麵の購入リンクを押すか、直接AsShopにて、オンラインにてご購入いただけます。\r\n\r\nアカウント申請に伴い {$this->config->get('system_name')}に下記の情報が登録されています。\r\n-----------------アカウント情報------------------\r\n\t 會社ID:{$company_id}\r\n 初期管理者ユーザID:admin\r\n 管理者パスワード:申請時ご入力いただいたパスワード (端末のログインパスワードも同じです)※セキュリティのためパスワード本メールに含んでいません\r\n WEB管理畫麵URL: {$this->config->get('url')}?company_id={$company_id}\r\n \r\n------------------デモ情報-------------------------\r\n**登録後すぐに端末からログインし、ご利用いただけるように、上記のアカウント情報以外に\r\n下記必要なデモデータも自動的に作成されています。\r\n 倉庫/場所/発注先 コード:{$warehouse_id}\r\n 端末ID:{$terminal_id}\r\n 擔當者ID:{$staff_id}\r\n---------------------------------------------------\r\n\r\n本サービスはiPhone/iPod touch用バーコードリーダー「AsReader」を併用すると更に便利にご利用になれます。\r\n詳しくはホームページまで。\r\nhttp://asreader.com/\r\n\r\n本サービスご利用にあたり、質問などお困りの時がございましたら、下記のサイトまでご參照ください。\r\nサービスホーム http://www.asx4.net\r\nAsWiki https://wiki.asx4.net\r\nAsHelp https://support.asx4.net\r\nAsShop https://ec.asx4.net\r\n\r\n ";
} elseif ($locale == 'zh-Hans') {
$subject = "{$this->config->get('app_name')}服務使用向導";
$message = "\r\n{$company_name} \r\n{$contact} 您好!\r\n \t\r\n非常感謝您登錄{$this->config->get('app_name')}。\r\n這封郵件是在您通過iPhone/iPod touch的{$this->config->get('app_name')}應用程序,申請賬號時自動發送給您的。\r\n如果您對該郵件不知情,請銷毀本郵件並與我們聯係。\r\n \t\r\n賬戶申請後,您就可以使用申請賬號時所設置的密碼在 {$this->config->get('app_name')}應用程序的登錄畫麵中登錄使用了。\r\n新注冊的賬號裏已自動生成1台終端,可免費使用兩個月。\r\n如需新增使用其他終端,需要在管理畫麵中的“終端管理”進行終端添加並購買證書後方可使用。\r\n \t\r\n以下是您所申請的{$this->config->get('app_name')}賬戶的相關信息。\r\n-----------------賬戶信息------------------\r\n\t 公司ID:{$company_id}\r\n \t 管理員ID:admin\r\n\t 管理員密碼:申請賬戶時填寫的密碼 (與終端登錄密碼相同)\r\n\t WEB管理頁麵URL: {$this->config->get('url')}?company_id={$company_id}\r\n \t \r\n------------------模板信息-------------------------\r\n**為了在注冊後您可以馬上使用終端登錄來體驗我們的服務,除以上賬戶信息外,\r\n我們也為你創建了以下必要的基本信息。\r\n\t 倉庫/場所/供貨方 代碼:{$warehouse_id}\r\n\t 終端ID:{$terminal_id}\r\n\t 操作員ID:{$staff_id}\r\n---------------------------------------------------\r\n \t\r\n如在使用本服務中遇到任何問題,請查看以下相關網站。\r\n服務總站 http://www.asx4.net\r\nAsWiki https://wiki.asx4.net\r\nAsHelp https://support.asx4.net\r\nAsShop https://ec.asx4.net \r\n \t\r\n";
} else {
$subject = "Thank you for signing up {$this->config->get('app_name')} service";
$message = "\r\n{$company_name} \r\nHi {$contact} \r\n \t \r\nThank you for signing up our service {$this->config->get('app_name')}. \r\nThis mail is sent to every user who has registered an new account from our iOS app {$this->config->get('app_name')}.\r\nPlease feel free to contact us if you were not aware that you were going to receive it.\r\n \t \r\nYou can login to the app {$this->config->get('app_name')} with the password you have input in the register form upon receipt of this email.\r\n \t \r\nAccount Information:\r\n-----------------Account info------------------\r\n\t Company ID:{$company_id}\r\n\t Admin User ID:admin\r\n\t Password:The password you set in registration form\r\n\t Admin page URL: {$this->config->get('url')}?company_id={$company_id}\r\nEvery new account is assoiated with one preset terminal with a 2month free license.\r\nIf you want more terminals or longer licenses, please create terminal in the back-end admin system and buy license from our online shop.\r\n\r\n------------------demo data-------------------------\r\nBesides the account information above, we have also created some demo datas in order to help you test or learn our system easier.\r\n\t Warehouse/Place/Seller ID:{$warehouse_id}\r\n\t Terminal ID:{$terminal_id}\r\n\t Staff ID:{$staff_id}\r\n---------------------------------------------------\r\n \t \r\nOur app support AsReader 100% internally. AsReader is a series of hardware for iOS devices, they have ability to scan barcode or RFID tags and send the data to iOS devices.\r\nSo, it can easily turn your iPhones/iPods into a powerful handheld termials.\r\nfor more information, please refer to their official site:\r\nhttp://asreader.com/\r\n\r\nIf you have any question during using our service, please consult our following site for more information.\r\nService Home http://www.asx4.net\r\nAsWiki https://wiki.asx4.net\r\nAsHelp https://support.asx4.net\r\nAsShop https://ec.asx4.net\r\n\r\nBest regards,\r\n\r\nAsApps Team\r\n \t \r\n";
}
$headers = "From: {$this->config->get('admin_email_address')}";
mb_send_mail($mail, $subject, $message, $headers);
$output['company_id'] = $company_id;
$output['warehouse_id'] = $warehouse_id;
$output['terminal_id'] = $terminal_id;
$output['staff_id'] = $staff_id;
$output['server_url'] = $this->config->get('url');
return array('json', $output);
}
示例5: Login
public function Login($params)
{
if ($this->isLogin()) {
$this->Logout();
}
// dao
$UserMst = DaoFactory::UserMst();
// スーパーユーザフラグ初期化
$super_user_flg = false;
// 指定したlogin_idのスーパーユーザを取得
$super_user = $UserMst->Retrieve(' company_id = ? and login_id = ? and kengen_flg = ? ', array('company_id' => '-', 'login_id' => $params['login_id'], 'kengen_flg' => Konst::KENGEN_FLG_SUPER));
// 指定した login_id と password を取得したレコードで存在チェック
if ($super_user['LOGIN_ID'] === $params['login_id'] && $super_user['USER_PWD'] === $params['password']) {
// 指定の會社IDが存在することを確認
$ret_kaisha = DaoFactory::CompanyMst()->Retrieve(' company_id = ? ', array('company_id' => $params['company_id']));
// 存在しない場合はログインエラー
if (!$ret_kaisha) {
return LoginController::LOGIN_FAILED;
}
// スーパーユーザである
$super_user_flg = true;
// 後のログイン処理に乗せるために代入
$userData = $super_user;
// スーパーユーザの會社CDは意味の無いものなので、ログイン時に入力した値を用いる
$su_company_id = $userData['COMPANY_ID'];
$userData['COMPANY_ID'] = $params['company_id'];
}
// ユーパーユーザでなければ通常ログイン処理
if ($super_user_flg === false) {
// ユーザデータ取得
$userData = $UserMst->UserMst_GetByLoginId($params);
// レコードのチェック
if (empty($userData)) {
return LoginController::LOGIN_FAILED;
}
// ユーザーの存在チェック
if ($userData['LOGIN_ID'] !== $params['login_id']) {
return LoginController::LOGIN_FAILED;
}
// パスワードロック中でないかチェック
if ($userData['PWD_LOCKING'] == 1) {
return LoginController::LOGIN_LOCKING;
}
// パスワードが合っているかチェック
if ($userData['USER_PWD'] !== $params['password']) {
// パスワード誤入力時の処理
$opt_params = array('company_id' => $userData['COMPANY_ID'], 'user_id' => $userData['USER_ID'], 'upd_uid' => $userData['USER_ID'], 'upd_pgm' => get_class());
$UserMst->UserMst_PasswordMismatch($opt_params);
if ($userData['PWD_MISMATCH'] == PWD_MISMATCH_NUM_TO_LOCK - 2) {
return LoginController::LOGIN_LOCK_WARNING;
} else {
if ($userData['PWD_MISMATCH'] == PWD_MISMATCH_NUM_TO_LOCK - 1) {
return LoginController::LOGIN_JUSTNOW_LOCKED;
}
}
return LoginController::LOGIN_FAILED;
}
// ライセンスが有効期間內かチェック
/*$wheresql = 'company_id = ? AND current_date BETWEEN start_date AND end_date';
$params = array(
'company_id' => $params['company_id'],
);
if (DaoFactory::LicenseD()->Retrieve($wheresql, $params) === false) {
// 有効期間外の場合
return LoginController::LOGIN_EXPIRE_LICENSE;
}*/
}
// ログイン成功時の処理
$opt_params = array('company_id' => $userData['COMPANY_ID'], 'user_id' => $userData['USER_ID'], 'upd_uid' => $userData['USER_ID'], 'upd_pgm' => get_class());
$UserMst->UserMst_loginSuccess($opt_params);
$this->session->start();
$loginData = array('user' => $userData, 'session_time' => time());
$this->session->set('loginData', serialize($loginData));
$this->session->set('company_id', $userData['COMPANY_ID']);
$this->session->set('user_id', $userData['USER_ID']);
$this->session->set('kengen_flg', $userData['KENGEN_FLG']);
$this->session->set('pwd_kigengire', $userData['PWD_KIGENGIRE']);
$this->session->set('pwd_kigen_zan', $userData['PWD_KIGEN_ZAN']);
$this->session->set('role_id', $userData['ROLE_ID']);
if ($super_user_flg === true) {
$this->session->set('su_company_id', $su_company_id);
}
return LoginController::LOGIN_SUCCESS;
}