<?php class FilePermission
{
 	public  function GetFileAccess($modid,$frmid,$rollid)
  	{
      global $db;
   $form_permission_query="select Permission, PerAdd,  PerEdit,  PerDelete,PerView,PerApprove
     from company_profile where roll_id='".$rollid."' and moduleid='".$modid."' and frm_moduleid='".$frmid."' ";
  //echo $form_permission_query."<br>";
	$form_permission_result=DB_query($form_permission_query,$db);
	$form_permission_row=DB_fetch_array($form_permission_result);
	/* Comment By Manish on 2 may, 2013 for exclude erp role
   	  $frmpermission[]=$form_permission_row['PerAdd'];
	   $frmpermission[]=$form_permission_row['PerEdit'];
	    $frmpermission[]=$form_permission_row['PerDelete'];
		$frmpermission[]=$form_permission_row['PerView'];
		$frmpermission[]=$form_permission_row['PerApprove'];
		*/
		 $frmpermission[]=1;
	   $frmpermission[]=1;
	    $frmpermission[]=1;
		$frmpermission[]=1;
		$frmpermission[]=1;
       return($frmpermission);
 	}
	
	public function GetFormId($frmurl)
	{
		global $db;
		//echo "Select id from modules_form where frm_url='".$frmurl."'";
		$form_id_query=DB_query("Select id from modules_form where frm_url='".$frmurl."'",$db);
		$form_id_row=DB_fetch_array($form_id_query);
		$form_id=$form_id_row['id'];
		return($form_id);
	}
}
 
 
 
 $px=new FilePermission();
 if(!$px)
 {
    die("error");
 }

?>
