Слияние кода завершено, страница обновится автоматически
<?php
require(dirname(__FILE__)."/"."global.php");
require_once(PHP168_PATH."inc/encode.php");
require(PHP168_PATH.'/JYAPI.php');
require(PHP168_PATH.'/JYSmarty.php');
$dep = new JYAPI("Model_Dep",true);
error_reporting(7);
//获取科室的JS列表
$job = $_GET['job'];
if($job == 'js'){
$where = "unit_id_path = '".UNITID.",'";
$deplist = $dep->getAllDep($where,'dep_id,short_name,level_desc');
$outstr = '';
foreach($deplist as $rs){
$outstr .="<a href=/dep.php?depid=".$rs['dep_id'].">".$rs['short_name']."</a>";
}
echo "document.write('".$outstr."');";
exit;
}
$where = "unit_id_path ='".UNITID.",' and type_id = 32";
$deplist = $dep->getAllDep($where,'dep_id,dep_name,level_desc','position desc',1,50);
$smarty->assign("deplist", $deplist);
$belongs_to = isset($_GET["belongs"]) ? $_GET["belongs"] : 1; // 默认科室的资源分类
$depid=isset($_GET['depid']) ? $_GET['depid'] : 0;
if($depid){
$info = $dep->getOneDep($depid); // 取得科室资料
$titleDB[title]=$info['dep_name'];
$text_pageSize = 6;
$pic_pageSize = 4;
$doctor_pageSize = 4;
// 取得科室的文章列表
$text = new JYAPI("Model_ResText");
//如果typeid为空,则获取所有文章的列表,否则获取指定类别的文章列表
$type = new JYAPI("Model_ResType");
$where = 'resource_kind=0 and belongs_to_id ='.$depid;
$tmplist = $type->getAllType($where);
foreach($tmplist as $rs){
$tmp['typeid']=$rs['res_type_id'];
$tmp['typename'] = $rs['res_type_name'];
$where = 'res_type_id ='.$rs['res_type_id'];
$tmp['items'] = $text->getAllText($where,'title,res_text_id,updated_time');
$texts[]=$tmp;
}
$texts_cnt = count($texts);
// 取得科室的医生列表
$doctor = new JYAPI("Model_Doctor");
$where = "unit_id_path ='".UNITID.",' and dep_id =".$depid;
$doctors = $doctor->getAllDoctor($where,'doctor_id,doctor_name,image,zc_desc,headship','position desc',1,$doctor_pageSize);
$doctors_cnt = count($doctors);
/* 科主任单独一行
if(($doctors_cnt % 2) == 1){
array_splice($doctors,1,0,array('docid'=>'2'));
}
*/
//读取科室环境
$pic = new JYAPI("Model_ResPic");
$pics = $pic->getFrontList( $belongs_to,$depid,4);
unset($pics[0]);
$pics_cnt = count($pics);
//读取科室视频
$video = new JYAPI("Model_ResFile");
$sql = "select title,store_upload_url as image,link_url as url from res_file where belongs_to_id='".$depid."' and res_type_id='2' order by position desc,res_file_id desc limit 0,3";
$videos = $video->findBySql($sql);
$video_cnt = count($videos);
$smarty->assign("videos", $videos);
$smarty->assign("videos_cnt", $video_cnt);
//获取科室相关的咨询
$ask = new JYAPI("Model_Ask");
$where = "has_reply=1 and unit_id_path ='".UNITID.",' and dep_id_path = '".$depid.",'";
$asklist = $ask->getAllAsk($where,'*','post_time desc',1,5);
$smarty->assign("asklist",$asklist);
$smarty->assign("pics", $pics);
$smarty->assign("pics_cnt", $pics_cnt);
$smarty->assign("slide", $slide);
$smarty->assign("slidecnt", count($slide));
$smarty->assign("dpager", $dpager);
$smarty->assign("doctors", $doctors);
$smarty->assign("reskind_dep_pics", $define_res_name["reskind_dep_pics"]);
$smarty->assign("reskind_dep_texts", $define_res_name["reskind_dep_texts"]);
$smarty->assign("pages", $pages);
$smarty->assign("dep_id", $depid);
$smarty->assign("url", "dep.php?depid=$depid&docpage=|num|");
$smarty->assign("def_text", $def_text);
$smarty->assign("texts", $texts);
$smarty->assign("att_id", $att_id);
$smarty->assign("info", $info);
$smarty->assign("doctors_cnt", $doctors_cnt);
$smarty->assign("texts_cnt", $texts_cnt);
$smarty->assign("pics_cnt", $pics_cnt);
$smarty->assign("pages_cnt", $pages_cnt);
}
require(PHP168_PATH."inc/head.php");
if($depid){
if( !isset( $info["style"]) || empty( $info["style"] ) || "" == $info["style"] ){
// 默认模板
$smarty->display("dep.html");
}else{
$smarty->display($info["style"].".html");
}
}else{
$smarty->display("dep_default.html");
}
require(PHP168_PATH."inc/foot.php");
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Опубликовать ( 0 )