<?php
#####Class For Adding Content Management ######
class Contact extends MysqlFns
{
 /* class constructor */
	function astrology()
	{
 		$this->LDDisplayPath= $config['SiteGlobalPath']."class.Contact.php";
  		global $config;
  		global $objSmarty;
  		$this->MysqlFns();
  		$this->Limit = 20;

	}
	

//*************************************************************************************************************************************************
	function GetBranches()
	{
  		global $objSmarty;
  		$SelQuery3		= 'SELECT * FROM `branches` WHERE `w_status` = "1" AND is_deleted="0" ORDER BY name ASC';
		$PageList2		= $this->ExecuteQuery($SelQuery3, 'select');
		
  $objSmarty->assign('PageList2', $PageList2);//print_r($PageList2);
  
  	$SelQuery4		= 'SELECT * FROM `branches` WHERE `w_status` = "0" AND b_status="1" AND status="0" AND is_deleted="0" ORDER BY name ASC';
		$PageList3		= $this->ExecuteQuery($SelQuery4, 'select');
		
  $objSmarty->assign('PageList3', $PageList3);//print_r($PageList3);
  return $PageList3;
 
 }
/**********************************************************************************************/
/*************************************************Insert Comment/***************************************************************/
function InsertComment($objArray)
{
global $objSmarty;

if((!$objArray['memName'])){
$objSmarty->assign('ErrorMessage', 'Member Name should not be blank');
return false;
}elseif(!$objArray['mobileNo']){
$objSmarty->assign('ErrorMessage', 'Mobile Number should not be blank');
return false;
}elseif(!$objArray['emailId']){
$objSmarty->assign('ErrorMessage', 'Email Id should not be blank');
return false;
}elseif(!$objArray['subject']){
$objSmarty->assign('ErrorMessage', 'Subject should not be blank');
return false;
}elseif(!$objArray['branchName']){
$objSmarty->assign('ErrorMessage', 'Branch Name should not be blank');
return false;
}elseif(!$objArray['memberCode']){
$objSmarty->assign('ErrorMessage', 'Member Code should not be blank');
return false;
}elseif(!$objArray['yourMessage']){
$objSmarty->assign('ErrorMessage', 'Comments should not be blank');
return false;
}

$objSmarty->assign('memName', $objArray['memName']);
if($objArray['emailId'] && $objArray['mobileNo']){
  $InsQuery = 'INSERT INTO online_registered_users
(
`name`,
`email_id`,
`dob`,
`mobile_no`,
`password`,
`branch_id`,
`plan_type`,
`mem_sub_id`,
`address`,
`pincode`,
`is_active`
) 
VALUES(
"'.trim(addslashes($objArray['regName'])).'",
"'.trim(addslashes($objArray['emailId'])).'",
"'.trim(addslashes($objArray['dob'])).'",
"'.trim(addslashes($objArray['mobileNo'])).'",
"'.trim(addslashes($objArray['password'])).'",
"'.$branchId.'",
"'.trim(addslashes($objArray['pType'])).'",
"'.$memSubPlanId.'",
"'.trim(addslashes($objArray['address'])).'",
"'.trim(addslashes($objArray['pincode'])).'",
"1")';  
$this->ExecuteQuery($InsQuery, 'insert');
}
header('Location:register.php?success_msg_for_insert');
}
/**********************************************************************************************/

 }
?>


