<table width=100% border=0 align="center" cellpadding=3 cellspacing=0>
<tr><td colspan="2"><b>Ratings stats of {$listing.name}</b></td>
</tr>
<tr>
  <td width="12%" align="right">Very Good:</td><td width="13%"><img src="{"images/r3.gif"|encurl}" alt="Very Good" title="Very Good" align="absmiddle"> {$listing.votes_summary.3.count} votes</td>
  <td><img src="{"images/r_dot.gif"|encurl}" width="{$listing.votes_summary.3.percent}" height="10" align="absmiddle" title="{$listing.votes_summary.3.count} votes ({$listing.votes_summary.3.percent}%)"> ({$listing.votes_summary.3.percent}%)</td>
</tr>
<tr>
  <td align="right">Good:</td><td><img src="{"images/r2.gif"|encurl}" alt="Good" title="Good" align="absmiddle"> {$listing.votes_summary.2.count} votes</td>
  <td><img src="{"images/y_dot.gif"|encurl}" width="{$listing.votes_summary.2.percent}" height="10" align="absmiddle" title="{$listing.votes_summary.2.count} votes ({$listing.votes_summary.2.percent}%)"> ({$listing.votes_summary.2.percent}%)</td>
  </tr>
  <tr>
    <td align="right">bad:</td><td><img src="{"images/r1.gif"|encurl}" alt="Bad" title="Bad" align="absmiddle"> {$listing.votes_summary.1.count} votes</td>
    <td><img src="{"images/g_dot.gif"|encurl}" width="{$listing.votes_summary.1.percent}" height="10" align="absmiddle" title="{$listing.votes_summary.1.count} votes ({$listing.votes_summary.1.percent}%)"> ({$listing.votes_summary.1.percent}%)</td>
  </tr>
  <tr>
    <td align="right">very bad:</td><td><img src="{"images/r0.gif"|encurl}" alt="Very Bad" title="Very Bad" align="absmiddle"> {$listing.votes_summary.0.count} votes</td>
    <td><img src="{"images/b_dot.gif"|encurl}" width="{$listing.votes_summary.0.percent}" height="10" align="absmiddle" title="{$listing.votes_summary.0.count} votes ({$listing.votes_summary.0.percent}%)"> ({$listing.votes_summary.0.percent}%)</td>
</tr>
</table>

<br />
<form method=post name="vote" onsubmit="return procVote()">
<input type="hidden" name="a" value="add_vote">
<input type="hidden" name="action" value="save">
<input type="hidden" name="lid" value="{$listing.id}">

<table cellspacing=1 cellpadding=2 border=0 width=99% style="border: 1px dotted #CCCCCC;" align=center>
<tr>
 <td class=title align=center><br>Your rating for <b>{$listing.name}</b></td></tr>
<tr>
  <td><table width="100%" border="0" cellspacing="1" cellpadding="2">
    <tr>
      <td width=25% height=50 align=center><img src="{"images/r3.gif"|encurl}" alt="Very Good" title="Very Good"><br>
          <input type="radio" name="vote" value=3>
    Very Good<br>
      </td>
      <td width=25% align=center><img src="{"images/r2.gif"|encurl}" alt="Good" title="Good"><br>
          <input type="radio" name="vote" value=2 checked>
    Good<br>
      </td>
      <td width=25% align=center><img src="{"images/r1.gif"|encurl}" alt="Bad" title="Bad"><br>
          <input type="radio" name="vote" value=1>
    Bad<br>
      </td>
      <td width=25% align=center><img src="{"images/r0.gif"|encurl}" alt="Very Bad" title="Very Bad"><br>
          <input type="radio" name="vote" value=0>
    Very Bad<br>
      </td>
    </tr>
    <tr><td colspan="4">&nbsp;</td></tr>
  </table></td>
</tr>
{if $frm.err}<tr><td>
<ul style="color:red">
{if $frm.err eq 'turing'}<li> Invalid turing image provided.</li>{/if}
{if $frm.err eq 'email'}<li> Please, enter your valid email</li>{/if}
</ul>  </td>
</tr>
{/if}
<tr>
<td align=center>
You can write short comment (max. 255 chars): <input readonly type="text" name="Len" size="3" value="255" class="inpts"><br>
<textarea name="comment" class="inpts" cols=65 rows=5 onKeyDown="textCounter(this.form.comment,this.form.Len,255);" onKeyUp="textCounter(this.form.comment,this.form.Len,255);"></textarea>
  </td>
</tr>
{if $userinfo.logged}
<tr>
  <td align="center">Username: <b>{$userinfo.username}</b></td>
</tr>
{else}
<tr>
  <td align="center">
Your e-mail{if $settings.vote_confirmation_require} (we will send you your vote confirmation code){/if}:<br>
<input type="text" name="email" class="inpts" size="50"></td></tr>
{/if}
{if $settings.use_turing}
<tr>
  <td align="center"><img src="{"?a=turing&`$sesname`=`$sesid`&r=`$rand`"|encurl}" alt="turing code" align="absmiddle">  <input type=text name="turing" maxlength="6" size="10" class="inpts"></td>
</tr>
{/if}
<tr>

  <td align=center><input type="submit" value="Add Vote" class=sbmt></td>
</tr>
<tr><td>&nbsp;</td></tr>
</table></form>
<div class="dline"></div>
{if $votes}
<table cellspacing=0 cellpadding=2 border=0 width=100%>
<tr><td colspan="4" class="newlistingsdatetitle"><strong>User Votes</strong></td>
</tr>
<tr>
  <td align=center class=title><strong>Rating</strong></td>
  <td align=center class=title><strong>Voter IP</strong></td>
  <td align=center class=title><strong>User/E-Mail</strong></td>
  <td align=center class=title><strong>Vote Date</strong></td>
</tr>

{section name=v loop=$votes}
<tr class={if $smarty.section.v.rownum % 2 == 0}detailsbg1{else}detailsbg2{/if}>
  <td align=center>
   {if $votes[v].vote == 0}<img src="{"images/r0.gif"|encurl}" alt="Very Bad" title="Very Bad">{/if}
   {if $votes[v].vote == 1}<img src="{"images/r1.gif"|encurl}" alt="Bad" title="Bad">{/if}
   {if $votes[v].vote == 2}<img src="{"images/r2.gif"|encurl}" alt="Good" title="Good">{/if}
   {if $votes[v].vote == 3}<img src="{"images/r3.gif"|encurl}" alt="Very Good" title="Very Good">{/if}
  </td>
  <td align=center><img src="{"images/c/`$votes[v].flag`.gif"|encurl}" align="absmiddle" alt="{$votes[v].flag}" title="{$votes[v].flag}" style="cursor:help;"> {$votes[v].ip}</td>
  <td align=center>{if $votes[v].username}{$votes[v].username}{else}{$votes[v].email}{/if}</td>
  <td align=center>{$votes[v].fdate}</td>
</tr>
{if $votes[v].comment}
<tr>
  <td colspan=4><img src="{"images/vcom.gif"|encurl}" alt=""> <font color="{if $votes[v].vote == 0}red{/if}{if $votes[v].vote == 1}orange{/if}{if $votes[v].vote == 2}#CBA903{/if}{if $votes[v].vote == 3}#008800{/if}">{$votes[v].comment}</td>
</tr>
{/if}
{/section}
</table>
{/if}

