stat2.tpl 8.62 KB
<div>
<a href="/admin.php?action=stat&modAction=stat">Ñòàòèñòèêà 1</a> <br />
<a href="/admin.php?action=stat&modAction=stat2">Ñòàòèñòèêà 2</a> 
</div>
<form method="post" action="/admin.php?action=stat&modAction=stat2">
<div style="padding:10px;background:#e8e8e8;float:left;margin:10px 10px 10px 0px;">
<table cellpadding="5" cellspacing="5" border="0">
 <tr>
  <td>
   Ãîä:
  </td>
  <td>
   <select name="y">
    <option value="0"></option>
	{section name=i loop=$year_ot}
	<option value="{$year_ot[i]}" {if $smarty.post.y eq $year_ot[i]}selected{/if}>{$year_ot[i]}</option>
	{/section}
   </select>
   
-   
   <select name="y2">
    <option value="0"></option>
	{section name=i loop=$year_do}
	<option value="{$year_do[i]}" {if $smarty.post.y2 eq $year_do[i]}selected{/if}>{$year_do[i]}</option>
	{/section}
   </select>   
  </td>	
  <td>
   Ìåñÿö:
  </td>
  <td>
   <select name="m">
    <option value="0"></option>
    <option value="1" {if $smarty.post.m eq 1}selected{/if}>ßíâàðü</option>
   <option value="2" {if $smarty.post.m eq 2}selected{/if}>Ôåâðàëü</option>
    <option value="3" {if $smarty.post.m eq 3}selected{/if}>Ìàðò</option>
    <option value="4" {if $smarty.post.m eq 4}selected{/if}>Àïðåëü</option>
    <option value="5" {if $smarty.post.m eq 5}selected{/if}>Ìàé</option>
    <option value="6" {if $smarty.post.m eq 6}selected{/if}>Èþíü</option>
    <option value="7" {if $smarty.post.m eq 7}selected{/if}>Èþëü</option>
    <option value="8" {if $smarty.post.m eq 8}selected{/if}>Àâãóñò</option>
    <option value="9" {if $smarty.post.m eq 9}selected{/if}>Ñåíòÿáðü</option>
    <option value="10" {if $smarty.post.m eq 10}selected{/if}>Îêòÿáðü</option>
    <option value="11" {if $smarty.post.m eq 11}selected{/if}>Íîÿáðü</option>
    <option value="12" {if $smarty.post.m eq 12}selected{/if}>Äåêàáðü</option>
   </select>
   
-   
   <select name="m2">
    <option value="0"></option>
    <option value="1" {if $smarty.post.m2 eq 1}selected{/if}>ßíâàðü</option>
   <option value="2" {if $smarty.post.m2 eq 2}selected{/if}>Ôåâðàëü</option>
    <option value="3" {if $smarty.post.m2 eq 3}selected{/if}>Ìàðò</option>
    <option value="4" {if $smarty.post.m2 eq 4}selected{/if}>Àïðåëü</option>
    <option value="5" {if $smarty.post.m2 eq 5}selected{/if}>Ìàé</option>
    <option value="6" {if $smarty.post.m2 eq 6}selected{/if}>Èþíü</option>
    <option value="7" {if $smarty.post.m2 eq 7}selected{/if}>Èþëü</option>
    <option value="8" {if $smarty.post.m2 eq 8}selected{/if}>Àâãóñò</option>
    <option value="9" {if $smarty.post.m2 eq 9}selected{/if}>Ñåíòÿáðü</option>
    <option value="10" {if $smarty.post.m2 eq 10}selected{/if}>Îêòÿáðü</option>
    <option value="11" {if $smarty.post.m2 eq 11}selected{/if}>Íîÿáðü</option>
    <option value="12" {if $smarty.post.m2 eq 12}selected{/if}>Äåêàáðü</option>
   </select>   
  </td>
  <td>
   Íåäåëÿ:
  </td>
  <td>
   <select name="w">
    <option value="0"></option>
	{section name=i loop=$week_ot}
	<option value="{$week_ot[i]}" {if $smarty.post.w eq $week_ot[i]}selected{/if}>{$week_ot[i]}</option>
	{/section}
   </select>
   
   -
   
   <select name="w2">
    <option value="0"></option>
	{section name=i loop=$week_do}
	<option value="{$week_do[i]}" {if $smarty.post.w2 eq $week_do[i]}selected{/if}>{$week_do[i]}</option>
	{/section}
   </select>   
  </td>
  </tr>
</table>
</div>
{*
<div style="padding:10px;background:#e8e8e8;float:left;margin:10px 10px 10px 0px;">
<table cellpadding="5" cellspacing="5" border="0">
 <tr>
  <td>
   Äàòà îò:
  </td>
  <td>
<input class="input_form" value="{$smarty.post.date_ot}" name="date_ot" id="date_ot" style="width: 70px;" type="text">
                    <img src="{$smarty.const.URL}img/calendar.gif" id="frd_trg" style="cursor: pointer;" title="Date selector">
 {literal}
<script type="text/javascript">
  Calendar.setup(
    {
      inputField  : "date_ot",         // ID of the input field
      ifFormat    : "%d-%m-%Y",    // the date format
      button      : "frd_trg"
    }
  );
</script>
{/literal}
  </td>	
  <td>
   äàòî äî:
  </td>
  <td>
<input class="input_form" value="{$smarty.post.date_do}" name="date_do" id="date_do" style="width: 70px;" type="text">
                    <img src="{$smarty.const.URL}img/calendar.gif" id="frd_trg2" style="cursor: pointer;" title="Date selector">
 {literal}
<script type="text/javascript">
  Calendar.setup(
    {
      inputField  : "date_do",         // ID of the input field
      ifFormat    : "%d-%m-%Y",    // the date format
      button      : "frd_trg2"
    }
  );
</script>
{/literal}
  </td>  
  </tr>
</table>  

</div>
*}
<div style="clear:both"></div>  

<select name="rubrics[]" multiple size=15>
{section name=i loop=$rubrics}
<option value="{$rubrics[i].id}" {if $rubrics[i].parent_id eq 0}disabled{/if} {section name=j loop=$smarty.post.rubrics}{if $smarty.post.rubrics[j] eq $rubrics[i].id}selected{/if}{/section}>{$rubrics[i].name}</option>
{/section}
</select>
<br><br> 

  <input type="submit" style="width:350px;" value=" Èñêàòü " /><br /><br />

</form>





<table cellpadding="5" cellspacing="1" border="0" bgcolor="#4d4d4d">
<tr bgcolor="#bcedff"><td></td>
{section name=i loop=$orders}
<td nowrap width="300">{$orders[i].date_start} - {$orders[i].date_end}</td>
{/section}
</tr>

{section name=r loop=$orders[0].rubrics}
<tr>
<td bgcolor="#fffac5">{$orders[0].rubrics[r].name}</td>
<td valign="top" bgcolor="#ffffff"> 
<table cellpadding="5" cellspacing="1" border="0">
<tr bgcolor="#fec9c9"><td width="100">Ìåòêà</td><td width="100">Êîë-âî</td><td width="100">Ñóììà</td></tr>
{section name=m loop=$orders[0].rubrics[r].metka}
<tr bgcolor="{cycle values='#eeeeee,#d0d0d0'}"><td noWrap>{$orders[0].rubrics[r].metka[m].label} - {$orders[0].rubrics[r].metka[m].label|label}</td><td width="100">{$orders[0].rubrics[r].metka[m].count|default:0}</td><td width="200">{$orders[0].rubrics[r].metka[m].sum|default:0}</td></tr>
{/section}
<tr bgcolor="#c2ffc3"><td></td><td><b>{$orders[0].rubrics[r].count}</b></td><td><b>{$orders[0].rubrics[r].sum}</b></td></tr>
<tr bgcolor="#ffd6fb"><td align="center" colspan="3">Îòìåíåí</td></tr>
{section name=m loop=$orders[0].rubrics[r].otmena}
<tr bgcolor="{cycle values='#eeeeee,#d0d0d0'}"><td noWrap>{$orders[0].rubrics[r].otmena[m].cause}</td><td width="100">{$orders[0].rubrics[r].otmena[m].count|default:0}</td><td width="200">{$orders[0].rubrics[r].otmena[m].sum|default:0}</td></tr>
{/section}
</table>
</td>
{section name=i loop=$orders start=1}
{if $orders[i].rubrics[r].name}
<td valign="top" bgcolor="#ffffff">
<table cellpadding="5" cellspacing="1" border="0">
<tr bgcolor="#fec9c9"><td width="100">Êîë-âî</td><td width="200">Ñóììà</td></tr>
{section name=m loop=$orders[i].rubrics[r].metka}
{section name=a loop=$orders[0].rubrics[r].metka}
{if $orders[i].rubrics[r].metka[m].label eq $orders[i.index_prev].rubrics[r].metka[a].label}
{assign var=rcount value=$orders[i].rubrics[r].metka[m].count-$orders[i.index_prev].rubrics[r].metka[a].count}
{assign var=rsum value=$orders[i].rubrics[r].metka[m].sum-$orders[i.index_prev].rubrics[r].metka[a].sum}
{/if}
{/section}
<tr bgcolor="{cycle values='#eeeeee,#d0d0d0'}"><td width="100">{$orders[i].rubrics[r].metka[m].count|default:0} <font color="{if $rcount>-1}#48b073{else}#ff0048{/if}">({$rcount})</font></td><td width="200">{$orders[i].rubrics[r].metka[m].sum|default:0} <font color="{if $rsum>-1}#48b073{else}#ff0048{/if}">({$rsum})</font></td></tr>
{/section}
{assign var=r_count value=$orders[i].rubrics[r].count-$orders[i.index_prev].rubrics[r].count}
{assign var=r_sum value=$orders[i].rubrics[r].sum-$orders[i.index_prev].rubrics[r].sum}
<tr bgcolor="#c2ffc3"><td><b>{$orders[i].rubrics[r].count}</b> <font color="{if $r_count>-1}#48b073{else}#ff0048{/if}">({$r_count})</font></td><td><b>{$orders[i].rubrics[r].sum}</b> <font color="{if $r_sum>-1}#48b073{else}#ff0048{/if}">({$r_sum})</font></td></tr>
<tr bgcolor="#ffd6fb"><td align="center" colspan="2">Îòìåíåí</td></tr>
{section name=m loop=$orders[i].rubrics[r].otmena}
{section name=a loop=$orders[0].rubrics[r].otmena}
{if $orders[i].rubrics[r].otmena[m].cause eq $orders[i.index_prev].rubrics[r].otmena[a].cause}
{assign var=rcount value=$orders[i].rubrics[r].otmena[m].count-$orders[i.index_prev].rubrics[r].otmena[a].count}
{assign var=rsum value=$orders[i].rubrics[r].otmena[m].sum-$orders[i.index_prev].rubrics[r].otmena[a].sum}
{/if}
{/section}
<tr bgcolor="{cycle values='#eeeeee,#d0d0d0'}"><td width="100">{$orders[i].rubrics[r].otmena[m].count|default:0} <font color="{if $rcount>-1}#48b073{else}#ff0048{/if}">({$rcount})</font></td><td width="200">{$orders[i].rubrics[r].otmena[m].sum|default:0} <font color="{if $rsum>-1}#48b073{else}#ff0048{/if}">({$rsum})</font></td></tr>
{/section}
</table>
</td>
{/if}
{/section}
</tr>
{/section}

</table>