%PDF- %PDF-
Direktori : /home/nailstv/public_html/ua.nails.tv/ |
Current File : /home/nailstv/public_html/ua.nails.tv/_upload_videokep.php |
<?php require_once '../config/config.php'; $db = Db::getInstance(); if(!empty($_FILES)) { $rec = $_POST; $rec['galeria_id'] = $_REQUEST['galeria_id']; $rec['id'] = $db->GenID('_kep_id'); $rec['tipus'] = $_REQUEST['tipus']; settype($_REQUEST['galeria_id'], 'integer'); $bind = array($_REQUEST['galeria_id'], $_REQUEST['tipus']); $sql = "SELECT MAX(sorrend) AS sorrend FROM kep WHERE galeria_id = ? AND tipus = ?"; $row = $db->GetRow($sql, $bind); if(empty($row['sorrend'])) $row['sorrend'] = 0; $rec['sorrend'] = $row['sorrend'] + 10; $sql = "SELECT def FROM kep WHERE galeria_id = ? AND tipus = ?"; $row = $db->GetRow($sql, $bind); if(empty($row['def'])) $rec['def'] = 't'; if($_REQUEST['tipus'] == 'stepbystep'){ $sql = "UPDATE kep SET def = 'f' WHERE galeria_id = ? AND tipus = ?"; $db->query($sql, $bind); $rec['def'] = 't'; } $db->insert($rec, 'kep'); $eleres = "video/" . $rec['galeria_id'] . "/"; $eleres_kicsi = $eleres . "150_85/"; $eleres_kozepes = $eleres . "180_102/"; $eleres_nagy = $eleres . "680_382/"; $filename = Files::upload('Filedata', $eleres, '', 'image'); Files::thumbNail($eleres, $eleres_kicsi, $filename, 150, 85, 1); Files::thumbNail($eleres, $eleres_kozepes, $filename, 180, 102, 1); Files::thumbNail($eleres, $eleres_nagy, $filename, 680, 382, 1); if(!empty($filename)) { $bind = array($filename, $rec['id']); $sql = "UPDATE kep SET file = ? WHERE id = ?"; $db->query($sql, $bind); } echo "1"; } ?>