Index: /pro-violet-viettel/www/deploy/20150304/application/modules/ajax/controllers/download.php
===================================================================
--- /pro-violet-viettel/www/deploy/20150304/application/modules/ajax/controllers/download.php	(revision 831)
+++ /pro-violet-viettel/www/deploy/20150304/application/modules/ajax/controllers/download.php	(revision 831)
@@ -0,0 +1,33 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+
+class Download extends MX_Controller 
+{
+
+	public function __construct() {
+		parent::__construct();
+                $user = $this->session->userdata ( 'userInfo' );
+		$this->vservices->setApiUrl($this->config->item('api_url'));
+		$this->vservices->setConnection($this->curl);
+		$this->vservices->setUserId($user['us_id']);
+	}
+	
+	public function getFile () {
+                $file = $this->config->item('api_url').'uploads/space/3/3854/1.JPG';
+                header('Content-Description: File Transfer');
+                header('Content-Type: application/octet-stream');
+                header('Content-Disposition: attachment; filename='.basename($file));
+                header('Expires: 0');
+                header('Cache-Control: must-revalidate');
+                header('Pragma: public');
+                header('Content-Length: ' . filesize($file));
+                readfile($file);
+                exit;
+            
+	}
+       
+
+}
+
+/* End of file privatecontent.php */
+/* Location: ./application/modules/ajax/controllers/privatecontent.php */
Index: /pro-violet-viettel/www/deploy/20150304/application/modules/ajax/views/preview/index.php
===================================================================
--- /pro-violet-viettel/www/deploy/20150304/application/modules/ajax/views/preview/index.php	(revision 830)
+++ /pro-violet-viettel/www/deploy/20150304/application/modules/ajax/views/preview/index.php	(revision 831)
@@ -5,5 +5,5 @@
         { 
         ?>
-    <a href="http://sbgapi.violet.vn/<?php echo $folder."/".$i;?>.png"><img src="http://sbgapi.violet.vn/<?php echo $folder."/".$i;?>.png" title="Trang <?php echo ($i+1);?>" alt="Trang <?php echo ($i+1);?>"></a>
+    <a href="<?php echo $this->config->item('api_url').$folder."/".$i;?>.png"><img src="<?php echo $this->config->item('api_url').$folder."/".$i;?>.png" title="Trang <?php echo ($i+1);?>" alt="Trang <?php echo ($i+1);?>"></a>
     <?php
     }?>
Index: /pro-violet-viettel/www/deploy/20150304/application/modules/frontend/views/lecture_editor.php
===================================================================
--- /pro-violet-viettel/www/deploy/20150304/application/modules/frontend/views/lecture_editor.php	(revision 830)
+++ /pro-violet-viettel/www/deploy/20150304/application/modules/frontend/views/lecture_editor.php	(revision 831)
@@ -118,5 +118,5 @@
     var us_id="<?php echo $us_id;?>";
     var is_overdate = <?php echo $isOverDate;?>;
-    var fileid = <?php echo $fileid;?>;
+    var fileid = "<?php echo $fileid;?>";
 
 </script>		
Index: /pro-violet-viettel/www/deploy/20150304/application/views/layout/header.php
===================================================================
--- /pro-violet-viettel/www/deploy/20150304/application/views/layout/header.php	(revision 830)
+++ /pro-violet-viettel/www/deploy/20150304/application/views/layout/header.php	(revision 831)
@@ -11,5 +11,7 @@
 <link rel="stylesheet" href="<?php echo base_url();?>assets/css/style2.css" />
 <script src="<?php echo base_url();?>assets/js/jwplayer.js" ></script> 
-
-                <script>jwplayer.key="0Wkdd5AMtD70O47y3hnZXqCG9CjnX1csi7+foQ==";</script>
-	</head>
+<script>jwplayer.key="0Wkdd5AMtD70O47y3hnZXqCG9CjnX1csi7+foQ==";</script>
+<script type="text/javascript">
+    var api_url = "<?php echo $this->config->item('api_url'); ?>";
+</script>
+</head>
Index: /pro-violet-viettel/www/deploy/20150304/assets/js/frontend/lecture.js
===================================================================
--- /pro-violet-viettel/www/deploy/20150304/assets/js/frontend/lecture.js	(revision 830)
+++ /pro-violet-viettel/www/deploy/20150304/assets/js/frontend/lecture.js	(revision 831)
@@ -9,18 +9,18 @@
 if (p_period == -1 && is_overdate == 1)
 {
-	$('#alert-trial-services').modal('show');
-	$('#alert-trial-services').on('hidden.bs.modal', function () {
-		if (update_user_info == "1")
-		{
-			$('#update_user_info').modal({backdrop: 'static',keyboard: false,});
-		}
-	}); 
+    $('#alert-trial-services').modal('show');
+    $('#alert-trial-services').on('hidden.bs.modal', function () {
+        if (update_user_info == "1")
+        {
+            $('#update_user_info').modal({backdrop: 'static', keyboard: false, });
+        }
+    });
 }
 else
 {
-	if (update_user_info == "1")
-	{
-		$('#update_user_info').modal({backdrop: 'static'});
-	}
+    if (update_user_info == "1")
+    {
+        $('#update_user_info').modal({backdrop: 'static'});
+    }
 }
 
@@ -54,5 +54,5 @@
     console.log('Show modal!');
     $('#alert-services-package').modal('show');
-	//$('#alert-services-package-bk').modal('show');
+    //$('#alert-services-package-bk').modal('show');
 }
 
@@ -124,11 +124,11 @@
 }
 
-function DoCloseLecture () {
-	g_Flash.SetVariable("command", "Quit App");		
-}
-
-function getLectureState () {
-	var state = g_Flash.GetVariable("dataChanged");
-	return state == 'true' ? true: (state == 'false' ? false:false);
+function DoCloseLecture() {
+    g_Flash.SetVariable("command", "Quit App");
+}
+
+function getLectureState() {
+    var state = g_Flash.GetVariable("dataChanged");
+    return state == 'true' ? true : (state == 'false' ? false : false);
 }
 
@@ -174,27 +174,28 @@
 
 $(document).ready(function () {
-      InitViolet();
-    if(fileid!="")
-    { 
-        console.log('http://sbgapi.violet.vn/space/file/id/'+fileid);
-    DoOpenLecture('http://sbgapi.violet.vn/space/file/id/'+fileid);
-    } 
-        var inFormOrLink = false;
-
-	$(window).on('beforeunload', function() {
-		var e = $.Event('webapp:page:closing');
-		$(window).trigger(e); // let other modules determine whether to prevent closing
-		if(e.isDefaultPrevented()) {
-			return e.message;
-		}
-	});
-
-	$(window).on('webapp:page:closing', function(e) {
-		if(getLectureState()) {
-			e.preventDefault();
-			e.message = 'Báº¡n Äang soáº¡n bÃ i giáº£ng vÃ  chÆ°a lÆ°u dá»¯ liá»u. Báº¡n cÃ³ muá»n chuyá»n khá»i á»©ng dá»¥ng khÃŽng?';
-		}
-	});
-
+    InitViolet();
+    var inFormOrLink = false;
+
+    $(window).on('beforeunload', function () {
+        var e = $.Event('webapp:page:closing');
+        $(window).trigger(e); // let other modules determine whether to prevent closing
+        if (e.isDefaultPrevented()) {
+            return e.message;
+        }
+    });
+
+    $(window).on('webapp:page:closing', function (e) {
+        if (getLectureState()) {
+            e.preventDefault();
+            e.message = 'Báº¡n Äang soáº¡n bÃ i giáº£ng vÃ  chÆ°a lÆ°u dá»¯ liá»u. Báº¡n cÃ³ muá»n chuyá»n khá»i á»©ng dá»¥ng khÃŽng?';
+        }
+    });
+    setTimeout(function () {
+        if (fileid != "")
+        {
+            DoOpenLecture(api_url+'space/file/id/' + fileid);
+        }
+
+    }, 1000);
 })
 
Index: /pro-violet-viettel/www/deploy/20150304/assets/js/manager.js
===================================================================
--- /pro-violet-viettel/www/deploy/20150304/assets/js/manager.js	(revision 830)
+++ /pro-violet-viettel/www/deploy/20150304/assets/js/manager.js	(revision 831)
@@ -442,5 +442,5 @@
                     var promptOptions = {
                         title: "Táº£i lÃªn",
-                        message: "<form id='upload' method='post'  action='http://sbgapi.violet.vn/space/upload' enctype='multipart/form-data'><div id='drop'>KÃ©o tháº£ tá»p vÃ o ÄÃ¢y <a> Chá»n tá»p </a><input type='hidden' name='response' value='1'/><input type='hidden' name='dir' value='" + self.getTreeCurrentNode() + "'/><input type='hidden' name='userid' value='"+userid+"'/><input type='file' name='upload_file' multiple /></div><ul></ul></form>",
+                        message: "<form id='upload' method='post'  action='"+api_url+"space/upload' enctype='multipart/form-data'><div id='drop'>KÃ©o tháº£ tá»p vÃ o ÄÃ¢y <a> Chá»n tá»p </a><input type='hidden' name='response' value='1'/><input type='hidden' name='dir' value='" + self.getTreeCurrentNode() + "'/><input type='hidden' name='userid' value='"+userid+"'/><input type='file' name='upload_file' multiple /></div><ul></ul></form>",
                         buttons: {
                             success: {
@@ -481,5 +481,5 @@
                     }
                    
-                    if($.inArray( $ext, [ "flv", "mp4","avi"])>=0)
+                    if($.inArray( $ext, [ "flv", "mp4","avi","m4v"])>=0)
 		   { 
                         $.ajax({
