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

if (isset($_POST['videoekle'])) {
	$seourl=seo($_POST['video']);
	$image = new Upload( $_FILES['image']);
	$upload= PATH . "/public/{$theme}/images/video/";
	$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 = 380;
	$image->image_y = 200;
	$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/video/".$name.".".$uzanti;
	$kaydet=$db->prepare("INSERT INTO video SET
		baslik=:baslik,
		video_url=:video_url,
		aciklama=:aciklama,
		image=:image 
		");
	$insert=$kaydet->execute(array(
		'baslik' => $_POST['baslik'],
		'video_url' => $_POST['video_url'],
		'aciklama' => $_POST['aciklama'],
		'image' => $image 
	));
	if ($insert) {
		$success = 'İşlem başarıyla gerçekleşti.';
	} else {
		$error = 'Bir hata oluştu.';
	}
}
require admin_view('video-ekle');