<!--#####################################################################
    #
    #   File          : DELETE VIDEO
    #   Project       : Game Magazine Project
    #   Author        : Béo Sagittarius
    #   Created       : 07/01/2015
    #
    ##################################################################### -->
<?php 
include '../includes/functions.php';
include '../includes/backend/header-admin.php';
include '../includes/backend/mysqli_connect.php';
$vid = validate_id($_GET['vid']);
// Neu muon delete page
$result = delete_videos($vid);
if (mysqli_affected_rows($dbc) == 1) {
    echo "\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\talert('{$lang['AD_DEL_SUCCESS']}');\n                    window.location = 'list_videos.php';\n\t\t\t\t</script>\n\t\t\t";
} else {
    echo "\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\talert('{$lang['AD_DEL_FAIL']}');\n                    window.location = 'list_videos.php';\n\t\t\t\t</script>\n\t\t\t";
}
Example #2
0
        //Delete thumbnail file
        //Video thumbnail has jpg extension
        $targetFile = dirname(__FILE__) . $ds . 'src' . $ds . $entity['album_ID'] . $ds . "thumb" . $ds . $entity['id'] . ".jpg";
        if (!unlink($targetFile)) {
            echo "Error deleting {$targetFile}";
        } else {
            echo "Deleted {$targetFile}";
        }
        //Remove sql entity
        $entityController->remove_entity($entity['id']);
    }
}
if (in_array('all', $_POST['media'])) {
    delete_images();
    delete_videos();
    $dbController->remove_album($_POST['album_ID']);
    header('Location: index.php');
    die;
} else {
    if (in_array('photos', $_POST['media'])) {
        echo "delete all Images";
        delete_images();
    }
    if (in_array('videos', $_POST['media'])) {
        echo "delete all videos";
        delete_videos();
    }
}
//Redirect Back
header('Location: ' . $_SERVER['HTTP_REFERER']);
die;