<?php
if ($c['level']=="superadmin") {

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

$title = $_POST['title'];
$provider = $_POST['provider'];
$players = $_POST['players'];
$status = $_POST['status'];
$sort = $_POST['sort'];

$img = $_FILES['image']['name'];
$tmp = $_FILES['image']['tmp_name'];
move_uploaded_file($tmp,"../../uploads/popular/".$img);

$q = mysqli_query($koneksi,"
INSERT INTO tb_popular 
VALUES(NULL,'$title','$provider','$img','$players','$status','$sort')
");

if($q){
echo "<script>alert('Popular berhasil ditambahkan');window.location='?page=popular'</script>";
}

}
}else{
echo "<script>window.location='?page=dashboard'</script>";
}
?>