<!DOCTYPE html>
<html>
  <head>
    <title>Upload multiple files</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <style type="text/css">
      img {border-width: 0}
      * {font-family:'Lucida Grande', sans-serif;}
    </style>
    <style>
.style1 {border-top: solid 1px;border-top-color: #A8A8A8;border-bottom: solid 1px;border-bottom-color: #A8A8A8;}
.style5 {border-left: solid 1px;border-left-color: #A8A8A8;}
.style3{ border-right: solid 1px;border-right-color: #A8A8A8; }
.style4 {border-bottom: solid 1px;border-bottom-color: #A8A8A8;}
.text{ font-family: Verdana; font-size:13px;}
</style>
    <link href="../../css/uploadfilemulti.css" rel="stylesheet">
<script src="../../js/jquery/jquery.fileuploadmulti.min.js"></script>
<link rel="stylesheet" href="../../css/ace.min.css" id="main-ace-style" />

  </head>
  <body>
     
     <br><br>
     <b>Multiple Files Upload:</b><br><br>
<div align="right" id="mulitplefileuploader">Browse</div>

<div id="status"></div><br><br>
<div align="center">
<button type="button" name="submit" id="close_button" class="btn btn-danger btn-xls" onClick="close_pop()"  >Close</button>
</div>
<p>
<script>
function file_upload(url)
	{
	new_popup= window.open(url,'new_popup','height=600,width=1000,scrollbars=yes,resizable=no,left=420,top=190,toolbar=no,location=no,directories=no,status=no,menubar=no');
	}
	
	
function sample_file_delete(id,order_no,random_no,random_sc)
{
	//alert("id="+id+"&order_no="+order_no+"&random_no="+random_no+"&random_sc="+random_sc+"&action=del_file_upld");
	if(confirm('Are You Sure! You Want To Delete?'))
	{
		jQuery.ajax({
		type: "POST",
		url: "sample_entry_db.php",
		data: "id="+id+"&order_no="+order_no+"&random_no="+random_no+"&random_sc="+random_sc+"&action=del_file_upld",
		success: function(msg){jQuery("#sample_file_upload_div").html(msg);
		window.location.reload(true);
	}
	});
    }
}
</script>
  <?php 
   include("../../include/db.php"); 

$order_no= $_GET['job_card_no']; 
$customer_name= $_GET['customer_name']; 
?>
</p>
<div id="file_upload_div">
<?php include("file_upload_subllist.php"); ?>
</div>
<p>&nbsp;</p>
<p>&nbsp; </p>
<script>
$(document).ready(function()
{
    var settings = {
    url: "file_upload_db.php?order_no=<?php echo $order_no;?>&customer_name=<?php echo $customer_name;  ?>&random_no=<?php echo $_GET['random_no']; ?>&random_sc=<?php echo $_GET['random_sc']; ?>",	
    method: "POST",
	allowedTypes:"jpg,png,gif,doc,docx,pdf,zip,txt",
	fileName: "myfile",
	multiple: true,
	onSuccess:function(files,data,xhr)
	{
	  $("#status").html("<font color='green'>Uploaded Successfully</font>");
	 // window.location.reload(true);
	  alert("Uploaded Successfully");
	},
    afterUploadAll:function()
    {
    },
	onError: function(files,status,errMsg)
	{		
		$("#status").html("<font color='red'>Upload is Failed</font>");
		  alert("Upload is Failed");
	      window.location.reload(true);

	}
}
$("#mulitplefileuploader").uploadFile(settings);
});

function close_pop()
{
jQuery("#file_upload_divs").html();
window.close();
//window.opener.location.reload(true);

//jQuery("#purchase_file_upload_div1").load(location.href + "#purchase_file_upload_div1");
//      $("#purchase_file_upload_div").html("result reloaded successfully");
//window.location.href = 'purchase_entry/purchase_entry_form.php'; 
}

$(document).ready(function(){
$("#close_button").click(function(){
$("#purchase_file_upload_div1").html(ajax_load).load(loadUrl);
window.close();
});
});
  </script>
</body>
</html>