<!DOCTYPE HTML>
<html>
	<head>
		<title><?=$this->Opt('website_title')?></title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="description" content="" />
		<meta name="keywords" content="" />
		<link rel="stylesheet" href="template/css/main.css" />
		<link rel="stylesheet" href="template/css/alertboxes.css" />
		<script src="template/js/alertboxes.js"></script>
		<meta name="viewport" content="width=device-width, initial-scale=1" /> 
		<link rel="shortcut icon" href="template/img/favicon.ico" type="image/x-icon" />
	</head>
	<body>
		<a href="./"><h1 class="logo"><?=$this->Opt('big_title')?></h1></a>
			<?php
			echo $this->ShowMsg();
			
			switch($this->Page()){
				default:
				$this->Open('template/pages/home.php');
				break;
				
				case "file":
				$info = false;
				if(isset($_GET['f'])){
					$info = $this->Valid($_GET['f']);
				}
				
				if($info == false){
					header("Location: ./");
				}else{
					include 'template/pages/v.php';
				}
				
				break;
				
				case "myfiles":
				include 'template/pages/myfiles.php';
				break;
				
				case "remove_file":
				$info = false;
				
				if(isset($_GET['hash']))
				{
					$info = $this->ValidRemoveHash($_GET['hash']);
				}
				
				if($info == false){
					header("Location: ./");
				}else{
					$check = $this->removePOST();
					
					echo $this->ShowMsg();
					
					if($check === true)
					{
						unlink('uploads/'.$info['filename']);
						mysql_query("DELETE FROM box_files WHERE removeHash = '".$info['removeHash']."' ;");
						header('Location: ./');
					}
					
					include 'template/pages/remove_file.php';
				}
				
				break;
			}
			
			?>
        <script src="template/js/jquery-1.9.1.min.js" type="text/javascript"></script>
        <script src="template/js/jquery.easing.min.js" type="text/javascript"></script>
        <script src="template/js/main.js"></script>
		<script>
		var counter = 1;
 
        $("#addButton").click(function () {
       
	    if(counter>=<?=$this->Opt('max_emails')?>){
                alert("Only <?=$this->Opt('max_emails')?> emails allow!");
                return false;
	    }   
       
	    var newTextBoxDiv = $(document.createElement('div'))
	         .attr("id", 'TextBoxDiv' + counter);
       
	    newTextBoxDiv.after().html('<input type="text" name="emails[]" style="text-align:center;" placeholder="SEND VIA EMAIL (OPTIONAL)">');
       
	    newTextBoxDiv.appendTo("#TextBoxesGroup");
       
       
	    counter++;
         });
       
       
         $("#removeButton").click(function () {
	       if(counter==1){
              alert("No more textbox to remove");
              return false;
           }   
       
	       counter--;
       
            $("#TextBoxDiv" + counter).remove();
       
        });
	 </script>
	</body>
</html>