1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/yunxi59-luohu

В этом репозитории не указан файл с открытой лицензией (LICENSE). При использовании обратитесь к конкретному описанию проекта и его зависимостям в коде.
Клонировать/Скачать
restext.php 2.1 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
邓云溪 Отправлено 21.05.2018 06:02 82b8225
<?php
require(dirname(__FILE__)."/"."global.php");
require_once(PHP168_PATH."inc/encode.php");
require(PHP168_PATH."inc/head.php");
require(PHP168_PATH.'/JYAPI.php');
require(PHP168_PATH.'/JYSmarty.php');
//获取科室的资料
$dep = new JYAPI("Model_Dep");
$tid = isset( $_GET["tid"] ) ? $_GET["tid"] : 0;
$typeid = isset( $_GET["typeid"] ) ? $_GET["typeid"] : 0;
$textObj = new JYAPI("Model_ResText",true);
//如果text_id有值,则显示具体的内容,否则显示分类的信息
if($tid){
$text = $textObj->getOneText($tid);
$smarty->assign("text",$text);
$depid = $text['belongs_to_id'];
$dep_name = $dep->getName($depid); // 取得科室名称
$smarty->assign("dep_name",$dep_name);
$smarty->assign("depid",$text['belongs_to_id']);
$smarty->display("res_text.html");
}else{
$depid= isset($_GET['depid']) ? $_GET['depid'] : 0;
if(!$depid){
echo "<script>alert('您没有选择科室');history.go(-1);</script>";
exit;
}
$typeid = isset($_GET['typeid']) ? $_GET['typeid'] : 0;
$dep_name = $dep->getName($depid); // 取得科室资料
$smarty->assign("dep_name",$dep_name);
$smarty->assign("depid",$depid);
$smarty->assign("typeid",$typeid);
//如果typeid为空,则获取所有文章的列表,否则获取指定类别的文章列表
$typeObj = new JYAPI("Model_ResType");
$where = 'belongs_to_id ='.$depid;
$tmplist = $typeObj->getAllType($where);
foreach($tmplist as $rs){
if($typeid){
if($typeid == $rs['res_type_id']){
$tmp['typeid']=0;
$tmp['typename'] = $rs['res_type_name'];
$smarty->assign("typename",$rs['res_type_name']);
$where = 'res_type_id ='.$typeid;
$tmp['txtlist'] = $textObj->getAllText($where);
$typelist[]=$tmp;
}
}else{
$tmp['typeid']=$rs['res_type_id'];
$tmp['typename'] = $rs['res_type_name'];
$where = 'res_type_id ='.$rs['res_type_id'];
$tmp['txtlist'] = $textObj->getAllText($where);
$typelist[]=$tmp;
}
}
$smarty->assign("typelist",$typelist);
$smarty->display("res_text_list.html");
}
require(PHP168_PATH."inc/foot.php");
?>

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/yunxi59-luohu.git
git@api.gitlife.ru:oschina-mirror/yunxi59-luohu.git
oschina-mirror
yunxi59-luohu
yunxi59-luohu
master