<?php //引入静态常量 require_once '../../../util/StackConst.php'; //引入操作DAO require_once '../dao/AnswerDao.php'; //实例化dao $answerDao = new AnswerDao(); //获取对象集合 $arrAnswers = $answerDao->getAnswerList(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> </head> <body> <input type="hidden" name="type" value=""/> <table border="1" width="95%"> <tr> <th>序号</th> <th>技术解答标题</th> <th>技术解答内容</th> <th width="120px" colspan="2">操作</th> </tr> <?php $XH = 1; foreach ($arrAnswers as $answer) { ?>
//引入AnswerDao操作类 require_once '../dao/AnswerDao.php'; //实例化Dao $answerDao = new AnswerDao(); if ($answerDao->deleteAnswerById(@$_GET['sup_res_answer_id'])) { echo "技术解答删除成功!"; StackConst::jump_page("../view/resanswerlist.php"); } else { echo "技术解答删除失败!"; } } else { if ("updateAnswer" == $type) { //引入AnswerDao操作类 require_once '../dao/AnswerDao.php'; //实例化Dao $answerDao = new AnswerDao(); if ($answerDao->deleteAnswerById(@$_POST['sup_res_answer_id'])) { $arrAnswerInfo = array("sup_res_answer_title" => @$_POST['sup_res_answer_title'], "sup_res_answer_content" => @$_POST['sup_res_answer_content']); if ($answerDao->addAnswer($arrAnswerInfo)) { echo "技术解答修改成功!"; StackConst::jump_page("../view/resanswerlist.php"); } else { echo "技术解答修改失败!"; } StackConst::jump_page("../view/resanswerlist.php"); } else { echo "技术解答修改失败!"; } } } }
<?php //引入静态常量 require_once '../../../util/StackConst.php'; //引入操作DAO require_once '../dao/AnswerDao.php'; //获得sup_res_answer_id $sup_res_answer_id = @$_GET['sup_res_answer_id']; //实例化dao $answerDao = new AnswerDao(); //获取对象集合 $arrAnswerDetail = $answerDao->getAnsWerById($sup_res_answer_id); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>服务支持|技术解答</title> <script language="javascript" type="text/javascript" src="../../zjs/jquery-1.8.3.js"></script> <script type="text/javascript"> function hhfwz(){ $("#sup_res_answer_content").val($("#sup_res_answer_content").val().replace(/\r\n|\n/g,'<br/>')); } </script> </head> <body> <form action="../control/answercontrol.php" method="post"> <input type="hidden" name="type" value="updateAnswer"/> <input type="hidden" name="sup_res_answer_id" value="<?php echo $arrAnswerDetail['sup_res_answer_id'];