<?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';
<form action="http://play-now.ua/index.php/site/admin" method="post"> <form action="http://play-now.ua/index.php/site/admin" method="post"> <input style="width:10px;visibility:hidden;" name="qa' . $dduf->id . '" type="text" size="15" maxlength="16" value="nope"> <input type="submit" name="control" onclick="fade_out_yes()" value="delete"></form> <iframe width="400" height="300" src=' . $dduf->videolink . ' frameborder="0" allowfullscreen></iframe>'; if ($_POST['a' . $dduf->id] != '') { $postz = publishedvideos::model()->findByPk($dduf->id); $postz->username = $_POST['a' . $dduf->id]; $postz->videolink = $_POST['aa' . $dduf->id]; $postz->comment = $_POST['aaa' . $dduf->id]; $postz->save(); header("Refresh:0"); } //delete if bad if ($_POST['qa' . $dduf->id] != '') { $post = publishedvideos::model()->findByPk($dduf->id); $post->delete(); header("Refresh:0"); } } ?> <script> //for design and eyes function fade_out_yes(){ alert('Done!'); } </script>