<?php 
/*
##################################################################
#                       PHP 4&5 MySQL 4&5                        #
##################################################################
#           Copyright (c) 2004-2008 Armia Systems Inc            #
##################################################################
#               This file is part of Cybermatch site             #
##################################################################
#    Developed By: simi (simi@armia.com)                         #
##################################################################
#               Developed On:   03-04-2008                       #
##################################################################
#  				Modified By:        	                         #
##################################################################
#               Modified On:                                     #
##################################################################
# This script may not be distributed, sold, given away for free  #
# to third party, or used as a part of any internet ervices such #
# as webdesign etc.                                              #
##################################################################
*/

require_once ("config.inc.php");
require_once ("includes/mysql.inc.php");
require_once ("classes/misc.class.php");
require_once ("classes/userside.class.php");

$message	= "";
$array		= array();
if (!$objDB) {
	$message	= "Unable to Locate Database Server.";
} else {
	$objM		= new misc($objDB);
	$objU		= new userside($objDB);
	
	if ($objU->is_expired($_SESSION['user_id'])) {
		$message	= "Your profile has been expired, please renew your profile for using this service.";	
	}	
	
	if (isset($_POST['LN'])) {
	
		if ($objU->is_expired($_SESSION['user_id'])) {
			$message	= "Your profile has been expired, please renew your profile for using this service.";	
		} else {
			$message	= $objM->login($_POST);
			if ($message == "") {
				header("Location: chatbox.php");
				exit;
			}
		}
	}
	$script		= $objM->get_script($message);
	$message	= $objM->remove_script($message);
}

include_once ("title_chat.inc.php");
?>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top" class="white"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%" valign="top"><div class="search-rslts01"><table width="100%"  border="0" cellspacing="0" cellpadding="5">
          <tr>
            <td>              <table width="100%"  border="0" cellspacing="0" cellpadding="5">
              <tr>
                  <td class="inenr-hd"><h2>Chat Login</h2></td>
               
              </tr>
            </table>
				<table width="100%"  border="0" cellspacing="0" cellpadding="10">
                <tr>
                  <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="headings2">Existing members? Login Now</td>
                    </tr>
                  </table>
                    <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td><img src="images/spacer.gif" width="1" height="10"></td>
                      </tr>
                    </table>
					<form name="frmTell" method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
                    <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                    <tr align="center">
                      <td colspan="2" class="warning"><?php if(isset($message) && trim($message)!='')
					{
						echo $message;
					}//end if
				?></td>
                      </tr>
                    <tr>
                      <td width="23%" align="right" class="maintext1">Username</td>
                      <td width="46%" class="maintext1"><input name="user" type="text" class="textbox" size="25" maxlength="100"></td>
                    </tr>
                    <tr>
                      <td class="maintext1" align="right">Password</td>
                      <td class="maintext1"><input name="pass" type="password" class="textbox" size="25" maxlength="100"></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td><input name="LN" type="submit" class="loginbutton" value="Login Now"></td>
                    </tr>
                  </table>
					</form>
                    </td>
                </tr>
              </table>
			  </td>
          </tr>
        </table></div></td>
        </tr>
    </table>      
    </td>
  </tr>
</table>
<?php include_once('chat_bottomhtml.inc.php');?>
