{include file="header.tpl"}

{literal}
<script type="text/javascript"><!--
function checkVote()
{
  if (!document.vote.email) return true;

  status = checkEmail(document.vote.email.value);

  if (status > 0) {
    if (status == 1)
	    alert('Please, enter your E-mail address!');
    if (status == 2)
	    alert('Please, enter a valid E-mail address!');

    document.vote.email.focus();
    return false;
  }
  return true;
}
--></script>
{/literal}
<div class="goback"><a href="javascript:history.go(-1)" class="staff">{t}&laquo; Go Back{/t}</a></div>

{include file="program_details.tpl" listing=$listing group=$group}

<div class="details">
<div class="delim"></div>
<div class="votes_summary">
<div class="summary mood3 clearfix">
 <div class="mood">{t}Very Good{/t}</div>
 <div class="rate"><div style="width:{$listing.votes_summary.3.percent+1}%" title="{$listing.votes_summary.3.count} votes ({$listing.votes_summary.3.percent}%)"></div></div>
</div>
<div class="summary mood2 clearfix">
 <div class="mood">{t}Good{/t}</div>
 <div class="rate"><div style="width:{$listing.votes_summary.2.percent+1}%" title="{$listing.votes_summary.2.count} votes ({$listing.votes_summary.2.percent}%)"></div></div>
</div>
<div class="summary mood1 clearfix">
 <div class="mood">{t}Bad{/t}</div>
 <div class="rate"><div style="width:{$listing.votes_summary.1.percent+1}%" title="{$listing.votes_summary.1.count} votes ({$listing.votes_summary.1.percent}%)"></div></div>
</div>
<div class="summary mood0 clearfix">
 <div class="mood">{t}Very Bad{/t}</div>
 <div class="rate"><div style="width:{$listing.votes_summary.0.percent+1}%" title="{$listing.votes_summary.0.count} votes ({$listing.votes_summary.0.percent}%)"></div></div>
</div>
</div>

{if $votes}
<table class="votes list">
<tr>
  <th style="text-align: center;">{t}Rating{/t}</th>
  <th>{t}Info{/t}</th>
  <th>{t}Comment{/t}</th>
</tr>
{section name=v loop=$votes}
<tr class="{cycle values="row1,row2"} {if $votes[v].flag == 1}verified{elseif $votes[v].flag == 2}fake{/if}">
  <td style="text-align: center;">
   {if $votes[v].vote == 0}<img src="{"`$theme`images/r0.gif"|encurl}" alt="{t}Very Bad{/t}" title="{t}Very Bad{/t}">{/if}
   {if $votes[v].vote == 1}<img src="{"`$theme`images/r1.gif"|encurl}" alt="{t}Bad{/t}" title="{t}Bad{/t}">{/if}
   {if $votes[v].vote == 2}<img src="{"`$theme`images/r2.gif"|encurl}" alt="{t}Good{/t}" title="{t}Good{/t}">{/if}
   {if $votes[v].vote == 3}<img src="{"`$theme`images/r3.gif"|encurl}" alt="{t}Very Good{/t}" title="{t}Very Good{/t}">{/if}
  </td>
  <td>
   {if $votes[v].username}<b>{$votes[v].username}</b>{else}{$votes[v].email}{/if}<br />
   {$votes[v].ip} {if $votes[v].country}({$votes[v].country}){/if}<br />
   {$votes[v].fdate}
  </td>
  <td>{$votes[v].comment}</td>
</tr>
{/section}
</table>

{paginator col=$pages.col cur=$pages.cur url="?a=details&lid=`$listing.id`&p=%s"|encurl}
{/if}

<a name="vote"></a>                        
<h3>{t}Add Vote{/t}</h3>
<form method="post" name="vote" onsubmit="return checkVote()" action="">
<input type="hidden" name="a" value="add_vote">
<input type="hidden" name="action" value="save">
<input type="hidden" name="lid" value="{$listing.id}">
<table class="form">
<tr>
  <th>{t}Mood{/t}</th>
  <td>
   <input type="radio" name="vote" value=3> <img src="{"`$theme`images/r3.gif"|encurl}" alt="{t}Very Good{/t}" title="{t}Very Good{/t}"> {t}Very Good{/t}<br>
   <input type="radio" name="vote" checked value=2> <img src="{"`$theme`images/r2.gif"|encurl}" alt="{t}Good{/t}" title="{t}Good{/t}"> {t}Good{/t}<br>
   <input type="radio" name="vote" value=1> <img src="{"`$theme`images/r1.gif"|encurl}" alt="{t}Bad{/t}" title="{t}Bad{/t}"> {t}Bad{/t}<br>
   <input type="radio" name="vote" value=0> <img src="{"`$theme`images/r0.gif"|encurl}" alt="{t}Very Bad{/t}" title="{t}Very Bad{/t}"> {t}Very Bad{/t}<br>
  </td>
</tr>
<tr>
  <th>{t}Comments{/t}</th>
  <td>
   <input type="text" name="comment" maxlength=255><br>
   {t}You can write short comment (max. 255 characters){/t}
  </td>
</tr>
{if $userinfo.logged}
<tr>
  <th>{t}Username{/t}</th>
  <td>{$userinfo.username}</td>
</tr>
{else}
<tr>
  <th>{t}E-mail{/t}</th>
  <td>
   <input type="text" name="email">
   {if $settings.vote_confirmation_require}{t}we will send you your vote confirmation code{/t}{/if}
  </td>
</tr>
{/if}
{if $settings.use_turing}
<tr>
  <th><img src="{"?a=turing&`$sesname`=`$sesid`&r=`$rand`"|encurl}" alt="turing code"></th>
  <td><input type=text name="turing" maxlength=6 size=6></td>
</tr>
{/if}
<tr>
  <th></th>
  <td><input type="submit" value="{t}Vote{/t}" class=sbmt></td>
</tr>
</table>
</form>
</div>
{include file="footer.tpl"}