public function postDeletevideo()
 {
     $data = Input::only('video_id');
     $vidObj = new Videos();
     $vidObj->deleteData($data['video_id']);
     if ($update) {
         return Response::json(array('status' => '1', $data));
     } else {
         return Response::json(array('status' => '0', $data));
     }
 }
 public function ActionVideo_add_to_my_page($id, $mid)
 {
     $video_model = new Videos();
     if ($video = $video_model->findByPk($mid)) {
         $video_model->isNewRecord = true;
         $video_model->id = 0;
         $video_model->file = $video['file'];
         $video_model->upload_date = time();
         $video_model->user_id = Yii::app()->user->id;
         $video_model->save();
     }
 }
Beispiel #3
0
 public function displayList()
 {
     $id_lang = $this->context->language->id;
     $id_shop = $this->context->shop->id;
     $limit_per_page = intval($this->conf['list_limit_page']);
     $current_page = isset($_GET['p']) && is_numeric($_GET['p']) ? intval($_GET['p']) : 1;
     $start = ($current_page - 1) * $limit_per_page;
     $list = VideoCategory::getCategories();
     $listCategories = array();
     if (isset($list) && is_array($list) && count($list)) {
         /** pagination * */
         //            $nb_pages = ceil($nb_articles / $limit_per_page);
         //            $next = $current_page > 1 ? true : false; //articles plus recents
         //            $back = $current_page >= 1 && ($current_page < $nb_pages) ? true : false; //articles precedents
         $i = 0;
         foreach ($list as $cat) {
             $videos = Videos::getVideoByCategory($cat['id_video_cat']);
             $list_video = array();
             foreach ($videos as $key => $val) {
                 $video = $val;
                 $video['average'] = VideosRatting::getAverage($val['id_video']);
                 $list_video[] = $video;
             }
             $cat['videos'] = $list_video;
             $listCategories[] = $cat;
         }
         //            echo '<pre>';
         //            print_r($listCategories);
         //            echo '</pre>';
         $this->context->smarty->assign(array('list_categories' => $listCategories, 'img_video_dir' => _THEME_VIDEO_DIR_, 'customer' => $this->context->customer->id));
     }
     $this->setTemplate('list.tpl');
 }
Beispiel #4
0
 public function loadModel($id)
 {
     $model = Videos::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Beispiel #5
0
 /**
  *
  *  Показвает скучную странику с видео, единственное украшение которой – дополнительные видео из трека
  *
  **/
 public function actionByid($id)
 {
     if ($video = Videos::model()->with("Track.Videos")->findByPk($id)) {
         $this->render('preview', array("video" => $video));
     } else {
         Yii::app()->notify->add("Не удалось найти видео", "danger");
         $this->render('site/error');
     }
 }
 public function actionIndex($id)
 {
     Yii::app()->clientScript->registerScript('global_user_id', 'var glUserId = ' . $id . ';', CClientScript::POS_HEAD);
     $user = UserProfile::model()->getUserProfile($id);
     $myPage = Yii::app()->user->id == $id;
     $videos = Videos::model()->findAll('user_id=:id', array(':id' => $id));
     $videos_count = count($videos);
     $this->render('index', array('profile' => $user, 'myPage' => $myPage, 'videos' => $videos, 'videos_count' => $videos_count));
 }
Beispiel #7
0
 public function buildGallery($profileid = 1, $catid = 0, $sort = '', $count = 0)
 {
     global $wpdb;
     if (isset($_GET['catid'])) {
         $qid = $_GET['catid'];
         $category = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "allvideogallery_categories WHERE slug='{$qid}'");
         $catid = $category->id;
     }
     if (isset($_GET['sort'])) {
         $sort = $_GET['sort'];
     }
     if ($catid || $sort) {
         $gallery = new Videos();
         $output = $gallery->buildGallery($profileid, $catid, $sort, $count);
     } else {
         $gallery = new Categories();
         $output = $gallery->buildGallery($profileid, $count);
     }
     return $output;
 }
 function rowToDto($row)
 {
     $objVideos = new Videos();
     $objVideos->setIdvideo($row["idvideo"]);
     $objVideos->setIdcanal($row["idcanal"]);
     $objVideos->setNomvideo($row["nomvideo"]);
     $objVideos->setDescripvideo($row["descripvideo"]);
     $objVideos->setFechacreavideo($row["fechacreavideo"]);
     return $objVideos;
 }
 public function actionVideo($id)
 {
     Yii::app()->clientScript->registerScript('global_user_id', 'var glUserId = ' . $id . ';', CClientScript::POS_HEAD);
     Yii::app()->clientScript->registerPackage('videos');
     $user = UserProfile::model()->getUserProfile($id);
     $myPage = Yii::app()->user->id == $id;
     $video_id_list = Bookmarks::model()->content_id_list($id, 2);
     // $photo_id_list
     $model = Videos::model();
     // Photos::model();
     $idcond = empty($video_id_list) ? '0' : implode(') OR (`t`.`id`=', $video_id_list);
     $cond = '`t`.`id`=' . $idcond;
     $videos = $model->ParametrizedLoadLimited($cond, 0);
     // $photos
     $list = $this->renderPartial('_videos_list', array('videos' => $videos, 'user_id' => $id), true);
     $this->render('videos', array('model' => $model, 'profile' => $user, 'myPage' => $myPage, 'videos_count' => count($videos), 'list' => $list));
 }
Beispiel #10
0
function display_page_content()
{
    $videos = Videos::FindAll();
    ?>
	
	<div id="edit-header" class="videonav">
		<div class="nav-left column">
    		<h1>Choose a Video to Edit</h1>
		</div>
		<div class="nav-right column">
            <a href="<?php 
    echo get_link("admin/edit_video/add");
    ?>
" class="hcd_button">Add a New Video</a>
		</div>
		<div class="clearleft"></div>
	</div>
	
	<p class="announce">Videos require the use of an outside video hosting and encoding service. The HCd&gt;CMS supports two service providers, YouTube and Vimeo. By defining videos by shortcode here, you can insert videos into text content just like images or documents. If a shortcode needs to change, you may edit it here and all references will be updated. </p>
	
<?php 
    if (count($videos) > 0) {
        ?>
			
	<div id="table-header" class="videos">
		<strong class="item-link">Video Name</strong>
		<span class="item-filename">Service</span>
		<span class="item-viewlink">Link to Play</span>
	</div>
	
	<ul id="listitems" class="managelist videolist">
		<?php 
        foreach ($videos as $thevid) {
            echo "\t\t<li>\n\t\t\t<span class=\"item-link\"><a href=\"" . get_link("/admin/edit_video/{$thevid->id}") . "\">" . $thevid->get_title() . " <small>EDIT</small></a></span>\n\t\t\t<span class=\"item-filename\">" . ucwords($thevid->service) . "</span>\n\t\t\t<span class=\"item-viewlink\"><a href=\"" . $thevid->getPublicUrl() . "\" target=\"_blank\">View video</a></span>\n\t\t</li>\n";
        }
        ?>
	
	</ul>
<?php 
    } else {
        echo "\t\t<h3 class=\"empty-list\">There are no videos to edit. <a class=\"short\" href=\"" . get_link("admin/edit_video/add") . "\">Add one if you like</a>.</h3>";
    }
}
Beispiel #11
0
    public function actionGetVideoBySearchQuery() {
        if (Yii::app()->request->isAjaxRequest && isset($_POST['query'])) {

            $queryString = trim($_POST['query']);
            $options = array(

                'search_option_title' => intval($_POST['search_option_title']),
                'search_option_log_line' => intval($_POST['search_option_log_line']),
                'search_option_description' => intval($_POST['search_option_description']),
                'search_option_link_name' => intval($_POST['search_option_link_name']),
            );

            $video_list = Videos::getVideoListByQueryString($queryString, $options);

            $result['html'] = $this->renderPartial('_video', array(
                'video_list' => $video_list,
            ),true);

            echo CJSON::encode($result);


        }

    }
Beispiel #12
0
 /**
  * [getCurrentPlaylist description]
  * @return [type] [description]
  */
 public function getCurrentPlaylist()
 {
     $videostoShow = array();
     $currentTime = date('h:i:s A');
     $today = date("Y-m-d");
     $videoCounter = 0;
     $timestamp = 0;
     // dd(new DateTime('today'));
     $activeSchedule = Schedule::where('active', '=', '1')->where('start_date', '<=', $today)->where('end_date', '>=', $today)->first();
     //dd($activeSchedule);
     if ($activeSchedule) {
         $videoList = Videos::where('schedule_id', '=', $activeSchedule->id)->where('active', '=', '1')->orderBy('position')->get();
     } else {
         $videoList = [];
     }
     //print_r(json_encode($videoList));exit;
     foreach ($videoList as $video) {
         $from_time = Carbon::createFromFormat('Y-m-d h:i:s A', $today . ' ' . trim($video->time))->toDateTimeString();
         $timestamp = Carbon::createFromFormat('Y-m-d h:i:s A', $today . ' ' . trim($video->time))->timestamp;
         $diffSec = strtotime($from_time) - time();
         $positivediffSec = abs($diffSec);
         $videoLength = intval($video->length);
         if ($videoCounter >= 1) {
             $videoEndTime = date('h:i:s A', $timestamp + $videoLength);
         } else {
             $videoEndTime = date('h:i:s A', $timestamp + 0);
         }
         if ($videoLength < $positivediffSec) {
             // Time over of the video
             $tubeurl = $video->url;
             parse_str(parse_url($tubeurl, PHP_URL_QUERY), $querys);
             $videoID = $querys['v'];
             $videostoShow[] = array('videoId' => $videoID, 'startSeconds' => 0, 'startTime' => trim($video->time), 'endTime' => trim($videoEndTime), 'length' => $video->formatTime($video->length), 'suggestedQuality' => 'default');
         } else {
             $tubeurl = $video->url;
             parse_str(parse_url($tubeurl, PHP_URL_QUERY), $querys);
             $videoID = $querys['v'];
             $videostoShow[] = array('videoId' => $videoID, 'startSeconds' => abs($diffSec), 'startTime' => trim($video->time), 'endTime' => trim($videoEndTime), 'length' => $video->formatTime($video->length), 'suggestedQuality' => 'default');
         }
         $videoCounter++;
     }
     $responceData = array("serverTime" => date('Y-m-d h:i:s A'), "date" => date('Y-m-d'), "time" => date('h:i:s A'), "videos" => $videostoShow);
     return $responceData;
 }
Beispiel #13
0
    /**
     * Lists all models.
     */
    public function actionIndex()
    {
        if (isset($_POST['oper']) && $_POST['oper'] == 'edit') {
            $id = intval($_POST["id"]);
            $video = Videos::model()->findByPk($id);
            if ($video) {

                $error_string= '';

                $video->Video_Title =$_POST['Video_Title'] ? $_POST["Video_Title"] : null;
                $video->Video_Log_Line =$_POST['Video_Log_Line'] ? $_POST["Video_Log_Line"] : null;
                $video->Video_Desc =$_POST['Video_Desc'] ? $_POST["Video_Desc"] : null;
                $video->Link_Title =$_POST['Link_Title'] ? $_POST["Link_Title"] : null;
                $video->Sort_Order =$_POST['Sort_Order'] ? $_POST["Sort_Order"] : null;
                $video->Video_URL =$_POST['Video_URL'] ? addslashes($_POST['Video_URL']) : null;
                $video->Video_Password =$_POST['Video_Password'] ? $_POST["Video_Password"] : null;
                $video->Visibility =$_POST['Visibility'] ? $_POST["Visibility"] : null;

                if (intval($_POST['Visibility'])==4) {
                    $client_id = intval($_POST['Clients_Client_ID']);
                    $client = Clients::model()->findByPk($client_id);

                    if (!$client) {
                        $error_string = 'Client_ID should be real';
                    }
                }

                if (intval($_POST['Visibility'])==5) {
                    $client_id = intval($_POST['Clients_Client_ID']);
                    $project_id = intval($_POST['Clients_Client_ID']);

                    $project = Projects::model()->findByAttributes(array(
                        'Project_ID'=>$project_id,
                        'Client_ID'=>$client_id
                    ));

                    if (!$project) {
                        $error_string = 'There is no project for such Client_ID and Project_ID';
                    }
                }
                $video->Clients_Client_ID =$_POST['Clients_Client_ID'] ? $_POST["Clients_Client_ID"] : null;
                $video->Project_ID =$_POST['Project_ID'] ? $_POST["Project_ID"] : null;



                if ($video->validate() && $error_string == '') {
                    $video->save();
                    echo "video\n";
                } else {
                    die($error_string);
                }
            }

            die;
        }

        if (isset($_POST['oper']) && $_POST['oper'] == 'add') {

           // var_dump($_POST);die;
            $error_string= '';

            $video = new Videos();

            $video->Video_Title =$_POST['Video_Title'];
            $video->Video_Log_Line =$_POST['Video_Log_Line'];
            $video->Video_Desc =$_POST['Video_Desc'];
            $video->Link_Title =$_POST['Link_Title'];
            $video->Video_URL =addslashes($_POST['Video_URL']);
            $video->Video_Password =$_POST['Video_Password'];
            $video->Sort_Order =$_POST['Sort_Order'] ? $_POST["Sort_Order"] : 1;

            if (intval($_POST['Visibility'])==4) {
                $client_id = intval($_POST['Clients_Client_ID']);
                $client = Clients::model()->findByPk($client_id);

                if (!$client) {
                    $error_string = 'Client_ID should be real';
                }
            }

            if (intval($_POST['Visibility'])==5) {
                $client_id = intval($_POST['Clients_Client_ID']);
                $project_id = intval($_POST['Clients_Client_ID']);

                $project = Projects::model()->findByAttributes(array(
                    'Project_ID'=>$project_id,
                    'Client_ID'=>$client_id
                ));

                if (!$project) {
                    $error_string = 'There is no project for such Client_ID and Project_ID';
                }
            }




            $video->Visibility =$_POST['Visibility'];
            $video->Clients_Client_ID =$_POST['Clients_Client_ID'];
            $video->Project_ID =$_POST['Project_ID'];

            if ($error_string == '') {
                $video->save();
            } else {
                die($error_string);
            }


        }

        if (isset($_POST['oper']) && $_POST['oper'] == 'del') {

            $video_id = intval($_POST["id"]);
            $video =Videos::model()->findByPk($video_id);
            if ($video) {
                $video->delete();
            }
            die;


        }

        $conn = mysql_connect(Yii::app()->params->dbhost, Yii::app()->params->dbuser, Yii::app()->params->dbpassword);
        mysql_select_db(Yii::app()->params->dbname);
        mysql_query("SET NAMES 'utf8'");

        Yii::import('ext.phpgrid.inc.jqgrid');

        // set columns
        $col = array();
        $col["title"] = "Video_ID"; // caption of column
        $col["name"] = "Video_ID";
        $col["dbname"] = "Video_ID"; // grid column name, same as db field or alias from sql
        $col["resizable"] = false;
        $col["editable"] = false; // this column is editable
        $col["hidden"] = false;
        $col["viewable"] = true;
        $col["search"] = false;
        $col["sortable"] = true;
        $cols[] = $col;

        // set columns
        $col = array();
        $col["title"] = "Video_Title"; // caption of column
        $col["name"] = "Video_Title";
        $col["dbname"] = "Video_Title"; // grid column name, same as db field or alias from sql
        $col["resizable"] = false;
        $col["editable"] = true; // this column is editable
        $col["hidden"] = false;
        $col["viewable"] = true;
        $col["search"] = true;
        $col["sortable"] = true;
        $cols[] = $col;

        // set columns
        $col = array();
        $col["title"] = "Video_Log_Line"; // caption of column
        $col["name"] = "Video_Log_Line";
        $col["dbname"] = "Video_Log_Line"; // grid column name, same as db field or alias from sql
        $col["resizable"] = true;
        $col["editable"] = true; // this column is editable
        $col["hidden"] = false;
        $col["viewable"] = true;
        $col["search"] = true;
        $col["sortable"] = true;
        $cols[] = $col;

        // set columns
        $col = array();
        $col["title"] = "Video_Desc"; // caption of column
        $col["name"] = "Video_Desc";
        $col["dbname"] = "Video_Desc"; // grid column name, same as db field or alias from sql
        $col["resizable"] = true;
        $col["editable"] = true; // this column is editable
        $col["hidden"] = false;
        $col["viewable"] = true;
        $col["search"] = true;
        $col["sortable"] = true;
        $cols[] = $col;

        // set columns
        $col = array();
        $col["title"] = "Link_Title"; // caption of column
        $col["name"] = "Link_Title";
        $col["dbname"] = "Link_Title"; // grid column name, same as db field or alias from sql
        $col["resizable"] = true;
        $col["editable"] = true; // this column is editable
        $col["hidden"] = false;
        $col["viewable"] = true;
        $col["search"] = true;
        $col["sortable"] = true;
        $cols[] = $col;

        // set columns
        $col = array();
        $col["title"] = "Video_URL"; // caption of column
        $col["name"] = "Video_URL";
        $col["dbname"] = "Video_URL"; // grid column name, same as db field or alias from sql
        $col["resizable"] = true;
        $col["editable"] = true; // this column is editable
        $col["hidden"] = false;
        $col["viewable"] = true;
        $col["search"] = true;
        $col["sortable"] = true;
        $cols[] = $col;

        // set columns
        $col = array();
        $col["title"] = "Video_Password"; // caption of column
        $col["name"] = "Video_Password";
        $col["dbname"] = "Video_Password"; // grid column name, same as db field or alias from sql
        $col["resizable"] = true;
        $col["editable"] = true; // this column is editable
        $col["hidden"] = false;
        $col["viewable"] = true;
        $col["search"] = true;
        $col["sortable"] = true;
        $cols[] = $col;

        // set columns
        $col = array();
        $col["title"] = "Sort_Order"; // caption of column
        $col["name"] = "Sort_Order";
        $col["dbname"] = "Sort_Order"; // grid column name, same as db field or alias from sql
        $col["resizable"] = true;
        $col["editable"] = true; // this column is editable
        $col["hidden"] = false;
        $col["viewable"] = true;
        $col["search"] = true;
        $col["sortable"] = true;
        $cols[] = $col;

        // set columns
        $col = array();
        $col["title"] = "Visibility"; // caption of column
        $col["name"] = "Visibility";
        $col["dbname"] = "Visibility"; // grid column name, same as db field or alias from sql
        $col["resizable"] = true;
        $col["editable"] = true; // this column is editable
        $col["hidden"] = false;
        $col["viewable"] = true;
        $col["search"] = true;
        $col["sortable"] = true;
        $cols[] = $col;

        // set columns
        $col = array();
        $col["title"] = "Clients_Client_ID"; // caption of column
        $col["name"] = "Clients_Client_ID";
        $col["dbname"] = "Clients_Client_ID"; // grid column name, same as db field or alias from sql
        $col["resizable"] = true;
        $col["editable"] = true; // this column is editable
        $col["hidden"] = false;
        $col["viewable"] = true;
        $col["search"] = true;
        $col["sortable"] = true;
        $cols[] = $col;

         // set columns
        $col = array();
        $col["title"] = "Project_ID"; // caption of column
        $col["name"] = "Project_ID";
        $col["dbname"] = "Project_ID"; // grid column name, same as db field or alias from sql
        $col["resizable"] = true;
        $col["editable"] = true; // this column is editable
        $col["hidden"] = false;
        $col["viewable"] = true;
        $col["search"] = true;
        $col["sortable"] = true;
        $cols[] = $col;







        $g = new jqgrid();

        $grid["caption"] = "Videos";
        // $grid["multiselect"] = true;
        $grid["autowidth"] = true;
        $grid["resizable"] = true;
        //$grid["toppager"] = true;
        $grid["sortname"] = 'Video_ID';
        $grid["sortorder"] = "ASC";
        $grid["add_options"] = array(
            'width'=>'420',
            "closeAfterEdit"=>true, // close dialog after add/edit
            "top"=>"200", // absolute top position of dialog
            "left"=>"200" // absolute left position of dialog
        );

        $g->set_options($grid);

        $g->set_actions(array(
                "add"=>true, // allow/disallow add
                "edit"=>true, // allow/disallow edit
                "delete"=>true, // allow/disallow delete
                "rowactions"=>true, // show/hide row wise edit/del/save option
                "export"=>true, // show/hide export to excel option
                "autofilter" => true, // show/hide autofilter for search
                "search" => "advance" // show single/multi field search condition (e.g. simple or advance)
            )
        );

        $g->select_command = "SELECT Videos.*
                              FROM Videos";

        // set database table for CRUD operations
        $g->table = "Videos";

        $g->set_columns($cols);

        // group columns header
        $g->set_group_header( array(
                "useColSpanStyle"=>true,
                "groupHeaders"=>array(
                    array(
                        "startColumnName"=>'Video_ID', // group starts from this column
                        "numberOfColumns"=>4, // group span to next 2 columns
                        "titleText"=>'Videos' // caption of group header
                    ),
                )
            )
        );

        // render grid and get html/js output
        $out = $g->render("Videos");

        $this->render('index',array(
            'out'=>$out,
        ));
    }
Beispiel #14
0
    public static function getVideoListByQueryString($queryString,$options){

        $visibility_array = Videos::getRightsForVideo();
        $condition = new CDbCriteria();

        if (count($options) > 0 && trim($queryString) != '') {
            $countCond = 0;

            if ($options['search_option_title']) {
                $condition->compare('Video_Title',$queryString,true,'OR');

            }
            if ($options['search_option_log_line']) {
                $condition->compare('Video_Log_Line',$queryString,true,'OR');
            }
            if ($options['search_option_description']) {
                $condition->compare('Video_Desc',$queryString,true,'OR');
            }
            if ($options['search_option_link_name']) {
                $condition->compare('Link_Title',$queryString,true,'OR');
            }

        }

        $condition->addInCondition('Visibility', $visibility_array);

        $videos = Videos::model()->findAll($condition);

        return $videos;

    }
Beispiel #15
0
function video_display($content_to_display)
{
    $videoPattern = "/{{2}(video:[A-Za-z0-9\\-\\_ \\.\\(\\)'\"]+){{2}/";
    $videoIds = getFilterIds($content_to_display, $videoPattern);
    $videos = array();
    foreach ($videoIds as $videoId) {
        $videoname = end(explode(":", $videoId));
        $videos[] = Videos::FindByName($videoname);
    }
    foreach ($videos as $thevid) {
        if (is_object($thevid)) {
            $replacement = $thevid->embed_video();
            $content_to_display = updateContent($content_to_display, "/{{2}video:" . str_replace(")", "\\)", str_replace("(", "\\(", $thevid->slug)) . "{{2}/", $replacement);
        } else {
            $content_to_display = "<span class=\"database_error\">HCd&gt;CMS Warning: Video &ldquo;{$videoname}&rdquo; not found!</span> " . $content_to_display;
        }
    }
    return $content_to_display;
}
Beispiel #16
0

  if (Security::containsIllegalChars($gUID))
  {
    Log::writeLog(1, $_SERVER["SCRIPT_NAME"], "User ID \"$gUID\" contains illegal characters.");
  }
  elseif (Security::containsIllegalChars($gVID))
  {
    Log::writeLog(1, $_SERVER["SCRIPT_NAME"], "Video ID \"$gVID\" contains illegal characters.");
  }
  elseif (strlen($gUID) > 0 && strlen($gVID) > 0 && Youtube::validYoutubeID($gVID))
  {
    /*
     * Find video entry.
     */
    $gLocalSrch = new Videos();
    $gLocalSrchResult = $gLocalSrch->getSongByID($gVID);
    $lVideoTitle = (strlen($gLocalSrchResult[VideoTitle])>64)?substr($gLocalSrchResult[VideoTitle], 0, 64)."...":$gLocalSrchResult[VideoTitle];
	
    /*
     * Insert transcode request into db.
     */
    $lClientIP = isset($_SERVER['HTTP_X_FORWARDED_FOR'])?$_SERVER['HTTP_X_FORWARDED_FOR']:$_SERVER['REMOTE_ADDR'];
    $lStatement = "INSERT INTO Conversions (Timestamp, VideoID, RequestingUID, ClientIP, Description) Values(NOW(), '$gVID', '$gUID', '$lClientIP', '$lVideoTitle')";
  
    $lDB = new Database();
    $lDB->connect();  
        
    $lDB->select($lStatement);  
    $lResult = $lDB->getResult();
    $lDB->disconnect(); 	
Beispiel #17
0
function initialize_page()
{
    $item = Items::FindById(getRequestVaratIndex(3));
    // get all the sections
    $sections = Sections::FindPublicSections();
    /* get this section
     * We do this mostly for the previous and next item functions. If we dont know what section we are currently inside, 
     * the user may get bounced over to a different place than they started. */
    $sectionname = getRequestVaratIndex(2);
    if ($sectionname != "item_orphan") {
        $section = Sections::FindByName($sectionname);
    }
    // get the associated gallery
    if ($item) {
        $gallery = $item->getGallery();
    }
    // finally, get the post action. Harder to hack if we explicitly check the value this way.
    $post_action = "";
    if (isset($_POST['submit'])) {
        $post_action = $_POST['submit'];
    }
    if ($post_action == "Save Item" || $post_action == "Add Image" || $post_action == "Add Document" || $post_action == "Add or Edit Video" || $post_action == "Save and Return to List") {
        /* 
         * Delete this item and its associated components
         */
        if (isset($_POST['delete'])) {
            // delete $photos and $gallery
            if (is_object($gallery)) {
                $gallery->delete(true);
                $success .= "Gallery and Images Deleted / ";
            }
            /* Documents ... Why not keep them?
            			if ( ITEM_DOCUMENTS ) {
            			    $itemdocuments = $item->findDocuments( 'display_order ASC' );
            			    foreach ( $itemdocuments as $thedoc ) {
               				    $thedoc->delete(true); 
            			    }
            			    $success .= "Documents Deleted / ";
            			}*/
            $item->delete(true);
            $success .= "Item Deleted / ";
            setFlash("<h3>" . substr($success, 0, -3) . "</h3>");
            //$main_portlink = ( DISPLAY_ITEMS_AS_LIST ) ? "admin/portfolio_list/alphabetical" : "admin/portfolio_list";
            //redirect( $main_portlink );
            redirect("admin/portfolio_list");
        } else {
            $item->content = $_POST['item_content'];
            $item->display_name = $_POST['display_name'];
            $previous_name = $item->name;
            $item->name = slug($_POST['display_name']);
            $item->template = 'inherit';
            $item->public = checkboxValue($_POST, 'public');
            $item->date_revised = date('Y-m-d H:i:s');
            // optional fields
            $item->sku = ITEM_SKU ? $_POST['item_sku'] : null;
            $item->taxonomy = ITEM_TAXONOMY ? $_POST['taxonomy'] : null;
            $item->price = ITEM_PRICE ? $_POST['item_price'] : null;
            // SAVE item... uses a MyActiveRecord method
            $item->save();
            $success = "Item Saved / ";
            // synchronize the users section selections only if they are different
            $selected_sections = array();
            $previous_sections = $item->getSections();
            if (isset($_POST['selected_sections'])) {
                $update_sections = false;
                $selected_sections = $_POST['selected_sections'];
                // Problem: If we loop on only the $previous_sections, we may have fewer or more loops than $selected_sections.
                // Compare one to the other.
                if (count($previous_sections) != count($selected_sections)) {
                    // The two do not match, so there has been a change
                    $update_sections = true;
                } else {
                    // In case the two match, let's make sure something is different.
                    foreach ($previous_sections as $sect) {
                        if (!in_array($sect->id, $selected_sections)) {
                            $update_sections = true;
                        }
                    }
                }
                if ($update_sections) {
                    $item->updateSelectedSections($selected_sections);
                    // update the revision dates of sections, too
                    $item->updateSectionRevisionDates();
                }
            }
            /* 
             * Rename the gallery if the slug has changed. 
             * We need the name of the gallery and the name of the slug to be consistent. 
             * If there isn't a gallery – something broke, so – create a new one. 
             */
            if (is_object($gallery) && $previous_name != $item->name) {
                $gallery->slug = "portfolioGal_" . $item->id . "_" . $item->name;
                $gallery->save();
                $success .= "Gallery name changed / ";
            }
            if (!is_object($gallery)) {
                $gallery = MyActiveRecord::Create('Galleries');
                $gallery->name = $_POST['display_name'] . " Gallery";
                $gallery->slug = "portfolioGal_" . $item->id . "_" . slug($_POST['display_name']);
                $gallery->save();
            }
            /* ! Gallery image functions
             */
            if (isset($_FILES['new_photo']) && $_FILES['new_photo']['error'] == 0) {
                // user has added a new file
                $newphoto = MyActiveRecord::Create('Photos', array('caption' => getPostValue("new_photo_caption"), 'gallery_id' => $gallery->id, 'display_order' => 1));
                $newphoto->save();
                $newphoto->save_uploaded_file($_FILES['new_photo']['tmp_name'], $_FILES['new_photo']['name'], true);
                $success .= "New photo uploaded / ";
            }
            /* 
             * Check current captions against previous ones. 
             */
            if (isset($_POST['captions'])) {
                $captions = $_POST['captions'];
                foreach ($captions as $key => $thecaption) {
                    $photo = Photos::FindById($key);
                    if ($photo->caption != $thecaption) {
                        $photo->caption = $thecaption;
                        $photo->save();
                    }
                }
            }
            /* 
             * Check photo display order against previous ones 
             */
            if (isset($_POST['photos_display_order'])) {
                $display_orders = $_POST['photos_display_order'];
                foreach ($display_orders as $key => $display_order) {
                    $photo = Photos::FindById($key);
                    if ($photo->display_order && $photo->display_order != $display_order) {
                        $photo->display_order = $display_order;
                        $photo->save();
                    }
                }
                $success .= "Photo order saved / ";
            }
            /* 
             * Delete a photo from the gallery
             */
            if (isset($_POST['deleted_photos'])) {
                $deleted_ids = $_POST['deleted_photos'];
                foreach ($deleted_ids as $status => $photo_id) {
                    $photo = Photos::FindById($photo_id);
                    $photo->delete(true);
                }
                $success .= "A photo was deleted / ";
            }
            /* 
             * Check to see if we allow Portfolio Thumbs
             */
            if (PORTFOLIOTHUMB_IMAGE) {
                // was a new thumbnail uploaded
                if (is_uploaded_file(realpath($_FILES["thumbnail"]["tmp_name"]))) {
                    if (Upload_and_Save_Image($_FILES["thumbnail"], 'items', 'thumbnail', $item->id, PORTFOLIOTHUMB_IMAGE_MAXWIDTH, PORTFOLIOTHUMB_IMAGE_MAXHEIGHT)) {
                        $success .= "Thumbnail updated / ";
                    }
                }
            }
            /* ! Video functions
             */
            if (ITEM_VIDEOS) {
                // If this gallery has mixed photos AND videos, check the display order again and set each by object type
                if (isset($_POST['galitem_display_order'])) {
                    foreach ($_POST['galitem_display_order'] as $key => $display_order) {
                        $type = $_POST['galitem_type'][$key];
                        $galitem = $type == 'photo' ? Photos::FindById($key) : Videos::FindById($key);
                        if (is_object($galitem)) {
                            //if ( $galitem->display_order && $galitem->display_order != $display_order ) {
                            $galitem->display_order = $display_order;
                            $galitem->save();
                        }
                    }
                }
                // Change the name of a video
                if (isset($_POST['vidnames'])) {
                    $vidnames = $_POST['vidnames'];
                    foreach ($vidnames as $key => $thename) {
                        $video = Videos::FindById($key);
                        if ($video->display_name != $thename) {
                            $video->name = slug($thename);
                            $video->display_name = $thename;
                            $video->save();
                        }
                    }
                    //$success .= "Video name updated / "; // False positive
                }
                // Change the embed code of a video
                if (isset($_POST['vidcodes'])) {
                    $vidnames = $_POST['vidcodes'];
                    foreach ($vidnames as $key => $thecode) {
                        $video = Videos::FindById($key);
                        if ($video->embed != $thecode) {
                            $video->embed = $thecode;
                            $video->save();
                        }
                    }
                    //$success .= "Video embed updated / "; // False positive
                }
                // Add a new Video
                if ($_POST['newvideo'] != '') {
                    $video = MyActiveRecord::Create('Videos');
                    /*
                     * Columns: id, name, title, service, embed, width, height, gallery_id, display_order
                     */
                    $vidtitle = $_POST['newvideo'];
                    $video->name = slug($vidtitle);
                    $video->display_name = $vidtitle;
                    $video->service = $_POST['vidservice'];
                    $video->embed = $_POST['vidembed'];
                    $video->width = $_POST['vidwidth'];
                    $video->height = $_POST['vidheight'];
                    $video->gallery_id = $gallery->id;
                    $video->display_order = count($gallery->get_photos()) + 1;
                    $video->save();
                    $success .= "Video added / ";
                }
                // Remove video association -- Does not delete the video itself
                if (isset($_POST['removevideo'])) {
                    $video = Videos::FindById($_POST['removevideo']);
                    $video->gallery_id = null;
                    $video->save();
                }
            }
            /* ! Document functions
             */
            if (ITEM_DOCUMENTS) {
                // Change the name of a document
                if (isset($_POST['docname'])) {
                    $docnames = $_POST['docname'];
                    foreach ($docnames as $key => $thename) {
                        $document = Documents::FindById($key);
                        if ($document->name != $thename) {
                            $document->name = $thename;
                            $document->save();
                        }
                    }
                }
                // Reorder documents
                if (isset($_POST['document_display_order'])) {
                    $display_orders = $_POST['document_display_order'];
                    foreach ($display_orders as $key => $display_order) {
                        $doc = Documents::FindById($key);
                        if ($doc->display_order != $display_order) {
                            $doc->display_order = $display_order;
                            $doc->save();
                        }
                    }
                }
                // Add a new document
                if (isset($_FILES['new_document']) && $_FILES['new_document']['error'] == 0) {
                    // Set the name equal to the input field or the physical doc name
                    $name = $_POST['new_document_title'] ? $_POST['new_document_title'] : unslug($_FILES['new_document']['name']);
                    $name = substr($name, 0, strrpos($name, "."));
                    // Find the extension. Explode on the period.
                    $extension = substr($_FILES['new_document']['name'], strrpos($_FILES['new_document']['name'], "."));
                    $file_type = substr($extension, 1);
                    // Chop the dot off
                    $filename = slug($name) . $extension;
                    $target_path = SERVER_DOCUMENTS_ROOT . $filename;
                    if (move_uploaded_file($_FILES['new_document']['tmp_name'], $target_path)) {
                        $new_doc = MyActiveRecord::Create('Documents', array('name' => $name, 'filename' => $filename, 'file_type' => $file_type, 'item_id' => $item->id));
                        $new_doc->save();
                        $success .= "Document uploaded and attached / ";
                        if (!chmod($target_path, 0644)) {
                            $success .= "!Warning: Document Permissions not set; this file may not display properly! / ";
                        }
                    } else {
                        $success .= "!WARNING: Document could not be uploaded! / ";
                    }
                } else {
                    echo $_FILES['new_document']['error'];
                }
                // Delete Documents
                if (isset($_POST['deleted_documents'])) {
                    $deleted_ids = $_POST['deleted_documents'];
                    foreach ($deleted_ids as $status => $doc_id) {
                        $doc = Documents::FindById($doc_id);
                        $doc->delete(true);
                    }
                    $success .= "A document was deleted / ";
                }
            }
            setFlash("<h3>" . substr($success, 0, -3) . "</h3>");
            if ($post_action == "Save and Return to List") {
                //$main_portlink = ( DISPLAY_ITEMS_AS_LIST ) ? "admin/portfolio_list/alphabetical" : "admin/portfolio_list";
                //redirect( $main_portlink );
                redirect("admin/portfolio_list");
            } else {
                if ($update_sections) {
                    // Find a new section, the one that has just been assigned...
                    // Breaks into an infinite loop on Windows servers... can we clear the post somehow?
                    $section = Sections::FindById($_POST['selected_sections'][0]);
                }
                redirect("/admin/portfolio_edit/" . $section->name . "/" . $item->id);
            }
        }
    }
}
Beispiel #18
0
 public function actionEditvideo($id)
 {
     $video = Videos::model()->findByPk($id);
     if (isset($_REQUEST['Videos'])) {
         // обрабатывем данные из формы
         $video = Videos::model()->updateFromRequest($id);
     }
     $this->render('video', array("video" => $video));
 }
<!-- Insert a Video function -->
<div id="video_insert" class="dropslide" style="display: none; ">
	<p><span class="hint">Click the name of the Video to insert the embed code for it in the edit window above. The window above might lose the insertion point, so be sure your cursor is where you want it first. </span></p>

<?php 
$videos = Videos::FindAll();
if (isset($videos) and count($videos) > 0) {
    ?>

	<table class="dropdown" cellpadding="0" cellspacing="0" border="0" width="98%">
		<thead>
			<th width="25%">Video Name</th>
			<th width="25%">Embed Name</th>
			<th width="25%">Video Name</th>
			<th width="25%">Embed Name</th>
		</thead>
		<tbody>
			<tr>
<?php 
    $counter_doc = 1;
    foreach ($videos as $video) {
        if ($counter_doc == 3) {
            echo "\t\t\t</tr><tr>\n";
            $counter_doc = 1;
        }
        ?>
			
				<td><b><a href="#" onclick="insertDocument('video:<?php 
        echo $video->slug;
        ?>
', '{{', '{{'); return false;"><?php 
Beispiel #20
0
 function remove_from_content()
 {
     // Not Done or Tested yet
     // A function to cycle through content types and remove references when deleting a video
     $videoPattern = "/{{2}(video:[A-Za-z0-9\\-\\_ \\.\\(\\)'\"]+){{2}/";
     $videoIds = getFilterIds($content_to_display, $videoPattern);
     $videos = array();
     foreach ($videoIds as $videoId) {
         $videos[] = Videos::FindByName(end(explode(":", $videoId)));
     }
     foreach ($videos as $thevid) {
         if (is_object($thevid)) {
             $replacement = $thevid->get_embed();
             $content_to_display = updateContent($content_to_display, "/{{2}video:" . str_replace(")", "\\)", str_replace("(", "\\(", $thevid->name)) . "{{2}/", $replacement);
         } else {
             $content_to_display = "<span class=\"database_error\">HCd&gt;CMS Warning: Video not found!</span> " . $content_to_display;
         }
     }
     return $content_to_display;
 }
Beispiel #21
0
});
/*
|--------------------------------------------------------------------------
| Front-end  API Routes
|--------------------------------------------------------------------------
*/
# Authentication API
Route::controller('auth', 'RainAuthController');
# Tv Schedule API
Route::controller('tv', 'RainTvController');
# Home Page Index
Route::get('/', function () {
    $videoObj = new Videos();
    $responceData = $videoObj->getCurrentPlaylist();
    //dd($responceData);
    return View::make('frontend.home')->with('videos', json_encode($responceData));
});
# Video List
Route::get('/playlist', function () {
    $videoObj = new Videos();
    $responceData = $videoObj->getCurrentPlaylist();
    //dd($responceData);
    return Response::json($responceData);
});
# Get Last Video
Route::get('/lastPlayable', function () {
    $videoObj = new Videos();
    $responceData = $videoObj->getLastPlayableVideoDuration();
    //dd($responceData);
    return Response::json($responceData);
});
    $result['imagem'] = $r['imagem'];
    $result['descricao'] = $r['descricao'];
    echo json_encode($result);
}
//---------------------------------------------------------------------------------------------------------
// SALVAR EDIÇÃO
//---------------------------------------------------------------------------------------------------------
if ($act == 'Save Edit') {
    if ($videoUrl) {
        $imagem = '';
        $videoCod = '';
        $type = '';
        $vd = mysql_fetch_assoc(mysql_query("SELECT `imagem` FROM `videos` WHERE `id` = '{$idItem}' LIMIT 1"));
        $imgAnterior = $vd['imagem'];
        if (strpos($videoUrl, 'youtube')) {
            $videoCod = Videos::stripCodYoutube($videoUrl);
            $type = 'Yt';
        }
        if (@$_FILES['imagem']['size'] > 0) {
            require_once '../libs/Strings.class.php';
            require_once '../libs/NwdGD.2.class.php';
            require_once '../libs/Images.class.php';
            $imagem = Images::uploadImagens($_FILES['imagem'], '../../../images/videos/', explode('_', $imgvalues), 100);
        }
        $insert = mysql_query("UPDATE `videos` SET\n\t\t\t\t\t\t\t\t`pos` = '{$pos}',\n\t\t\t\t\t\t\t\t`videoUrl` = '{$videoUrl}', \n\t\t\t\t\t\t\t\t`videoCod` = '{$videoCod}',\n\t\t\t\t\t\t\t\t`type` = '{$type}',\n\t\t\t\t\t\t\t\t" . ($imagem || $remove_img ? "`imagem` = '{$imagem}'," : '') . "\n\t\t\t\t\t\t\t\t`titulo` = '{$titulo}',\n\t\t\t\t\t\t\t\t`descricao` = '{$descricao}'\n\t\t\t\t\t\t\t\t WHERE `id` = '{$idItem}' LIMIT 1");
        if ($insert) {
            UpdatePos::videos($idItem, $pos, $catid);
            $result = true;
            if ($imagem && @$imgAnterior || $remove_img) {
                @unlink('../../../images/videos/' . $imgAnterior);
            }
Beispiel #23
0
        $video = Videos::find($id);
        return View::make('backend.editvideo')->with('user', $user)->with('video', $video);
    });
    Route::post('/edit/{id}', array('uses' => 'RainTvController@postUpdatevideo'));
    # Admin Status Change Video;
    Route::get('/status/{status}/{id}', function ($status, $id) {
        $user = Sentry::getUser();
        $scObj = new Videos();
        $update = $scObj->changeStatus($id, $status, $user->id);
        $videos = Videos::get();
        return View::make('backend.listvideos')->with('videos', $videos);
    });
    # Admin Delete Video;
    Route::get('/delete/{id}', function ($id) {
        $user = Sentry::getUser();
        $scObj = new Videos();
        $update = $scObj->deleteData($id);
        $videos = Videos::get();
        return View::make('backend.listvideos')->with('videos', $videos);
    });
});
// Admin Panel | category
Route::group(array('before' => 'admin.login', 'prefix' => 'admin/category'), function () {
    # Admin Add category
    Route::get('/add', function () {
        $user = Sentry::getUser();
        return View::make('backend.category')->with('edit', false)->with('user', $user);
    });
    # Admin Edit category
    Route::get('/edit/{id}', function ($id) {
        $user = Sentry::getUser();
Beispiel #24
0
  

  $gYTSearch = isset($_GET['srch'])?$_GET['srch']:'';    

  if (strlen($gYTSearch) <= 0)
    $gYTSearch = isset($_POST['srch'])?$_POST['srch']:'';


  $gOutRecords = array();


  if (strlen($gYTSearch) >= 3)
  {
    $lHTML = file_get_html(Config::$YoutubeSearchVideoURL . urlencode($gYTSearch));
    $lVideo = new Videos();

    foreach($lHTML->find('div[class=yt-lockup-content] h3 a') as $lElement) 
    {
      if (strlen($lElement->href) > 0 && strlen($lElement->title) > 0)
      {
        if (!preg_match(Config::$YoutubeIgnoreResultRegex, $lElement->title))
        {
          $lYTID = Youtube::extractYTID($lElement->href);
          $lYTTitle = preg_replace('/[\'\"\`\=\&\%\'\+]+/', ' ', $lElement->title);
          $lYTTitle = preg_replace('/\s{2,}/', ' ', $lYTTitle);

          if (Youtube::validYoutubeID($lYTID))
          {
            $lRec =  " {\n";
            $lRec .= "    \"ytid\": \"$lYTID\",\n";
Beispiel #25
0
    $lResult = $lDB->getResult();
    $lDB->disconnect();


    if (array_key_exists('ID', $lResult) && array_key_exists('DataContainer', $lResult))
    {
      $lID = $lResult['ID'];
      $lVideoID = $lResult['VideoID'];
      $lStatus = $lResult['Status'];
      $lStatusStr = Videos::$Status[$lStatus];
      $lDescr = $lResult['Description'];
      $lDataContainer = $lResult['DataContainer'];


      $lFile = new Files();
      $lFile->downloadFile($gUID, $lDataContainer);

      # Remove file and DB entry
      $lFile->removeFile($gUID, $lDataContainer);

      $lVideos = new Videos();
      $lVideos->removeVideo($lID);
    }
    else
    {
      Log::writeLog(1, $_SERVER["SCRIPT_NAME"], "User with ID $gUID can't download $gVID");
    }
  }

?>
Beispiel #26
0
function display_page_content()
{
    // Double check that the proper columns exist
    $video_id = find_db_column('photos', 'video_id');
    if (!$video_id) {
        echo '<h2 class="system-warning"><span>HCd&gt;CMS says:</span> The Photos table does not have a column called "video_id"</h2>';
    }
    $add_video = requestIdParam() == "add" ? true : false;
    if ($add_video) {
        $video = $videotitle = $videoservice = $videoembed = $videowidth = $videoheight = $videoposter = $attached_item = null;
    } else {
        $video_id = requestIdParam();
        $video = Videos::FindById($video_id);
        $videotitle = $video->get_title();
        $videoservice = $video->service;
        $videoembed = $video->embed;
        $videowidth = $video->width;
        $videoheight = $video->height;
        if ($video_id) {
            $possibleposter = Photos::FindVideoPoster($video_id);
            $videoposter = !empty($possibleposter) ? $possibleposter : null;
        }
    }
    ?>

	<script type="text/javascript">
		$().ready(function() {
			$("#edit_video").validate({
				rules : {
					title: "required", 
					embed: "required"
				},
				messages: {
					title: "Please enter a title for this video", 
					embed: "Please enter an embed code for this video"
				}
			});
		});
	</script>
	
	<div id="edit-header" class="videonav">
		<h1><?php 
    if ($add_video) {
        echo 'Add';
    } else {
        echo 'Edit';
    }
    ?>
 Video</h1>
	</div>
	
	<form method="POST" id="edit_video" enctype="multipart/form-data">
		
		<p class="display_name">
			<label for="title">Video Display Name:</label>
			<?php 
    textField("title", $videotitle, "required: true");
    ?>
<br />
			<span class="hint">This name should match the name you use on the embedding service source (YouTube or Vimeo), but it does not have to.</span>
		</p>
		
		<div class="column half">
    		<p><label for="service">Hosting Service:</label>
    			<select id="service" name="service">
    				<option value="youtube"<?php 
    if (!empty($video)) {
        if ($video->service == 'youtube') {
            echo ' selected';
        }
    }
    ?>
>YouTube</option>
    				<option value="vimeo"<?php 
    if (!empty($video)) {
        if ($video->service == 'vimeo') {
            echo ' selected';
        }
    }
    ?>
>Vimeo</option>
    			</select><br />
    			<span class="hint">Only two are supported at this time &mdash; YouTube is the default service.</span>
    		</p>
    		<p>
    			<label for="embed">Unique ID:</label>
    			<?php 
    textField("embed", $videoembed, "required: true");
    ?>
<br />
    			<span class="hint">The unique identifier is a random string of numbers and letters associated with the file. <br />
    			YouTube example: http://www.youtube.com/embed/<mark>tVUCsnMK18E</mark> <br />
    			Vimeo example: http://player.vimeo.com/video/<mark>72632269</mark> <br />
    			In both cases, we are only interested in the text highlighted.</span>
    		</p>
		</div>
		
		<div class="column half last">
    		<div class="column half">
        		<p>
        		    <label for="width">Video Width:</label>
        		    <?php 
    textField("width", $videowidth);
    ?>
        		</p>
    		</div>
    		<div class="column half last">
        		<p>
        		    <label for="height">Video Height:</label>
        		    <?php 
    textField("height", $videoheight);
    ?>
        		</p>
    		</div>
    		<div class="clearit"></div>
    		<p class="hint">With responsive design, the width may be set to 100% by the templates, so that number may not always be used</p>
    		
    		<?php 
    if ($video_id) {
        ?>
    		<!-- Video poster image -->
    		<p><label for="new_poster">Add/Edit a Poster image:</label>
				<input type="file" name="new_poster" id="new_poster" value="" />
			</p>
			<p class="hint">A poster image may be used by your site to display a link to a pop up video player. </p>
			<?php 
        if (!is_null($videoposter)) {
            echo '<h3>Existing Poster Image</h3>';
            echo '<p><img src="' . $videoposter->getPublicUrl() . '" style="max-width:100%;" alt=""></p>';
        }
        ?>
			<?php 
    }
    ?>
			
		</div>
		<div class="clearleft"></div>
		
<?php 
    // Show an attached Item if there is one.
    if (is_object($video)) {
        $attached_gallery = $video->getGallery();
        $attached_item = is_object($attached_gallery) ? $attached_gallery->get_item() : null;
    }
    if (is_object($attached_item)) {
        $section = array_shift($attached_item->getSections());
        echo '<h2>This video is attached to this Portfolio Item:</h2>';
        echo '<ol id="video_list" class="managelist">';
        echo '<li><a href="' . get_link("admin/portfolio_edit/" . $section->name . "/" . $attached_item->id) . '">' . $attached_item->get_title() . ' <small>EDIT</small></a></li>';
        echo '</ol>';
    }
    ?>
		
		<div id="edit-footer" class="videonav clearfix">
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Save Video" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Save and Return to List" />
				</p>
				
			</div>
			<div class="column half last">
<?php 
    $user = Users::GetCurrentUser();
    if ($user->has_role() && requestIdParam() != "add") {
        ?>
	
				<p><label for="delete">Delete this video?</label>
					<input name="delete" class="boxes" type="checkbox" value="<?php 
        echo $video->id;
        ?>
" />
					<span class="hint">Check the box and then click &ldquo;Save&rdquo; above to delete this video from the database</span>
				</p>
<?php 
    }
    ?>
			</div>
		</div>
	
	</form>
<?php 
}
 public function getVerVideos($id, $item)
 {
     $video = Videos::find($id);
     $archivo = '/home/corazonperuano/uploads/' . $video->archivo . '.' . $video->extension;
     $itemArchivo = $item . '.' . $video->extension;
     if (file_exists($archivo)) {
         $headers = array('Content-type' => 'video/' . $video->extension, 'Content-Disposition' => 'inline; filename=' . $itemArchivo);
         return Response::make(file_get_contents($archivo), 200, $headers);
     }
 }
$users_address_array = $users->returnAllUsersAddresss();
$users_type_array = $users->returnAllUsersTypes();
$courses = new Courses();
$courses_id_array = $courses->returnAllCoursesIds();
$courses_name_array = $courses->returnAllCoursesName();
$courses_type_array = $courses->returnAllCoursesTypes();
$courses_price_array = $courses->returnAllCoursesPrices();
$courses_introduction_array = $courses->returnAllCoursesIntroductions();
$courses_time_array = $courses->returnAllCoursesTimes();
$news = new News();
$news_id_array = $news->returnAllNewsIds();
$news_title_array = $news->returnAllNewsTitles();
$news_content_array = $news->returnAllNewsContents();
$news_date_array = $news->returnAllNewsDates();
$contact = new Contact();
$contactUs = $contact->returnAllContactUsContent();
$about = new About();
$aboutUs = $about->returnAllAboutContent();
$videos = new Videos();
$videos_id_array = $videos->returnAllVideosIds();
$videos_title_array = $videos->returnAllVideosTitles();
$videos_link_array = $videos->returnAllVideosLinks();
$videos_time_array = $videos->returnAllVideosTimes();
$basic_info = new Basic_info();
$basic_info_web_name = $basic_info->returnAllWebName();
$basic_info_web_title = $basic_info->returnAllWebTitle();
$basic_info_web_domain = $basic_info->returnAllWebDomain();
$contactUs = new Contact();
$contactUs_content = $contactUs->returnAllContactUsContent();
$aobutUs = new About();
$aboutUs_content = $aobutUs->returnAllAboutContent();