<?php

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

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

?>
<tr>
    <td>
    <?php
    if (isset($INSTALL_FILE))
    {
    ?>
    <table width="100%" cellpadding="0" cellspacing="0" class="tableBorderError">
    <tr>
        <td class="error"><?php echo $adminhome3; ?></td>
    </tr>
    </table>
    <?php
    }
    ?> 
    <table width="100%" cellspacing="0" cellpadding="0" border="0">
    <tr>
        <td>
        <table border="0" cellpadding="0" cellspacing="0" width="100%" class="tableBorder">
        <tr>
           <td class="displayTable"><?php echo $adminhome2; ?></td>
        </tr>
        </table>
        <table cellpadding="0" cellspacing="1" width="100%" class="tableBorderHeader">
        <tr>
            <td class="menutable">&raquo; <b><?php echo str_replace("{count}",NEXT_EVENTS_COUNT,$adminhome7); ?></b></td>
        </tr>
        </table>
        <table border="0" cellpadding="0" cellspacing="0" width="100%" class="tableBorder">
        <tr>
           <td class="displayTable">
           <?php
           
           $q_events = mysql_query("SELECT *,DATE_FORMAT(fromDate,'".$SETTINGS->formatdate."') AS f_date,
                                    DATE_FORMAT(toDate,'".$SETTINGS->formatdate."') AS t_date  
                                    FROM ".$database['prefix']."events
                                    WHERE fromDate >= '".date("Y-m-d")."' 
                                    ORDER BY fromDate
                                    LIMIT ".NEXT_EVENTS_COUNT."
                                    ") or die(mysql_error());
           
           if (mysql_num_rows($q_events)>0) {
             while ($EVENTS = mysql_fetch_object($q_events)) {
             ?>
             <table width="100%" cellspacing="0" cellpadding="0" class="tableBorder">
             <tr>
               <td class="displayTable" style="width:95%"><b><?php echo cleanData($EVENTS->title); ?></b><br />
               <i><?php echo ($EVENTS->fromDate===$EVENTS->toDate ? translateCalendar($EVENTS->f_date) : translateCalendar($EVENTS->f_date).' / '.translateCalendar($EVENTS->t_date)); ?></i></td>
               <td class="displayTable" style="width:5%;text-align:center"><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></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 $manage4; ?></td>
           </tr>
           </table>
           <?php
           }  
           
           ?>
           </td>
        </tr>
        </table>
        <table cellpadding="0" cellspacing="1" width="100%" class="tableBorderHeader">
        <tr>
            <td class="menutable">&raquo; <b><?php echo $adminhome8; ?></b></td>
        </tr>
        </table>
        <table border="0" cellpadding="0" cellspacing="0" width="100%" class="tableBorder">
        <tr>
           <td class="displayTable"><?php echo $adminhome4; ?><br /><br />
           <a href="http://www.maianevents.com/"><img src="img/donation.gif" alt="<?php echo $adminhome5 ; ?>" title="<?php echo $adminhome5 ; ?>" /></a><br /><br />
           <?php echo $adminhone6; ?>
           </td>
        </tr>
        </table>
        </td>
    </tr>
    </table>
    </td>
</tr>

