sheia sheia - 7 months ago 16
PHP Question

please help to understand code below

{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>




What does it mean?:

{if $smarty.get.type eq "statistic"}
{assign var="total" value=0}
{assign var="i" value=1}


And how should I create a php script to list 5 years that passed from current moment?

Answer
{if $smarty.get.type eq "statistic"}
{assign var="total" value=0}
{assign var="i" value=1}

this means in php is

if($smarty->get->type == 'statistic')
{
    $total = 0;
    $i = 1;
    ---
    ---your code
}

php script for five years

$curYear = date('Y');//gives you current year
$startYear = curYear -5;
$yearArr = array();
for($startYear; $startYear <= $curYear ; $startYear++)
{
    $yearArr[] = $startYear;
}

for $yearArr array you can make your list.

Comments