/** * 前台台控制器初始化 */ protected function _initialize() { // plugin('Fangke'); /* 读取数据库中的配置 */ $config = F('DB_CONFIG_DATA'); if (!$config || APP_DEBUG) { $config = api('Config/lists'); F('DB_CONFIG_DATA', $config); } C($config); //添加配置 C('TMPL_PARSE_STRING', array('__STATIC__' => __ROOT__ . '/Public/Static', '__IMG__' => __ROOT__ . '/Public/' . MODULE_NAME . '/' . C('DEFAULT_THEME') . '/images', '__CSS__' => __ROOT__ . '/Public/' . MODULE_NAME . '/' . C('DEFAULT_THEME') . '/css', '__JS__' => __ROOT__ . '/Public/' . MODULE_NAME . '/' . C('DEFAULT_THEME') . '/js')); defined('__DB_PREFIX__') or define('__DB_PREFIX__', C('DB_PREFIX')); defined('UID') or define('UID', is_login()); if (C('WEB_SITE_CLOSE') && UID != 1) { $this->show('网站维护中请稍后访问'); die; } $str = run_plugin_method('Spider', 'addinfo'); //var_dump($config); if (UID) { //登陆的情况 //赋值当前登陆用户信息 $uinfo = session('uinfo'); $map[get_account_type($uinfo['username'])] = $uinfo['username']; $jin = __DB_PREFIX__ . "member_group as a on " . __DB_PREFIX__ . "member.member_group_id=a.member_group_id"; $field = "*," . __DB_PREFIX__ . "member.status as status"; $user = D('Member')->field($field)->where($map)->join($jin)->find(); session('uinfo', $user); $this->assign('uinfo', $user); } }
function can_process($selected_id) { if (strlen(trim($_POST['id'])) == 0) { display_error(_("The account group id cannot be empty.")); set_focus('id'); return false; } if (strlen(trim($_POST['name'])) == 0) { display_error(_("The account group name cannot be empty.")); set_focus('name'); return false; } $type = get_account_type(trim($_POST['id'])); if ($type && $type['id'] != $selected_id) { display_error(_("This account group id is already in use.")); set_focus('id'); return false; } //if (strcmp($_POST['id'], $_POST['parent']) == 0) if ($_POST['id'] === $_POST['parent']) { display_error(_("You cannot set an account group to be a subgroup of itself.")); return false; } return true; }
public function add($member_group_id = '', $username = '', $password = '', $repassword = '', $email = '') { if (IS_POST) { /* 检测密码 */ if ($password != $repassword) { $this->error('密码和重复密码不一致!'); } $data = array('member_group_id' => $member_group_id, 'username' => $username, 'password' => $password, 'email' => $email, 'mobile' => $mobile, 'create_time' => NOW_TIME, 'update_time' => NOW_TIME, 'account' => create_account()); //自动判断用户名是哪个字段 $data[get_account_type($username)] = $username; $mem = D('Member'); /* 添加用户 */ if ($mem->create($data)) { $mem->password = ainiku_ucenter_md5($mem->password); $uid = $mem->add(); return $uid > 0 ? $this->success('添加成功') : $this->error('添加失败'); //0-未知错误,大于0-注册成功 } else { return $this->error($mem->getError()); //错误详情见自动验证注释 } } else { $field = get_model_attr('member'); $this->assign('fieldarr', $field); $this->meta_title = '新增用户'; $this->display('edit'); } }
public function login($username = null, $password = null, $verify = null, $autologin = false) { if (IS_POST || $autologin) { /* 检测验证码 TODO: */ if (!check_verify($verify) && !$autologin) { $this->error('验证码输入错误!'); } //自动判断用户名是哪个字段的 $map[get_account_type($username)] = $username; $map['password'] = ainiku_ucenter_md5($password); $map['status'] = 1; //$map['member_group_id']=1; $map['is_adminlogin'] = 1; $user = D('MemberView')->where($map)->find(); if (empty($user)) { //登录失败 cookie('__uid__', null); return $autologin ? false : $this->error('用户名或密码错误!'); } else { //登陆成功 /* 记录登录SESSION和COOKIES */ $auth = array('uid' => $user['member_id'], 'username' => $user['username'], 'last_login_time' => $user['update_time']); session('user_auth', $auth); session('uinfo', $user); session('user_auth_sign', data_auth_sign($auth)); //更新用户登录信息 $this->updateLogin($user['member_id']); //把用户密码加密保存到cookie中 if (!$autologin) { $u['u'] = ainiku_encrypt($username); $u['p'] = ainiku_encrypt($password); //如果有验证码的话就再次设置记录时间cookie $a = I('post.remember'); $b = 0; switch ($a) { case 1: $b = 24 * 3600; break; case 2: $b = 24 * 3600 * 7; break; case 3: $b = 24 * 3600 * 30; break; default: $b = -1; } cookie('__uid__', $u, $b); } return $autologin ? $user['member_id'] : $this->success('登录成功!', U($user['admin_index'], array('mainmenu' => 'true'))); } } else { if (is_login() || $this->autologin()) { $user = session('uinfo'); redirect(U($user['admin_index'], array('mainmenu' => 'true'))); } else { $this->display(); } } }
public function login($username = null, $password = null, $verify = null) { if (IS_POST) { /* 检测验证码 TODO: */ if (!check_verify($verify)) { $this->error('验证码输入错误!'); } //用户登陆验证开始 $error = ''; $map = array(); $dbprefix = __DB_PREFIX__; $map[get_account_type($username)] = $username; $map['password'] = ainiku_ucenter_md5($password); $map['status'] = 1; $map['member_group_id'] = 2; //前台只允许会员登陆 $user = M('Member')->field($field)->where($map)->find(); if (empty($user)) { $this->error('用户名或密码错误!'); } else { /* 记录登录SESSION和COOKIES */ $auth = array('uid' => $user['member_id'], 'username' => $user['username'], 'last_login_time' => $user['last_login_time']); session('user_auth', $auth); session('uinfo', $user); session('user_auth_sign', data_auth_sign($auth)); define('UID', $user['member_id']); //更新用户登录信息 self::updateLogin($user['member_id']); $this->success('登陆成功', U('Member/portal')); } } else { //显示登陆页面 if (IS_AJAX) { $this->display('ajaxlogin'); } else { $this->display(); } } }
function display_profit_and_loss() { global $path_to_root, $sel; if (!isset($_POST['Dimension'])) { $_POST['Dimension'] = 0; } if (!isset($_POST['Dimension2'])) { $_POST['Dimension2'] = 0; } $dimension = $_POST['Dimension']; $dimension2 = $_POST['Dimension2']; $from = $_POST['TransFromDate']; $to = $_POST['TransToDate']; $compare = $_POST['Compare']; if (isset($_POST["AccGrp"]) && strlen($_POST['AccGrp']) > 0) { $drilldown = 1; } else { $drilldown = 0; } // Root level $dec = 0; $pdec = user_percent_dec(); if ($compare == 0 || $compare == 2) { $end = $to; if ($compare == 2) { $begin = $from; } else { $begin = begin_fiscalyear(); } } elseif ($compare == 1) { $begin = add_months($from, -12); $end = add_months($to, -12); } div_start('pl_tbl'); start_table(TABLESTYLE, "width=50%"); $tableheader = "<tr>\n <td class='tableheader'>" . _("Group/Account Name") . "</td>\n <td class='tableheader'>" . _("Period") . "</td>\n\t\t<td class='tableheader'>" . $sel[$compare] . "</td>\n\t\t<td class='tableheader'>" . _("Achieved %") . "</td>\n </tr>"; if (!$drilldown) { $parent = -1; $classper = 0.0; $classacc = 0.0; $salesper = 0.0; $salesacc = 0.0; //Get classes for PL $classresult = get_account_classes(false, 0); while ($class = db_fetch($classresult)) { $class_per_total = 0; $class_acc_total = 0; $convert = get_class_type_convert($class["ctype"]); //Print Class Name table_section_title($class["class_name"], 4); echo $tableheader; //Get Account groups/types under this group/type $typeresult = get_account_types(false, $class['cid'], -1); while ($accounttype = db_fetch($typeresult)) { $TypeTotal = display_type($accounttype["id"], $accounttype["name"], $from, $to, $begin, $end, $compare, $convert, $dec, $pdec, $rep, $dimension, $dimension2, $drilldown, $path_to_root); $class_per_total += $TypeTotal[0]; $class_acc_total += $TypeTotal[1]; if ($TypeTotal[0] != 0 || $TypeTotal[1] != 0) { $url = "<a href='{$path_to_root}/gl/inquiry/profit_loss.php?TransFromDate=" . $from . "&TransToDate=" . $to . "&Compare=" . $compare . "&Dimension=" . $dimension . "&Dimension2=" . $dimension2 . "&AccGrp=" . $accounttype['id'] . "'>" . $accounttype['id'] . " " . $accounttype['name'] . "</a>"; alt_table_row_color($k); label_cell($url); amount_cell($TypeTotal[0] * $convert); amount_cell($TypeTotal[1] * $convert); amount_cell(Achieve($TypeTotal[0], $TypeTotal[1])); end_row(); } } //Print Class Summary start_row("class='inquirybg' style='font-weight:bold'"); label_cell(_('Total') . " " . $class["class_name"]); amount_cell($class_per_total * $convert); amount_cell($class_acc_total * $convert); amount_cell(Achieve($class_per_total, $class_acc_total)); end_row(); $salesper += $class_per_total; $salesacc += $class_acc_total; } start_row("class='inquirybg' style='font-weight:bold'"); label_cell(_('Calculated Return')); amount_cell($salesper * -1); amount_cell($salesacc * -1); amount_cell(achieve($salesper, $salesacc)); end_row(); } else { //Level Pointer : Global variable defined in order to control display of root global $levelptr; $levelptr = 0; $accounttype = get_account_type($_POST["AccGrp"]); $classid = $accounttype["class_id"]; $class = get_account_class($classid); $convert = get_class_type_convert($class["ctype"]); //Print Class Name table_section_title($_POST["AccGrp"] . " " . get_account_type_name($_POST["AccGrp"]), 4); echo $tableheader; $classtotal = display_type($accounttype["id"], $accounttype["name"], $from, $to, $begin, $end, $compare, $convert, $dec, $pdec, $rep, $dimension, $dimension2, $drilldown, $path_to_root); } end_table(1); // outer table div_end(); }
function parseXmlAndUpdateDB($xmlData, $user_id, $score_id) { $clean_xml = str_ireplace(['SOAP-ENV:', 'SOAP:'], '', $xmlData); $xml = simplexml_load_string($clean_xml); //print_r($xml); $created_date = date('Y-m-d H:i:s'); //echo "<h1>Score Related Details</h1>"; $CreditProfileHeader = $xml->CreditProfileHeader; // Fetch Main Object from XML $Enquiry_Username = $CreditProfileHeader->Enquiry_Username; $enq_username = $Enquiry_Username['0']; $ReportDate = $CreditProfileHeader->ReportDate; $report_date = $ReportDate['0']; $ReportNumber = $CreditProfileHeader->ReportNumber; $report_number = $ReportNumber['0']; $Subscriber = $CreditProfileHeader->Subscriber; $subscriber = $Subscriber['0']; $Subscriber_Name = $CreditProfileHeader->Subscriber_Name; $subscriber_name = $Subscriber_Name['0']; $Current_Application_Details = $xml->Current_Application->Current_Application_Details; // Fetch Main Object from XML $Enquiry_Reason = $Current_Application_Details->Enquiry_Reason; $enquiry_reason = $Enquiry_Reason['0']; $Finance_Purpose = $Current_Application_Details->Finance_Purpose; $finance_purpose = $Finance_Purpose['0']; $Amount_Financed = $Current_Application_Details->Amount_Financed; $amount_financed = $Amount_Financed['0']; $Duration_Of_Agreement = $Current_Application_Details->Duration_Of_Agreement; $duration_agreement = $Duration_Of_Agreement['0']; //echo "<h1>SCORE</h1>"; $SCORE = $xml->SCORE; // Fetch Main Object from XML $score = $SCORE->BureauScore; $score_level = $SCORE->BureauScoreConfidLevel; //echo "<h1>Current Applicant Details</h1>"; //$Applicant_Details = $xml->Current_Application->Current_Application_Details->Current_Applicant_Details; // Fetch Main Object from XML //echo "<h1>Account Details</h1>"; $Credit_Account = $xml->CAIS_Account->CAIS_Summary->Credit_Account; // Fetch Main Object from XML $CreditAccountTotal = $Credit_Account->CreditAccountTotal; $accounts_total = $CreditAccountTotal['0']; $CreditAccountActive = $Credit_Account->CreditAccountActive; $accounts_active = $CreditAccountActive['0']; $CreditAccountClosed = $Credit_Account->CreditAccountClosed; $accounts_closed = $CreditAccountClosed['0']; $CreditAccountDefault = $Credit_Account->CreditAccountDefault; $accounts_default = $CreditAccountDefault['0']; $Total_Outstanding_Balance = $xml->CAIS_Account->CAIS_Summary->Total_Outstanding_Balance; // Fetch Main Object from XML $Outstanding_Balance_Secured = $Total_Outstanding_Balance->Outstanding_Balance_Secured; $os_balance_secured = $Outstanding_Balance_Secured['0']; $Outstanding_Balance_UnSecured = $Total_Outstanding_Balance->Outstanding_Balance_UnSecured; $os_balance_unsecured = $Outstanding_Balance_UnSecured['0']; // Insert all data into table tbl_getscore_details $sql_score_details = "INSERT INTO `tbl_getscore_details` ( `user_id` , `score_id` , `score` ,\n`score_level` , `enq_username` , `report_date` , `report_number` , `subscriber` ,\n`subscriber_name` , `enquiry_reason` , `finance_purpose` , `amount_financed` , `duration_agreement` ,\n`accounts_total` , `accounts_active` , `accounts_closed` , `accounts_default` , `os_balance_secured` ,\n`os_balance_unsecured` , `created` )\nVALUES ('{$user_id}', '{$score_id}', '{$score}', '{$score_level}', '{$enq_username}', '{$report_date}',\n'{$report_number}', '{$subscriber}', '{$subscriber_name}', '{$enquiry_reason}', '{$finance_purpose}',\n'{$amount_financed}', '{$duration_agreement}', '{$accounts_total}', '{$accounts_active}',\n'{$accounts_closed}', '{$accounts_default}', '{$os_balance_secured}', '{$os_balance_unsecured}', '{$created_date}');"; $exe = mysql_query_with_throw($sql_score_details); //echo "<h1>List Of Account</h1>"; $CAIS_Account = $xml->CAIS_Account; // Fetch Main Object from XML foreach ($CAIS_Account->CAIS_Account_DETAILS as $Account_Details) { $Identification_Number = $Account_Details->Identification_Number; $identification_number = $Identification_Number['0']; $Subscriber_Name = $Account_Details->Subscriber_Name; $subscriber_name = $Subscriber_Name['0']; $Account_Number = $Account_Details->Account_Number; $account_number = $Account_Number['0']; $Portfolio_Type = $Account_Details->Portfolio_Type; $portfolio_type = $Portfolio_Type['0']; $Account_Type = $Account_Details->Account_Type; $account_type = $Account_Type['0']; $Open_Date = $Account_Details->Open_Date; $date_open = $Open_Date['0']; $Highest_Credit_Loan_Amount = $Account_Details->Highest_Credit_or_Original_Loan_Amount; $highcredit_loanamount = $Highest_Credit_Loan_Amount = $Highest_Credit_Loan_Amount['0']; $Terms_Duration = $Account_Details->Terms_Duration; $terms_duration = $Terms_Duration['0']; $Account_Status = $Account_Details->Account_Status; $account_status = $Account_Status['0']; $Date_Closed = $Account_Details->Date_Closed; $date_closed = $Date_Closed['0']; // add additional details $Value_of_Collateral = $Account_Details->Value_of_Collateral; $value_of_collateral = $Value_of_Collateral['0']; $Type_of_Collateral = $Account_Details->Type_of_Collateral; $type_of_collateral = $Type_of_Collateral['0']; $Date_Reported = $Account_Details->Date_Reported; $date_reported = $Date_Reported['0']; $Current_Balance = $Account_Details->Current_Balance; $current_balance = $Current_Balance['0']; $Amount_Past_Due = $Account_Details->Amount_Past_Due; $amount_past_due = $Amount_Past_Due['0']; // end additionals details $Date_of_Last_Payment = $Account_Details->Date_of_Last_Payment; $date_last_payment = $Date_of_Last_Payment['0']; $AccountHoldertypeCode = $Account_Details->AccountHoldertypeCode; $acc_holder_type = $AccountHoldertypeCode['0']; $CurrencyCode = $Account_Details->CurrencyCode; $currency = $CurrencyCode['0']; $CAIS_Account_History_Due_date = $Account_Details->CAIS_Account_History->Days_Past_Due; $last_history_duedays = $CAIS_Account_History_Due_date['0']; $account_status1 = account_status_good_bad("{$account_status}", "{$last_history_duedays}"); // Categorize account as Good/Bad or Closed $CAIS_Account_History_Year = $Account_Details->CAIS_Account_History->Year; $last_history_year = $CAIS_Account_History_Year['0']; $CAIS_Account_History_Month = $Account_Details->CAIS_Account_History->Month; $last_history_month = $CAIS_Account_History_Month['0']; $account_holder_lname = $Account_Details->CAIS_Holder_Details->Surname_Non_Normalized; $account_holder_fname = $Account_Details->CAIS_Holder_Details->First_Name_Non_Normalized; $full_name = $account_holder_fname['0'] . ' ' . $account_holder_lname['0']; $Gender_Code = $Account_Details->CAIS_Holder_Details->Gender_Code; $gender = $Gender_Code['0']; $Income_TAX_PAN = $Account_Details->CAIS_Holder_Details->Income_TAX_PAN; $pan = @$Income_TAX_PAN['0']; $Passport_Number = $Account_Details->CAIS_Holder_Details->Passport_Number; $passport = @$Passport_Number['0']; $Date_of_birth = $Account_Details->CAIS_Holder_Details->Date_of_birth; $dob = $Date_of_birth['0']; $First_Line_Of_Address_non_normalized = $Account_Details->CAIS_Holder_Address_Details->First_Line_Of_Address_non_normalized; $Second_Line_Of_Address_non_normalized = $Account_Details->CAIS_Holder_Address_Details->Second_Line_Of_Address_non_normalized; $Third_Line_Of_Address_non_normalized = $Account_Details->CAIS_Holder_Address_Details->Third_Line_Of_Address_non_normalized; $address = $First_Line_Of_Address_non_normalized['0'] . ' ' . $Second_Line_Of_Address_non_normalized['0'] . ' ' . $Third_Line_Of_Address_non_normalized['0']; $City_non_normalized = $Account_Details->CAIS_Holder_Address_Details->City_non_normalized; $city = $City_non_normalized['0']; $State_non_normalized = $Account_Details->CAIS_Holder_Address_Details->State_non_normalized; $state = $State_non_normalized['0']; $ZIP_Postal_Code_non_normalized = $Account_Details->CAIS_Holder_Address_Details->ZIP_Postal_Code_non_normalized; $zipcode = $ZIP_Postal_Code_non_normalized['0']; $Telephone_Number = $Account_Details->CAIS_Holder_Phone_Details->Telephone_Number; $telephone = $Telephone_Number['0']; $EMailId = $Account_Details->CAIS_Holder_Phone_Details->EMailId; $email_id = $EMailId['0']; $account_id = 0; if ($account_status1 == "Bad") { $query = "SELECT * FROM `tbl_banks` WHERE `bank` = '{$subscriber_name}' order by id DESC limit 1"; $exe = mysql_query_with_throw($query); if (mysql_num_rows($exe) == 0) { $select_bank = mysql_query_with_throw("INSERT INTO `tbl_banks` ( `bank` , `logo` , `status` ,\n`add_date`) VALUES ('{$subscriber_name}', '', '0', NOW())"); $bankidn = mysql_insert_id(); } else { $user_code = mysql_fetch_assoc($exe); $bankidn = $user_code['id']; } $year = date("y"); $month = date("m"); $date = date("d"); $rand2 = mt_rand(1000000, 9999999); $unikdueid = "DI-" . $date . $month . $year . '-' . $rand2; $product_type = get_account_type($account_type); // $dateofbirth = $_SESSION['myForm']['dob_yy'].'-'.$_SESSION['myForm']['dob_mm'].'-'.$_SESSION['myForm']['dob_dd']; $query = "INSERT INTO `tbl_accounts` ( `id` , `account` , `balance`, `bank` ,\n`product_type` , `account_no` , `date_opened` , `date_closed` , `dateofbirth` ,\n`pancard` , `otherbank` , `unikdueid` , `caption` , `notes` , `alert`, `status` ,\n`userid` , `payin` , `add_date`) VALUES (0, '{$full_name}', '{$balance}', '{$bankidn}',\n'{$product_type}', '{$account_number}', '{$date_opened}', '{$date_closed}', '{$dob}', '{$pan}',\n'{$otherbank}', '{$unikdueid}', '{$caption}', '{$notes}', '0', '', '" . $_SESSION['GTUserID'] . "',\n'{$rwspayfull}', NOW());"; $result = mysql_query_with_throw($query); $account_id = mysql_insert_id(); } $sql_accounts = "INSERT INTO `tbl_getaccounts` (`user_id`, `score_id`, `identification_number`,\n`subscriber_name`, `account_number`, `portfolio_type`, `account_type`, `account_status`,\n`account_status1`, `highcredit_loanamount`, `terms_duration`, `date_open`, `date_closed`,\n`date_last_payment`, `acc_holder_type`, `currency`, `last_history_year`, `last_history_month`,\n`last_history_duedays`, `full_name`, `gender`, `pan`, `passport`, `dob`, `address`, `city`, `state`,\n`zipcode`, `telephone`, `email_id`, `created`, `account_id`, `bank`, `date_reported`, `current_balance`, \n`amount_due`, `value_collateral`, `type_collateral` )\nVALUES ('{$user_id}', '{$score_id}', '{$identification_number}', '{$subscriber_name}',\n'{$account_number}', '{$portfolio_type}', '{$account_type}', '{$account_status}', '{$account_status1}',\n'{$highcredit_loanamount}', '{$terms_duration}', '{$date_open}', '{$date_closed}', '{$date_last_payment}',\n'{$acc_holder_type}', '{$currency}', '{$last_history_year}', '{$last_history_month}', '{$last_history_duedays}',\n'{$full_name}', '{$gender}', '{$pan}', '{$passport}', '{$dob}', '{$address}', '{$city}', '{$state}', '{$zipcode}', '{$telephone}',\n'{$email_id}', '{$created_date}', '{$account_id}', '{$bankidn}', '{$date_reported}', '{$current_balance}', '{$amount_past_due}',\n'{$value_of_collateral}', '{$type_of_collateral}' );"; $exe = mysql_query_with_throw($sql_accounts); } //echo "<h1>List Of Applications( CAPS)</h1>"; $CAPS = $xml->CAPS; // Fetch Main Object from XML foreach ($CAPS->CAPS_Application_Details as $Apps_Details) { $Subscriber_code = $Apps_Details->Subscriber_code; $subscriber_code = $Subscriber_code['0']; $Subscriber_Name = $Apps_Details->Subscriber_Name; $subscriber = $Subscriber_Name['0']; $Date_of_Request = $Apps_Details->Date_of_Request; $request_date = $Date_of_Request['0']; $Product = $Apps_Details->Product; $product = $Product['0']; $ReportNumber = $Apps_Details->ReportNumber; $report_number = $ReportNumber['0']; $Enquiry_Reason = $Apps_Details->Enquiry_Reason; $enquiry_reason = $Enquiry_Reason['0']; $Finance_Purpose = $Apps_Details->Finance_Purpose; $finance_purpose = $Finance_Purpose['0']; $Amount_Financed = $Apps_Details->Amount_Financed; $amount_financed = $Amount_Financed['0']; $Duration_Of_Agreement = $Apps_Details->Duration_Of_Agreement; $duration_agreement = $Duration_Of_Agreement['0']; $First_Name = $Apps_Details->CAPS_Applicant_Details->First_Name; $Last_Name = $Apps_Details->CAPS_Applicant_Details->Last_Name; $full_name = $First_Name['0'] . ' ' . $Last_Name['0']; $Gender_Code = $Apps_Details->CAPS_Applicant_Details->Gender_Code; $gender = $Gender_Code['0']; $IncomeTaxPan = $Apps_Details->CAPS_Applicant_Details->IncomeTaxPan; $pan = $IncomeTaxPan['0']; $Date_Of_Birth_Applicant = $Apps_Details->CAPS_Applicant_Details->Date_Of_Birth_Applicant; $dob = $Date_Of_Birth_Applicant['0']; $Telephone_Number_Applicant_1st = $Apps_Details->CAPS_Applicant_Details->Telephone_Number_Applicant_1st; $telephone = $Telephone_Number_Applicant_1st['0']; $MobilePhoneNumber = $Apps_Details->CAPS_Applicant_Details->MobilePhoneNumber; $mobile = $MobilePhoneNumber['0']; $FlatNoPlotNoHouseNo = $Apps_Details->CAPS_Applicant_Address_Details->FlatNoPlotNoHouseNo; $BldgNoSocietyName = $Apps_Details->CAPS_Applicant_Address_Details->BldgNoSocietyName; $RoadNoNameAreaLocality = $Apps_Details->CAPS_Applicant_Address_Details->RoadNoNameAreaLocality; $address = $FlatNoPlotNoHouseNo['0'] . ' ' . $BldgNoSocietyName['0'] . ' ' . $RoadNoNameAreaLocality['0']; $City = $Apps_Details->CAPS_Applicant_Address_Details->City; $city = $City['0']; $State = $Apps_Details->CAPS_Applicant_Address_Details->State; $state = $State['0']; $PINCode = $Apps_Details->CAPS_Applicant_Address_Details->PINCode; $zipcode = $PINCode['0']; $non_credit_caps = ''; $sql_applications = "INSERT INTO `tbl_getapplications` (`user_id`, `score_id`,\n`subscriber_code`, `subscriber`, `request_date`, `product`, `report_number`, `enquiry_reason`,\n`finance_purpose`, `amount_financed`, `duration_agreement`, `full_name`, `gender`, `pan`,\n`dob`, `telephone`, `mobile`, `address`, `city`, `state`, `zipcode`, `non_credit_caps`, `created`)\nVALUES ('{$user_id}', '{$score_id}', '{$subscriber_code}',\n'{$subscriber}', '{$request_date}', '{$product}', '{$report_number}',\n'{$enquiry_reason}', '{$finance_purpose}', '{$amount_financed}', '{$duration_agreement}',\n'{$full_name}', '{$gender}', '{$pan}', '{$dob}', '{$telephone}', '{$mobile}', '{$address}', '{$city}',\n'{$state}', '{$zipcode}', '{$non_credit_caps}', '{$created_date}') ;"; $exe = mysql_query_with_throw($sql_applications); } //echo "<h1>List Of Applications(Non Credit (NC) CAPS)</h1>"; $NonCreditCAPS = $xml->NonCreditCAPS; // Fetch Main Object from XML foreach ($NonCreditCAPS->CAPS_Application_Details as $NC_Apps_Details) { $Subscriber_code = $Apps_Details->Subscriber_code; $subscriber_code = $Subscriber_code['0']; $Subscriber_Name = $Apps_Details->Subscriber_Name; $subscriber = $Subscriber_Name['0']; $Date_of_Request = $Apps_Details->Date_of_Request; $request_date = $Date_of_Request['0']; $Product = $Apps_Details->Product; $product = $Product['0']; $ReportNumber = $Apps_Details->ReportNumber; $report_number = $ReportNumber['0']; $Enquiry_Reason = $Apps_Details->Enquiry_Reason; $enquiry_reason = $Enquiry_Reason['0']; $Finance_Purpose = $Apps_Details->Finance_Purpose; $finance_purpose = $Finance_Purpose['0']; $Amount_Financed = $Apps_Details->Amount_Financed; $amount_financed = $Amount_Financed['0']; $Duration_Of_Agreement = $Apps_Details->Duration_Of_Agreement; $duration_agreement = $Duration_Of_Agreement['0']; $First_Name = $Apps_Details->CAPS_Applicant_Details->First_Name; $Last_Name = $Apps_Details->CAPS_Applicant_Details->Last_Name; $full_name = $First_Name['0'] . ' ' . $Last_Name['0']; $Gender_Code = $Apps_Details->CAPS_Applicant_Details->Gender_Code; $gender = $Gender_Code['0']; $IncomeTaxPan = $Apps_Details->CAPS_Applicant_Details->IncomeTaxPan; $pan = $IncomeTaxPan['0']; $Date_Of_Birth_Applicant = $Apps_Details->CAPS_Applicant_Details->Date_Of_Birth_Applicant; $dob = $Date_Of_Birth_Applicant['0']; $Telephone_Number_Applicant_1st = $Apps_Details->CAPS_Applicant_Details->Telephone_Number_Applicant_1st; $telephone = $Telephone_Number_Applicant_1st['0']; $MobilePhoneNumber = $Apps_Details->CAPS_Applicant_Details->MobilePhoneNumber; $mobile = $MobilePhoneNumber['0']; $FlatNoPlotNoHouseNo = $Apps_Details->CAPS_Applicant_Address_Details->FlatNoPlotNoHouseNo; $BldgNoSocietyName = $Apps_Details->CAPS_Applicant_Address_Details->BldgNoSocietyName; $RoadNoNameAreaLocality = $Apps_Details->CAPS_Applicant_Address_Details->RoadNoNameAreaLocality; $address = $FlatNoPlotNoHouseNo['0'] . ' ' . $BldgNoSocietyName['0'] . ' ' . $RoadNoNameAreaLocality['0']; $City = $Apps_Details->CAPS_Applicant_Address_Details->City; $city = $City['0']; $State = $Apps_Details->CAPS_Applicant_Address_Details->State; $state = $State['0']; $PINCode = $Apps_Details->CAPS_Applicant_Address_Details->PINCode; $zipcode = $PINCode['0']; $non_credit_caps = 'yes'; $sql_applications_non_credit = "INSERT INTO `tbl_getapplications` (`user_id`, `score_id`, `subscriber_code`, `subscriber`, `request_date`, `product`, `report_number`, `enquiry_reason`, `finance_purpose`, `amount_financed`, `duration_agreement`, `full_name`, `gender`, `pan`, `dob`, `telephone`, `mobile`, `address`, `city`, `state`, `zipcode`, `non_credit_caps`, `created`)\nVALUES ('{$user_id}', '{$score_id}', '{$subscriber_code}', '{$subscriber}', '{$request_date}', '{$product}', '{$report_number}', '{$enquiry_reason}', '{$finance_purpose}', '{$amount_financed}', '{$duration_agreement}', '{$full_name}', '{$gender}', '{$pan}', '{$dob}', '{$telephone}', '{$mobile}', '{$address}', '{$city}', '{$state}', '{$zipcode}', '{$non_credit_caps}', '{$created_date}') ;"; $exe = mysql_query_with_throw($sql_applications_non_credit); } }
function display_balance_sheet() { global $path_to_root; $from = begin_fiscalyear(); $to = $_POST['TransToDate']; if (!isset($_POST['Dimension'])) { $_POST['Dimension'] = 0; } if (!isset($_POST['Dimension2'])) { $_POST['Dimension2'] = 0; } $dimension = $_POST['Dimension']; $dimension2 = $_POST['Dimension2']; $lconvert = $econvert = 1; if (isset($_POST["AccGrp"]) && strlen($_POST['AccGrp']) > 0) { $drilldown = 1; } else { $drilldown = 0; } // Root level div_start('balance_tbl'); start_table(TABLESTYLE, "width='30%'"); if (!$drilldown) { $equityclose = 0.0; $lclose = 0.0; $calculateclose = 0.0; $parent = -1; //Get classes for BS $classresult = get_account_classes(false, 1); while ($class = db_fetch($classresult)) { $classclose = 0.0; $convert = get_class_type_convert($class["ctype"]); $ctype = $class["ctype"]; $classname = $class["class_name"]; //Print Class Name table_section_title($class["class_name"]); //Get Account groups/types under this group/type $typeresult = get_account_types(false, $class['cid'], -1); while ($accounttype = db_fetch($typeresult)) { $TypeTotal = display_type($accounttype["id"], $accounttype["name"], $from, $to, $convert, $dimension, $dimension2, $drilldown, $path_to_root); //Print Summary if ($TypeTotal != 0) { $url = "<a href='{$path_to_root}/gl/inquiry/balance_sheet.php?TransFromDate=" . $from . "&TransToDate=" . $to . "&Dimension=" . $dimension . "&Dimension2=" . $dimension2 . "&AccGrp=" . $accounttype['id'] . "'>" . $accounttype['id'] . " " . $accounttype['name'] . "</a>"; alt_table_row_color($k); label_cell($url); amount_cell($TypeTotal * $convert); end_row(); } $classclose += $TypeTotal; } //Print Class Summary start_row("class='inquirybg' style='font-weight:bold'"); label_cell(_('Total') . " " . $class["class_name"]); amount_cell($classclose * $convert); end_row(); if ($ctype == CL_EQUITY) { $equityclose += $classclose; $econvert = $convert; } if ($ctype == CL_LIABILITIES) { $lclose += $classclose; $lconvert = $convert; } $calculateclose += $classclose; } if ($lconvert == 1) { $calculateclose *= -1; } //Final Report Summary $url = "<a href='{$path_to_root}/gl/inquiry/profit_loss.php?TransFromDate=" . $from . "&TransToDate=" . $to . "&Dimension=" . $dimension . "&Dimension2=" . $dimension2 . "&Compare=0'>" . _('Calculated Return') . "</a>"; start_row("class='inquirybg' style='font-weight:bold'"); label_cell($url); amount_cell($calculateclose); end_row(); start_row("class='inquirybg' style='font-weight:bold'"); label_cell(_('Total') . " " . _('Liabilities') . _(' and ') . _('Equities')); amount_cell($lclose * $lconvert + $equityclose * $econvert + $calculateclose); end_row(); } else { //Level Pointer : Global variable defined in order to control display of root global $levelptr; $levelptr = 0; $accounttype = get_account_type($_POST["AccGrp"]); $classid = $accounttype["class_id"]; $class = get_account_class($classid); $convert = get_class_type_convert($class["ctype"]); //Print Class Name table_section_title($_POST["AccGrp"] . " " . get_account_type_name($_POST["AccGrp"])); $classclose = display_type($accounttype["id"], $accounttype["name"], $from, $to, $convert, $dimension, $dimension2, $drilldown, $path_to_root); } end_table(1); // outer table div_end(); }
?> </td> <td height="30"><?php echo $row['subscriber_name']; ?> </td> <td height="30"><?php echo $row['account_number']; ?> </td> <td height="30"><?php echo $row['portfolio_type']; ?> </td> <td height="30"><?php echo get_account_type($row["account_type"]); ?> </td> <td height="30"><?php echo $row['account_status1']; ?> </td> <td height="30"><?php echo $row['highcredit_loanamount']; ?> </td> <td height="30"><?php echo $row['terms_duration']; ?> </td> <td height="30"><?php
/** * 用户登录认证 * @param string $username 用户名 * @param string $password 用户密码 * @param integer $type 用户名类型 (1-用户名,2-邮箱,3-手机,4-UID) * @return integer 登录成功-用户ID,登录失败-错误编号 */ public function login($username, $password, $type = 1) { $map = array(); // switch ($type) { // case 1: // $map['username'] = $username; // break; // case 2: // $map['email'] = $username; // break; // case 3: // $map['mobile'] = $username; // break; // case 4: // $map['id'] = $username; // break; // default: // return 0; //参数错误 // } $map[get_account_type($username)] = $username; $jin = __DB_PREFIX__ . "member_group as a on " . __DB_PREFIX__ . "member.member_group_id=a.member_group_id"; $field = "*," . __DB_PREFIX__ . "member.status as status"; $user = $this->field($field)->where($map)->join($jin)->find(); if (is_array($user) && $user['status'] === '1' && $user['member_group_id'] == C('ALLOW_GROUP')) { /* 验证用户密码 */ $md5pas = ainiku_ucenter_md5($password); if ($md5pas === $user['password']) { /* 记录登录SESSION和COOKIES */ $auth = array('uid' => $user['member_id'], 'username' => $user['username'], 'last_login_time' => $user['update_time']); session('user_auth', $auth); session('uinfo', $user); session('user_auth_sign', data_auth_sign($auth)); //更新用户登录信息 $this->updateLogin($user['member_id']); return $user['member_id']; //登录成功,返回用户ID } else { return -2; //密码错误 } } else { return -1; // '用户不存在或被禁用!' } }
} else { $parent_text = get_account_type_name($myrow["parent"]); } label_cell($myrow["name"]); label_cell($parent_text); label_cell($bs_text); edit_link_cell("selected_id=" . $myrow["id"]); delete_link_cell("selected_id=" . $myrow["id"] . "&delete=1"); end_row(); } end_table(); //----------------------------------------------------------------------------------- hyperlink_no_params($_SERVER['PHP_SELF'], tr("New Account Group")); start_form(); start_table($table_style2); if ($selected_id != "") { //editing an existing status code $myrow = get_account_type($selected_id); $_POST['name'] = $myrow["name"]; $_POST['parent'] = $myrow["parent"]; $_POST['class_id'] = $myrow["class_id"]; hidden('selected_id', $selected_id); } text_row_ex(tr("Name:"), 'name', 50); gl_account_types_list_row(tr("Subgroup Of:"), 'parent', null, true, tr("None"), true); class_list_row(tr("Class Type:"), 'class_id', null); end_table(1); submit_add_or_update_center($selected_id == ""); end_form(); //------------------------------------------------------------------------------------ end_page();