public function addquestion() { if ($_POST) { unset($_POST['submit']); $data = $_POST; $lastone = mod_crmmanage::getlastqid(); $date = substr($lastone, 1, 8); if ($date != date('Ymd')) { $qid = date('Ymd') . "00001"; } else { $qid = substr($lastone, 1) + 1; } $data['question_id'] = 'Q' . $qid; $data['create_id'] = ADMINUSERID; $data['create_time'] = time(); $data['add_role'] = 1; $id = pm_db::insert('crm_question', $data, true); if ($id) { mod_login::message('添加成功', "?c=crmmanage&a=answerlist&qid=" . $data['question_id']); } else { mod_login::message('添加失败'); } exit; } $plist = mod_product::getcrmproduct(); $slist = mod_crmmanage::getserverlist($plist[0]['pid']); $tlist = mod_crmmanage::getqtype(); foreach ($tlist as $key => $value) { $newtype[$key + 1] = $value; } $newtype = genTree($newtype); pm_tpl::assign('action_link', array('href' => '?c=crmmanage&a=index', 'text' => '返回问题列表')); pm_tpl::assign("tlist", $newtype); pm_tpl::assign("json_type", json_encode($newtype)); pm_tpl::assign("plist", $plist); pm_tpl::assign("slist", $slist); pm_tpl::assign("ur_here", "添加问题"); pm_tpl::display('crmmanage_addquestion'); }