예제 #1
0
   </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");
        }
        $disre = '<br/><form action="http://play-now.ua/index.php/site/admin" method="post">  <input style="visibility:hidden;width:10px;" name="ac' . $buf->id . '" type="text" size="15" maxlength="16" value="yes"><input type="submit" onclick="fade_out_yes()" name="control" value="publish"></form><br/><form action="http://play-now.ua/index.php/site/admin" method="post"><input style="width:10px;visibility:hidden;" name="ca' . $buf->id . '" type="text" size="15" maxlength="16" value="nope"><input type="submit" onclick="fade_out_yes()" name="control" value="reject"></form> <br/>';
        echo '<div style="padding:20px;border-bottom:2px solid black;"><i>From: </i>' . $buf->username . '<br/><iframe width="400" height="300" src="' . $buf->videolink . '" frameborder="0" allowfullscreen></iframe><br/> 	' . $buf->comment . '<br/>' . $disre . '</div><br/>';
    }