<?php
/*
	DevSaver Web Framework
	Copyright (c) 2013-2016 DevSaver. 
	All rights reserved.
		web:  www.devsaver.com
		mail: support@devsaver.com		
*/

// dependencies

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

	function __construct() {
		//$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 )
		);
	}
	


}

?>