Esempio n. 1
0
 public function view_index()
 {
     $DistributorBasicInformation = A('DistributorBasicInformation');
     $data = $DistributorBasicInformation->act_getDistributorBasicInformation();
     if ($data['status'] == '6') {
         header('Location:/index.php?mod=distributorBasicInformation&act=index');
     }
     $category = $DistributorBasicInformation->act_getRootCategoryInfo();
     $data['main_products'] = json_decode($data['main_products'], true);
     $mainProducts = array();
     foreach ($data['main_products'] as $v) {
         $mainProducts[] = $category[$v];
     }
     $loginName = _authcode($_COOKIE['hcUser']);
     $loginName = json_decode($loginName, true);
     $loginName = $loginName['email'];
     $data['intention_products'] = json_decode($data['intention_products'], true);
     $intentionProducts = array();
     foreach ($data['intention_products'] as $v) {
         $intentionProducts[] = $category[$v];
     }
     $loginName = _authcode($_COOKIE['hcUser']);
     $loginName = json_decode($loginName, true);
     $loginName = $loginName['email'];
     $baseDir = C("DISTRIBUTOR_KEY_PICTURE_DIR") . $loginName . "/";
     $this->smarty->assign(array("loginName" => $loginName, 'type' => $data['type'], 'company' => $data['company'], 'companyShortName' => $data['company_short_name'], 'companyLegalPerson' => $data['company_legal_person'], 'address' => $data['address'], 'address2' => $data['address2'], 'contactPerson' => $data['user_name'], 'contactPersonPhone' => $data['phone'], 'mainProducts' => implode(',', $mainProducts), 'soldToCountries' => $data['sold_to_countries'], 'intentionProducts' => implode(',', $intentionProducts), 'contactPersonExt' => json_decode($data['contact_person_ext'], true), 'contactPersonPhoneExt' => json_decode($data['contact_person_phone_ext'], true)));
     //图片地址
     //echo $baseDir."idCard.jpg";exit;
     F("dp");
     $baseDir = C("DISTRIBUTOR_KEY_PICTURE_DIR") . $loginName . "/";
     $idCardName = get_getSuffixByName("idCard");
     $idCardUrl = $baseDir . $idCardName;
     if (is_file($idCardUrl)) {
         $this->smarty->assign("idCardUrl", "/images/distributor/" . $loginName . "/" . $idCardName);
     }
     $businessLicenseName = get_getSuffixByName("businessLicense");
     $businessLicenseUrl = $baseDir . $businessLicenseName;
     if (is_file($businessLicenseUrl)) {
         $this->smarty->assign("businessLicenseUrl", "/images/distributor/" . $loginName . "/" . $businessLicenseName);
     }
     $taxRegistrationName = get_getSuffixByName("taxRegistration");
     $taxRegistrationUrl = $baseDir . $taxRegistrationName;
     if (is_file($taxRegistrationUrl)) {
         $this->smarty->assign("taxRegistrationUrl", "/images/distributor/" . $loginName . "/" . $taxRegistrationName);
     }
     //高级信息
     $advancedData = json_decode($data['advance_data'], true);
     //var_dump($data);exit;
     if (!empty($advancedData)) {
         $this->smarty->assign(array('bank' => $advancedData['bank'], 'bankName' => $advancedData['bank_name'], 'bankUser' => $advancedData['bank_user'], 'bankCardNo' => $advancedData['bank_card_no'], 'compangSumPerson' => $advancedData['compang_sum_person'], 'companyType' => $advancedData['company_type'], 'lastYearSales' => $advancedData['last_year_sales'], 'predictSalesByYear' => $advancedData['predict_sales_by_year'], 'retail' => $advancedData['retail'], 'wholesale' => $advancedData['wholesale'], 'predictSalesByEveryMonth' => $advancedData['predict_sales_by_every_month'], 'startElectricBusinessTime' => $advancedData['start_electric_business_time'], 'electricBusinessPlatform' => $advancedData['electric_business_platform'], 'otherContactPersonName' => $advancedData['other_contact_person_name'], 'otherContactPhone' => $advancedData['other_contact_phone']));
     }
     if ($data['type'] == '1') {
         $this->smarty->display('sucAuthenticationPersonal.html');
     } else {
         $this->smarty->display('sucAuthentication.html');
     }
 }
Esempio n. 2
0
 public function view_uploadPic()
 {
     F("dp");
     if (isset($_REQUEST["PHPSESSID"])) {
         session_id($_REQUEST["PHPSESSID"]);
     }
     $dpInfo = A("DistributorBasicInformation")->act_getDistributorBasicInformationById();
     $loginName = $dpInfo['email'];
     $uploadName = $_POST['uploadPicName'];
     $baseDir = C("DISTRIBUTOR_KEY_PICTURE_DIR") . $loginName . "/";
     del_picByName($uploadName);
     $time = time();
     $suffixArr = array('jpg', 'jpeg', 'gif', 'bmp', 'png');
     //var_dump($_FILES);exit;
     $flag = uploadFile("Filedata", $baseDir, $uploadName . $time, $suffixArr);
     $name = get_getSuffixByName($uploadName . $time, $loginName);
     echo $this->ajaxReturn(array("name" => $uploadName, "ret" => $flag, "url" => '/images/distributor/' . $loginName . '/' . $name));
 }
 public function view_changWatermarkName()
 {
     F("dp");
     $loginName = json_decode(_authcode($_COOKIE['hcUser']), true);
     $loginName = $loginName['email'];
     $baseDir = C("DISTRIBUTOR_KEY_PICTURE_DIR") . $loginName . "/";
     $newName = $_REQUEST['newName'];
     $newName = str_replace("_", "", $newName);
     $shopPlat = $_REQUEST['shopPlat'];
     $picPath = $baseDir . $shopPlat . "/";
     if (!is_dir($picPath)) {
         mkdir($picPath, 0777);
     }
     $name = get_getSuffixByName("watermark1");
     $renameFlag = rename($baseDir . $name, $picPath . $newName . '.png');
     echo $this->ajaxReturn(array("flag" => $renameFlag, "imgUrl" => "/images/distributor/" . $loginName . "/" . $shopPlat . "/" . $newName . '.png'));
 }
Esempio n. 4
0
 /**
  * 功能:获取信息的完成度
  * zjr
  */
 public function act_getInforProgress()
 {
     //判断进度条    标志位为1时就去数据库重新拉取判断
     if ($this->act_getUserSomeInfor('progressInforFlag') == 1) {
         F("dp");
         $totalNums = 0;
         $comNums = 0;
         //**********获取基本信息的完成情况******
         $developerMod = M('Developer');
         $basInfoSta = $developerMod->getDeveloper("*", "id = " . $this->act_getUserInfor('id'));
         if ($basInfoSta[0]['status'] > 3) {
             $checkArr = array("type", "company", "phone", "address", "company_short_name", "address2", "main_products", "sold_to_countries", "user_name", "plat_form_id", "shop_account", "listing_address", "b_paypal_account", "s_paypal_account");
             $baseDir = C("DISTRIBUTOR_KEY_PICTURE_DIR") . $this->act_getUserInfor('email') . "/";
             $idCardName = get_getSuffixByName("idCard");
             $idCardUrl = $baseDir . $idCardName;
             if (is_file($idCardUrl)) {
                 $comNums += 1;
             }
             if ($basInfoSta[0]['type'] == 2) {
                 $totalNums = 13;
                 //判断企业法人
                 if ($basInfoSta[0]['company_legal_person']) {
                     $comNums += 1;
                 }
                 //判断营业执照
                 $businessLicenseName = get_getSuffixByName("businessLicense");
                 $businessLicenseUrl = $baseDir . $businessLicenseName;
                 if (is_file($businessLicenseUrl)) {
                     $comNums += 1;
                 }
                 //判断税务登记
                 $taxRegistrationName = get_getSuffixByName("taxRegistration");
                 $taxRegistrationUrl = $baseDir . $taxRegistrationName;
                 if (is_file($taxRegistrationUrl)) {
                     $comNums += 1;
                 }
             } else {
                 $totalNums = 10;
             }
             foreach ($basInfoSta[0] as $key => $val) {
                 if (in_array($key, $checkArr) && $val != "null" && $val) {
                     $comNums += 1;
                 }
             }
             $this->act_setUserSomeInfor('basicInforProgress', ceil($comNums / $totalNums * 100) . "%");
             //基本信息完成百分比
             //*******************************
             //**********获取店铺信完成情况*********
             $distributorShopMod = M('DistributorShop');
             $shopInfo = $distributorShopMod->getShopInfo("*", "dp_id= " . $this->act_getUserInfor('id'));
             if (count($shopInfo) == 0) {
                 //判断是否有店铺  没有就默认为其他的【平台
                 $totalNums += 3;
             } else {
                 $nowNums = 0;
                 //主要用来记录店铺中必填项中已填写数
                 $bigNums = 0;
                 //用于记录添加的店铺中必填写相中填写最多的那个店铺填写的项
                 $platForm = 1;
                 //记录平台
                 foreach ($shopInfo as $value) {
                     if ($value['plat_form_id'] == 1) {
                         //判断平台
                         $nowNums = 0;
                         foreach ($value as $key => $val) {
                             if (in_array($key, $checkArr) && $val) {
                                 $nowNums += 1;
                             }
                             if ($key == 's_paypal_account') {
                                 break;
                             }
                         }
                         if ($nowNums > $bigNums) {
                             $bigNums = $nowNums;
                             $platForm = $value['plat_form_id'];
                         }
                     } else {
                         $nowNums = 0;
                         foreach ($value as $key => $val) {
                             if (in_array($key, $checkArr) && $val) {
                                 $nowNums += 1;
                             }
                             if ($key == 'listing_address') {
                                 break;
                             }
                         }
                         if ($nowNums > $bigNums) {
                             $bigNums = $nowNums;
                             $platForm = $value['plat_form_id'];
                         }
                     }
                 }
                 $comNums += $bigNums;
                 if ($platForm == 1) {
                     $totalNums += 5;
                     $this->act_setUserSomeInfor('shopInforProgress', ceil($bigNums / 5 * 100) . "%");
                     //店铺资料完成百分比
                 } else {
                     $totalNums += 3;
                     $this->act_setUserSomeInfor('shopInforProgress', ceil($bigNums / 3 * 100) . "%");
                     //店铺资料完成百分比
                 }
             }
             //*******************************
             //
             $this->act_setUserSomeInfor('progressInfor', ceil($comNums / $totalNums * 100) . "%");
             $this->act_setUserSomeInfor('progressInforFlag', 0);
         } else {
             $this->act_setUserSomeInfor('progressInfor', "100%");
             $this->act_setUserSomeInfor('progressInforFlag', 0);
         }
     }
     //标志位为1时,就去判断是否未认证状态
     // 		if($this->act_getUserSomeInfor('checkFlag') == 1){
     $developerMod = M('Developer');
     $basInfoSta = $developerMod->getDeveloper("*", "id = " . $this->act_getUserInfor('id'));
     $this->act_setUserSomeInfor('checkInfor', $basInfoSta[0]['status']);
     $this->act_setUserSomeInfor('checkFlag', 0);
     // 		}
     //判断各类服务的申请状态
     // 		if($this->act_getUserSomeInfor('serviceFlag') == 1){
     $myEmpowerMod = M('MyEmpower');
     $myEmpowers = $myEmpowerMod->getMyEmpower("*", "dp_id=" . $this->act_getUserInfor('id'));
     $services = array();
     foreach ($myEmpowers as $val) {
         $services[] = $val['open_service_id'];
     }
     $this->act_setUserSomeInfor('serviceInfor', $services);
     $this->act_setUserSomeInfor('serviceFlag', 0);
     // 		}
     return array("progressInfor" => $this->act_getUserSomeInfor('progressInfor'), "checkInfor" => $this->act_getUserSomeInfor('checkInfor'), "serviceInfor" => $this->act_getUserSomeInfor('serviceInfor'), "shopInforProgress" => $this->act_getUserSomeInfor('shopInforProgress'), "basicInforProgress" => $this->act_getUserSomeInfor('basicInforProgress'));
 }