<?php 

include ('include/functions.php');

$user = new Admin();



if (!$user->get_session())

{

header("location:login.php");

}



if($_REQUEST['getmeout'] == 'ok'){

	$user->logout();

}



if(isset($_POST['Addslider'])){

	$event = $set->add_slider();

}



if(isset($_POST['Editslider'])){

	$event = $set->update_slider($_REQUEST['edit']);

}

?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Admin</title>

<link rel="stylesheet" type="text/css" href="css/style.css" />

<link href='http://fonts.googleapis.com/css?family=Ubuntu:300,400' rel='stylesheet' type='text/css'>



</head>



<body>

<!-- Admin Main Area -->

<div id="adminmain"> 

<?PHP include ('include/header.php'); ?>



<div class="left" id="scroll">

<?PHP include ('include/menu.php'); ?>

</div>

<div class="dashbox-main-div">

     	



     <h2><span>Add slider</span>

     <p><a href="index.php">Home</a> > <a href="#">Add slider</a></p>

     <div style="clear:both"></div>

     </h2>

     <?php if($msg != "") { echo '<p class="success">'.$msg.'</p>'; } ?>

<div class="col-100 bg_color_white border_top_gray border_radius_5" >

<br />

<h2>Add slider</h2>

<br />

			<?

			$edit = $_REQUEST['edit'];

			$selectslider = mysql_query(" SELECT * FROM slider WHERE slider_id='$edit' ");

			$row=mysql_fetch_array($selectslider);

			extract($row);

			?>





			<form action="" method="post" enctype="multipart/form-data">



			<table width="100%" style="margin:0;">

			<tr>

			<td>Slider Text 1</td>

			<td><input type="text"   name="slider_txt_top" value="<?=$slider_txt_top?>" style="width:85%; height:30px; margin-left:10px;"  /></td>

			</tr>

			<tr>

			<td>Slider Text 2</td>

			<td><input type="text"   name="slider_txt_bottom" value="<?=$slider_txt_bottom?>" style="width:85%; height:30px; margin-left:10px;"  /></td>

			</tr>

			<tr>

			<td>Slider Image</td>

			<td><input type="file" name="file"  style="width:85%; height:30px; margin-left:10px;"  /></td>

			</tr>

			<tr>

			<td>Is Active <span class="color_red">*</span></td><td><select name="status" required style="width:85%; height:30px; margin-left:10px;"><option value="">Select</option><option value="active">Active</option><option value="deactive">Deactive</option></select></td>

			</tr>

			<input type="hidden" name="slider_id" value="<?=rand()?>" />

			<tr>

			<td></td>

			<td>

			<? if(isset($_REQUEST['edit'])): ?>

			<input type="submit" class="green_button fright" value="Edit Slider.." name="Editslider">

			<? else: ?>

			<input type="submit" class="green_button fright" value="Add Slider.." name="Addslider">

			<? endif; ?>

			</td>

			</tr>

			

			</table>

			<script>

						// Replace the <textarea id="editor1"> with an CKEditor instance.

						CKEDITOR.replace( 'editor1', {

							on: {

								focus: onFocus,

								blur: onBlur,



								// Check for availability of corresponding plugins.

								pluginsLoaded: function( evt ) {

									var doc = CKEDITOR.document, ed = evt.editor;

									if ( !ed.getCommand( 'bold' ) )

										doc.getById( 'exec-bold' ).hide();

									if ( !ed.getCommand( 'link' ) )

										doc.getById( 'exec-link' ).hide();

								}

							}

						});

					</script>

			</form>

<br /><br />



</div>





<Div style="clear:both"></div>

<?php include ('include/footer.php'); ?>

</div>















</body>

</html>