View file iblog/admin/themes.php

File size: 6.91Kb
<?php 
	include "../lib/functions_class.php"; 
	include "inc/check_session.php"; 
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>iBlog | Themes </title>
	
	<!-- FAVICONS -->
    <link rel="shortcut icon" href="../uploads/favicon/<?php echo $DB->get_settingdata('favicon');?>" type="image/x-icon">
	
    <!-- Bootstrap -->
    <link href="plugins/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <!-- iCheck -->
    <link href="plugins/iCheck/skins/flat/green.css" rel="stylesheet">
	
	<!-- JqueryUi -->
    <link href="plugins/jquery.ui/jquery-ui-1.9.2.custom.css" rel="stylesheet">
	
	<!-- Alert, Info, Confirm Plugin -->
    <link href="plugins/lobibox/lobibox.min.css" rel="stylesheet">
	
    <!-- bootstrap-progressbar -->
    <link href="plugins/bootstrap-progressbar/css/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet">
    <!-- jVectorMap -->
    <link href="css/maps/jquery-jvectormap-2.0.3.css" rel="stylesheet"/>

    <!-- Custom Theme Style -->
    <link href="css/custom.css" rel="stylesheet">
	
  </head>

  <body class="nav-md">
    <div class="container body">
      <div class="main_container">
 

            <?php include "inc/header.php";?>
			

        <?php include "inc/top_nav.php";?>
		
        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
              <div class="title_left">
                <h3><li class="fa fa-home"></li>Home / Themes</h3>
              </div>
            </div>
            <div class="clearfix"></div>

            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
				<div class="col-md-1 col-sm-12 col-xs-12">
						<select class="form-control" name="rowlimit" id="rowlimit">
							<option value="10">10</option>
							<option value="20">20</option>
							<option value="50">50</option>
							<option value="100">100</option>
						</select>
					</div><br><br>
			  
				<div class="x_panel" style="height:100%;">
                  <div class="x_content">
						<form action="controller/themes_ajax.php" method="post" enctype="multipart/form-data">
							<input type="file" id="file" name="file">
							<input type="submit" value="Upload Theme">
						</form>
						
						<div class="progress hidden">
							<div class="bar"></div >
							<div class="percent">0%</div >
						</div>
						<div id="status"></div>
                  </div>
                </div>
				
                <div class="x_panel" style="height:100%;">
				  
                  <div class="x_content">
                   
						<div id="themes_tbl"></div>
							
                  </div>
				  
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- /page content -->
		
		<div id="dialog" title="Confirmation Required" style="display:none;">
			Are you sure , You want to delete?
		</div>
		
		<?php include "inc/footer.php";?>
		
      </div>
    </div>

    <!-- jQuery -->
    <script src="plugins/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="plugins/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="plugins/fastclick/lib/fastclick.js"></script>
	
	<!-- Date Picker -->
	<script src="js/moment/moment.min.js"></script>
	<script src="js/datepicker/daterangepicker.js"></script>
	
    <!-- NProgress -->
    <script src="plugins/nprogress/nprogress.js"></script>
    <!-- iCheck -->
    <script src="plugins/iCheck/icheck.min.js"></script>
	
	<!-- Alert, Info Or Confirm Plugin -->
    <script src="plugins/lobibox/lobibox.js"></script>
	
	<!-- JqueryUI -->
    <script src="plugins/jquery.ui/jquery-ui-1.9.2.custom.js"></script>
    
    <!-- Form J.S -->
    <script src="js/jquery.form.js"></script>
	
	<!-- Custom Theme Scripts -->
    <script src="js/custom.js"></script>
	
	
	<script>
	$(document).ready(function() {
		themes_tbl();
		$('input[type="submit"]').prop('disabled', true);
	});
	
	//To Load Table
	function themes_tbl(){
		var rowlimit = $("#rowlimit").val();
		$("#themes_tbl").html("<center><img src='images/loading.gif'></center>");
		$.post("tables/themes_tbl.php",{rowlimit:rowlimit},function(data){
			$("#themes_tbl").html(data);
		});
	}
	
	$("#rowlimit").on('change',function(){
		themes_tbl();
	});
	
	$("#file").on('change',function(){
		var file = $(this).val();
		if(file == ''){
			$('input[type="submit"]').prop('disabled', true);
		}else{
			$('input[type="submit"]').prop('disabled', false);
		}
	});
	
	//Next And Previous Page
	$('#themes_tbl').on('click','.clickpage',function(e){
		e.preventDefault();
		
		var rowlimit = $("#rowlimit").val();
		//Get Page ID
		$page = $(this).attr('href');
		$pageind = $page.indexOf('page=');
		$page = $page.substring(($pageind+5));
		
		//alert($page);
		$.post("tables/themes_tbl.php",{
			page:$page,
			rowlimit:rowlimit,
			},function(data){
				$("#themes_tbl").html(data);
		});
	});
	
	//Active Themes
	function active(id){
		var message = "Theme Applied successfully";
		$.post("controller/themes_ajax.php",{
				action:'active',
				id:id,
				},function(data){
					themes_tbl();
					Lobibox.alert('info', {msg: message});
			});
			
	}

	//Delete
	function deleted(id,name){
		var message = "Theme Deleted Sucessfully.";
		$.post("controller/themes_ajax.php",{
				action:'delete',
				id:id,
				name:name,
				},function(data){
					themes_tbl();
					Lobibox.alert('info', {msg: data});
			});
			
	}
	
	  //Dilaog Delete Function
	  function deldialog(id,name){
		$("#dialog").dialog({
		  show: 'explode',
		  hide: 'fold',
		  buttons : {
			"Confirm" : function() {
			  deleted(id,name);
			  $(this).dialog("close");
			},
			"Cancel" : function() {
			  $(this).dialog("close");
			}
		  }
		});

		$("#dialog").dialog("open");
	  }
	  
	////////////////////////////////
	(function() {

		var bar = $('.bar');
		var percent = $('.percent');
		var status = $('#status');
		   
		$('form').ajaxForm({
			beforeSend: function() {
				status.empty();
				var percentVal = '0%';
				bar.width(percentVal)
				percent.html(percentVal);
				$(".progress").removeClass("hidden");
			},
			uploadProgress: function(event, position, total, percentComplete) {
				var percentVal = percentComplete + '%';
				bar.width(percentVal)
				percent.html(percentVal);
			},
			success: function() {
				var percentVal = '100%';
				bar.width(percentVal)
				percent.html(percentVal);
			},
			complete: function(xhr) {
				status.html(xhr.responseText);
				themes_tbl();
				$('input[type="file"]').val('');
				$('input[type="submit"]').prop('disabled', true);
			}
		}); 

	})();
	  
	
	</script>
  </body>
</html>