
7 changed files with 7580 additions and 250 deletions
@ -0,0 +1,86 @@ |
|||||
|
<?php |
||||
|
|
||||
|
//include_once(dirname(dirname(__FILE__))."/publicBase.php"); |
||||
|
class Page extends publicBase { |
||||
|
public $totalnum; // 总记录数[必填],例:$page->setTotalnum(100); |
||||
|
public $page; // 当前页码[必填] |
||||
|
public $url; // 分页URL[必填] |
||||
|
public $pagesize=100; // 每页记录数 |
||||
|
|
||||
|
public $viewpagenum=7; // 每页看到的页码数 |
||||
|
public $virtualpage='...'; // 省略或跨越页码 |
||||
|
|
||||
|
public $totalpage; |
||||
|
|
||||
|
//mysql表中数据量过多时采用的分页改造 |
||||
|
public $first_page_url; //点击”首页“跳转链接 |
||||
|
public $end_page_url; //点击”尾页“跳转链接 |
||||
|
public $prev_page_url; //点击”上一页“跳转链接 |
||||
|
public $next_page_url; //点击”下一页“跳转链接 |
||||
|
public $endpage=false; //跳转到尾页标识 |
||||
|
public $jump_to_page_url; //跳转到某一页链接 |
||||
|
public $maxid; //点击上一页时 当前页面最大id |
||||
|
public $minid; //点击下一页时 当前页面最小id |
||||
|
|
||||
|
|
||||
|
/* |
||||
|
* $pageobj = new Page(); |
||||
|
$pageobj->setTotalnum($totalnum); |
||||
|
$pageobj->setPage($page); |
||||
|
$pageobj->setPagesize($pagesize); |
||||
|
$pageobj->setUrl('/comment/black/page/'); |
||||
|
$plist = $pageobj->getPageList(); |
||||
|
*/ |
||||
|
|
||||
|
/* |
||||
|
listnum 显示页码数, 默认展示7页 |
||||
|
*/ |
||||
|
public function getPageList() { |
||||
|
$pagelist = array(); // 构造的翻页数据 |
||||
|
$begin = $last = array(); // 开始,结尾数据 |
||||
|
|
||||
|
$totalpage = ceil($this->totalnum/$this->pagesize); // 总页数 |
||||
|
$this->totalpage = $totalpage; |
||||
|
$middle_page = ceil($this->viewpagenum/2); // 每页中间页码值 |
||||
|
|
||||
|
if($this->page > $middle_page && $totalpage > $this->viewpagenum) { // 开头有...时 |
||||
|
$begin[] = array('page' => 1, 'url' => $this->url . '1'); |
||||
|
$begin[] = array('page' => $this->virtualpage, 'url' => ''); |
||||
|
$firstpage = $totalpage-$this->viewpagenum+2; |
||||
|
$endpage = $totalpage; |
||||
|
|
||||
|
if($totalpage-$this->page > $middle_page) { // 结尾也有...时 |
||||
|
$last[$totalpage-1] = array('page' => $this->virtualpage, 'url'=>''); |
||||
|
$last[$totalpage] = array('page' => $totalpage, 'url' => $this->url . $totalpage); |
||||
|
$firstpage = $this->page-$middle_page+2; |
||||
|
$endpage = $this->page+$middle_page-2; |
||||
|
} |
||||
|
} elseif($totalpage-$this->page > $middle_page && $totalpage > $this->viewpagenum) { // 只有结尾的...时 |
||||
|
$last[$totalpage-1] = array('page' => $this->virtualpage, 'url' => ''); |
||||
|
$last[$totalpage] = array('page' => $totalpage, 'url' => $this->url . $totalpage); |
||||
|
|
||||
|
$firstpage = 1; |
||||
|
$endpage = $this->viewpagenum-1; |
||||
|
} else { // 没有...时 |
||||
|
$firstpage = 1; |
||||
|
$endpage = $totalpage; |
||||
|
} |
||||
|
|
||||
|
// 中间页码数据 |
||||
|
for ($i=$firstpage; $i<=$endpage; $i++) { |
||||
|
$pagelist[$i-1]['page'] = $i; |
||||
|
$pagelist[$i-1]['url'] = $this->url . $i; |
||||
|
} |
||||
|
|
||||
|
return $begin + $pagelist + $last; |
||||
|
} |
||||
|
|
||||
|
public function getLimitInfo() { |
||||
|
$this->first_page_url = $this->url."/page/1"; //首页链接 |
||||
|
$this->end_page_url = $this->url."/end_page/1"; //尾页链接 |
||||
|
$this->jump_to_page_url = $this->url."/jump_to_page"; //跳转到某一页 |
||||
|
if($this->totalnum>0) $this->page = ceil($this->totalnum/$this->pagesize); |
||||
|
if ($this->page > 1 || $this->endpage) $this->prev_page_url = $this->url.'/page/'.($this->page-1).'/maxid/'.$this->maxid; //上一页连接 |
||||
|
if (!$this->endpage) $this->next_page_url = $this->url.'/page/'.($this->page+1).'/minid/'.$this->minid; //下一页连接 |
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
@ -0,0 +1,223 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en"> |
||||
|
<head> |
||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||
|
<script type="text/javascript" src="{$smarty.const.CSS_URL}/js/jquery-1.8.1.min.js"></script> |
||||
|
<script type="text/javascript" src="{$smarty.const.CSS_URL}/js/jquery.form.js"></script> |
||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
||||
|
<title>添加药方</title> |
||||
|
<meta name="viewport" content="width=device-width,initial-scale=1"> |
||||
|
<link href="{$smarty.const.CSS_URL}/css/global.css?v={$smarty.const.CSS_JS_VERSION}" media="screen" rel="stylesheet" type="text/css"> |
||||
|
</head> |
||||
|
<body> |
||||
|
|
||||
|
<div id="page"> |
||||
|
<div class="container"> |
||||
|
<section id="main"> |
||||
|
<div id="main-content"> |
||||
|
<div class="record-control"> |
||||
|
<div class="header"> |
||||
|
<span style="font-size:14px;padding:5px">添加药方</span> |
||||
|
<div class="row"> </div> |
||||
|
<div class="flash-message"></div> |
||||
|
|
||||
|
<ul class="tabs"><li></li></ul> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div id="domain-list"> |
||||
|
<div class="entry"> |
||||
|
<div class="modal-body"> |
||||
|
<div class="wizard-container"><div> |
||||
|
<div class="inputs"> |
||||
|
<div id="form_area"> |
||||
|
<form id="prescription-form" onsubmit="submitForm(event)"> |
||||
|
<input id="id" name="id" type="hidden" value="{$data.id}"> |
||||
|
|
||||
|
<div class="row"> </div> |
||||
|
|
||||
|
<div class="row"> |
||||
|
<label for="name">药方名称<font color='red'>*</font>:</label> |
||||
|
<input type="text" id="name" name="name" maxlength="" style="width:280px" value="{$data.name}"> |
||||
|
</div> |
||||
|
|
||||
|
<div class="row"> </div> |
||||
|
|
||||
|
<div class="row"> |
||||
|
<label for="source">药方来源<font color='red'>*</font>:</label> |
||||
|
<input type="text" id="source" name="source" maxlength="" style="width:280px" value="{$data.source}"> |
||||
|
</div> |
||||
|
|
||||
|
<div class="row"> </div> |
||||
|
|
||||
|
<div class="row"> |
||||
|
<label for="method">用法<font color='red'></font>:</label> |
||||
|
<input type="text" id="method" name="method" maxlength="" style="width:280px" value="{$data.method}"> |
||||
|
<span id="author_limit"></span> |
||||
|
</div> |
||||
|
|
||||
|
<div class="row"> </div> |
||||
|
|
||||
|
<div class="row" style="position:relative;"> |
||||
|
<label>药材<font color='red'>*</font>:</label> |
||||
|
<button class="add-button" type="button" onclick="addIngredient()">+</button> |
||||
|
</div> |
||||
|
|
||||
|
<div id="ingredient-list" class="row"> |
||||
|
{foreach from=$data.formula key=key item=item} |
||||
|
<div class="row"> |
||||
|
<label> </label> |
||||
|
<div class="herb_input"> |
||||
|
<input type="text" name="herb_name[]" value="{$item.name}" placeholder="药材名" required/> |
||||
|
<input type="text" name="herb_num[]" value="{$item.num_str}" |
||||
|
placeholder="用量" required/> |
||||
|
<!-- /--> |
||||
|
<!-- <input style="width: 80px" type="text" value="{$item.num}克" disabled/>--> |
||||
|
<!-- <input type="text" name="herb_desc[]" value="{$item.desc}" placeholder="说明"/>--> |
||||
|
|
||||
|
<button class="" type="button" onclick="removeIngredient(this)">X</button> |
||||
|
</div> |
||||
|
</div> |
||||
|
{/foreach} |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
<div class="row"> </div> |
||||
|
|
||||
|
<div class="row" id="" style="position:relative;"> |
||||
|
<label> </label> |
||||
|
|
||||
|
<button class="button primary next submitlock" id="submitbtn" onclick="check_submit()"><span class="tdesc_text" style="color:white;">提交</span></button> |
||||
|
</div> |
||||
|
|
||||
|
<div class="row"> </div> |
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div></div> |
||||
|
<div style="display: none;" id="formtips"> |
||||
|
<div class="alert-message block-message info" style="color:red;"></div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!--end of a domain entry--> |
||||
|
</div> |
||||
|
<!-- 批量上传 <div id="onetickupload"></div> --> |
||||
|
</div> |
||||
|
</div></section> |
||||
|
|
||||
|
<!--end of main section--> |
||||
|
</div><!--end of container--> |
||||
|
</div><!--end of #page--> |
||||
|
|
||||
|
{literal} |
||||
|
<script type="text/javascript"> |
||||
|
// 动态添加药材输入字段 |
||||
|
function addIngredient() { |
||||
|
const ingredientList = document.getElementById('ingredient-list'); |
||||
|
const ingredientDiv = document.createElement('div'); |
||||
|
ingredientDiv.classList.add('row'); |
||||
|
|
||||
|
ingredientDiv.innerHTML = ` |
||||
|
<label> </label> |
||||
|
<div class="herb_input"> |
||||
|
<input type="text" name="herb_name[]" placeholder="药材名" required /> |
||||
|
<input type="text" name="herb_num[]" placeholder="药量" required /> |
||||
|
<!-- <input type="text" name="herb_desc[]" placeholder="说明"/>--> |
||||
|
<button class="" type="button" onclick="removeIngredient(this)">X</button> |
||||
|
</div> |
||||
|
`; |
||||
|
ingredientList.appendChild(ingredientDiv); |
||||
|
} |
||||
|
|
||||
|
// 移除药材输入字段 |
||||
|
function removeIngredient(button) { |
||||
|
button.parentElement.parentElement.remove(); |
||||
|
} |
||||
|
|
||||
|
function submitForm(e) { |
||||
|
e.preventDefault(); // 阻止默认表单提交 |
||||
|
|
||||
|
const form = document.getElementById('prescription-form'); |
||||
|
const formData = new FormData(form); |
||||
|
|
||||
|
const uid = 'admin'; |
||||
|
|
||||
|
const data = { |
||||
|
id: formData.get('id'), |
||||
|
uid: uid, |
||||
|
name: formData.get('name'), |
||||
|
source: formData.get('source'), |
||||
|
method: formData.get('method'), |
||||
|
herbs: "" |
||||
|
}; |
||||
|
|
||||
|
// 收集所有药材名称和重量 |
||||
|
const herb_name = formData.getAll('herb_name[]'); |
||||
|
const herb_num = formData.getAll('herb_num[]'); |
||||
|
const herb_desc = formData.getAll('herb_desc[]'); |
||||
|
|
||||
|
const herbs = []; |
||||
|
herb_name.forEach((name, index) => { |
||||
|
herbs.push({ |
||||
|
name: name, |
||||
|
num: herb_num[index], |
||||
|
desc: herb_desc[index] |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
data.herbs = JSON.stringify(herbs); |
||||
|
|
||||
|
if (data.id.length > 0) { |
||||
|
$.ajax({ |
||||
|
url: 'ajax_update_formula', // 替换为你的服务器端处理文件 |
||||
|
type: 'POST', |
||||
|
data: data, |
||||
|
dataType: 'json', |
||||
|
success: function (response) { |
||||
|
alert(response.info); |
||||
|
if (response.status == true) { |
||||
|
window.location.reload(); |
||||
|
} |
||||
|
}, |
||||
|
error: function (xhr, status, error) { |
||||
|
console.error('错误:', response); |
||||
|
alert('提交失败,请重试。'); |
||||
|
} |
||||
|
}); |
||||
|
} else { |
||||
|
$.ajax({ |
||||
|
url: 'ajax_save_formula', // 替换为你的服务器端处理文件 |
||||
|
type: 'POST', |
||||
|
data: data, |
||||
|
dataType: 'json', |
||||
|
success: function (response) { |
||||
|
alert(response.info); |
||||
|
if (response.status == true) { |
||||
|
window.location.href = "/index/home" |
||||
|
} |
||||
|
}, |
||||
|
error: function (xhr, status, error) { |
||||
|
console.error('错误:', response); |
||||
|
alert('提交失败,请重试。'); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
<style> |
||||
|
.add-button { |
||||
|
width: 20px; |
||||
|
height: 20px; |
||||
|
background-color: #DD4B38; |
||||
|
border: none; |
||||
|
border-radius: 50px; |
||||
|
color: #fff; |
||||
|
} |
||||
|
</style> |
||||
|
{/literal} |
||||
|
|
||||
|
</body> |
||||
|
</html> |
@ -1,231 +1,148 @@ |
|||||
<!DOCTYPE html> |
<!DOCTYPE html> |
||||
|
<html class="no-js" lang="zh-CN"> |
||||
<head> |
<head> |
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||
<script type="text/javascript" src="{$smarty.const.CSS_URL}/js/jquery-1.8.1.min.js"></script> |
<script type="text/javascript" src="{$smarty.const.CSS_URL}/js/jquery-1.8.1.min.js"></script> |
||||
<script type="text/javascript" src="{$smarty.const.CSS_URL}/js/jquery.form.js"></script> |
<script type="text/javascript" src="{$smarty.const.CSS_URL}/js/jquery.form.js"></script> |
||||
<meta charset="utf-8"> |
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
||||
<title>首页</title> |
<title>药方列表</title> |
||||
<meta name="viewport" content="width=device-width,initial-scale=1"> |
<meta name="viewport" content="width=device-width,initial-scale=1"> |
||||
{literal} |
<link href="{$smarty.const.CSS_URL}/css/global.css?v={$smarty.const.CSS_JS_VERSION}" media="screen" rel="stylesheet" type="text/css"> |
||||
<style> |
|
||||
#prescription-form{ |
|
||||
width: 800px; |
|
||||
margin-left: 100px; |
|
||||
} |
|
||||
.form-group { |
|
||||
margin-bottom: 15px; |
|
||||
} |
|
||||
.form-group label { |
|
||||
display: block; |
|
||||
margin-bottom: 10px; |
|
||||
} |
|
||||
.form-group input { |
|
||||
width: 100%; |
|
||||
padding: 8px; |
|
||||
box-sizing: border-box; |
|
||||
} |
|
||||
.form-group textarea { |
|
||||
width: 100%; |
|
||||
padding: 8px; |
|
||||
box-sizing: border-box; |
|
||||
} |
|
||||
.ingredient-list { |
|
||||
margin-top: 20px; |
|
||||
} |
|
||||
.add-button{ |
|
||||
width: 20px; |
|
||||
height: 20px; |
|
||||
background-color: #DD4B38; |
|
||||
border: none; |
|
||||
border-radius: 50px; |
|
||||
color: #fff; |
|
||||
float: right; |
|
||||
} |
|
||||
.submit-btn{ |
|
||||
margin-top: 50px; |
|
||||
width: 150px; |
|
||||
height: 45px; |
|
||||
background-color: #DD4B38; |
|
||||
border: none; |
|
||||
border-radius:5px; |
|
||||
color: #fff; |
|
||||
} |
|
||||
.herb_item{ |
|
||||
width: 800px; |
|
||||
position: relative; |
|
||||
display: flex; |
|
||||
line-height: 50px; |
|
||||
margin-top: 15px; |
|
||||
} |
|
||||
.herb_item button{ |
|
||||
position: absolute; |
|
||||
left:620px; |
|
||||
top:15px; |
|
||||
width: 20px; |
|
||||
height: 20px; |
|
||||
background-color: #C28A2F; |
|
||||
border: none; |
|
||||
border-radius: 30px; |
|
||||
color: #fff; |
|
||||
} |
|
||||
.herb_input{ |
|
||||
/*width: 800px;*/ |
|
||||
} |
|
||||
.herb_input input{ |
|
||||
height: 50px; |
|
||||
margin-right: 30px; |
|
||||
text-indent: 10px; |
|
||||
} |
|
||||
#change{ |
|
||||
position: absolute; |
|
||||
left: 1000px; |
|
||||
top:500px |
|
||||
} |
|
||||
</style> |
|
||||
<script> |
|
||||
// 动态添加药材输入字段 |
|
||||
function addIngredient() { |
|
||||
const ingredientList = document.getElementById('ingredient-list'); |
|
||||
const ingredientDiv = document.createElement('div'); |
|
||||
ingredientDiv.classList.add('herb_item'); |
|
||||
|
|
||||
ingredientDiv.innerHTML = ` |
|
||||
<div class="herb_input"> |
|
||||
<input type="text" name="herb_name[]" placeholder="药材名" required /> |
|
||||
<input type="text" name="herb_num[]" placeholder="药量" required /> |
|
||||
<input type="text" name="herb_desc[]" placeholder="说明"/> |
|
||||
</div> |
|
||||
<button class="" type="button" onclick="removeIngredient(this)">X</button> |
|
||||
`; |
|
||||
ingredientList.appendChild(ingredientDiv); |
|
||||
} |
|
||||
|
|
||||
// 移除药材输入字段 |
|
||||
function removeIngredient(button) { |
|
||||
button.parentElement.remove(); |
|
||||
} |
|
||||
|
|
||||
function submitForm(e) { |
|
||||
e.preventDefault(); // 阻止默认表单提交 |
|
||||
|
|
||||
const form = document.getElementById('prescription-form'); |
|
||||
const formData = new FormData(form); |
|
||||
|
|
||||
const data = { |
|
||||
id: formData.get('id'), |
|
||||
name: formData.get('name'), |
|
||||
source: formData.get('source'), |
|
||||
method: formData.get('method'), |
|
||||
herbs: [] |
|
||||
}; |
|
||||
|
|
||||
// 收集所有药材名称和重量 |
|
||||
const herb_name = formData.getAll('herb_name[]'); |
|
||||
const herb_num = formData.getAll('herb_num[]'); |
|
||||
const herb_desc = formData.getAll('herb_desc[]'); |
|
||||
|
|
||||
herb_name.forEach((name, index) => { |
|
||||
data.herbs.push({ |
|
||||
name: name, |
|
||||
num: herb_num[index], |
|
||||
desc: herb_desc[index] |
|
||||
}); |
|
||||
}); |
|
||||
|
|
||||
if(data.id.length>0){ |
|
||||
$.ajax({ |
|
||||
url: 'ajax_update_case', // 替换为你的服务器端处理文件 |
|
||||
type: 'POST', |
|
||||
data: data, |
|
||||
dataType: 'json', |
|
||||
success: function(response) { |
|
||||
alert(response.info); |
|
||||
if (response.status==true) { |
|
||||
window.location.reload(); |
|
||||
} |
|
||||
}, |
|
||||
error: function(xhr, status, error) { |
|
||||
console.error('错误:', response); |
|
||||
alert('提交失败,请重试。'); |
|
||||
} |
|
||||
}); |
|
||||
}else{ |
|
||||
$.ajax({ |
|
||||
url: 'ajax_save_case', // 替换为你的服务器端处理文件 |
|
||||
type: 'POST', |
|
||||
data: data, |
|
||||
dataType: 'json', |
|
||||
success: function(response) { |
|
||||
alert(response.info); |
|
||||
if (response.status==true) { |
|
||||
window.location.reload(); |
|
||||
} |
|
||||
}, |
|
||||
error: function(xhr, status, error) { |
|
||||
console.error('错误:', response); |
|
||||
alert('提交失败,请重试。'); |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
{/literal} |
|
||||
</head> |
</head> |
||||
<body> |
<body> |
||||
|
|
||||
<h2 style="margin-left: 100px">添加药方</h2> |
<div id="page"> |
||||
<form id="prescription-form" onsubmit="submitForm(event)"> |
<div class="container"> |
||||
<input id="id" name="id" type="hidden" value="{$data.case.id}"> |
<section id="main"> |
||||
<div class="form-group"> |
<div id="main-content"> |
||||
<label for="name">药方名称:</label> |
<div class="entry"> |
||||
<input type="text" id="name" name="name" value="{$data.case.name}" required> |
<div class="modal-body"> |
||||
</div> |
<table class="table table-striped table-bordered table-condensed"> |
||||
<div class="form-group"> |
<tbody class='js-bundle-record-list'> |
||||
<label for="source">药方来源:</label> |
<tr> |
||||
<textarea id="source" name="source" rows="4">{$data.case.source}</textarea> |
<td> |
||||
</div> |
全部药方: |
||||
|
<select id="is_all"> |
||||
<div class="form-group"> |
<option value="0" {if $smarty.get.is_all==0}selected{/if}>否</option> |
||||
<label for="method">用法:</label> |
<option value="1" {if $smarty.get.is_all==1}selected{/if}>是</option> |
||||
<textarea id="method" name="method" rows="4" required>{$data.case.method}</textarea> |
</select> |
||||
</div> |
|
||||
|
药方名称: |
||||
{if $data.case.original} |
<input type="text" id='name' value="{$smarty.get.name}"> |
||||
<h3>原方 <button class="add-button" type="button" onclick="addIngredient()">+</button></h3> |
|
||||
{else} |
<button onclick="searchList();" class="button primary next" id="btnVer">搜索</button> |
||||
<h3>药材 <button class="add-button" type="button" onclick="addIngredient()">+</button></h3> |
</td> |
||||
{/if} |
</tr> |
||||
|
</tbody> |
||||
<div id="ingredient-list" class="ingredient-list"> |
</table> |
||||
<!-- 动态添加药材输入字段 --> |
</div> |
||||
{foreach from=$data.case.original key=key item=item} |
</div> |
||||
<div class="herb_item"> |
|
||||
<div class="herb_input"> |
<div class="record-control"> |
||||
<input type="text" name="herb_name[]" value="{$item.name}" placeholder="药材名" required /> |
<div class="flash-message"></div> |
||||
<input type="text" name="herb_num[]" value="{$item.num}" placeholder="用量" required/> |
<ul class="tabs"> |
||||
<input type="text" name="herb_desc[]" value="{$item.desc}" placeholder="说明" required /> |
<li class="active"><a href="javascript:;">药方列表</a></li> |
||||
|
<div style="display:inline-block;float: right;"> |
||||
|
<button class="button primary next" onclick="to_add()">添加药方</button> |
||||
|
</div> |
||||
|
</ul> |
||||
|
</div> |
||||
</div> |
</div> |
||||
<button class="" type="button" onclick="removeIngredient(this)">X</button> |
|
||||
</div> |
|
||||
{/foreach} |
|
||||
</div> |
|
||||
|
|
||||
<div id="change" class="form-group"> |
|
||||
<label for="method">转换后:</label> |
|
||||
{foreach from=$data.case_herb key=key item=item} |
|
||||
<div style="display: flex;line-height: 50px"> |
|
||||
<div style="margin-right: 20px">{if $data.herb[$item.herb_id]}{$data.herb[$item.herb_id].name}{/if}</div> |
|
||||
<div style="margin-right: 20px">{$item.num} 克</div> |
|
||||
<div>{if $data.herb[$item.herb_id]}{$data.herb[$item.herb_id].desc}{/if}</div> |
|
||||
</div> |
|
||||
{/foreach} |
|
||||
</div> |
|
||||
|
|
||||
<div class="form-group" style="text-align: center"> |
|
||||
<button class="submit-btn" type="submit">提交药方</button> |
|
||||
</div> |
|
||||
</form> |
|
||||
|
|
||||
|
<div class="entry"> |
||||
|
<div class="modal-body"> |
||||
|
{if count($page_list) > 1} |
||||
|
<div class="modal-body"> |
||||
|
|
||||
|
{if isset($prev_page)} |
||||
|
<a href="{$prev_page}">上一页</a> |
||||
|
{/if} |
||||
|
|
||||
|
{foreach from=$page_list key=key item=item} |
||||
|
<a href="{$item.url}">{if $key+1 eq $curpage}<b>{/if}{$item.page}{if $key+1 eq $curpage}</b>{/if}</a> |
||||
|
{/foreach} |
||||
|
|
||||
|
{if isset($post_page)} |
||||
|
<a href="{$post_page}">下一页</a> |
||||
|
{/if} |
||||
|
|
||||
|
</div> |
||||
|
{/if} |
||||
|
<table class="table table-striped table-bordered table-condensed"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th>ID</th> |
||||
|
<th>录方者</th> |
||||
|
<th>药方名称</th> |
||||
|
<th>药方来源</th> |
||||
|
<th>使用次数</th> |
||||
|
<th>操作</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
{foreach from=$list key=key item=item} |
||||
|
<tr> |
||||
|
<td>{$item.id}</td> |
||||
|
<td>{$item.uid}</td> |
||||
|
<td>{$item.name}</td> |
||||
|
<td>{$item.source}</td> |
||||
|
<td>{$item.use_num}</td> |
||||
|
|
||||
|
<td>{if $item.uid == 0}<a href="/index/formula_add/id/{$item.id}">编辑</a>{/if}</td> |
||||
|
</tr> |
||||
|
{/foreach} |
||||
|
</tbody> |
||||
|
</table> |
||||
|
</div> |
||||
|
|
||||
|
</div></section><!--end of main section--> |
||||
|
|
||||
|
</div><!--end of container--> |
||||
|
|
||||
|
</div><!--end of #page--> |
||||
|
|
||||
|
{literal} |
||||
|
<script type="text/javascript"> |
||||
|
function searchList() { |
||||
|
var is_all = $('#is_all').val(); |
||||
|
var name = $.trim($('#name').val()); |
||||
|
|
||||
|
var url = '/index/home'; |
||||
|
|
||||
|
if(is_all > 0) url += '/is_all/' + is_all; |
||||
|
if(name) url += '/name/' + name; |
||||
|
|
||||
|
location.href = url; |
||||
|
} |
||||
|
function to_add(){ |
||||
|
location.href = '/index/formula_add'; |
||||
|
} |
||||
|
</script> |
||||
|
<style> |
||||
|
|
||||
|
</style> |
||||
|
{/literal} |
||||
|
|
||||
|
<!-- UserAgent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0 --> |
||||
|
|
||||
|
{literal} |
||||
|
|
||||
|
<!--[if lt IE 7]> |
||||
|
<![endif]--> |
||||
|
<!-- |
||||
|
<script type="text/javascript"> |
||||
|
/*Load jQuery if not already loaded*/ if(typeof jQuery == 'undefined'){ document.write("<script type=\"text/javascript\" src=\"" + ('https:' == document.location.protocol ? 'https://' : 'http://')+ "ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js\"></"+"script>"); var __noconflict = true; } |
||||
|
var IE6UPDATE_OPTIONS = { |
||||
|
url: "http://blog.dnspod.cn/2010/04/ie6-must-die/", |
||||
|
message: "DNSPod 新版已经完全取消对微软 Internet Explorer 6.0 浏览器的支持,IE6 用户无法正常使用 DNSPod。请升级您的IE6浏览器至IE8,或者升级至Chrome、火狐、Safari等其他浏览器。", |
||||
|
icons_path: "https://statics.dnspod.cn/zhanjiang/images/ie6update/" |
||||
|
} |
||||
|
</script> |
||||
|
<script type="text/javascript" src="https://statics.dnspod.cn/zhanjiang/javascripts/ie6update.v2.js"></script> |
||||
|
--> |
||||
|
<!--[if lt IE 7]> |
||||
|
<![endif]--> |
||||
|
{/literal} |
||||
</body> |
</body> |
||||
</html> |
</html> |
||||
|
Loading…
Reference in new issue