<?php
/*
	Stempora Web Framework
	Copyright (c) 2002-2014 Stempora. 
	All rights reserved.
		web:  www.stempora.com
		mail: support@stempora.com		
*/

// dependencies

/**
* description
*
* @library	
* @author	
* @since	
*/
class CSliders extends CPlugin{
	
	var $tplvars; 

	function CSliders() {
		//$this->CPlugin($db, $tables , $templates);
	}

	function DoEvents(){
		global $base, $_CONF, $_TSM , $_VARS , $_USER , $_BASE , $_SESS;

		parent::DoEvents();

		if ($_GET["mod"] == "sliders") {
			$sub = $_GET["sub"];
			$action = $_GET["action"];

			//read the module
			$this->tpl_module = $this->module->plugins["modules"]->LoadDefaultModule("sliders");			
		}
	}

	
	/**
	* description
	*
	* @param
	*
	* @return
	*
	* @access
	*/

	
	/**
	* description
	*
	* @param
	*
	* @return
	*
	* @access
	*/
	function AddSlider($slider) {

		$id = $this->db->QueryInsert(
			$this->tables["plugin:sliders"],
			$slider
		);

		return $id;
	}
	

	/**
	* description
	*
	* @param
	*
	* @return
	*
	* @access
	*/
	function UpdateSlider($slider) {

		$this->db->QueryUpdate(
			$this->tables["plugin:sliders"],
			$slider,
			"slider_id={$slider[slider_id]}"
		);

		return $slider["slider_id"];
	}
	
	/**
	* description
	*
	* @param
	*
	* @return
	*
	* @access
	*/
	function DeleteSlider($slider) {
		$this->db->Query(
			"DELETE FROM {$this->tables['plugin:sliders']} WHERE slider_id={$slider}"
		);
	}
	

	/**
	* description
	*
	* @param
	*
	* @return
	*
	* @access
	*/
	function GetSlider($slider) {
		return $this->db->QFetchArray(
			"SELECT * FROM {$this->tables['plugin:sliders']} WHERE slider_id=%d" , array( $slider )
		);
	}
	


}

?>