<?php
if (!defined("root")) {
	define("root", $_SERVER['DOCUMENT_ROOT']);
}
require(root."/___simple_config.php");
session_start();
require(root."/".adminFolder."/_common.php");
require(root."/".adminFolder."/_lib/db.php");
require(root."/".adminFolder."/_lib/main.php");
$formodule = trim(cekpost(cleanQuery($_GET["formodule"]), ""));
$kd = cekpost(cleanQuery($_GET["kd"]), "0");
$tipeform = cekpost(cleanQuery($_GET["tipeform"]), "");
$tipedata = cekpost(cleanQuery($_GET["tipedata"]), "");
#tipeform = 0=single file or 1=multiple files
#tipedata = 0=image or 1=others
?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8"/>
		<title>Mini Ajax File Upload Form</title>

		<!-- Google web fonts -->
		<link href="http://fonts.googleapis.com/css?family=PT+Sans+Narrow:400,700" rel='stylesheet' />

		<!-- The main CSS file -->
		<link href="assets/css/style.css?<?php echo time(); ?>" rel="stylesheet" />
	</head>

	<body>
		<form id="upload" method="post" action="upload.php?<?php echo '?tipeform='.$tipeform.'&tipedata='.$tipedata.'&kd='.$kd.'&formodule='.$formodule.''; ?>" target="frame_x" enctype="multipart/form-data">
			<div id="drop">
				Drop Here

				<a>Browse</a>
				<?php
				if ($formodule=="teachers") {
					$minw = 300; $minh = 300;
				}
				echo '<div style="font-size:15px;margin:5px;">Width: <em>'.$minw.'px</em> <br/> Height: <em>'.$minh.'px</em></div>';
				?>
				<input type="file" name="upl" multiple />
			</div>
			<ul>
				<!-- The file uploads will be shown here -->
			</ul>
		</form>
		<!--
		<footer>
            <h2><a href="http://tutorialzine.com/2013/05/mini-ajax-file-upload-form/"><i>Tutorial:</i> Mini Ajax File Upload Form</a></h2>
            <div id="tzine-actions">
            	
	            <a id="tzine-download" href="http://tutorialzine.com/2013/05/mini-ajax-file-upload-form/" title="Download This Example!">Download</a>
            </div>
        </footer>
        -->
		<!-- JavaScript Includes -->
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
		<script src="assets/js/jquery.knob.js"></script>

		<!-- jQuery File Upload Dependencies -->
		<script src="assets/js/jquery.ui.widget.js"></script>
		<script src="assets/js/jquery.iframe-transport.js"></script>
		<script src="assets/js/jquery.fileupload.js"></script>
		
		<!-- Our main JS file -->
		<script src="assets/js/script.js"></script>


		<!-- Only used for the demos. Please ignore and remove.
        <script src="http://cdn.tutorialzine.com/misc/enhance/v1.js" async></script>
		-->

	</body>
</html>