<?php
$theme = $settings["theme"];

if (isset($_POST['banner'])) {
	$seourl=seo($_POST['slider']);
	$image = new Upload( $_FILES['image']);
	$upload= PATH . "/public/{$theme}/images/slider/";
	$s1=rand(1000,3200);
	$s2=rand(1000,3200);
	$s3=rand(1000,3200);
	$s4=rand(1000,3200);
	$names=$s1.$s2.$s3.$s4;
	$image->image_resize = true;
	$image->image_ratio_crop = true;
	$image->image_x = 2000;
	$image->image_y = 750;
	$name=$image->file_new_name_body = $names;
	$uzantiss=$image->file_src_name;
	$uzantis=ext($uzantiss);
	$uzanti=$image->image_convert = $uzantis;
	$image->Process($upload);
	$image->allowed = array ('image/*');
	$image="images/slider/".$name.".".$uzanti;
	$kaydet=$db->prepare("INSERT INTO slider SET
		baslik=:baslik,
		aciklama=:aciklama,
		image=:image, 
		sira=:sira
		");
	$insert=$kaydet->execute(array(
		'baslik' => $_POST['baslik'],
		'aciklama' => $_POST['aciklama'],
		'image' => $image, 
		'sira' => $_POST['sira']
	));
	if ($insert) {
		$success = 'İşlem başarıyla gerçekleşti.';
	} else {
		$error = 'Bir hata oluştu.';
	}
}
require admin_view('slider-ekle');