<%Links::Tools::validate_reviews%>
<html>

<head>
<title>Gossamer Links - Tools - Validate Reviews</title>
<base target="_self">
<script language="JavaScript">
<!--
/* Takes a check-all element, and a check-all value of
 * 'email', 'delete', or 'validate'
 */
function checkAll (all, value) {
  var valform = document.valform;
  for (var i = valform.elements.length - 1; i >= 0; i--) {
    var element = valform.elements[i];
    if (/^validate-\d+$/.test(element.name) && element.value == value) {
      if (all.checked)
        element.checked = true;
      else
        document.getElementById(element.name + '-nothing').checked = true;
    }
  }
  checkValidate();
}

function checkValidate () {
  var checked = {
    'validate' : false,
    'delete'   : false,
    'email'    : false,
    ''         : false,
    'types'    : 0
  };
  var valform = document.valform;
  if (!valform) return;
  for (var i = valform.elements.length - 1; i >= 0; i--) {
    var element = valform.elements[i];
    if (/^validate-\d+$/.test(element.name) && element.checked) {
      checked[element.value] = true;
      checked['types'] = 0;
      if (checked['']) checked['types']++;
      if (checked['validate']) checked['types']++;
      if (checked['email']) checked['types']++;
      if (checked['delete']) checked['types']++;
      if (checked['types'] > 1) break;
    }
  }
  if (checked['types'] > 1) {
    checked['validate'] = checked['delete'] = checked['email'] = false;
  }
  if (!document.getElementById('checkall_validate_top')) return;
  document.getElementById('checkall_validate_top').checked    = checked['validate'];
  document.getElementById('checkall_validate_bottom').checked = checked['validate'];
  document.getElementById('checkall_email_top').checked    = checked['email'];
  document.getElementById('checkall_email_bottom').checked = checked['email'];
  document.getElementById('checkall_delete_top').checked    = checked['delete'];
  document.getElementById('checkall_delete_bottom').checked = checked['delete'];
}

<%if total > 1%>window.onload = checkValidate;<%endif%>
// -->
</script>
</head>

<body bgcolor="#FFFFFF">

<table border="1" cellpadding="0" cellspacing="0"><tr><td>
	<table bgColor="#ffffff" border="0" cellPadding="3" cellSpacing="3" width="500" valign="top">
	  <tr>
		<td align="left" bgColor="navy"><b><font color="#ffffff" size="2" face="Tahoma,Arial,Helvetica">Validate Reviews</font></b></td>
	  </tr>
	  <tr>
		<td>
		  <p align="center"><b><font color="#000000" size="2" face="Tahoma,Arial,Helvetica">Validate Reviews</font></b></p>
		  <p><font size="2" face="Tahoma,Arial,Helvetica">This allows you to validate reviews that users
		  have entered.</font>
<%if results%>
	<p><font size="2" face="Tahoma,Arial,Helvetica"><%results%></font></p><font size="2" face="Tahoma,Arial,Helvetica">
<%endif%>
		  <p><font size="2" face="Tahoma,Arial,Helvetica">There are <b><%total%></b> reviews waiting to be validated.</font></p></font></td>
	  </tr>
	</table>
	</td></tr>
</table>

<%if total%>
<br>
<form action="admin.cgi" method="get" name="repage" style="margin: 0px">
  <input type="hidden" name="do" value="page">
  <input type="hidden" name="page" value="tools_validate_reviews.html">
  <input type="hidden" name="mh" value="<%if mh%><%mh%><%else%>5<%endif%>" id="mh">
</form>
<form action="admin.cgi" method="post" name="valform">
<input type="hidden" name="do" value="page">
<input type="hidden" name="page" value="tools_validate_reviews.html">

<%if total > 1%>
<table border="1" cellpadding="0" cellspacing="0" style="margin-bottom: 20px">
  <tr><td>
    <table bgColor="#ffffff" border="0" cellpadding="3" cellspacing="3" valign="top" width="500">
      <tr><td colspan="2">
        <p><font size="2" face="Tahoma,Arial,Helvetica">
          Pages: <%if toolbar%><%toolbar%><%else%>1<%endif%> -
          Links per page:
          <select onchange="document.getElementById('mh').value = this.value; document.repage.submit()">
            <option value="1"<%if mh == 1%> selected="selected"<%endif%>>1</option>
            <option value="5"<%if mh == 5 or not mh%> selected="selected"<%endif%>>5</option>
            <option value="10"<%if mh == 10%> selected="selected"<%endif%>>10</option>
            <option value="25"<%if mh == 25%> selected="selected"<%endif%>>25</option>
            <option value="100"<%if mh == 100%> selected="selected"<%endif%>>100</option>
          </select>
          <noscript><input type="submit" value="Go"></noscript>
        </font></p>
        <p><font size="2" face="Tahoma,Arial,Helvetica">
          <input type="checkbox" id="checkall_validate_top" onclick="checkAll(this, 'validate')"><label for="checkall_validate_top"> Validate all</label>
          <input type="checkbox" id="checkall_delete_top" onclick="checkAll(this, 'delete')"><label for="checkall_delete_top"> Delete all without reason</label>
          <input type="checkbox" id="checkall_email_top" onclick="checkAll(this, 'email')"><label for="checkall_email_top"> Delete all and e-mail reason</label>
        </font></p>
      </td></tr>
    </table>
  </td></tr>
</table>
<%endif%>

<%output%>

<%if total > 1%>
<table border="1" cellpadding="0" cellspacing="0" style="margin-bottom: 20px">
  <tr><td>
    <table bgColor="#ffffff" border="0" cellpadding="3" cellspacing="3" valign="top" width="500">
      <tr><td colspan="2">
        <p><font size="2" face="Tahoma,Arial,Helvetica">
          Pages: <%if toolbar%><%toolbar%><%else%>1<%endif%>
          Links per page:
          <select onchange="document.getElementById('mh').value = this.value; document.repage.submit()">
            <option value="1"<%if mh == 1%> selected="selected"<%endif%>>1</option>
            <option value="5"<%if mh == 5 or not mh%> selected="selected"<%endif%>>5</option>
            <option value="10"<%if mh == 10%> selected="selected"<%endif%>>10</option>
            <option value="25"<%if mh == 25%> selected="selected"<%endif%>>25</option>
            <option value="100"<%if mh == 100%> selected="selected"<%endif%>>100</option>
          </select>
          <noscript><input type="submit" value="Go"></noscript>
        </font></p>
        <p><font size="2" face="Tahoma,Arial,Helvetica">
          <input type="checkbox" id="checkall_validate_bottom" onclick="checkAll(this, 'validate')"><label for="checkall_validate_bottom"> Validate all</label>
          <input type="checkbox" id="checkall_delete_bottom" onclick="checkAll(this, 'delete')"><label for="checkall_delete_bottom"> Delete all without reason</label>
          <input type="checkbox" id="checkall_email_bottom" onclick="checkAll(this, 'email')"><label for="checkall_email_bottom"> Delete all and e-mail reason</label>
        </font></p>
      </td></tr>
    </table>
  </td></tr>
</table>
<%endif%>

<br>
<table border=1 cellpadding=0 cellspacing=0><tr><td align=center>
	<table border=0 width=500><tr><td align=center><center><input type=submit value="Validate Selected"></center></td></tr></table>
</td></tr></table>

</form>
<%endif%>

</body>
</html>



