Ejemplo n.º 1
0
 function quick_reply()
 {
     $msg = '0';
     if ($_POST) {
         $site = $this->config->item('site');
         if ($this->username == strip_tags($this->input->post('from', TRUE))) {
             $content = strip_tags($this->input->post('content', TRUE));
             $content = preg_replace("/[A-Za-z0-9+]+[A-Za-z0-9\\.\\_\\-+]*@([A-Za-z0-9\\-]+\\.)+[A-Za-z0-9]+/i", "*", $content);
             $content = str_replace(array("\r\n", "\n", "\r"), "<br />", $content);
             $typeid = intval($this->input->post('typeid', TRUE));
             if ($typeid == 2) {
                 $auth = md5($this->config->item('encryption_key') . mt_rand());
             } else {
                 $auth = '';
             }
             $touser = strip_tags($this->input->post('to', TRUE));
             $iid = intval($this->input->post('inquiry_id', TRUE));
             $message = array('title' => strip_tags($this->input->post('subject', TRUE)), 'typeid' => $typeid, 'content' => $content, 'fromuser' => $this->username, 'touser' => $touser, 'addtime' => time(), 'ip' => $this->input->ip_address(), 'issend' => 1, 'status' => 1, 'auth' => $auth);
             $insert_id = $this->comm->create('message', $message);
             if ($insert_id) {
                 $this->comm->update('message', array('mid' => intval($this->input->post('mid', TRUE))), array('feedback' => 1));
                 $count = $this->comm->findCount("member", array('email' => $touser, 'vmail' => 1));
                 if ($count) {
                     echo $msg = '1';
                     exit;
                 }
                 if ($typeid == 2 && !$touser) {
                     $uemail = $this->comm->find("inquiry", array("id" => $iid), '', 'id,email,sid');
                     if (!$uemail) {
                         echo $msg = '-1';
                         exit;
                     }
                     $frommsg = $this->comm->find("member", array("username" => $this->username), "", "company,truename,mobile,areaid");
                     $frommsg_1 = $this->comm->find("company", array("username" => $this->username), "", "telephone,mail");
                     $frommsg_1 = $frommsg_1 ? $frommsg_1 : array('telephone' => '', 'mail' => '');
                     $country = $this->comm->find("area", array("areaid" => $frommsg['areaid']), "", "areaname");
                     $country = $country ? $country['areaname'] : '';
                     $inquiry = array('title' => strip_tags($this->input->post('subject', TRUE)), 'fromuser' => $this->username, 'company' => $frommsg['company'], 'country' => $country, 'truename' => $frommsg['truename'], 'telephone' => $frommsg_1['telephone'], 'mobile' => $frommsg['mobile'], 'email' => $frommsg_1['mail'], 'sid' => $uemail['sid'], 'ip' => $this->input->ip_address(), 'postdate' => time(), 'pid' => $uemail['id'], 'inquiry_data' => array('message' => $content));
                     $inquiry_id = $this->comm->linker()->create('inquiry', $inquiry);
                     $this->comm->update('message', array('mid' => $insert_id), array('iid' => $inquiry_id));
                     $call = array_shift(explode('@', $uemail['email']));
                     $this->load->config("email");
                     $email = $this->config->item("email");
                     $link = sell_url(site_url("supplier_connect/nomem_inquiry/" . $insert_id . "/" . $auth));
                     $this->load->library('email', $email);
                     $this->email->set_newline("\r\n");
                     $my_email = $email['smtp_user'];
                     $this->email->from($my_email, strtoupper($site['site_name']));
                     $this->email->to($uemail['email']);
                     $this->email->subject('Information about reply for inquiry from ' . ucfirst($site['site_name']));
                     $str = "Dear " . $call . "<br/>Please click <a href='" . $link . "'>here</a> to read the information about reply of your inquiry.";
                     $str .= "<br/>The message is just a notification, not receiving any reply.";
                     $str .= "<br/>PLEASE DO NOT REPLY to this message.";
                     $str .= "<br/>If you have any questions, please do not hesitate to visit our official website.";
                     $str .= "<br/>If you can&#39;t click the link, please copy the following link to your address bar and visit it!<br/>";
                     $str .= $link;
                     $this->email->message($str);
                     if ($this->email->send()) {
                         $msg = 1;
                     } else {
                         $msg = -1;
                     }
                 } else {
                     echo $msg = '1';
                     exit;
                 }
             } else {
                 $msg = -1;
             }
         }
     }
     echo $msg;
 }
Ejemplo n.º 2
0
<input type="hidden" name="iid" value="<?php 
echo $inquiry_detail['id'];
?>
"/>
<table class="tb" cellpadding="2" cellspacing="1">
<tbody><tr>
<td class="tl">询单标题</td>
<td class="f_b"><?php 
echo $inquiry_detail['title'];
?>
</td>
</tr>
<tr>
<td class="tl">询盘产品ID</td>
<td><a href="<?php 
echo sell_url(company_url("content/index/" . $inquiry_detail['sid'] . "/" . $inquiry_detail['item_url']), $inquiry_detail['username']);
?>
" target="_blank"><?php 
echo $inquiry_detail['sid'];
?>
</a></td>
</tr>
<tr>
<td class="tl">供应商</td>
<td><a href="<?php 
echo site_url("member/member/get_detail/{$inquiry_detail['touser']}");
?>
"><?php 
echo $inquiry_detail['touser'];
?>
</a></td>