Exemplo n.º 1
0
 function getAnswerList()
 {
     $tlist = mod_crmmanage::getqtype();
     foreach ($tlist as $key => $value) {
         $newtype[$key + 1] = $value;
     }
     $newtype = genTree($newtype);
     //$answer_id=mod_crmtest::getAnswerId();
     //debug($alist['answer_id']);
     $alist = mod_crmtest::getanswerlist();
     //debug($alist);
     //$a=mb_substr($alist['3']['content'],0,2);
     pm_tpl::assign("ser_tlist", $newtype);
     pm_tpl::assign("alist", $alist);
     pm_tpl::display('crmtest_getanswerlist');
 }
Exemplo n.º 2
0
 public function export()
 {
     $where = stripcslashes($_GET['query']);
     $sql = "SELECT * from crm_question WHERE `exists`= '1' {$where} order by create_time desc";
     $list = pm_db::fetch_all_result($sql);
     $plist = mod_product::getcrmproduct();
     $tlist = mod_crmmanage::getqtype();
     $slist = mod_crmmanage::getserverlist();
     foreach ($list as &$value) {
         foreach ($slist as $val) {
             if ($value['server_id'] == $val['id']) {
                 $value['server'] = $val['server_name'];
             }
         }
         foreach ($plist as $val) {
             if ($value['game_id'] == $val['pid']) {
                 $value['game'] = $val['pname'];
             }
         }
         foreach ($tlist as $val) {
             if ($value['qtype_id'] == $val['id']) {
                 $value['qtype'] = $val['name'];
             }
         }
         if ($value['status'] == 'untreated') {
             $value['status_info'] = "未处理";
         } elseif ($value['status'] == 'processed') {
             $value['status_info'] = "已处理";
         } else {
             $value['status_info'] = "已关闭";
         }
         if ($value['operation'] == 1) {
             $value['status_info'] .= "--运营处理中";
         }
         if ($value['operation'] == 2) {
             $value['status_info'] .= "--运营已回复";
         }
     }
     $line = "<tr>";
     foreach ($list as $value) {
         $line .= "<td>" . $value['question_id'] . "</td>";
         $line .= "<td>" . $value['title'] . "</td>";
         $line .= "<td>" . $value['content'] . "</td>";
         $line .= "<td>" . $value['game'] . "</td>";
         $line .= "<td>" . $value['server'] . "</td>";
         $line .= "<td>" . $value['channel'] . "</td>";
         $line .= "<td>" . $value['account'] . "</td>";
         $line .= "<td>" . $value['nick'] . "</td>";
         $line .= "<td>" . $value['role_id'] . "</td>";
         $line .= "<td>" . $value['occurs_time'] . "</td>";
         $line .= "<td>" . $value['qtype'] . "</td>";
         $line .= "<td>" . $value['create_time'] . "</td>";
         $line .= "<td>" . $value['status_info'] . "</td>";
         $line .= "<td>" . $value['qq'] . "</td>";
         $line .= "<td>" . $value['mobile'] . "</td>";
         $line .= "<td>" . $value['email'] . "</td></tr><tr>";
     }
     $content = substr($line, 0, -4);
     $template = file_get_contents("template.html");
     $html = str_replace("[content]", $content, $template);
     echo $html;
 }
Exemplo n.º 3
0
 public function answerlist()
 {
     if ($_POST['rquestion']) {
         if (ADMINUSERID == 249) {
             dump($_POST);
             exit;
         }
         $data['qid'] = $_POST['qid'];
         $data['content'] = $_POST['reply'];
         $data['create_time'] = time();
         $data['creater_id'] = ADMINUSERID;
         $data['reply_type'] = 'cus_server';
         pm_db::tran_query("BEGIN");
         $id = pm_db::insert('crm_answer', $data, 'tran');
         $reply['lastreply_id'] = ADMINUSERID;
         $reply['lastreply_time'] = time();
         if (isset($_POST['to_server']) && !empty($_POST['to_server'])) {
             if ($_POST['operation'] == 0 && $_POST['status'] == 'untreated') {
                 $reply['operation'] = 3;
             }
         } else {
             if ($_POST['operation'] == 3) {
                 $reply['operation'] = 0;
             }
             $reply['status'] = 'processed';
         }
         $status = pm_db::update('crm_question', $reply, "question_id = '{$_POST['qid']}'", 'tran');
         if ($id && $status) {
             pm_db::tran_query("COMMIT");
             mod_login::message('回复成功');
         } else {
             pm_db::tran_query("ROLLBACK");
             mod_login::message('回复失败');
         }
         pm_db::tran_query("END");
         exit;
     }
     if ($_POST['tooperation']) {
         $data['operation'] = 1;
         $data['status'] = 'untreated';
         $status = pm_db::update('crm_question', $data, "question_id = '{$_POST['qid']}'");
         if ($status) {
             mod_login::message('转交成功!');
         } else {
             mod_login::message('转交失败!');
         }
         exit;
     }
     if ($_POST['cquestion']) {
         $data['status'] = 'closed';
         $data['operation'] = 0;
         $status = pm_db::update('crm_question', $data, "question_id = '{$_POST['qid']}'");
         if ($status) {
             mod_login::message('问题关闭成功!');
         } else {
             mod_login::message('问题关闭失败!');
         }
         exit;
     }
     $qid = $_GET['qid'];
     $info = mod_crmmanage::getqbyid($qid);
     $memberinfo = mod_member::get_oneamdinbyuser_id($info['create_id']);
     $admin_info = mod_member::get_oneamdinbyuser_id(ADMINUSERID);
     $proinfo = mod_product::get_one_product($info['game_id']);
     $serinfo = mod_crmmanage::getserverbyid($info['server_id']);
     $info['truename'] = $memberinfo['truename'];
     $info['pname'] = $proinfo['pname'];
     $info['server_name'] = $serinfo['server_name'];
     $info['is_right'] = strpos($admin_info['rights'], 'custom-question');
     $tlist = mod_crmmanage::getqtype();
     $alist = mod_crmmanage::getanswerlist($qid);
     $userlist = mod_crmmanage::getusername();
     if ($alist) {
         foreach ($alist as &$value) {
             if ($value['reply_type'] != 'customer') {
                 foreach ($userlist as $val) {
                     if ($val['user_id'] == $value['creater_id']) {
                         $value['username'] = $val['user_name'];
                     }
                 }
             }
         }
     }
     pm_tpl::assign("tlist", $tlist);
     pm_tpl::assign("alist", $alist);
     pm_tpl::assign("info", $info);
     pm_tpl::assign("ur_here", "回复列表");
     pm_tpl::assign('action_link', array('href' => '?c=crmmanage&a=index', 'text' => '问题列表'));
     pm_tpl::display('crmmanage_answerlist');
 }