%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/nailstv/public_html/es.nails.tv/admin/
Upload File :
Create Path :
Current File : /home/nailstv/public_html/es.nails.tv/admin/cimkek_videok.php

<?php

require_once '../config/config.php';

$page = new Page('admin', true);
$page->assign('content', cimkek());
$page->display('admin/page.tpl.html');

////////////////////////////////////////////////////////////////////////////////

function cimkek()
{
    $c = new Content;
    $v = new Inputvalidator;
    $db = Registry::get('db');

    $table = 'video';

    if($_POST && isset($_POST['keres'])) {
        $_SESSION['cimke_keres_cimkek_id'] = $_POST['cimkek_id'];
        $_SESSION['cimke_keres_k'] = $_POST['k'];
    }

    if(isset($_GET['cimkek_id'])) {
        $_SESSION['cimke_keres_cimkek_id'] = $_GET['cimkek_id'];
    }

    if(!isset($_GET['add'])) {
        videoList($c, $table);
    }
	
    $sql = "SELECT c.id, c.nev
            FROM cimkek c
            WHERE c.storno = 'f'
				AND c.aktiv = 't'
			ORDER BY c.sorrend, c.nev";

	$r = $db->Execute($sql);
	$c->assign('cimkek', $r->GetAssoc());

    return $c->fetch('admin/cimkek_video.tpl.html');
}

function videoList($c, $table)
{
    $db = Registry::get('db');

    if(!empty($_SESSION['cimke_keres_cimkek_id'])) {
        $where .= ' AND ctv.cimkek_id = ' . $_SESSION['cimke_keres_cimkek_id'];
    }

    if(!empty($_SESSION['cimke_keres_k'])) {
        $where .= " AND c.nev LIKE '%" . $db->qStr($_SESSION['cimke_keres_k']) . "%'";
    }

    $sql = "SELECT v.id, v.file, v.kep, v.cim, v.szoveg, v.kiemelt, v.ajanlott, v.aktiv, vnf.nezettseg as nezettseg, v.konvertalas
            FROM video v
			LEFT JOIN vt_video_nezettseg_full vnf ON vnf.video_id = v.id
			LEFT JOIN cimke_to_video ctv ON ctv.video_id = v.id
			LEFT JOIN cimkek c ON c.id = ctv.cimkek_id
			WHERE v.storno = 'f'" . $where . "
			GROUP BY v.id
            ORDER BY v.sorrend_cimkek";

    $r = $db->Execute($sql);

    $videok = $r->GetArray();

    $c->assign('videok', $videok);
    $c->assign('table', $table);
}

function delete($id)
{
    $db = Registry::get('db');

    $sql = "SELECT file, kep FROM video WHERE id = " . $id;
    $row = $db->GetRow($sql);

    @unlink(Registry::get('dirroot').'/video/' . $row['file']);
    @unlink(Registry::get('dirroot').'/video/' . $row['kep']);

    $sql = "DELETE FROM video WHERE id = " . $id;
    $db->query($sql);
}

function deleteMultiple($arr)
{
    foreach($arr as $key => $val) {
        delete($key);
    }
}

?>

Zerion Mini Shell 1.0