Success! Content successfully added.
";
echo '';
} else {
$message = "Error! Problem uploading Content.
";
}
}
if(!empty($_POST['btnedit'])=="Save Changes")
{
$service_title= mysqli_real_escape_string($conn,$_POST['service_title']);
$service_content= mysqli_real_escape_string($conn,$_POST['service_content']);
if($_FILES['service_image']['name'])
{
$service_image = time() . '_' . $_FILES['service_image']['name'];
$destination = '../upload/service/' . $service_image;
move_uploaded_file($_FILES['service_image']['tmp_name'], $destination);
}
else
{
$service_image=$_POST['service_image_prv'];
}
//echo "UPDATE `tm_service` SET `service_title`='$service_title',`service_image`='$service_image',`restaurant_id`='$restaurant_id' WHERE `id`='".$_REQUEST['service_id']."'";
//die;
$update_sql= mysqli_query($conn,"UPDATE `tm_service` SET `service_title`='$service_title',`service_image`='$service_image',`service_content`='$service_content' WHERE `id`='".$_REQUEST['service_id']."'");
if ($update_sql) {
$message = "Success! Content updated successfully.
";
echo '';
} else {
$message = "Error! Problem updating Content.
";
}
}
?>