{if $smarty.get.type eq "statistic"}
{assign var="total" value=0}
{assign var="i" value=1}
<form action="" method="post" name="grid_form" id="form">
<input type="hidden" name="show" value="1"/>
<div class="ip_date" style="text-align: center">
Begin:<select>
<option value="begin_m">January</option>
</select>
<select>
<option value="begin_y">2008</option>
</select>
End: <select>
<option value="end_m">January</option>
</select>
<select>
<option value="end_y">2008</option>
</select>
<button type="submit" class="button">OK</button>
<!-- <input type="submit" class="button" value="xls" name="xls"/>-->
</div>
这是什么意思?:
{if $smarty.get.type eq "statistic"}
{assign var="total" value=0}
{assign var="i" value=1}
我应该如何创建一个php脚本来列出从当前时刻开始的5年?
答案 0 :(得分:0)
{if $smarty.get.type eq "statistic"}
{assign var="total" value=0}
{assign var="i" value=1}
这意味着在php中
if($smarty->get->type == 'statistic')
{
$total = 0;
$i = 1;
---
---your code
}
PHP脚本五年
$curYear = date('Y');//gives you current year
$startYear = curYear -5;
$yearArr = array();
for($startYear; $startYear <= $curYear ; $startYear++)
{
$yearArr[] = $startYear;
}
$ yearArr数组,你可以列出你的名单。