<?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 services 	 #
# such as webdesign etc.                                         #
##################################################################
*/

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

$message	= "";
$script		= "";

$flag		= false;
$objC		= new check();
$aid		= isset($_REQUEST['aid'])	?	trim($_REQUEST['aid'])	:	"0";

if (!$objDB) {
	$message	= "Unable to Locate Database Server.";
} else {
	$objU	= new userside($objDB);
	$objM	= new misc($objDB);
	$flag	= $objU->mobile_alert_activated();
	$flag	= true;	
	$success = 0;
	if (isset($_POST['CON1'])) {
	    $objU->set_user_alert($_POST);
		$message	= $objU->save_user_alerts($_SESSION['user_id'], $aid);
		if ($aid <= 0 AND $message == "")
			$aid	= $objU->nAlert_Id;
		if ($message == ""){
			$message	.= "Your alerts have been saved.<br>";
			$success = 1;
		}
			
	} else {
		$array	= $objU->get_user_alerts($_SESSION['user_id']);
		$objU->set_user_alert($array);
		$aid	= $objU->nAlert_Id;
	}
	
	$script		= $objM->get_script($message);
	$message	= $objM->remove_script($message);
}
include_once ("title.inc.php");
include_once ("tophtml.inc.php");
?>

<div class="row">
	<div class="eight columns">
		<div class="search-rslts">
			<div class="row"><div class="inenr-hd"><h2>My Settings for Alerts</h2></div></div>
			<div class="row">
				<h2 class="headings2">Alerts</h2>
			</div>
			<div class="row">
				<form name="frmStep2" method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
					<div class="newdesignforinput maintext1">
						<?php if(isset($message) && trim($message)!='' && !$success)
							  {
						?>
						<div class="full_row padding_bottom_15">
							<div class="maintext1 warning"><?php echo $message;?></div>
						</div>
						<?php } else { ?>
						<div class="full_row padding_bottom_15">
							<div class="maintext1 warning" style="color: green !important;"><?php echo $message;?></div>
						</div>
						<?php }//end if?>
						
						<div class="full_row padding_bottom_15">
							<div class="three columns">New Registration</div>
							<div class="four columns margin_R_200">
								<input type="checkbox" name="nNewUser" class="textbox_checkbox" value="Y" <?php echo $objU->nNewUser == "Y" ? "checked" : ""?>>
							</div>
						</div>
						
						<div class="full_row padding_bottom_15">
							<div class="three columns">Added as Hot</div>
							<div class="four columns margin_R_200">
								<input type="checkbox" class="textbox_checkbox" name="nAddHot" value="Y" <?php echo $objU->nAddHot == "Y" ? "checked" : ""?>>
							</div>
						</div>
						
						<div class="full_row padding_bottom_15">
							<div class="three columns">Profile Viewed</div>
							<div class="four columns margin_R_200">
								<input type="checkbox" class="textbox_checkbox" name="nProfileViewed" value="Y" <?php echo $objU->nProfileViewed == "Y" ? "checked" : ""?>>
							</div>
						</div>
						<?php if ($flag) 
							  { 
						?>
						
						<div class="full_row padding_bottom_15">
							Mobile alerts won't work, if you won't enter a valid mobile number and corresponding service provider in your profile.
						</div>
						
						<div class="full_row padding_bottom_15">
							<div class="three columns">New Message (Mobile)</div>
							<div class="four columns margin_R_200">
								<input type="checkbox" class="textbox_checkbox" name="nNewMessageMobile" value="Y" <?php echo $objU->nNewMessageMobile == "Y" ? "checked" : ""?>>
							</div>
						</div>
						
						<div class="full_row padding_bottom_15">
							<div class="three columns">New Interest (Mobile)</div>
							<div class="four columns margin_R_200">
								<input type="checkbox" class="textbox_checkbox" name="nNewInterestMobile" value="Y" <?php echo $objU->nNewInterestMobile == "Y" ? "checked" : ""?>>
							</div>
						</div>
						<?php }//end if?>
						
						<div class="full_row padding_bottom_15">
							<div class="three columns">&nbsp;</div>
							<div class="four columns margin_R_200">
								<input name="CON1" type="submit" class="loginbutton" value="Save">
								<input type="hidden" name="step" value="3">
								<input type="hidden" name="aid" value="<?php echo $aid?>">
							</div>
						</div>
					</div>
				</form>
				<div id="hide"><?php echo $script?></div>
			</div>
		</div>
	</div>
	<div class="four columns right search_result_R">
		<?php include_once ("left.inc.php");?>
	</div>
</div>



<?php include_once('bottomhtml.inc.php');?>
