芝麻web文件管理V1.00
';
}
else
{
move_uploaded_file($_FILES['slider']['tmp_name'],'../slider/'.$slider);
}
if($imgValidation==1)
{
$sqlSubject = mysqli_query ($cn, "insert into `tbl_slider` set `type`='".$type."', `title`='".$title."', `slider`='".$slider."', `link`='".$link."', `slider_order`='".$slider_order."', `description`='".$description."'");
if ($sqlSubject)
{
echo 'Success! Slider Added Successfully.
';
}
else
{
echo 'Danger! Slider Not Added. Try Again.
';
}
}
else
{
echo $_SESSION['errorMsg'];
}
}
if(isset($_POST['edit']))
{
$id = $_POST['id'];
$type = $_POST['type'];
$title = mysqli_real_escape_string($cn,$_POST['title']);
$slider = $_FILES['slider']['name'];
$link = $_POST['link'];
$slider_order = $_POST['slider_order'];
$description = mysqli_real_escape_string($cn,$_POST['description']);
$sql = mysqli_query($cn, "select * from tbl_slider where id='$id'");
$sqlData = mysqli_fetch_array($sql);
if(!empty($slider))
{
move_uploaded_file($_FILES['slider']['tmp_name'],'../slider/'.$slider);
}
else
{
$slider = $sqlData['slider'];
}
$sqlSubject = mysqli_query ($cn,"update tbl_slider SET `type`='".$type."', `title`='".$title."', `slider`='".$slider."', `link`='".$link."', `slider_order`='".$slider_order."', `description`='".$description."' where `id`='".$id."'");
if($sqlSubject)
{
echo 'Success! Slider Update Successfully.
';
}
else
{
echo 'Warning! Not Updated try again.
';
}
}
if(isset($_GET['edit_id']))
{
$id = $_GET['edit_id'];
$sql = mysqli_query($cn, "select * from tbl_slider where id='$id'");
$sqlData = mysqli_fetch_array ($sql);
}
if(isset($_GET['delete_id']))
{
$id = $_GET['delete_id'];
$sql = mysqli_query($cn, "delete from tbl_slider where id='$id'");
if($sql)
{
echo 'Success! Slider Deleted Successfully.
';
}
else
{
echo "error: " . $sql . "
" . mysqli_error($conn);
}
}
?>
Slider
Slider List
Sr. No. |
Image |
Title |
Link |
Order |
Action |
|
|
|
|
|
Edit | Delete |