<?php
///////////////////////////////////////////////////////////////////
//	Copyright: Mintegra.com
//	Product: Ebay Auction Lister 2.0
//	Distributors: www.mintegra.com
//	Support: http://www.mintgera.com/support
///////////////////////////////////////////////////////////////////
class ModelEbayCategoryVersion extends Model {
	public function addVersion($data) {
		$this->db->query("INSERT INTO `" . DB_PREFIX . "ebay_category_version` SET version = '" . $data . "'");
	}
	
	public function deleteVersion() {
		$this->db->query("DELETE FROM `" . DB_PREFIX . "ebay_category_version`" );
	}
	
	public function getVersion() {
		$ret_version = "";
		$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "ebay_category_version` " );
		foreach ($query->rows as $row)
		{
		   $ret_version = (string) $row['version'];
			}
		 return $ret_version;
	 }
	
	// public function getUser($user_id) {
		// $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "user` WHERE user_id = '" . (int)$user_id . "'");
	
		// return $query->row;
	// }
	
	// public function getUsers($data = array()) {
		// $sql = "SELECT * FROM `" . DB_PREFIX . "user`";
			
		// $sort_data = array(
			// 'username',
			// 'status',
			// 'date_added'
		// );	
			
		// if (isset($data['sort']) && in_array($data['sort'], $sort_data)) {
			// $sql .= " ORDER BY " . $data['sort'];	
		// } else {
			// $sql .= " ORDER BY username";	
		// }
			
		// if (isset($data['order']) && ($data['order'] == 'DESC')) {
			// $sql .= " DESC";
		// } else {
			// $sql .= " ASC";
		// }
		
		// if (isset($data['start']) || isset($data['limit'])) {
			// if ($data['start'] < 0) {
				// $data['start'] = 0;
			// }			
			
			// if ($data['limit'] < 1) {
				// $data['limit'] = 20;
			// }	
			
			// $sql .= " LIMIT " . (int)$data['start'] . "," . (int)$data['limit'];
		// }
			
		// $query = $this->db->query($sql);
	
		// return $query->rows;
	// }

}
?>