<style type="text/css">
body {
	font: 13px Arial, Helvetica, Sans-serif;
}
.uploadifive-button {
	float: left;
	margin-right: 10px;
}
#queue {
	border: 1px solid #E5E5E5;
	height: 177px;
	overflow: auto;
	margin-bottom: 10px;
	padding: 0 3px 3px;
	width: 300px;
}
</style>

<div class="row">
    <div class="col-lg-12" style="margin-top:-41px;margin-bottom:-13px;">
        <h1 class="page-header" style="font-size:19px; color:#09F;"><i class="fa fa-user fa-fw"></i>&nbsp;Gallery</h1>
    </div>
    <!-- /.col-lg-12 -->
</div>
<!-- Row -->
<?php
	$pro_id=$_GET['pro_id'];	
?> 

 <script type="text/javascript">
 	
		$(function() {
			$('#file_upload').uploadifive({
				'auto'         : false,
				'multi'		: true,
				'formData'     : {'test' : 'something'},
				'queueID'      : 'queue',
				'uploadScript' : 'include/gallery/uploadifive.php',
				'onUploadComplete' : function(fileobj, data) {

					$.post("include/gallery/insert.php",{name : data, pro_id:<?php echo $pro_id; ?>}, function(info){
						window.location.href="?page=addgallery&pro_id=<?= $pro_id;?>";
					});
					
				}
			});
		});
	</script>   
<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default" style="width:100%;">
            <div class="panel-body">
                <div class="row">
                    <div class="col-lg-6" style="margin-bottom:20px;">
                        <form id="test" name="test" action="" method="post">
                            <div id="queue"></div>
                            <input id="file_upload" name="file_upload" type="file"/><br/>
                            <a href="javascript:$('#file_upload').uploadifive('upload')">
                            <input type="button" name="Upload" class="btn btn-primary" value="&nbsp;Upload&nbsp;" title="upload" style="margin-top:-25px; margin-left:20px;"/>
                            </a>
                        </form>
                    </div>
                </div>
            </div>
       </div>
   	</div>
</div>
<?php
	include('gallery_data.php');
?>