[789] | 1 | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
---|
| 2 | |
---|
| 3 | |
---|
| 4 | class Preview extends MX_Controller |
---|
| 5 | { |
---|
| 6 | |
---|
[872] | 7 | public function __construct() { |
---|
[789] | 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 | |
---|
[807] | 15 | public function getFilePreview () { |
---|
[803] | 16 | $fileId = $this->uri->segment(4); |
---|
[789] | 17 | $data = $this->vservices->getPreview($fileId); |
---|
[790] | 18 | $data= json_decode($data,true); |
---|
[803] | 19 | $data['fileId']=$fileId; |
---|
[790] | 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 | { |
---|
[789] | 26 | $this->load->view('preview/index', $data); |
---|
[790] | 27 | } |
---|
[789] | 28 | } |
---|
[807] | 29 | public function getVideoPreview () { |
---|
| 30 | $data=$this->input->post(); |
---|
[816] | 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; |
---|
[807] | 36 | $this->load->view('preview/video', $data); |
---|
| 37 | |
---|
| 38 | } |
---|
[789] | 39 | |
---|
| 40 | } |
---|
| 41 | |
---|
| 42 | /* End of file privatecontent.php */ |
---|
| 43 | /* Location: ./application/modules/ajax/controllers/privatecontent.php */ |
---|