<?php $result = publishedvideos::model()->findAll('id > :numsz', array(':numsz' => 0)); foreach ($result as $dduf) { $d = $dduf->id; if ($d < $dduf->id) { $d = $duff->id; } //if($dduf->moderation == 'yes'){ //echo '<div class="post"><iframe width="400" height="300" src='.$dduf->videolink.' frameborder="0" allowfullscreen></iframe></div>'; //} } $resultsec = publishedvideos::model()->findAll('id > :numsz', array(':numsz' => 0)); foreach ($resultsec as $ddufa) { for ($d; $d >= 0; $d--) { $standit = publishedvideos::model()->findAll('id=:d', array(':d' => $d)); foreach ($standit as $one) { echo '<div class="post"><iframe width="400" height="300" src=' . $one->videolink . ' frameborder="0" allowfullscreen></iframe></div>'; } } } ?> <?php $vid = new videos(); if ($_POST['name'] != '') { $vid->username = $_POST['name']; $vid->videolink = $_POST['vlink']; $vid->comment = $_POST['comment']; $vid->moderation = 'no';
document.write(adminpanel); }*/ }; </script> <?php echo '<h3><b>= New video =</b></h3><br/>'; $result = videos::model()->findAll('id > :numsz', array(':numsz' => 0)); foreach ($result as $buf) { if ($buf->moderation == 'no') { //adding from all 'no' videos if ($_POST['ac' . $buf->id] != '') { $vid = new publishedvideos(); $vid->username = $buf->username; $vid->videolink = $buf->videolink; $vid->comment = $buf->comment; $vid->save(); $post = videos::model()->findByPk($buf->id); $post->moderation = 'yes'; //$post->id=$b+1; $post->save(); header("Refresh:0"); } //delete if bad if ($_POST['ca' . $buf->id] != '') { $post = videos::model()->findByPk($buf->id); $post->delete(); header("Refresh:0");