stat.tpl 8.7 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">
<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}
	<option value="{$year[i]}" {if $smarty.post.y eq $year[i]}selected{/if}>{$year[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>
  </td>
  <td>
   Íåäåëÿ:
  </td>
  <td>
   <select name="w">
    <option value="0"></option>
	{section name=i loop=$week}
	<option value="{$week[i]}" {if $smarty.post.w eq $week[i]}selected{/if}>{$week[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 />
<div>Ñðàâíèòü ñ</div>
<div style="padding:10px;background:#e8e8e8;float:left;margin:10px 10px 10px 0px;">
<table cellpadding="5" cellspacing="5" border="0" align="left">
 <tr>
  <td>
   Ãîä:
  </td>
  <td>
   <select name="y2">
    <option value="0"></option>
	{section name=i loop=$year}
	<option value="{$year[i]}" {if $smarty.post.y2 eq $year[i]}selected{/if}>{$year[i]}</option>
	{/section}
   </select>
  </td>	
  <td>
   Ìåñÿö:
  </td>
  <td>
   <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="w2">
    <option value="0"></option>
	{section name=i loop=$week}
	<option value="{$week[i]}" {if $smarty.post.w2 eq $week[i]}selected{/if}>{$week[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.date2_ot}" name="date2_ot" id="date2_ot" style="width: 70px;" type="text">
                    <img src="{$smarty.const.URL}img/calendar.gif" id="frd_trg_3" style="cursor: pointer;" title="Date selector">
 {literal}
<script type="text/javascript">
  Calendar.setup(
    {
      inputField  : "date2_ot",         // ID of the input field
      ifFormat    : "%d-%m-%Y",    // the date format
      button      : "frd_trg_3"
    }
  );
</script>
{/literal}
  </td>	
  <td>
   äàòî äî:
  </td>
  <td>
<input class="input_form" value="{$smarty.post.date2_do}" name="date2_do" id="date2_do" style="width: 70px;" type="text">
                    <img src="{$smarty.const.URL}img/calendar.gif" id="frd_trg2_4" style="cursor: pointer;" title="Date selector">
 {literal}
<script type="text/javascript">
  Calendar.setup(
    {
      inputField  : "date2_do",         // ID of the input field
      ifFormat    : "%d-%m-%Y",    // the date format
      button      : "frd_trg2_4"
    }
  );
</script>
{/literal}
  </td>  
  </tr>
</table> 
</div><div style="clear:both"></div>  

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

</table>