public function add()
 {
     if (think_send_mail($_POST['mail'], $_POST['title'], $subject = '一起来欢乐!', $_POST['content'], $attachment = null)) {
         $this->success('发送成功!');
     } else {
         $this->error('发送失败');
     }
 }
 public function add()
 {
     // if (think_send_mail($_POST['mail'], $_POST['title'], $subject = '一起来欢乐!',$_POST['content'], $attachment = null)) {
     // $this->success('发送成功!','/index');
     // } else {
     // $this->error('发送失败');
     // }
     if (think_send_mail('*****@*****.**', 'sss', $subject = '一起来欢乐!', 'ssss', $attachment = null)) {
         $this->success('发送成功!', '/index');
     } else {
         $this->error('发送失败');
     }
 }
Esempio n. 3
0
 public function orderupdate()
 {
     $receive = array('onum' => $_POST['onum'], 'opsname' => $_POST['opsname'], 'ocunum' => $_POST['unum'], 'assignstatus' => 1);
     $result = M('order')->save($receive);
     if ($result) {
         $opsname = M('shop')->where(array('sname' => $receive['opsname']))->find();
         $mail = $opsname['smail'];
         $r = think_send_mail("{$mail}", '海彦', "新订单", "有新订单,订单号为:{$receive['onum']}.");
         $this->success("修改成功", U('Admin/Order/index', array('unum' => $_POST['unum'])));
     } else {
         $this->error("未改动", U('Admin/Order/index', array('unum' => $_POST['unum'])));
     }
 }
Esempio n. 4
0
 public function bookhandle()
 {
     $sid = $_POST['shop'];
     $shop = M('shop')->where(array('sid' => $sid))->find();
     $receive = array('bname' => $_POST['bname'], 'bmale' => $_POST['bmale'], 'bphone' => $_POST['bphone'], 'bsid' => $shop['sid'], 'bshopsname' => $shop['sname'], 'bdate' => time());
     $result = M('book')->add($receive);
     if ($result) {
         $mail = $shop['smail'];
         $r = think_send_mail("{$mail}", '海彦', "新预约", "有新预约,预约号为:{$result}.");
         $this->success('预约成功', U('Index/Index/index'));
     } else {
         $this->error('预约失败', U('Index/Index/book'));
     }
 }
Esempio n. 5
0
 /**
  *指定群发
  *@create 2015-1-13
  *@author lck
  */
 public function mailsend_address()
 {
     if (IS_POST) {
         $_POST['email'] = str_replace(';', ';', $_POST['email']);
         $_POST['email'] = trim($_POST['email'], ';');
         if (empty($_POST['email'])) {
             $this->error('收件人不能为空');
         }
         $mail_arr = explode(';', $_POST['email']);
         think_send_mail($mail_arr, '', $_POST['title'], $_POST['body']);
         echo "<br />邮件发送完成,<a href='javascript:history.back();'>返回</a>";
     } else {
         $this->display();
     }
 }
Esempio n. 6
0
 public function sendmsg()
 {
     $name = I('post.name', 'Anonymous');
     $email = I('post.email', '');
     $phone = I('post.phone', '');
     $message = I('post.message', '');
     $tomail = '*****@*****.**';
     $fromname = 'TC';
     $msg = think_send_mail($tomail, $fromname, 'GC Website Message From ' . $name, "Message:{$message}<br/><br/>Name:{$name}<br/>Email:{$email}<br/>Phone:{$phone}");
     if (true === $msg) {
         $this->success('Your message has been sent. Thank you.', U('/Contactus'), 3);
     } else {
         $this->success($msg, U('/Contactus'), 3);
     }
 }
Esempio n. 7
0
 public function getCode()
 {
     $account = trim(I('post.account'));
     if ($account == '') {
         $this->error('请输入手机号码/邮箱!');
     }
     $code = rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9);
     //如果是手机号码
     if (preg_match('/^13[0-9]{9}$|14[0-9]{9}|15[0-9]{9}$|18[0-9]{9}$/', $account)) {
         $content = C('SITE_TITLE') . "验证码:" . $code . ",如非本人操作,无需理会";
         $status = sms($account, $content);
         if ($status < 0) {
             $this->error('验证短信发送失败,请联系客服');
         } else {
             session('account_type', 'phone');
             session('get_code', $code);
             session('get_account', $account);
             $this->success('验证短信已发送,请注意查收');
         }
     } else {
         if (preg_match('/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i', $account)) {
             //如果是邮箱
             $subject = C('SITE_TITLE') . "验证码邮件";
             $body = "尊敬的" . C('SITE_TITLE') . "用户,您好:<br />您的验证码为:" . $code . ",如非本人操作,无需理会";
             $status = think_send_mail($account, $account, $subject, $body);
             if ($status == 1) {
                 session('account_type', 'email');
                 session('get_code', $code);
                 session('get_account', $account);
                 $this->success('验证邮件已发送,请登录查看');
             } else {
                 $this->error('验证邮件发送失败,请联系客服');
             }
         } else {
             session('get_account', null);
             session('get_code', null);
             $this->error('请输入正确的手机号码/邮箱!');
         }
     }
 }
 public function readExpressHandle()
 {
     if (empty($_POST['sexpress'])) {
         $sexpress = '';
     } else {
         $sexpress = $_POST['sexpress'];
     }
     if (empty($_POST['sexpressnum'])) {
         $sexpressnum = '';
     } else {
         $sexpressnum = $_POST['sexpressnum'];
     }
     if ($_POST['sgetstatus'] == '1') {
         $reco = array('onum' => $_POST['onum'], 'pullstatus' => '2');
         $order = M('order')->save($reco);
     }
     if (!empty($_POST['sexpressnum'])) {
         $reco = array('onum' => $_POST['onum'], 'pullstatus' => '3');
         $order = M('order')->save($reco);
     }
     if ($_POST['eclass'] == "样品") {
         if ($_POST['okstatus'] == '1') {
             $recop = array('onum' => $_POST['onum'], 'pullok' => '1', 'pullstatus' => '0', 'pullokdate' => time());
             $order = M('order')->save($recop);
         } else {
             $recop = array('onum' => $_POST['onum'], 'pullok' => '0');
             $order = M('order')->save($recop);
         }
     } else {
         if ($_POST['okstatus'] == '1') {
             $recop = array('onum' => $_POST['onum'], 'goodsok' => '1', 'goodsokdate' => time());
             $order = M('order')->save($recop);
         } else {
             $recop = array('onum' => $_POST['onum'], 'goodsok' => '0');
             $order = M('order')->save($recop);
         }
     }
     $receive = array('eid' => $_POST['eid'], 'sexpress' => $sexpress, 'sexpressnum' => $sexpressnum, 'sgetstatus' => $_POST['sgetstatus']);
     $db = M('express');
     $express = $db->save($receive);
     if ($express || $order) {
         $order = M('order')->where(array('onum' => $_POST['onum']))->field(array('opsname'))->find();
         $shop = M('shop')->where(array('sname' => $order["opsname"]))->find();
         $mail = $shop["smail"];
         $r = think_send_mail("{$mail}", '海彦', "新物流", "有新快递;快递公司:{$sexpress},物流号:{$sexpressnum},合订号为:{$_POST['onum']}.");
         $this->success("修改成功");
     } else {
         $this->error("未修改");
     }
 }
 function registerCode()
 {
     //$account=trim(I('post.account'));
     $member_id = session('forgetPassword_id');
     $info = get_info($this->table, array('id' => $member_id));
     //根据type查询account
     //if($account==1){
     $account = $info['telephone'];
     //}else if($account==2){
     //$account = $info['email'];
     //}
     $code = rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9);
     session('forget_register_code', $code);
     //如果是手机号码
     if (preg_match('/^13[0-9]{9}$|14[0-9]{9}|15[0-9]{9}$|18[0-9]{9}$/', $account)) {
         //$content="您在N邦翻译上注册验证码为:".$code.",如非本人操作,无需理会【N邦翻译】";
         $content = $code;
         $status = sms($account, $content);
         if ($status < 0) {
             $this->error('验证短信发送失败,请联系客服');
         } else {
             $this->success('验证短信已发送,请查看');
         }
     } else {
         if (preg_match("/^\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*\$/", $account)) {
             //如果是邮箱
             $subject = "来自N邦翻译";
             $body = "尊敬的N邦翻译用户,您好!<hr/>您的验证码:{$code}<br/>请在页面注册以完成认证";
             $status = think_send_mail($account, $account, $subject, $body);
             $this->ajaxReturn(array('info' => $status));
             if ($status == 1) {
                 $this->success('验证邮件已发送,请登录查看');
             } else {
                 $this->error('验证邮件发送失败,请联系客服');
             }
         } else {
             session('forget_register_code', null);
             $this->error('请输入正确的手机号码!' . $account);
         }
     }
 }
Esempio n. 10
0
 public function reset()
 {
     if (IS_POST) {
         if ('' != I('post.code')) {
             $verify = new \Think\Verify();
             $checksurepwd = $verify->check(I('post.code'), $id);
             if (!$checksurepwd) {
                 $json['code'] = false;
                 $json['msg'] = '验证码错误!';
                 $this->ajaxreturn($json);
                 exit;
             }
             $emailinfo = M('user')->where(array('email' => I('post.email')))->field('email')->find();
             if (!$emailinfo) {
                 $json['code'] = false;
                 $json['msg'] = '邮箱不在记录列表中';
                 $this->ajaxreturn($_POST);
                 exit;
             }
             $json['code'] = true;
             $this->ajaxreturn($json);
         } else {
             $data['to'] = I('post.email');
             $data['subject'] = '邮箱验证';
             $data['message'] = 'yzm';
             think_send_mail($data);
             $json['code'] = true;
             $json['msg'] = '验证码已成功发送至邮箱';
             $this->ajaxreturn($json);
         }
     } else {
         $this->display('Public/reset');
     }
 }
Esempio n. 11
0
    public function receiver()
    {
        $from = $_SESSION['id'];
        $to = I('post.to', 0);
        $msg_type = I('post.type', 0) . '_CODE';
        $object = I('post.obj', 0);
        $attach = I('post.attach');
        //echo json_encode($_POST);
        //dump($from);
        //dump($to);
        //dump($msg_type);
        //dump($object);
        $Form = M('messagebox');
        $model = new Model();
        if ($msg_type === 'INVEST_CODE') {
            if ($object === 'PROJECT') {
                $project = $model->query('select project_id, project_name, project_admin from project_info where project_id = "%s"', $to);
                if ($project) {
                    $project_name = $project[0]['project_name'];
                    $project_admin = $project[0]['project_admin'];
                    $content = '<p>您的项目<a onclick="openProject(\'' . $to . '\')">' . $project_name . '</a>收到了投资人的投资意愿。</p>';
                }
                $investor = $model->query('select name, email, mobile from investor_personal where user_id = "%s"', $from);
                if ($investor) {
                    $name = $investor[0]['name'];
                    $email = decode($investor[0]['email']);
                    $phone = decode($investor[0]['mobile']);
                    $content = $content . '<p>姓名: ' . $name . ' 邮箱: ' . $email . ' 电话: ' . $phone . '</p>';
                }
            }
            $data['from_id'] = $from;
            $data['to_id'] = $project_admin;
            $data['msg_type'] = C(MESSAGE_CODE)[$msg_type];
            $data['msg_content'] = $content;
            $data['sent_time'] = date('Y-m-d H:i:s');
            //dump($data);
            $result = $Form->add($data);
            //send sms and email to project_admin
            $innovator = $model->query('select nickname, phone, email from entrepreneur_personal where user_id = "%s"', $project_admin);
            if ($innovator[0]['phone']) {
                $sms = sprintf('您的项目%s收到了投资人%s的投资意愿,请登录查看消息。', $project_name, $name);
                send_forward_msg(decode($innovator[0]['phone']), $sms);
            }
            if ($innovator[0]['email']) {
                $body = $body = sprintf("尊敬的用户 %s:<br>  您的项目“%s”收到了投资人“%s”的投资意愿,\n\t        \t请登录来创吧并进入消息盒查看。<br><a href='%s'>点击查看</a>", $innovator[0]['nickname'], $project_name, $name, C(MAIN_PAGE));
                think_send_mail(decode($innovator[0]['email']), 'User', $subject = '您收到了新的投资意愿', $body);
            }
            $innovator[0]['phone'] = decode($innovator[0]['phone']);
            $innovator[0]['email'] = decode($innovator[0]['email']);
            echo json_encode($innovator[0]);
            //echo 400;
            //dump($result);
        }
        if ($msg_type === 'JOIN_CODE') {
            if ($object === 'PROJECT') {
                $project = $model->query('select project_id, project_name, project_admin from project_info where project_id = "%s"', $to);
                if ($project) {
                    $project_name = $project[0]['project_name'];
                    $project_admin = $project[0]['project_admin'];
                    $content = '<p>您的项目<a onclick="openProject(\'' . $to . '\')">' . $project_name . '</a>收到了创业者的合伙意愿。</p>';
                }
                $innovator = $model->query('select nickname, email, phone from entrepreneur_personal where user_id = "%s"', $from);
                if ($innovator) {
                    $name = $innovator[0]['nickname'];
                    $email = decode($innovator[0]['email']);
                    $phone = decode($innovator[0]['phone']);
                    $content = $content . '<p>昵称: ' . $name . ' 邮箱: ' . $email . ' 电话: ' . $phone . '</p>';
                }
            }
            $data['from_id'] = $from;
            $data['to_id'] = $project_admin;
            $data['msg_type'] = C(MESSAGE_CODE)[$msg_type];
            $data['msg_content'] = $content;
            $data['msg_attachment'] = $attach;
            $data['sent_time'] = date('Y-m-d H:i:s');
            //dump($data);
            $result = $Form->add($data);
            //send sms and email to project_admin
            $admin = $model->query('select nickname, phone, email from entrepreneur_personal where user_id = "%s"', $project_admin);
            if ($admin[0]['phone']) {
                $sms = sprintf('您的项目%s收到了创业者%s的合伙意愿,请登录查看消息。', $project_name, $name);
                send_forward_msg(decode($admin[0]['phone']), $sms);
            }
            if ($admin[0]['email']) {
                $body = $body = sprintf("尊敬的用户 %s:<br>  您的项目“%s”收到了创业者“%s”的合伙意愿,\n\t        \t请登录来创吧并进入消息盒查看。<br><a href='%s'>点击查看</a>", $admin[0]['nickname'], $project_name, $name, C(MAIN_PAGE));
                think_send_mail(decode($admin[0]['email']), 'User', $subject = '您收到了新的合伙意愿', $body);
            }
            //dump($result);
        }
        if ($msg_type === 'REQUIRE_CODE') {
            if ($object === 'INVESTOR') {
                $innovator = $model->query('select nickname, email, phone from entrepreneur_personal where user_id = "%s"', $from);
                if ($innovator) {
                    $name = $innovator[0]['nickname'];
                    $email = decode($innovator[0]['email']);
                    $phone = decode($innovator[0]['phone']);
                    $content = '<p>您收到了创业者<a onclick="openUser(\'' . $from . '\')">' . $name . '</a>的投资申请, 联系方式如下: </p>';
                    $content = $content . '<p>邮箱: ' . $email . ' 电话: ' . $phone . '</p>';
                }
            }
            $data['from_id'] = $from;
            $data['to_id'] = $to;
            $data['msg_type'] = C(MESSAGE_CODE)[$msg_type];
            $data['msg_content'] = $content;
            $data['msg_attachment'] = $attach;
            $data['sent_time'] = date('Y-m-d H:i:s');
            //dump($data);
            $result = $Form->add($data);
            //send sms and email to project_admin
            $investor = $model->query('select name, mobile, email from investor_personal where user_id = "%s"', $to);
            if ($investor[0]['mobile']) {
                $sms = sprintf('尊敬的投资人: 您收到了创业者%s的投资申请,请登录查看详情。', $name);
                send_forward_msg(decode($investor[0]['mobile']), $sms);
            }
            if ($investor[0]['email']) {
                $body = $body = sprintf("尊敬的用户 %s:<br>  您收到了创业者“%s”的投资申请,\n\t        \t请登录来创吧并进入消息盒查看。<br><a href='%s'>点击查看</a>", $investor[0]['name'], $name, C(MAIN_PAGE));
                think_send_mail(decode($investor[0]['email']), 'User', $subject = '您收到了新的投资申请', $body);
            }
            //dump($result);
        }
        if ($msg_type === 'MEMBERS_CODE') {
            if ($object === "PROJECT") {
                $member = $model->query('select user_id, nickname from entrepreneur_personal where email="%s" or phone="%s"', $attach, $attach);
                if ($member) {
                    $member_info = "<a onclick='openUser(\"" . $member[0]['user_id'] . "\")'>" . $member[0]['nickname'] . "</a>";
                }
                $project = $model->query('select project_id, project_name, project_admin from project_info where project_id = "%s"', $to);
                if ($project) {
                    $project_name = $project[0]['project_name'];
                    $content = '<p>您关注/投资的项目<a onclick="openProject(\'' . $to . '\')">' . $project_name . '</a>增加了新成员' . $member_info . '。</p>';
                }
                $followers = $model->query('select user_id from relation_follow where object_id="%s" and object_type = 1 and follow_status = 1', $to);
                $investors = $model->query('select user_id from project_investor where project_id="%s"', $to);
                $users = arrayUnion($followers, $investors, 'user_id');
                $data['from_id'] = $to;
                $data['msg_type'] = C(MESSAGE_CODE)[$msg_type];
                $data['msg_content'] = $content;
                $data['sent_time'] = date('Y-m-d H:i:s');
                foreach ($users as $key => $value) {
                    $data['to_id'] = $value;
                    $result = $Form->add($data);
                }
                echo 200;
            }
        }
        if ($msg_type === 'FINANCIAL_CODE') {
            if ($object === 'PROJECT') {
                $round = C('INVEST_ROUND')[intval($_POST['attach'])];
                $project = $model->query('select project_id, project_name from project_info where project_id = "%s"', $to);
                if ($project) {
                    $project_name = $project[0]['project_name'];
                    $content = '<p>您关注/投资的项目<a onclick="openProject(\'' . $to . '\')">' . $project_name . '</a>进行了' . $round . '融资。</p>';
                }
                $followers = $model->query('select user_id from relation_follow where object_id="%s" and object_type = 1 and follow_status = 1', $to);
                //dump($followers);
                $investors = $model->query('select user_id from project_investor where project_id="%s"', $to);
                //dump($investors);
                $users = arrayUnion($followers, $investors, 'user_id');
                //dump($users);
                $data['from_id'] = $to;
                $data['msg_type'] = C(MESSAGE_CODE)[$msg_type];
                $data['msg_content'] = $content;
                $data['sent_time'] = date('Y-m-d H:i:s');
                foreach ($users as $key => $value) {
                    $data['to_id'] = $value;
                    $result = $Form->add($data);
                }
                echo 200;
            }
        }
        if ($msg_type === 'ARTICLES_CODE') {
            //dump($_POST);
            $article = $model->query('select * from admin_articles where article_id = "%s"', $to);
            if ($article) {
                $field = $article[0]['article_field'];
                $users = $model->query('select id from interest_investor where interest_field = %d', $field);
                $content = "您感兴趣的“" . C('INTEREST_FIELD')[$field] . "”领域发布了一条新的资讯,<a onclick=\"openNews('" . $to . "')\">点击查看</a>";
                $data['from_id'] = $to;
                $data['msg_type'] = C(MESSAGE_CODE)[$msg_type];
                $data['msg_content'] = $content;
                $data['sent_time'] = date('Y-m-d H:i:s');
                foreach ($users as $key => $value) {
                    $data['to_id'] = $value['id'];
                    $result = $Form->add($data);
                    //dump($result);
                }
                echo 200;
            }
        }
        if ($msg_type === 'PROJECTS_CODE') {
            if ($object === "PROJECT") {
                $project = $model->query('select * from project_info where project_id = "%s"', $to);
                if ($project) {
                    $project_name = $project[0]['project_name'];
                }
                $users = $model->query('select interest_investor.id, interest_investor.interest_field from interest_investor 
					inner join interest_project on interest_project.interest_field = interest_investor.interest_field
					where interest_project.id = "%s"', $to);
                $data['from_id'] = $to;
                $data['msg_type'] = C(MESSAGE_CODE)[$msg_type];
                $data['sent_time'] = date('Y-m-d H:i:s');
                foreach ($users as $key => $value) {
                    $data['to_id'] = $value['id'];
                    $data['msg_content'] = "您感兴趣的“" . C('INTEREST_FIELD')[$value['interest_field']] . "”领域新增了一个创业项目“" . $project_name . "”, \n\t\t\t\t\t<a onclick=\"openProject('" . $to . "')\">点击查看</a>";
                    $result = $Form->add($data);
                    //dump($result);
                }
                echo 200;
            }
        }
        if ($msg_type === 'AUTHORIZATION_CODE') {
            if ($object === "PROJECT") {
                $data['from_id'] = $_SESSION['userid'];
                $data['msg_type'] = C(MESSAGE_CODE)[$msg_type];
                $verified = $model->query('select status, project_admin, project_name from project_info where project_id = "%s"', $to);
                if ($verified[0]['status'] == 2) {
                    $data['msg_content'] = '您的项目<a onclick="openProject(\'' . $to . '\')">' . $verified[0]['project_name'] . '</a>已经通过审核, 成为来创认证的创业项目!';
                    $data['to_id'] = $verified[0]['project_admin'];
                } else {
                    if ($verified[0]['status'] == 0) {
                        $data['msg_content'] = '您的项目<a onclick="openProject(\'' . $to . '\')">' . $verified[0]['project_name'] . '</a>未通过管理员审核, 请修改信息并重新提交审核!';
                        $data['to_id'] = $verified[0]['project_admin'];
                        $data['msg_attachment'] = $attach;
                    }
                }
                $data['sent_time'] = date('Y-m-d H:i:s');
                //dump($data);
                $result = $Form->add($data);
            }
            if ($object === "INVESTOR") {
                $data['from_id'] = $_SESSION['userid'];
                $data['to_id'] = $to;
                $data['msg_type'] = C(MESSAGE_CODE)[$msg_type];
                $verified = $model->query('select reg_status from investor_personal where user_id = "%s"', $to);
                if ($verified[0]['reg_status'] == 2) {
                    $data['msg_content'] = '您已经通过审核, 成为来创认证的投资人!';
                } else {
                    if ($verified[0]['reg_status'] == 0) {
                        $data['msg_content'] = '您未通过管理员审核, 请修改资料并重新提交审核!';
                        $data['msg_attachment'] = $attach;
                    }
                }
                $data['sent_time'] = date('Y-m-d H:i:s');
                //dump($data);
                $result = $Form->add($data);
            }
            if ($object === "INNOVATOR") {
                $data['from_id'] = $_SESSION['userid'];
                $data['to_id'] = $to;
                $data['msg_type'] = C(MESSAGE_CODE)[$msg_type];
                $verified = $model->query('select reg_status from entrepreneur_personal where user_id = "%s"', $to);
                if ($verified[0]['reg_status'] == 2) {
                    $data['msg_content'] = '您已经通过审核, 成为来创认证的创业者!';
                } else {
                    if ($verified[0]['reg_status'] == 0) {
                        $data['msg_content'] = '您未通过管理员审核, 请修改资料并重新提交审核!';
                        $data['msg_attachment'] = $attach;
                    }
                }
                $data['sent_time'] = date('Y-m-d H:i:s');
                //dump($data);
                $result = $Form->add($data);
            }
        }
    }
Esempio n. 12
0
 public function save()
 {
     $Order = D('Foodorder');
     $itemcount = I('itemCount');
     if (!$itemcount) {
         $this->error('非法操作');
     }
     for ($i = 0; $i <= $itemcount; $i++) {
         $arrname = I('item_name_' . $i);
         if ($arrname) {
             $arr[$i]['fname'] = I('item_name_' . $i);
             $arr[$i]['fprice'] = I('item_price_' . $i);
             $arr[$i]['fcount'] = I('item_quantity_' . $i);
             $arr[$i]['prices'] = $arr[$i]['fcount'] * $arr[$i]['fprice'];
             $fid = I('item_options_' . $i);
             $arr[$i]['fid'] = trim(substr($fid, 4));
         }
     }
     $data['Foodorderext'] = $arr;
     $data['uid'] = session('user_id');
     //
     $address = I('address');
     if ($data['uid']) {
         $add = explode(",", $address);
         $data['otel'] = $add['0'];
         //联系手机号
         $data['oman'] = $add['1'];
         //联系人
         $data['oaddress'] = $add['2'];
         //联系址址
     } else {
         $data['otel'] = I('otel');
         //联系手机号
         $data['oman'] = I('oman');
         //联系人
         $data['oaddress'] = I('oaddress');
         //联系址址
     }
     $data['pid'] = $_COOKIE["PHPSESSID"];
     $days = I('days');
     //吃饭时间
     $times = I('times');
     //吃饭时间
     $data['order_dtime'] = $days . ' ' . $times;
     //吃饭时间
     $data['morecontent'] = I('ocontent');
     //备注
     if (!$data['oaddress']) {
         $this->error('外卖地址不可以为空');
     }
     if (!$data['otel']) {
         $this->error('电话不可以为空');
     }
     $data['orderprice'] = I('item_totals');
     //购物车商品总价格
     $data['ordercount'] = I('itemCount');
     //购物车商品总数量
     $data['order_ctime'] = time();
     //提交时间
     $data['shopspay'] = I('shopspay');
     //配送费用
     $data['paytype'] = I('paytype');
     //配送费用
     $data['gid'] = session('gid');
     //
     $data['ordersource'] = session('source');
     //订单来源
     $data['uname'] = session('username');
     //
     $data['orderstatus'] = 0;
     //
     $result = $Order->relation(true)->add($data);
     //生成订单后处理
     $ctime = date("Y-m-d h:i", $data['order_ctime']);
     //新增订单系统发邮件给管理员
     $mailto = C('TO_EMAIL');
     $mailname = C('name');
     $mailtitle = "新订单提醒:您有订单需要处理";
     $mailbody = "\n\t   订单号:" . $result . "<br>\n\t   订单金额:" . $data['orderprice'] . "<br>\n\t   下单时间:" . $ctime . "<br>\n\t   收货人:" . $data['oman'] . "<br>\n\t   收货地址:" . $data['oaddress'] . "<br>\n\t   收货人手机号:" . $data['otel'] . "<br>\n\t   送货时间:" . $data['order_dtime'] . "<br>\n\t   订单明细:<br><a href=''>查看详情</a><hr>\n\t  ";
     think_send_mail($mailto, $mailname, $mailtitle, $mailbody, '');
     //发邮件结束
     if ($result) {
         if ($data['paytype'] == 1) {
             //货到付款
             $this->redirect('Cart/cartok', 'id=' . $result);
         } else {
             if ($data['paytype'] == 2) {
                 //在线支付
                 $this->redirect('Cart/cartpay', 'id=' . $result);
                 // $this->redirect(U('Cart/cartok2'));
             }
         }
     }
 }
Esempio n. 13
0
 public function addExpress()
 {
     if ($_POST['pullok'] == '0' || $_POST['eclass'] == '1') {
         $receive = array('pexpress' => $_POST['pexpress'], 'pexpressnum' => $_POST['pexpressnum'], 'edate' => time(), 'eclass' => $_POST['eclass']);
         $reco = array('onum' => $_POST['onum'], 'pullstatus' => '1', 'expresslock' => '0');
         $order = M('order')->save($reco);
         $express = M('express')->add($receive);
         //写入订单流程关系表
         $merge = array('express_id' => $express, 'order_num' => $_POST['onum']);
         M('express_order')->add($merge);
         if ($express) {
             $order = M('order')->where(array('onum' => $_POST['onum']))->field(array('ossmail'))->find();
             $mail = $order['ossmail'];
             $r = think_send_mail("{$mail}", '海彦', "新物流", "有新快递;快递公司:{$_POST['pexpress']},物流号:{$_POST['pexpressnum']},合订号为:{$_POST['onum']}.");
             $this->success("修改成功");
         } else {
             $this->error("修改失败");
         }
     } else {
         $this->error("打样已经完成");
     }
 }
Esempio n. 14
0
function send_find_mail($user_id, $objectid, $to_address)
{
    $Form = new Model();
    $name = '';
    $pwd = '';
    $active_code = '';
    if ($objectid == 2) {
        $names = $Form->query('select name from investor_personal where user_id="%s"', $user_id);
        $pwds = $Form->query('select user_pwd from investor_security where user_id="%s"', $user_id);
        $name = $names[0][name];
        $pwd = $pwds[0][user_pwd];
    } else {
        $names = $Form->query('select name from entrepreneur_personal where user_id="%s"', $user_id);
        $pwds = $Form->query('select user_pwd from entrepreneur_security where user_id="%s"', $user_id);
        $name = $names[0][name];
        $pwd = $pwds[0][user_pwd];
    }
    $active_time = time();
    $over_time = $active_time + 24 * 60 * 60;
    $active_code = md5($user_id . $name . $pwd . $active_time);
    $sqlstr = sprintf("replace into email_find_pwd (user_id,active_code,mail_address,over_time,active_status)\n             values ('%s','%s','%s','%d','%d')", $user_id, $active_code, $to_address, $over_time, 0);
    $res = $Form->execute($sqlstr);
    if ($res) {
        $url = sprintf("http://localhost:8888/lcb/index.php/Home/Account/setting?key1=%s&key2=%s&key3=%s", $user_id, $to_address, $active_code);
        $body = sprintf("尊敬的用户 %s:请点击以下链接重置密码,如不能点击请将地址拷贝至浏览器栏。<br><a>%s</a>", $name, $url);
        return think_send_mail($to_address, $name, $subject = '来创科技重置密码', $body);
    }
    return 400;
}
Esempio n. 15
0
 public function orderupdate()
 {
     if ($_POST['belly'] == "on") {
         $belly = 1;
     } else {
         $belly = 0;
     }
     if ($_POST['sleg'] == "on") {
         $sleg = 1;
     } else {
         $sleg = 0;
     }
     if ($_POST['upleg'] == "on") {
         $upleg = 1;
     } else {
         $upleg = 0;
     }
     if ($_POST['flathip'] == "on") {
         $flathip = 1;
     } else {
         $flathip = 0;
     }
     if ($_POST['oleg'] == "on") {
         $oleg = 1;
     } else {
         $oleg = 0;
     }
     if ($_POST['xleg'] == "on") {
         $xleg = 1;
     } else {
         $xleg = 0;
     }
     //记录设计总监的修改
     $orderold = M('order')->where(array('onum' => $_POST['onum']))->find();
     //可以编辑量身单
     if ($orderold['inspectorverify'] == '0') {
         //处理审核之前的操作
         //处理复选框
         if ($_POST['rbook'] == "on") {
             $rbook = 1;
         } else {
             $rbook = 0;
         }
         if ($_POST['rsale'] == "on") {
             $rsale = 1;
         } else {
             $rsale = 0;
         }
         if ($_POST['rrent'] == "on") {
             $rrent = 1;
         } else {
             $rrent = 0;
         }
         if ($_POST['rpacke'] == "on") {
             $rpacke = 1;
         } else {
             $rpacke = 0;
         }
         $field = array('gnum', 'gname', 'gid');
         //处理选择框
         $ougid = I('cloth', 0, 'intval');
         $odgid = I('pants', 0, 'intval');
         $obgid = I('vest', 0, 'intval');
         $otgid = I('tcloth', 0, 'intval');
         //处理数据库字段为空的问题
         $cloth = M('goods')->where(array('gid' => $ougid))->field($field)->find();
         if (empty($cloth)) {
             $cloth['gnum'] = '';
             $cloth['gname'] = '';
         }
         $pants = M('goods')->where(array('gid' => $odgid))->field($field)->find();
         if (empty($pants)) {
             $pants['gnum'] = '';
             $pants['gname'] = '';
         }
         $vest = M('goods')->where(array('gid' => $obgid))->field($field)->find();
         if (empty($vest)) {
             $vest['gnum'] = '';
             $vest['gname'] = '';
         }
         $tcloth = M('goods')->where(array('gid' => $otgid))->field($field)->find();
         if (empty($tcloth)) {
             $tcloth['gnum'] = '';
             $tcloth['gname'] = '';
         }
         //处理供应商分配状态
         if ($_POST['inspectorverify'] == '1') {
             $opsname = $_POST['provider'];
         } else {
             $opsname = "";
         }
         //处理不打样算已完成
         if ($_POST['ispull'] == '0') {
             $pullok = 1;
         } else {
             $pullok = 0;
         }
         $receive = array('onum' => $_POST['onum'], 'oscalenum' => $_POST['oscalenum'], 'scale' => $_POST['scale'], 'ougid' => $ougid, 'ougnum' => $cloth['gnum'], 'ougname' => $cloth['gname'], 'uremark' => $_POST['uremark'], 'ushoulderwidth1' => $_POST['ushoulderwidth1'], 'ushoulderwidth2' => $_POST['ushoulderwidth2'], 'usleevewidth1' => $_POST['usleevewidth1'], 'usleevewidth2' => $_POST['usleevewidth2'], 'uclothlength1' => $_POST['uclothlength1'], 'uclothlength2' => $_POST['uclothlength2'], 'ubreathsur1' => $_POST['ubreathsur1'], 'ubreathsur2' => $_POST['ubreathsur2'], 'uwaistsur1' => $_POST['uwaistsur1'], 'uwaistsur2' => $_POST['uwaistsur2'], 'uhipsur1' => $_POST['uhipsur1'], 'uhipsur2' => $_POST['uhipsur2'], 'ubreathwidth1' => $_POST['ubreathwidth1'], 'ubreathwidth2' => $_POST['ubreathwidth2'], 'ubackwidth1' => $_POST['ubackwidth1'], 'ubackwidth2' => $_POST['ubackwidth2'], 'unecksur' => $_POST['unecksur'], 'uneckstyle' => $_POST['uneckstyle'], 'ubosom' => $_POST['ubosom'], 'usleevesur' => $_POST['usleevesur'], 'ucode' => $_POST['ucode'], 'uclothfabric' => $_POST['uclothfabric'], 'odgid' => $odgid, 'odgnum' => $pants['gnum'], 'odgname' => $pants['gname'], 'dremark' => $_POST['dremark'], 'dwaistsur1' => $_POST['dwaistsur1'], 'dwaistsur2' => $_POST['dwaistsur2'], 'dhipsur1' => $_POST['dhipsur1'], 'dhipsur2' => $_POST['dhipsur2'], 'dpantslength1' => $_POST['dpantslength1'], 'dpantslength2' => $_POST['dpantslength2'], 'dupcrotch1' => $_POST['dupcrotch1'], 'dupcrotch2' => $_POST['dupcrotch2'], 'dallcrotch1' => $_POST['dallcrotch1'], 'dallcrotch2' => $_POST['dallcrotch2'], 'dwaistdown1' => $_POST['dwaistdown1'], 'dwaistdown2' => $_POST['dwaistdown2'], 'dlegsur1' => $_POST['dlegsur1'], 'dlegsur2' => $_POST['dlegsur2'], 'dkneesur1' => $_POST['dkneesur1'], 'dkneesur2' => $_POST['dkneesur2'], 'dpantssur' => $_POST['dpantssur'], 'belly' => $belly, 'sleg' => $sleg, 'upleg' => $upleg, 'flathip' => $flathip, 'oleg' => $oleg, 'xleg' => $xleg, 'dcode' => $_POST['dcode'], 'dpantsfabric' => $_POST['dpantsfabric'], 'obgid' => $obgid, 'obgnum' => $vest['gnum'], 'obgname' => $vest['gname'], 'bfrontlength' => $_POST['bfrontlength'], 'bbacklength' => $_POST['bbacklength'], 'bup' => $_POST['bup'], 'bcenter' => $_POST['bcenter'], 'bcode' => $_POST['bcode'], 'bbackfabric' => $_POST['bbackfabric'], 'clothgetdate' => $_POST['clothgetdate'], 'clothbackdate' => $_POST['clothbackdate'], 'otgid' => $otgid, 'otgnum' => $tcloth['gnum'], 'otgname' => $tcloth['gname'], 'tremark' => $_POST['tremark'], 'tshoulderwidth1' => $_POST['tshoulderwidth1'], 'tshoulderwidth2' => $_POST['tshoulderwidth2'], 'tsleevewidth1' => $_POST['tsleevewidth1'], 'tsleevewidth2' => $_POST['tsleevewidth2'], 'tclothlength1' => $_POST['tclothlength1'], 'tclothlength2' => $_POST['tclothlength2'], 'tbreathsur1' => $_POST['tbreathsur1'], 'tbreathsur2' => $_POST['tbreathsur2'], 'twaistsur1' => $_POST['twaistsur1'], 'twaistsur2' => $_POST['twaistsur2'], 'thipsur1' => $_POST['thipsur1'], 'thipsur2' => $_POST['thipsur2'], 'tbreathwidth1' => $_POST['tbreathwidth1'], 'tbreathwidth2' => $_POST['tbreathwidth2'], 'tbackwidth1' => $_POST['tbackwidth1'], 'tbackwidth2' => $_POST['tbackwidth2'], 'tnecksur' => $_POST['tnecksur'], 'tneckstyle' => $_POST['tneckstyle'], 'tbosom' => $_POST['tbosom'], 'tsleevesur' => $_POST['tsleevesur'], 'tcode' => $_POST['tcode'], 'tclothfabric' => $_POST['tclothfabric'], 'tclothgetdate' => $_POST['tclothgetdate'], 'ispull' => $_POST['ispull'], 'inspectorverify' => $_POST['inspectorverify'], 'opsname' => $opsname, 'pullok' => $pullok, 'pullokdate' => time());
         $db = M('order');
         $result = $db->save($receive);
         if ($result) {
             if ($_POST['shopleaderverify'] == '1') {
                 $provider = M('shop')->where(array('sname' => $opsname))->find();
                 $mail = $provider['smail'];
                 $r = think_send_mail("{$mail}", '海彦', "新订单", "有新订单,合订号为:{$_POST['onum']}.");
             }
             $this->success("保存成功", U('Admin/Inspector/order', array('unum' => $_POST['osunum'], 'sid' => $_POST['sid'], 'ossname' => $_POST['ossname'])));
         } else {
             $this->error("保存失败", U('Admin/Inspector/order', array('unum' => $_POST['osunum'], 'sid' => $_POST['sid'], 'ossname' => $_POST['ossname'])));
         }
     } else {
         //之后的返修单修改的操作
         if ($orderold['repairlock'] == '0') {
             //上衣西服部分
             if ($_POST['ushoulderwidth1'] != $orderold['ushoulderwidth1']) {
                 $rupcloth = "上衣实际肩宽" . $orderold['ushoulderwidth1'] . "=>" . $_POST['ushoulderwidth1'] . "\n";
             }
             if ($_POST['ushoulderwidth2'] != $orderold['ushoulderwidth2']) {
                 $rupcloth = $rupcloth . "上衣完成肩宽" . $orderold['ushoulderwidth2'] . "=>" . $_POST['ushoulderwidth2'] . "\n";
             }
             if ($_POST['usleevewidth1'] != $orderold['usleevewidth1']) {
                 $rupcloth = $rupcloth . "上衣实际袖长" . $orderold['usleevewidth1'] . "=>" . $_POST['usleevewidth1'] . "\n";
             }
             if ($_POST['usleevewidth2'] != $orderold['usleevewidth2']) {
                 $rupcloth = $rupcloth . "上衣完成袖长" . $orderold['usleevewidth2'] . "=>" . $_POST['usleevewidth2'] . "\n";
             }
             if ($_POST['uclothlength1'] != $orderold['uclothlength1']) {
                 $rupcloth = $rupcloth . "上衣实际衣长" . $orderold['uclothlength1'] . "=>" . $_POST['uclothlength1'] . "\n";
             }
             if ($_POST['uclothlength2'] != $orderold['uclothlength2']) {
                 $rupcloth = $rupcloth . "上衣完成衣长" . $orderold['uclothlength2'] . "=>" . $_POST['uclothlength2'] . "\n";
             }
             if ($_POST['ubreathsur1'] != $orderold['ubreathsur1']) {
                 $rupcloth = $rupcloth . "上衣实际胸围" . $orderold['ubreathsur1'] . "=>" . $_POST['ubreathsur1'] . "\n";
             }
             if ($_POST['ubreathsur2'] != $orderold['ubreathsur2']) {
                 $rupcloth = $rupcloth . "上衣完成胸围" . $orderold['ubreathsur2'] . "=>" . $_POST['ubreathsur2'] . "\n";
             }
             if ($_POST['uwaistsur1'] != $orderold['uwaistsur1']) {
                 $rupcloth = $rupcloth . "上衣实际腰围" . $orderold['uwaistsur1'] . "=>" . $_POST['uwaistsur1'] . "\n";
             }
             if ($_POST['uwaistsur2'] != $orderold['uwaistsur2']) {
                 $rupcloth = $rupcloth . "上衣完成腰围" . $orderold['uwaistsur2'] . "=>" . $_POST['uwaistsur2'] . "\n";
             }
             if ($_POST['uhipsur1'] != $orderold['uhipsur1']) {
                 $rupcloth = $rupcloth . "上衣实际臀围" . $orderold['uhipsur1'] . "=>" . $_POST['uhipsur1'] . "\n";
             }
             if ($_POST['uhipsur2'] != $orderold['uhipsur2']) {
                 $rupcloth = $rupcloth . "上衣完成臀围" . $orderold['uhipsur2'] . "=>" . $_POST['uhipsur2'] . "\n";
             }
             if ($_POST['ubreathwidth1'] != $orderold['ubreathwidth1']) {
                 $rupcloth = $rupcloth . "上衣实际胸宽" . $orderold['ubreathwidth1'] . "=>" . $_POST['ubreathwidth1'] . "\n";
             }
             if ($_POST['ubreathwidth2'] != $orderold['ubreathwidth2']) {
                 $rupcloth = $rupcloth . "上衣完成胸宽" . $orderold['ubreathwidth2'] . "=>" . $_POST['ubreathwidth2'] . "\n";
             }
             if ($_POST['ubackwidth1'] != $orderold['ubackwidth1']) {
                 $rupcloth = $rupcloth . "上衣实际背宽" . $orderold['ubackwidth1'] . "=>" . $_POST['ubackwidth1'] . "\n";
             }
             if ($_POST['ubackwidth2'] != $orderold['ubackwidth2']) {
                 $rupcloth = $rupcloth . "上衣完成背宽" . $orderold['ubackwidth2'] . "=>" . $_POST['ubackwidth2'] . "\n";
             }
             if ($_POST['unecksur'] != $orderold['unecksur']) {
                 $rupcloth = $rupcloth . "上衣领围" . $orderold['unecksur'] . "=>" . $_POST['unecksur'] . "\n";
             }
             if ($_POST['uneckstyle'] != $orderold['uneckstyle']) {
                 $rupcloth = $rupcloth . "上衣领型" . $orderold['uneckstyle'] . "=>" . $_POST['uneckstyle'] . "\n";
             }
             if ($_POST['ubosom'] != $orderold['ubosom']) {
                 $rupcloth = $rupcloth . "上衣前襟" . $orderold['ubosom'] . "=>" . $_POST['ubosom'] . "\n";
             }
             if ($_POST['usleevesur'] != $orderold['usleevesur']) {
                 $rupcloth = $rupcloth . "上衣袖口" . $orderold['usleevesur'] . "=>" . $_POST['usleevesur'] . "\n";
             }
             if ($_POST['ucode'] != $orderold['ucode']) {
                 $rupcloth = $rupcloth . "上衣码数" . $orderold['ucode'] . "=>" . $_POST['ucode'] . "\n";
             }
             if ($_POST['uclothfabric'] != $orderold['uclothfabric']) {
                 $rupcloth = $rupcloth . "上衣布号" . $orderold['uclothfabric'] . "=>" . $_POST['uclothfabric'] . "\n";
             }
             //上衣衬衫部分
             if ($_POST['tshoulderwidth1'] != $orderold['tshoulderwidth1']) {
                 $rupcloth = $rupcloth . "衬衫实际肩宽" . $orderold['tshoulderwidth1'] . "=>" . $_POST['tshoulderwidth1'] . "\n";
             }
             if ($_POST['tshoulderwidth2'] != $orderold['tshoulderwidth2']) {
                 $rupcloth = $rupcloth . "衬衫完成肩宽" . $orderold['tshoulderwidth2'] . "=>" . $_POST['tshoulderwidth2'] . "\n";
             }
             if ($_POST['tsleevewidth1'] != $orderold['tsleevewidth1']) {
                 $rupcloth = $rupcloth . "衬衫实际袖长" . $orderold['tsleevewidth1'] . "=>" . $_POST['tsleevewidth1'] . "\n";
             }
             if ($_POST['tsleevewidth2'] != $orderold['tsleevewidth2']) {
                 $rupcloth = $rupcloth . "衬衫完成袖长" . $orderold['tsleevewidth2'] . "=>" . $_POST['tsleevewidth2'] . "\n";
             }
             if ($_POST['tclothlength1'] != $orderold['tclothlength1']) {
                 $rupcloth = $rupcloth . "衬衫实际衣长" . $orderold['tclothlength1'] . "=>" . $_POST['tclothlength1'] . "\n";
             }
             if ($_POST['tclothlength2'] != $orderold['tclothlength2']) {
                 $rupcloth = $rupcloth . "衬衫完成衣长" . $orderold['tclothlength2'] . "=>" . $_POST['tclothlength2'] . "\n";
             }
             if ($_POST['tbreathsur1'] != $orderold['tbreathsur1']) {
                 $rupcloth = $rupcloth . "衬衫实际胸围" . $orderold['tbreathsur1'] . "=>" . $_POST['tbreathsur1'] . "\n";
             }
             if ($_POST['tbreathsur2'] != $orderold['tbreathsur2']) {
                 $rupcloth = $rupcloth . "衬衫完成胸围" . $orderold['tbreathsur2'] . "=>" . $_POST['tbreathsur2'] . "\n";
             }
             if ($_POST['twaistsur1'] != $orderold['twaistsur1']) {
                 $rupcloth = $rupcloth . "衬衫实际腰围" . $orderold['twaistsur1'] . "=>" . $_POST['twaistsur1'] . "\n";
             }
             if ($_POST['twaistsur2'] != $orderold['twaistsur2']) {
                 $rupcloth = $rupcloth . "衬衫完成腰围" . $orderold['twaistsur2'] . "=>" . $_POST['twaistsur2'] . "\n";
             }
             if ($_POST['thipsur1'] != $orderold['thipsur1']) {
                 $rupcloth = $rupcloth . "衬衫实际臀围" . $orderold['thipsur1'] . "=>" . $_POST['thipsur1'] . "\n";
             }
             if ($_POST['thipsur2'] != $orderold['thipsur2']) {
                 $rupcloth = $rupcloth . "衬衫完成臀围" . $orderold['thipsur2'] . "=>" . $_POST['thipsur2'] . "\n";
             }
             if ($_POST['tbreathwidth1'] != $orderold['tbreathwidth1']) {
                 $rupcloth = $rupcloth . "衬衫实际胸宽" . $orderold['tbreathwidth1'] . "=>" . $_POST['tbreathwidth1'] . "\n";
             }
             if ($_POST['tbreathwidth2'] != $orderold['tbreathwidth2']) {
                 $rupcloth = $rupcloth . "衬衫完成胸宽" . $orderold['tbreathwidth2'] . "=>" . $_POST['tbreathwidth2'] . "\n";
             }
             if ($_POST['tbackwidth1'] != $orderold['tbackwidth1']) {
                 $rupcloth = $rupcloth . "衬衫实际背宽" . $orderold['tbackwidth1'] . "=>" . $_POST['tbackwidth1'] . "\n";
             }
             if ($_POST['tbackwidth2'] != $orderold['tbackwidth2']) {
                 $rupcloth = $rupcloth . "衬衫完成背宽" . $orderold['tbackwidth2'] . "=>" . $_POST['tbackwidth2'] . "\n";
             }
             if ($_POST['tnecksur'] != $orderold['tnecksur']) {
                 $rupcloth = $rupcloth . "衬衫领围" . $orderold['tnecksur'] . "=>" . $_POST['tnecksur'] . "\n";
             }
             if ($_POST['tneckstyle'] != $orderold['tneckstyle']) {
                 $rupcloth = $rupcloth . "衬衫领型" . $orderold['tneckstyle'] . "=>" . $_POST['tneckstyle'] . "\n";
             }
             if ($_POST['tbosom'] != $orderold['tbosom']) {
                 $rupcloth = $rupcloth . "衬衫前襟" . $orderold['tbosom'] . "=>" . $_POST['tbosom'] . "\n";
             }
             if ($_POST['tsleevesur'] != $orderold['tsleevesur']) {
                 $rupcloth = $rupcloth . "衬衫袖口" . $orderold['tsleevesur'] . "=>" . $_POST['tsleevesur'] . "\n";
             }
             if ($_POST['tcode'] != $orderold['tcode']) {
                 $rupcloth = $rupcloth . "衬衫码数" . $orderold['tcode'] . "=>" . $_POST['tcode'] . "\n";
             }
             if ($_POST['tclothfabric'] != $orderold['tclothfabric']) {
                 $rupcloth = $rupcloth . "衬衫布号" . $orderold['tclothfabric'] . "=>" . $_POST['tclothfabric'] . "\n";
             }
             //裤子部分
             if ($_POST['dwaistsur1'] != $orderold['dwaistsur1']) {
                 $rpants = "实际腰围" . $orderold['dwaistsur1'] . "=>" . $_POST['dwaistsur1'] . "\n";
             }
             if ($_POST['dwaistsur2'] != $orderold['dwaistsur2']) {
                 $rpants = $rpants . "完成腰围" . $orderold['dwaistsur2'] . "=>" . $_POST['dwaistsur2'] . "\n";
             }
             if ($_POST['dhipsur1'] != $orderold['dhipsur1']) {
                 $rpants = $rpants . "实际臀围" . $orderold['dhipsur1'] . "=>" . $_POST['dhipsur1'] . "\n";
             }
             if ($_POST['dhipsur2'] != $orderold['dhipsur2']) {
                 $rpants = $rpants . "完成臀围" . $orderold['dhipsur2'] . "=>" . $_POST['dhipsur2'] . "\n";
             }
             if ($_POST['dpantslength1'] != $orderold['dpantslength1']) {
                 $rpants = $rpants . "实际裤长" . $orderold['dpantslength1'] . "=>" . $_POST['dpantslength1'] . "\n";
             }
             if ($_POST['dpantslength2'] != $orderold['dpantslength2']) {
                 $rpants = $rpants . "完成裤长" . $orderold['dpantslength2'] . "=>" . $_POST['dpantslength2'] . "\n";
             }
             if ($_POST['dupcrotch1'] != $orderold['dupcrotch1']) {
                 $rpants = $rpants . "实际上裆" . $orderold['dupcrotch1'] . "=>" . $_POST['dupcrotch1'] . "\n";
             }
             if ($_POST['dupcrotch2'] != $orderold['dupcrotch2']) {
                 $rpants = $rpants . "完成上裆" . $orderold['dupcrotch2'] . "=>" . $_POST['dupcrotch2'] . "\n";
             }
             if ($_POST['dallcrotch1'] != $orderold['dallcrotch1']) {
                 $rpants = $rpants . "实际全裆" . $orderold['dallcrotch1'] . "=>" . $_POST['dallcrotch1'] . "\n";
             }
             if ($_POST['dallcrotch2'] != $orderold['dallcrotch2']) {
                 $rpants = $rpants . "完成全裆" . $orderold['dallcrotch2'] . "=>" . $_POST['dallcrotch2'] . "\n";
             }
             if ($_POST['dwaistdown1'] != $orderold['dwaistdown1']) {
                 $rpants = $rpants . "实际腰下" . $orderold['dwaistdown1'] . "=>" . $_POST['dwaistdown1'] . "\n";
             }
             if ($_POST['dwaistdown2'] != $orderold['dwaistdown2']) {
                 $rpants = $rpants . "完成腰下" . $orderold['dwaistdown2'] . "=>" . $_POST['dwaistdown2'] . "\n";
             }
             if ($_POST['dlegsur1'] != $orderold['dlegsur1']) {
                 $rpants = $rpants . "实际腿围" . $orderold['dlegsur1'] . "=>" . $_POST['dlegsur1'] . "\n";
             }
             if ($_POST['dlegsur2'] != $orderold['dlegsur2']) {
                 $rpants = $rpants . "完成腿围" . $orderold['dlegsur2'] . "=>" . $_POST['dlegsur2'] . "\n";
             }
             if ($_POST['dkneesur1'] != $orderold['dkneesur1']) {
                 $rpants = $rpants . "实际膝围" . $orderold['dkneesur1'] . "=>" . $_POST['dkneesur1'] . "\n";
             }
             if ($_POST['dkneesur2'] != $orderold['dkneesur2']) {
                 $rpants = $rpants . "完成膝围" . $orderold['dkneesur2'] . "=>" . $_POST['dkneesur2'] . "\n";
             }
             if ($_POST['dpantssur'] != $orderold['dpantssur']) {
                 $rpants = $rpants . "裤口" . $orderold['dpantssur'] . "=>" . $_POST['dpantssur'] . "\n";
             }
             if ($belly != $orderold['belly']) {
                 $rpants = $rpants . "有肚" . $orderold['belly'] . "=>" . $belly . "\n";
             }
             if ($sleg != $orderold['sleg']) {
                 $rpants = $rpants . "S腿" . $orderold['sleg'] . "=>" . $sleg . "\n";
             }
             if ($upleg != $orderold['upleg']) {
                 $rpants = $rpants . "翘腿" . $orderold['upleg'] . "=>" . $upleg . "\n";
             }
             if ($flathip != $orderold['flathip']) {
                 $rpants = $rpants . "平臀" . $orderold['flathip'] . "=>" . $flathip . "\n";
             }
             if ($oleg != $orderold['oleg']) {
                 $rpants = $rpants . "O腿" . $orderold['oleg'] . "=>" . $oleg . "\n";
             }
             if ($xleg != $orderold['xleg']) {
                 $rpants = $rpants . "X腿" . $orderold['xleg'] . "=>" . $xleg . "\n";
             }
             if ($_POST['dcode'] != $orderold['dcode']) {
                 $rpants = $rpants . "码数" . $orderold['dcode'] . "=>" . $_POST['dcode'] . "\n";
             }
             if ($_POST['dclothfabric'] != $orderold['dclothfabric']) {
                 $rpants = $rpants . "布号" . $orderold['dclothfabric'] . "=>" . $_POST['dclothfabric'] . "\n";
             }
             //背心部分
             if ($_POST['bfrontlength'] != $orderold['bfrontlength']) {
                 $rvest = "前长" . $orderold['bfrontlength'] . "=>" . $_POST['bfrontlength'] . "\n";
             }
             if ($_POST['bbacklength'] != $orderold['bbacklength']) {
                 $rvest = $rvest . "后长" . $orderold['bbacklength'] . "=>" . $_POST['bbacklength'] . "\n";
             }
             if ($_POST['bup'] != $orderold['bup']) {
                 $rvest = $rvest . "上" . $orderold['bup'] . "=>" . $_POST['bup'] . "\n";
             }
             if ($_POST['bcenter'] != $orderold['bcenter']) {
                 $rvest = $rvest . "中" . $orderold['bcenter'] . "=>" . $_POST['bcenter'] . "\n";
             }
             if ($_POST['bcode'] != $orderold['bcode']) {
                 $rvest = $rvest . "码数" . $orderold['bcode'] . "=>" . $_POST['bcode'] . "\n";
             }
             if ($_POST['bbackfabric'] != $orderold['bbackfabric']) {
                 $rvest = $rvest . "布号" . $orderold['bbackfabric'] . "=>" . $_POST['bbackfabric'] . "\n";
             }
             //记录结束
             $repairold = M('repair')->where(array('rid' => $orderold['repairid']))->find();
             $rupcloth = $repairold['upremark2'] . "\n" . "修改人工号:" . $_POST['osunum'] . "\n" . $rupcloth . "==========" . "\n";
             $rpants = $repairold['downremark2'] . "\n" . "修改人工号:" . $_POST['osunum'] . "\n" . $rpants . "==========" . "\n";
             $rvest = $repairold['backremark2'] . "\n" . "修改人工号:" . $_POST['osunum'] . "\n" . $rvest . "==========" . "\n";
             $repair = array('rid' => $orderold['repairid'], 'upremark2' => $rupcloth, 'downremark2' => $rpants, 'backremark2' => $rvest);
             M('repair')->save($repair);
             //处理量身单的修改
             $receive2 = array('onum' => $_POST['onum'], 'oscalenum' => $_POST['oscalenum'], 'scale' => $_POST['scale'], 'ushoulderwidth1' => $_POST['ushoulderwidth1'], 'ushoulderwidth2' => $_POST['ushoulderwidth2'], 'usleevewidth1' => $_POST['usleevewidth1'], 'usleevewidth2' => $_POST['usleevewidth2'], 'uclothlength1' => $_POST['uclothlength1'], 'uclothlength2' => $_POST['uclothlength2'], 'ubreathsur1' => $_POST['ubreathsur1'], 'ubreathsur2' => $_POST['ubreathsur2'], 'uwaistsur1' => $_POST['uwaistsur1'], 'uwaistsur2' => $_POST['uwaistsur2'], 'uhipsur1' => $_POST['uhipsur1'], 'uhipsur2' => $_POST['uhipsur2'], 'ubreathwidth1' => $_POST['ubreathwidth1'], 'ubreathwidth2' => $_POST['ubreathwidth2'], 'ubackwidth1' => $_POST['ubackwidth1'], 'ubackwidth2' => $_POST['ubackwidth2'], 'unecksur' => $_POST['unecksur'], 'uneckstyle' => $_POST['uneckstyle'], 'ubosom' => $_POST['ubosom'], 'usleevesur' => $_POST['usleevesur'], 'ucode' => $_POST['ucode'], 'uclothfabric' => $_POST['uclothfabric'], 'dwaistsur1' => $_POST['dwaistsur1'], 'dwaistsur2' => $_POST['dwaistsur2'], 'dhipsur1' => $_POST['dhipsur1'], 'dhipsur2' => $_POST['dhipsur2'], 'dpantslength1' => $_POST['dpantslength1'], 'dpantslength2' => $_POST['dpantslength2'], 'dupcrotch1' => $_POST['dupcrotch1'], 'dupcrotch2' => $_POST['dupcrotch2'], 'dallcrotch1' => $_POST['dallcrotch1'], 'dallcrotch2' => $_POST['dallcrotch2'], 'dwaistdown1' => $_POST['dwaistdown1'], 'dwaistdown2' => $_POST['dwaistdown2'], 'dlegsur1' => $_POST['dlegsur1'], 'dlegsur2' => $_POST['dlegsur2'], 'dkneesur1' => $_POST['dkneesur1'], 'dkneesur2' => $_POST['dkneesur2'], 'dpantssur' => $_POST['dpantssur'], 'belly' => $belly, 'sleg' => $sleg, 'upleg' => $upleg, 'flathip' => $flathip, 'oleg' => $oleg, 'xleg' => $xleg, 'dcode' => $_POST['dcode'], 'dpantsfabric' => $_POST['dpantsfabric'], 'bfrontlength' => $_POST['bfrontlength'], 'bbacklength' => $_POST['bbacklength'], 'bup' => $_POST['bup'], 'bcenter' => $_POST['bcenter'], 'bcode' => $_POST['bcode'], 'bbackfabric' => $_POST['bbackfabric'], 'tshoulderwidth1' => $_POST['tshoulderwidth1'], 'tshoulderwidth2' => $_POST['tshoulderwidth2'], 'tsleevewidth1' => $_POST['tsleevewidth1'], 'tsleevewidth2' => $_POST['tsleevewidth2'], 'tclothlength1' => $_POST['tclothlength1'], 'tclothlength2' => $_POST['tclothlength2'], 'tbreathsur1' => $_POST['tbreathsur1'], 'tbreathsur2' => $_POST['tbreathsur2'], 'twaistsur1' => $_POST['twaistsur1'], 'twaistsur2' => $_POST['twaistsur2'], 'thipsur1' => $_POST['thipsur1'], 'thipsur2' => $_POST['thipsur2'], 'tbreathwidth1' => $_POST['tbreathwidth1'], 'tbreathwidth2' => $_POST['tbreathwidth2'], 'tbackwidth1' => $_POST['tbackwidth1'], 'tbackwidth2' => $_POST['tbackwidth2'], 'tnecksur' => $_POST['tnecksur'], 'tneckstyle' => $_POST['tneckstyle'], 'tbosom' => $_POST['tbosom'], 'tsleevesur' => $_POST['tsleevesur'], 'tcode' => $_POST['tcode'], 'tclothfabric' => $_POST['tclothfabric']);
             $db = M('order');
             $result2 = $db->save($receive2);
             if ($result2) {
                 $this->success("保存成功", U('Admin/Shopleader/order', array('sid' => $_POST['sid'], 'ossname' => $_POST['ossname'], 'unum' => $_POST['osunum'])));
             } else {
                 $this->error("保存失败", U('Admin/Shopleader/order', array('sid' => $_POST['sid'], 'ossname' => $_POST['ossname'], 'unum' => $_POST['osunum'])));
             }
         }
     }
 }
Esempio n. 16
0
 public function mails($chengjie, $id)
 {
     //发送邮件函数
     $talent = new BopaiViewModel();
     $list = $talent->find($id);
     //dump($list);
     $talents = new BopaimailViewModel();
     $lists = $talents->find($chengjie);
     //dump($lists);
     $subject = $list['yourname'] . '顾问在摸排库承接提醒您!';
     $body = '<b>人才姓名:</b>' . $list['name'] . '<br/><b>职位:</b>' . $list['job'] . '<br/><b>出生年月:</b>' . $list['chusheng'] . '<br/><b>年薪:</b>' . $list['moeny'] . '万<br/><b>所在项目名称:</b>' . $list['project'] . '<br/><a href="http://tjd.timehr.com/test.php/Bopai/my_join.html">进入官网查看</a>';
     $to = trim($lists['mail']);
     think_send_mail($to, 'tjd.timehr.com官网', $subject, $body);
 }