<?php

/*---------------------------------------------
  MAIAN EVENTS v2.0
  Written by David Ian Bennett
  E-Mail: support@maianscriptworld.co.uk
  Website: www.maianscriptworld.co.uk
  This File: Admin - Approve Comments
  New in v2.0
----------------------------------------------*/

if(!defined('INCLUDE_FILES')) {
	include('index.html');
	exit;
}

?>
<tr>
    <td>
    <table border="0" cellpadding="0" cellspacing="0" width="100%" class="tableBorder">
    <tr>
        <td class="displayTable">&raquo; <b><?php echo strtoupper($comments); ?></b><br /><br /><?php echo $comments2; ?></td>
    </tr>
    </table>
    <form method="post" name="MyForm" action="index.php?cmd=comments" onsubmit="return delete_confirm('<?php echo $msg_javascript; ?>')">
    <p><input type="hidden" name="process2" value="1" /></p>
    <table cellpadding="0" cellspacing="1" width="100%" class="tableBorderHeader">
    <tr>
        <td class="menutable"><b><?php echo str_replace("{count}",rowCount('comments',' WHERE is_active = \'0\''),$comments3); ?></b></td>
        <td class="menutable" style="width:5%;text-align:center"><input type="checkbox" name="log" onclick="selectAll()" /></td>
    </tr>
    </table>
    <?php
    if (isset($OK)) {
    echo ok(str_replace("{count}",count($_POST['id']),$comments4));
    }
    
    $q_comments = mysql_query("SELECT * FROM ".$database['prefix']."comments
                               WHERE is_active = '0'
                               ORDER BY id DESC
                               LIMIT $limitvalue,$limit
                               ") or die(mysql_error());
    if (mysql_num_rows($q_comments)>0) {
      while ($COMMENTS = mysql_fetch_object($q_comments)) {
        // Event data..
        $EVENT = getEvent($COMMENTS->eventid);
      ?>
      <table width="100%" cellspacing="0" cellpadding="0" class="tableBorder">
      <tr>
        <td class="displayTable" style="width:80%;vertical-align:top">
        <b><?php echo $comments8; ?></b>: <?php echo cleanData($EVENT->title); ?><br />
        <b><?php echo $comments9; ?></b>: <?php echo cleanData($COMMENTS->name); ?><br />
        <b><?php echo $comments10; ?></b>: <a href="mailto:<?php echo $COMMENTS->email; ?>" title="<?php echo $COMMENTS->email; ?>"><?php echo $COMMENTS->email; ?></a>
        </td>
        <td class="displayTable" style="width:15%">
        <table width="100%" cellspacing="1" cellpadding="0">
        <tr>
          <td class="optionsCell" style="width:100%"><a href="index.php?cmd=comments&amp;comment=<?php echo $COMMENTS->id; ?>" rel="gb_page_center[680, 400]" title="<?php echo $comments13; ?>"><img src="img/edit.gif" alt="<?php echo $comments12; ?>" title="<?php echo $comments12; ?>" /></a><span class="optionsText"><?php echo $comments12; ?></span></td>
        </tr>
        </table>
        </td>
        <td class="displayTable" style="width:5%;text-align:center;"><input type="checkbox" name="id[]" value="<?php echo $COMMENTS->id; ?>##<?php echo $COMMENTS->eventid; ?>" /></td>
      </tr>
      </table>
      <?php
      }
    } else {
    ?>
    <table width="100%" cellspacing="0" cellpadding="0" class="tableBorder">
    <tr>
        <td class="displayTable" style="text-align:center;padding:10px 0 10px 0"><?php echo $comments14; ?></td>
    </tr>
    </table>
    <?php
    }
    
    ?>
    <?php
    if (rowCount('comments',' WHERE is_active = \'0\'')>0) {
    ?>
    <p class="cboxes"><input onclick="processBoxes()" type="checkbox" name="approve" value="1" /> <b><?php echo $comments5; ?></b>&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" onclick="processBoxes()" name="reject" value="1" /> <b><?php echo $comments6; ?></b>&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" name="mail" value="1" /> <?php echo $comments7; ?></p>
    <p class="button"><input class="formbutton" type="submit" value="<?php echo $comments11; ?>" title="<?php echo $comments11; ?>" /></p>
    <?php
    echo admin_page_numbers(rowCount('comments',' WHERE is_active = \'0\''),$limit,$page);
    }
    ?>
    </form>
    </td>
</tr>

