<?php
/**
 * This is general file which contains
 * connection file, common function file, etc.,
 *
 * PHP version 5
 *
 * @category Admin_Tool
 * @package  Admin_Tool
 * @author   Aum Infosys <admin@auminfosys.com>
 * @license  ACE
 * @version  CVS:1.0.1
 * @link     http://auminfosys.com/
 * @filesource
 */
 
/**
 * This is general file which contains
 * connection file, common function file, etc.,
 *
 */
  	require "../commonincludefiles.php";

	$Product_Ids = $_POST['ids']; // Get our array back and translate it :
	$deleteProduct_Id = 0;
   	$deleteProduct_Id = json_decode(stripslashes($Product_Ids));

	if(sizeof($deleteProduct_Id)<1){
		echo '0';
	}
	else{
		$objproductMgmt = new ProductMgmt();
		$product_id  = implode(",",$deleteProduct_Id);
	$sql = "SELECT 
					product_photo  
				FROM 
					lms_productmaster 
				WHERE 
					product_id  in($product_id )
					And company_id='".$_SESSION["cCompany_id"]."'";
					
		$result = dbQuery($sql);			
		
		if(dbRows($result)){
			while($record = dbArray($result)){
				$remove = "../".$ProductImagePath.$record['product_photo'];
				unlink($remove);
			}
		}
		$objproductMgmt ->deleteId = implode(",",$deleteProduct_Id);
		$objproductMgmt ->delete();
		echo '1';
	}       
?>