source: pro-violet-viettel/www/deploy/20150304/application/modules/ajax/controllers/preview.php

Last change on this file was 872, checked in by quyenla, 10 years ago

preview

File size: 1.4 KB
Line 
1<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2
3
4class Preview extends MX_Controller
5{
6
7        public function __construct() {
8                parent::__construct();
9                $user = $this->session->userdata ( 'userInfo' );
10                $this->vservices->setApiUrl($this->config->item('api_url'));
11                $this->vservices->setConnection($this->curl);
12                $this->vservices->setUserId($user['us_id']);
13        }
14       
15        public function getFilePreview () {
16            $fileId =  $this->uri->segment(4);
17            $data = $this->vservices->getPreview($fileId);
18            $data=  json_decode($data,true);
19            $data['fileId']=$fileId;
20            if ($data['total']==0)
21            {
22                echo "Chế độ xem trước khÃŽng khả dụng, vui lòng tải xuống để xem";
23            }
24            else
25            {
26            $this->load->view('preview/index', $data);
27            }
28        }
29        public function getVideoPreview () {
30            $data=$this->input->post();
31            $fileName = $data['fileurl'];
32            $fileNames = explode("/", $fileName);
33            $name=$fileNames[(count($fileNames)-1)];
34            $fileName = str_replace($name, "", $fileName).  str_replace("+","%20",urlencode($name));
35            $data['fileurl']=$fileName;
36            $this->load->view('preview/video', $data);
37           
38        }
39
40}
41
42/* End of file privatecontent.php */
43/* Location: ./application/modules/ajax/controllers/privatecontent.php */
Note: See TracBrowser for help on using the repository browser.