<?php

/////////////////////////////////////////////////////////////////////////////////////////
//
//   this file has been generated by sformi, the clever tool for lazy developers.
//
//
//

session_start();

if (!session_is_registered("clave_audio")) {
	include("../login.php");
	if (!$continuar) exit;
}

include('../db.php');

if(isset($_REQUEST['op'])){
	$operacion = $_REQUEST['op'];
	$banner_texto=$_REQUEST['banner_texto'];
	$banner_url=$_REQUEST['banner_url'];
	$banner_file=$_REQUEST['banner_file'];
	$banner_tipo=$_REQUEST['banner_tipo'];

	
	if(db_connect()) {
		switch($operacion) {
			case "add":
				$sql = 'INSERT INTO bania_banners(banner_texto, banner_url, banner_file, banner_tipo) VALUES("' . $banner_texto . '", "' . $banner_url . '", "' . $banner_file . '", "' . $banner_tipo . '");';		
				break;

			case "edit":
				$sql = 'UPDATE bania_banners SET banner_texto="' . $banner_texto . '", banner_url="' . $banner_url . '",  banner_file="' . $banner_file . '", banner_tipo="' . $banner_tipo . '" WHERE banner_id = ' . $_REQUEST['id'];		
				break;

			case "del":
				$sql = 'DELETE FROM bania_banners WHERE banner_id = ' . $_REQUEST['id'];
				break;

			default:
				break;
		}
		$result = mysql_query($sql) or header('Location: ../error.php');
		header('Location: banners.php');
	}
}
?>