<?php
class user{
	static function isCreditCustomer(){
  		return utility::getTableFieldById("user","credit_customer","id",$_SESSION[user_id]);
	}
	
	static function getNewPriceAssigned($product_id){
		global $db,$conn;		
		$sql = "SELECT new_price FROM product_user_price_mapping WHERE user_id =$_SESSION[user_id] AND prod_id ='$product_id' ";
		$result = $db->query($sql);
		$data = 0;		
		if ($db->num_rows($result) > 0){
		  $row = $db->next_record($result);		  
		  $data = $row['new_price'];
		}
		return $data;
	}	
	
	static function getSortOptions($listName = "", $id="", $width = 250, $displayName){
		global $db,$conn;		
		$dataArray = array("first_name"=>"Name","company_name"=>"Company","username"=>"username");
		print utility::createList($dataArray,$listName,$id,$width,$displayName,false);  	
	}
}
?>