<?php

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

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

?>
<tr>
    <td>
    <?php
    if (isset($SEARCH_RESULTS))
    {
    ?>
    <table border="0" cellpadding="0" cellspacing="0" width="100%" class="tableBorder">
    <tr>
        <td class="displayTable">&raquo; <b><?php echo strtoupper($search7); ?></b><br /><br /><?php echo str_replace("{count}",mysql_num_rows($q_search),$search8); ?></td>
    </tr>
    </table>
    <table cellpadding="0" cellspacing="1" width="100%" class="tableBorderHeader">
    <tr>
        <td class="menutable">&raquo; <b><?php echo $search9; ?></b></td>
    </tr>
    </table>
    <?php
    // Show search results..
    while ($EVENTS = mysql_fetch_object($q_search)) {
    ?>
    <table width="100%" cellspacing="0" cellpadding="0" class="tableBorder">
    <tr>
      <td class="displayTable" style="width:55%;vertical-align:top">
      <b><?php echo $manage5; ?></b>: <?php echo cleanData($EVENTS->title); ?><br />
      <b><?php echo $manage6; ?></b>: <?php echo ($EVENTS->fromDate===$EVENTS->toDate ? translateCalendar($EVENTS->f_date) : translateCalendar($EVENTS->f_date).' / '.translateCalendar($EVENTS->t_date)); ?><br />
      <b><?php echo $manage12; ?></b>: <?php echo rowCount('comments',' WHERE eventid = \''.$EVENTS->id.'\' AND is_active = \'1\''); ?>
      </td>
      <td class="displayTable" style="width:45%">
      <table width="100%" cellspacing="1" cellpadding="0">
      <tr>
        <td class="optionsCell"><a href="<?php echo $SETTINGS->folder.'/'.($SETTINGS->modr ? 'event/'.$EVENTS->id.'/'.cleanEventName(cleanData($EVENTS->title)).'/index.html' : 'index.php?cmd=event&amp;event='.$EVENTS->id); ?>" target="_blank"><img src="img/view.gif" alt="<?php echo $manage9; ?>" title="<?php echo $manage9; ?>" /></a><span class="optionsText"><?php echo $manage9; ?></span></td>
        <td class="optionsCell"><a href="index.php?cmd=edit&amp;id=<?php echo $EVENTS->id; ?>"><img src="img/edit.gif" alt="<?php echo $manage10; ?>" title="<?php echo $manage10; ?>" /></a><span class="optionsText"><?php echo $manage10; ?></span></td>
        <td class="optionsCell"><a href=<?php echo (rowCount('comments',' WHERE eventid = \''.$EVENTS->id.'\' AND is_active = \'1\'')>0 ? '"index.php?cmd=manage&amp;comments='.$EVENTS->id.'" rel="gb_page_center[680, 540]" title="'.$comments13.'"' : '"#" onclick="javascript:message(\''.$msg_javascript16.'\');"'); ?>><img src="img/comments2.gif" alt="<?php echo $manage11; ?>" title="<?php echo $manage11; ?>" /></a><span class="optionsText"><?php echo $manage11; ?></span></td>
      </tr>
      </table>
      </td>
    </tr>
    </table>
    <?php
    }
    echo admin_page_numbers(rowCount('events',' '.$SQL),$limit,$page);
    
    }
    else
    {
    ?>
    <table border="0" cellpadding="0" cellspacing="0" width="100%" class="tableBorder">
    <tr>
        <td class="displayTable">&raquo; <b><?php echo strtoupper($header9); ?></b><br /><br /><?php echo $search; ?></td>
    </tr>
    </table>
    <form method="get" action="index.php">
    <p><input type="hidden" name="cmd" value="search" />
    <input type="hidden" name="search" value="1" /></p>
    <table cellpadding="0" cellspacing="1" width="100%" class="tableBorderHeader">
    <tr>
        <td class="menutable">&raquo; <b><?php echo $search2; ?></b></td>
    </tr>
    </table>
    <?php
    if (isset($NO_RESULTS)) {
    echo error($search6);
    }
    ?>
    <table cellpadding="0" cellspacing="0" width="100%" class="tableBorder">
    <tr>
        <td class="displayTable">
        <table cellpadding="0" cellspacing="1" width="100%">
        <tr>
           <td style="width:30%"><b><?php echo $search3; ?></b>:</td>
           <td style="width:70%"><input class="formbox" type="text" name="keywords" size="30" value="<?php echo (isset($_GET['keywords']) ? cleanData($_GET['keywords']) : ''); ?>" /></td>
        </tr>
        <tr>
           <td><b><?php echo $search4; ?></b>:</td>
           <td><input class="formbox" type="text" name="fromDate" size="30" value="<?php echo (isset($_GET['fromDate']) ? cleanData($_GET['fromDate']) : ''); ?>" style="width:20%" /> <img onclick="displayDatePicker('fromDate');" src="img/calendar.gif" style="vertical-align:middle" alt="<?php echo $add15; ?>" title="<?php echo $add15; ?>" /> <input class="formbox" type="text" name="toDate" size="30" value="<?php echo (isset($_GET['toDate']) ? cleanData($_GET['toDate']) : ''); ?>" style="width:20%" /> <img style="vertical-align:middle" onclick="displayDatePicker('toDate');" src="img/calendar.gif" alt="<?php echo $add15; ?>" title="<?php echo $add15; ?>" /> <?php echo toolTip($msg_javascript2,$msg_javascript14); ?></td>
        </tr>
        <tr>
           <td>&nbsp;</td>
           <td><br /><input class="formbutton" type="submit" value="<?php echo $search5; ?>" title="<?php echo $search5; ?>" /></td>
        </tr>
        </table>
        </td>
    </tr>
    </table>    
    </form>
    <?php
    }
    ?>
    </td>
</tr>

