<?php

session_start();
include "include/config.php";
include "include/function.php";
chk_member_login();
if ($_POST[remove_video] != "") {
    $msg = delete_vdo($VID, $_SESSION[UID]);
}
//PAGING STARTS
if ($page == "") {
    $page = 1;
}
$sql = "SELECT count(*) as total from audio WHERE UID={$_SESSION['UID']} limit {$config['total_per_ini']}";
$ars = $conn->Execute($sql);
if ($ars->fields['total'] <= $config[total_per_ini]) {
    $total = $ars->fields['total'];
} else {
    $total = $config[total_per_ini];
}
$tpage = ceil($total / $config[items_per_page]);
if ($tpage == 0) {
    $spage = $tpage + 1;
} else {
    $spage = $tpage;
}
$startfrom = ($page - 1) * $config[items_per_page];
$sql = "select * from audio WHERE UID={$_SESSION['UID']} limit {$startfrom}, {$config['items_per_page']}";
$rs = $conn->execute($sql);
if ($rs->recordcount() > 0) {
    $vdo = $rs->getrows();
<?php

session_start();
include "include/config.php";
include "include/function.php";
chk_member_login();
if ($_REQUEST[remove_video] != "") {
    $msg = delete_vdo($_REQUEST[VID], $_SESSION[UID]);
    $sql = "DELETE from video where vid='{$_REQUEST['VID']}'";
    $path = $config['BASE_DIR'] . "/video/" . $_REQUEST[VID] . ".mpg";
    if (file_exists($path)) {
        unlink($path);
    }
    $ars = $conn->Execute($sql);
}
//PAGING STARTS
if ($_REQUEST[page] == "") {
    $page = 1;
} else {
    $page = $_REQUEST[page];
}
$sql = "SELECT count(*) as total from video WHERE UID={$_SESSION['UID']} limit {$config['total_per_ini']}";
$ars = $conn->Execute($sql);
if ($ars->fields['total'] <= $config[total_per_ini]) {
    $total = $ars->fields['total'];
} else {
    $total = $config[total_per_ini];
}
$tpage = ceil($total / $config[items_per_page]);
if ($tpage == 0) {
    $spage = $tpage + 1;