コード例 #1
0
    $arr['question_no'] = time();
    $arr['user_no'] = $_POST['fb_truename'];
    $arr['title'] = $_POST['title'];
    $arr['question'] = $_POST['fb_content'];
    $arr['question_time'] = time();
    $arr['agree_rate'] = '0';
    $arr['status'] = '1';
    $arr['conter'] = $_POST['content'];
    $arr['type'] = $_POST['fb_type'];
    $arr['conter'] = $_POST['fb_truename'];
    $arr['conter_email'] = $_POST['fb_email'];
    $arr['conter_tel'] = $_POST['fb_tel'];
    $question->insertTable("mpos_question ", $arr);
    echo "<script>alert('添加提問成功!');location.href='faq.php';</script>";
}
if ($_GET['action'] == 'del') {
    $no = $_GET['k_id'];
    $sql = "delete from mpos_answer where question_no='{$no}'";
    $sql1 = "delete from mpos_question where question_no='{$no}'";
    $question->delete($sql);
    $question->delete($sql1);
    echo "<script>alert('刪除提問成功!');location.href='faqlist.php';</script>";
}
$smarty->assign("right", $_SESSION[usrinfo][username]);
$smarty->assign("username", $_SESSION[usrinfo][username]);
$smarty->assign("tname", $_SESSION[usrinfo][tname]);
$smarty->assign("privileges", $_SESSION[usrinfo][privileges]);
$smarty->assign("is_admin", $_SESSION[usrinfo][is_admin]);
$smarty->assign("pages", $pages);
$smarty->assign("list", $list);
$smarty->display("faqlist.html");