%PDF- %PDF-
Direktori : /home/nailstv/public_html/ |
Current File : /home/nailstv/public_html/_kedvencek.php |
<?php if(empty($_POST)) die; require_once 'config/config.php'; Registry::set('debug', false); $db = Db::getInstance(); settype($_POST['video'], 'integer'); if(isset($_SESSION[Registry::get('site')]['user_id'])){ $rec['felhasznalo_id'] = $_SESSION[Registry::get('site')]['user_id']; $rec['video_id'] = $_POST['video']; $rec['datum'] = date("Y-m-d H:i:s"); $bind = array($rec['video_id'], $rec['felhasznalo_id']); $sql = "SELECT video_id FROM kedvencek WHERE video_id = ? AND felhasznalo_id = ?"; $row = $db->GetRow($sql, $bind); } if(empty($rec['felhasznalo_id'])) { echo '<div class="white-popup favorite-callback"><p>You have to login to use this function.</p></div>'; } elseif(!empty($row)) { echo '<div class="white-popup favorite-callback"><p>This video already added to your favorites.</p></div>'; } else { $db->insert($rec, 'kedvencek'); echo '<div class="white-popup favorite-callback"><p>This video added to your favorites.</p></div>'; } ?>