1 Star 0 Fork 6

八爪鱼工作室/罗湖医院体检科

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ask.php 2.62 KB
一键复制 编辑 原始数据 按行查看 历史
邓云溪 提交于 2018-05-21 11:01 . no commit message
<?php
require(dirname(__FILE__)."/"."global.php");
require_once(PHP168_PATH."inc/encode.php");
require(PHP168_PATH."inc/head.php");
require(PHP168_PATH.'/JYSmarty.php');
require(PHP168_PATH.'/JYAPI.php');
//require(PHP168_PATH.'/jyapi_local.php');
//error_reporting(7);
$ask = new JYAPI("Model_Ask",true);
//如果提交咨询,则保留提交的内容,并返回当前页
if($act == "send"){
if( isset( $_POST["title"] ) && !empty($_POST["title"]) ){
// 处理提交
$ask_info = array(
"title" => $_POST["title"],
"content" => $_POST["content"],
"dep_id" => isset( $_POST["dep_id"] ) ? $_POST["dep_id"] : "",
"ip" => getenv("REMOTE_ADDR"),
"post_name" => $_POST["post_name"],
"unit_id" => UNITID,
"doctor_id" => isset( $_POST["doctor_id"] ) ? $_POST["doctor_id"] : "",
);
if( false != $ask->newAsk($ask_info)){
$out = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><script>alert(\"成功提交咨询\");";
$comeurl = $_POST['comeurl'];
if($comeurl){
$out .= "</script><meta http-equiv = \"refresh\" content = \"0; url=".$comeurl."\" />";
}else{
$out .= "</script><meta http-equiv = \"refresh\" content = \"0; url=ask.php?depid=".(isset( $_POST["dep_id"] ) ? $_POST["dep_id"] : "")."\" /></head></html>";
}
echo $out;
exit;
}
}
}else{
//如果没有提交,则显示咨询的列表
$dep = new JYAPI("Model_Dep");
$where = "unit_id_path ='".UNITID.",'";
$depid=789;
$deplist = $dep->getAllDep($where,'dep_id,dep_name','position desc',1,50);
$smarty->assign("deplist", $deplist);
$depid=isset($_GET['depid']) ? $_GET['depid']:0;
if($depid){
$depinfo = $dep->getOneDep($depid); // 取得科室资料
$smarty->assign("depinfo",$depinfo);
}
$askid = isset($_GET['askid']) ? $_GET['askid'] : 0;
$page = (isset($_GET['page'])) ? $_GET['page'] : 1;
if($askid){
//获取咨询及回复信息
$askinfo = $ask->getAskInfo($askid);
$smarty->assign("askinfo",$askinfo);
$smarty->display("ask.html");
}else{
$page = (isset($_GET['page'])) ? $_GET['page'] : 1;
$pageSize = 20;
$where = "unit_id_path='".UNITID.",'";
//取回复咨询
$where .= " and has_reply = 1 ";
$depid=789;
if($depid){
$where .= " and dep_id_path ='".$depid.",'";
}
$asklist = $ask->getAllAsk($where,'*','post_time desc',$page,$pageSize);
$dpager = $ask->pager;
$smarty->assign("asklist",$asklist);
$smarty->assign("dpager", $dpager);
$smarty->assign("url", "ask.php?depid=$depid&page=|num|");
$currdep[$depid] = " selected ";
$smarty->assign("currdep",$currdep);
$smarty->display("ask_list.html");
}
}
require(PHP168_PATH."inc/foot.php");
?>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/elfbobo/luohu.git
[email protected]:elfbobo/luohu.git
elfbobo
luohu
罗湖医院体检科
master

搜索帮助