Пример #1
0
 public function baoming()
 {
     if (IS_POST) {
         $post = I('post.');
         if (empty($post['mshop']) || !strstr($post['mshop'], 'http://')) {
             $this->error('请填写您的店铺链接地址,地址必须带http://');
         }
         if (empty($post['mprovince'])) {
             $this->error('请选择您所在地区');
         }
         if (empty($post['mname'])) {
             $this->error('请填写联系人姓名');
         }
         if (empty($post['mtel'])) {
             $this->error('请留下您的联系电话');
         }
         $post['create_time'] = time();
         $post['status'] = false;
         $model = M('TryMember');
         $result = $model->add($post);
         if ($result) {
             $this->success('您的信息已提交,我们会尽快与您联系!');
         } else {
             $this->error('信息提交失败,请稍候再试!');
         }
     } else {
         $this->province = getProvince();
         $this->display();
     }
 }
Пример #2
0
     // each person on the card
 }
 /* meminfo
  */
 $meminfo[card_no] = $custdata[CardNo];
 // Need fixAddress to capitalize first letter of each word.
 $meminfo[street] = fixAddress($row[street_address]);
 if ($row[supplemental_address_1] != "") {
     $meminfo[street] .= ", {$row['supplemental_address_1']}";
 }
 if ($row[supplemental_address_2] != "") {
     $meminfo[street] .= ", {$row['supplemental_address_2']}";
 }
 // Need fixCity to capitalize first letter.
 $meminfo[city] = fixCity($row[city]);
 $meminfo[state] = getProvince($row[state_province_id], 1);
 $meminfo[zip] = fixPostalCode($row[postal_code]);
 $meminfo[phone] = fixPhone($row[phone]);
 $meminfo[email_1] = $row[email];
 // Use for 2nd phone is there is one. None I know of.
 $meminfo[email_2] = "";
 // What should the source for this be?
 $meminfo[ads_OK] = "1";
 if ($is4cOp[meminfo] == "insert") {
     // Compose the insert statement.
     $insertMeminfo = "INSERT INTO meminfo (\ncard_no\n,street\n,city\n,state\n,zip\n,phone\n,email_1\n,email_2\n,ads_OK\n)\nVALUES (\n{$meminfo['card_no']}\n, '{$meminfo['street']}'\n, '{$meminfo['city']}'\n, '{$meminfo['state']}'\n, '{$meminfo['zip']}'\n, '{$meminfo['phone']}'\n, '{$meminfo['email_1']}'\n, '{$meminfo['email_2']}'\n, {$meminfo['ads_OK']}\n);";
     // update
 } else {
     $updateMeminfo = "UPDATE meminfo SET\nstreet =  '{$meminfo['street']}'\n,city = '{$meminfo['city']}'\n,state = '{$meminfo['state']}'\n,zip = '{$meminfo['zip']}'\n,phone = '{$meminfo['phone']}'\n,email_1 = '{$meminfo['email_1']}'\n,email_2 = '{$meminfo['email_2']}'\n,ads_OK = {$meminfo['ads_OK']}\nWHERE card_no = {$meminfo['card_no']}\n;";
 }
 /* memDates
Пример #3
0
                        <div class="form-group input-group">
                            <span class="input-group-addon"><i class="glyphicon glyphicon-user"  ></i></span>
                            <input type="text" class="form-control" placeholder="กรอกที่อยู่" name = "address_shop" required="" value = "<?php 
    echo $val_address_shop;
    ?>
"/>
                        </div>
                    </div>
                    <div class="form-group col-xs-12">
                        <label for="province">จังหวัด</label><label class="text-danger">*</label>
                        <div class="btn-group">
                            <select id="aaa" name ="idprovince" class="form-control" required >
                                <?php 
    echo "<option name ='idprovince' value = {$val_idprovince_s} >{$val_name_province_s}:{$val_name_code_s} [{$val_name_region_s}] </option>";
    $i = 0;
    $getProvince = getProvince();
    foreach ($getProvince as $value) {
        $i++;
        $val_idprovince = $value["idprovince"];
        $val_name_region = $value["name_region"];
        $val_name_province = $value["name_province"];
        $val_code_province = $value["code_province"];
        if ($val_idprovince != $val_idprovince_s) {
            echo "<option name ='idprovince' value = {$val_idprovince}> {$val_name_province}:{$val_code_province} [{$val_name_region}] </option>";
        }
    }
    ?>

                            </select>
                        </div>
                    </div>
Пример #4
0
					<td><?php 
echo $result["Address"];
?>
</td>
				</tr>
				<tr>
					<td>อำเภอ :</td>
					<td><?php 
echo getAmphur($result["AMPHUR_ID"]);
?>
</td>
				</tr>
				<tr>
					<td>จังหวัด :</td>
					<td><?php 
echo getProvince($result["PROVINCE_ID"]);
?>
</td>
				</tr>
				<tr>
					<td>รหัสไปรษณีย์ :</td>
					<td><?php 
echo $result["Zipcode"];
?>
</td>
				</tr>
        <tr>
          <td>วันที่เป็นสมาชิก :</td>
          <td><?php 
echo $result["Added"];
?>
Пример #5
0
 public function update()
 {
     //B('FilterString');
     if (is_numeric($_POST['province'])) {
         $_POST['province'] = getProvince($_POST['province']);
         $_POST['city'] = getCity($_POST['city']);
         $_POST['dist'] = getDistrict($_POST['dist']);
     }
     $_POST['birthday'] = strtotime($_POST['birthday']);
     $name = $this->getActionName();
     $model = CM($name);
     if (false === $model->create()) {
         $this->error($model->getError());
     }
     // 更新数据
     $list = $model->save();
     if (false !== $list) {
         //成功提示
         $this->assign('jumpUrl', Cookie::get('_currentUrl_'));
         $this->success('编辑成功!');
     } else {
         //错误提示
         $this->error('编辑失败!');
     }
 }
Пример #6
0
        preg_match_all( '/<a href=[\'\"]?([^\'\" ]+).*?>/i', $json, $url);
        $json = $url[1];
        $json = json_encode($json);
        return $json;
    }

    function getProvinceHTML($json) {
        $url = json_decode($json);
        foreach ($url as $value) {
            if ($value !="") {
                $split = explode("/", $value);
                $filename = $split[sizeof($split)-1];
                printf("wget \"%s\" -O %s\n", $value, $filename);
            }
        }
    }

    function getProvinceURL($json, $prefix) {
        # code...
    }

    $url = 'http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/2014/index.html';
    $json = getProvince($url);
    $cmd = getProvinceHTML($json);

    echo $json;
    echo $cmd


?>
Пример #7
0
         $addrQuery = pdoQuery('address_tbl', null, array('id' => $_GET['addressId']), ' limit 1');
     } else {
         $addrQuery = pdoQuery('address_tbl', null, array('c_id' => $_SESSION['customerId'], 'dft_a' => 1), ' limit 1');
     }
     if ($addrrow = $addrQuery->fetch()) {
         $addr = $addrrow;
     } else {
         $addrrow = array('id' => -1, 'name' => '', 'phone' => '', 'address' => '点击设置收货地址', 'province' => ' ', 'city' => ' ', 'area' => ' ');
         $addr = $addrrow;
     }
     include 'view/order.html.php';
     exit;
 }
 //地址页面修改已存在地址
 if (isset($_GET['alterAddress'])) {
     $pro = getProvince($_POST['pro']);
     $city = getCity($_POST['pro'], $_POST['city']);
     $area = getArea($_POST['pro'], $_POST['city'], $_POST['area']);
     $value = array('pro_id' => $_POST['pro'], 'city_id' => $_POST['city'], 'area_id' => $_POST['area'], 'area' => $_POST['area'], 'province' => $pro, 'city' => $city, 'area' => $area, 'address' => $_POST['address'], 'name' => $_POST['name'], 'phone' => $_POST['phone']);
     if (-1 == $_POST['address_id']) {
         $value['c_id'] = $_SESSION['customerId'];
         $value['dft_a'] = 0;
         $addrId = pdoInsert('address_tbl', $value);
     } else {
         pdoUpdate('address_tbl', $value, array('id' => $_POST['address_id']));
     }
     $from = isset($_GET['from']) ? '&from=' . $_GET['from'] : '';
     header('location:controller.php?editAddress=1' . $from);
 }
 if (isset($_GET['editAddress'])) {
     $to = $_GET['from'];
Пример #8
0
 function send_email($email, $token)
 {
     $message = "\n\t\t<html>\t\n\t\t\t<body>\t\n\t\t\t\t<table align='center'\t\n\t\t\t\t\t\t\tstyle='\t\n\t\t\t\t\t\t\t\t\tborder-right: solid 1px #000;\t\n\t\t\t\t\t\t\t\t\tborder-left: solid 1px #000;\t\n\t\t\t\t\t\t\t\t\tborder-collapse: collapse;\t\n\t\t\t\t\t\t\t\t  '\t\n\t\t\t\t>\t\n\t\t\t\t\t<tr>\t\n\t\t\t\t\t\t<td colspan='3'\t\n\t\t\t\t\t\t\tstyle='\t\n\t\t\t\t\t\t\t\t\t\twidth:350px;\t\n\t\t\t\t\t\t\t\t\t\ttext-align: center;\t\n\t\t\t\t\t\t\t\t\t\tmargin: 0 auto;\t\n\t\t\t\t\t\t\t\t\t\tfont-size: 14px;\t\n\t\t\t\t\t\t\t\t\t\tfont-weight: bold;\n\t\t\t\t\t\t\t\t\t\tcolor: #FFF;\n\t\t\t\t\t\t\t\t\t\tborder: 2px solid #AB0303;\t\n\t\t\t\t\t\t\t\t\t\tbackground: #C00 url(http://bol.shiponline.ca/minimax/css/images/ui-bg_highlight-hard_50_cc0000_1x100.png) 50% 50% repeat-x;\t\n\t\t\t\t\t\t\t\t\t\tpadding: 7px;\t\n\t\t\t\t\t\t\t\t  '\t\n\t\t\t\t\t\t>\t\n\t\t\t\t\t\t\tYou have recieved a new pick up request\t\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\n\t\t\t\t\t<tr style='background: #CCC'> <td>Name:      </td> <td colspan='2'> " . $address['name'] . "     </td> </tr>\t\n\t\t\t\t\t<tr style='background: #EEE'> <td>Phone:     </td> <td colspan='2'> " . $address['phone'] . "    </td> </tr>\t\n\t\t\t\t\t<tr style='background: #CCC'> <td>Email:     </td> <td colspan='2'> " . $address['email'] . "    </td> </tr>\t\n\t\t\t\t\t<tr style='background: #EEE'> <td>Street:    </td> <td colspan='2'> " . $address['street'] . "   </td> </tr>\t\n\t\t\t\t\t<tr style='background: #CCC'> <td>City:      </td> <td colspan='2'> " . $address['city'] . "     </td> </tr>\t\n\t\t\t\t\t<tr style='background: #EEE'> <td>Province:  </td> <td>             " . getProvince($address['province']) . " </td> <td>Postal: " . $address['postal'] . " </td> </tr>\t\n\t\t\t\t\t\n\t\t\t\t\t<tr style='background: #CCC'> <td> &nbsp; </td> <td> &nbsp; </td> <td> &nbsp; </td>  </tr>\t\n\t\n\t\t\t\t\t<tr style='background: #EEE'> <td>Pickup Date:      </td> <td> " . format_date($data['pickup_date']) . "</td> <td>Time: " . $data['pickup_time'] . " </td> </tr>\t\n\t\t\t\t\t<tr style='background: #CCC'> <td>Pickup Door:      </td> <td colspan='2'> " . $data['pickup_door'] . "</td> </tr>\n\t\n\t\t\t\t\t<tr style='background: #EEE'> <td> &nbsp; </td> <td> &nbsp; </td> <td> &nbsp; </td>  </tr>\t\n\t\t\t\t\t<tr style='background: #FCC'> <td colspan='3' style='text-align: center;'>Click <a href='http://bol.shiponline.ca/minimax/pdf/view_mail.php?token=" . $token . "'> HERE </a> to view the Bill of Lading </td> </tr>\n\t\t\n\t\t\t\t\t<tr style='\t\n\t\t\t\t\t\t\t\t\twidth:300px;\t\n\t\t\t\t\t\t\t\t\ttext-align: center;\t\n\t\t\t\t\t\t\t\t\tmargin: 0 auto;\t\n\t\t\t\t\t\t\t\t\tfont-size: 14px;\t\n\t\t\t\t\t\t\t\t\tfont-weight: bold;\t\n\t\t\t\t\t\t\t\t\tcolor: #FFF;\n\t\t\t\t\t\t\t\t\tborder: 2px solid #AB0303;\t\n\t\t\t\t\t\t\t\t\tbackground: #C00 url(http://bol.shiponline.ca/minimax/css/images/ui-bg_highlight-hard_50_cc0000_1x100.png) 50% 50% repeat-x;\t\n\t\t\t\t\t\t\t\t\tpadding: 7px;\t\n\t\t\t\t\t\t\t\t'\t\n\t\t\t\t\t>\t\n\t\t\t\t\t\t<td> &nbsp; </td> <td> &nbsp; </td> <td> &nbsp; </td>  </tr>\t\n\t\t\t\t</table>\t\n\t\t\t</body>\n\t\t</html>\t\n\t\t";
     mail($email, "New Shipment", "");
 }