<?php 
session_start();
ob_start();
include("../../pidbco/pidbjoin.php");
$sujpath="./";
?>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Projects</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" href="<?php echo $sujpath; ?>bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="<?php echo $sujpath; ?>font-awesome/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="<?php echo $sujpath; ?>font-awesome/ionicons.min.css">
    <!-- DataTables -->
    <link rel="stylesheet" href="<?php echo $sujpath; ?>plugins/datatables/dataTables.bootstrap.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="<?php echo $sujpath; ?>dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="<?php echo $sujpath; ?>dist/css/skins/_all-skins.min.css">
   
    <link rel="stylesheet" type="text/css" href="tcal.css" />    
    <script type="text/javascript" src="tcal.js"></script>
    
    <script>
    function add_new_voucher() {
             var rcompany = $('#rcompany').val();
             var rbranch = $('#rbranch').val();
             var vvendr = $('#vvendr').val();
             var purch_num = $('#purch_num').val();
             var ramnt_type = $('#ramnt_type').val();
             var vamount = $('#vamount').val();
             var rcheque = $('#rcheque').val();
             var rbank = $('#rbank').val();
             var rdate = $('#rdate').val();
             var vremarks = $('#vremarks').val();
             
             var vaccounth = $('#vaccounth').val();
             var vsubhead1 = $('#vsubhead1').val();
             var vsubhead2 = $('#vsubhead2').val();
             
             if(rcompany == ''){
                alert("Select Company");   	
             } else if(rbranch == ''){
             	alert("Select Branch");
             } else if(vaccounth == ''){
             	alert("Select Account Head");
             } else if(ramnt_type == ''){
             	alert("Select Amount Type");
             } else if(vamount == ''){
             	alert("Enter Amount");
             }
             else {                    
                  $.ajax({
                    type: "POST",
                    url: "ajaxmarket.php",
                     data: {
                          add_new_voucher  : 1,
                          rcompany         : rcompany,
                          rbranch          : rbranch,
                          vvendr           : vvendr,
                          purch_num        : purch_num,
                          ramnt_type       : ramnt_type,
                          vamount          : vamount,
                          rcheque          : rcheque,
                          rbank            : rbank,
                          rdate            : rdate,
                          vremarks         : vremarks,
                          
                          vaccounth  : vaccounth,
                          vsubhead1  : vsubhead1,
                          vsubhead2  : vsubhead2                          
                     },
                     cache: true,
                     success: function(res23)
                     {
                     	   	$('#rcompany').val('');
                     	   	$('#rbranch').val('');
                     	   	$('#vvendr').val('');
                           	$('#purch_num').val('');
                           	$('#ramnt_type').val('');
                           	$('#vamount').val('');
                           	$('#rcheque').val('');
                           	$('#rbank').val('');
                           	$('#rdate').val('');
                            $('#vremarks').val('');   
                           	$("#marketingdiv123").load("voucher.php #marketingdiv123");   
                            datat2();                    
                      }
                   }); 
    	    } 	
    }


    	
    	
   function edit_news_voucher()
   {
             var rcompany = $('#rcompany').val();
             var rbranch = $('#rbranch').val();
             var vvendr = $('#vvendr').val();
             var purch_num = $('#purch_num').val();
             var ramnt_type = $('#ramnt_type').val();
             var vamount = $('#vamount').val();
             var rcheque = $('#rcheque').val();
             var rbank = $('#rbank').val();
             var rdate = $('#rdate').val();
             var vremarks = $('#vremarks').val();
             
             var vaccounth = $('#vaccounth').val();
             var vsubhead1 = $('#vsubhead1').val();
             var vsubhead2 = $('#vsubhead2').val();
             var hidvall = $('#hidvall').val();
           
             if(rcompany == ''){
                alert("Select Company");   	
             } else if(rbranch == ''){
             	alert("Select Branch");
             } else if(vaccounth == ''){
             	alert("Select Account Head");
             } else if(ramnt_type == ''){
             	alert("Select Amount Type");
             } else if(vamount == ''){
             	alert("Enter Amount");
             }
             else {    
             	  $.ajax({
                    type: "POST",
                    url: "ajaxmarket.php",
                     data: {
                          update_new_voucher : 1,
                          rcompany         : rcompany,
                          rbranch          : rbranch,
                          vvendr           : vvendr,
                          purch_num        : purch_num,
                          ramnt_type       : ramnt_type,
                          vamount          : vamount,
                          rcheque          : rcheque,
                          rbank            : rbank,
                          rdate            : rdate,
                          vremarks         : vremarks,
                          vaccounth        : vaccounth,
                          vsubhead1        : vsubhead1,
                          vsubhead2        : vsubhead2,
                          hidvall          : hidvall                          
                     },
                     cache: true,
                     success: function(res23)
                     {
                     	   	$('#rcompany').val('');
                     	   	$('#rbranch').val('');
                     	   	$('#vvendr').val('');
                           	$('#purch_num').val('');
                           	$('#ramnt_type').val('');
                           	$('#vamount').val('');
                           	$('#rcheque').val('');
                           	$('#rbank').val('');
                           	$('#rdate').val('');
                            $('#vremarks').val('');   
                           	$("#marketingdiv123").load("voucher.php #marketingdiv123");   
                            datat2();                    
                      }
                   }); 
    	    } 	      

   }
        
        
    	
    	    	
    	function delete_voucher(id)
    	{
    		var result = confirm("Want to delete?");
			if (result) 
			{
     		$.ajax({
			type: "POST",
			url: "ajaxmarket.php",
			data: {
			btn_delete_voucher : 1,
			id:id
			},
			cache: true,
			success: function(res)
			{
			      $("#marketingdiv123").load("voucher.php #marketingdiv123");
			      datat();
         	
			}  
			});
   			}
    	}
    	
    	
    	function edit_voucher(id)
    	{
    		$.ajax({
			type: "POST",
			url: "ajaxmarket.php",
			data: {
			btn_edit_market: 1,
			id:id
			},
			cache: true,
			success: function(res)
			{
			
	         	$("#marketingdiv2").load("voucher.php?idd2="+id+" #marketingdiv2"); 	
			}  
			});
    	}
    	
    	
function branch_change(str)
{
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("rbranch").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","ajaxmarket.php?comp_idd="+str,true);
xmlhttp.send();
}

function vend_change(str)
{
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("purch_num").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","ajaxmarket.php?vendr_idd="+str,true);
xmlhttp.send();
}

 function amount_type(amt_typ)
        {
         if(amt_typ == 'Cheque'){
           document.getElementById('cheque_idd').style.display='block';
	     } else {
           document.getElementById('cheque_idd').style.display='none';
         } 
        }
        
   function account_head(type)
    {
        $.ajax({
            url   : "ajaxmarket.php",
            type  : "POST",
            async : false,
            data  : {
                account_subhead : 1,
                type            : type
            },
            success:function(res_type)
            {
                $('#subacc_h1').html(res_type);
            }
        });
    }
    
    function sub_head(type2)
    {
        $.ajax({
            url   : "ajaxmarket.php",
            type  : "POST",
            async : false,
            data  : {
                account_subhead2 : 1,
                type2            : type2
            },
            success:function(res_type)
            {
                $('#subacc_h2').html(res_type);
            }
        });
    }     
    </script>
    
  </head>
  <body class="hold-transition skin-blue sidebar-mini">
     <div class="wrapper">
  <?php include("head.php");
    include("left.php"); ?> 
	 
      <!-- Content Wrapper. Contains page content -->
      <div class="content-wrapper" >
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1> Voucher
          	<small>- Control panel</small>
          	</h1>
          <ol class="breadcrumb">
            <li><a href="dash_board.php"><i class="fa fa-dashboard"></i> Home</a></li>
            <li class="active">Voucher</li> 
          </ol>
        </section>
  <!-- Main content -->
        <section class="content" >
          <div class="row" >
            <div class="col-xs-12" >





   <div class="box-body" id="marketingdiv2">
 <?php 
       $idd2='';
    if(!isset($_GET)){
      $idd2 = strip_tags(base64_decode($_GET['idd2']));
        }
	  $sq = mysqli_query($con, "SELECT * FROM `p_voucher` WHERE `vid`='$idd2' " );
	  $rs = mysqli_fetch_assoc($sq);
 
 ?>		
			  	
	<div class="box-body" >
 <div class="row" >	
<div class="col-md-12" style="" >
	
<div class="col-md-3"  style="padding-left: 2px; padding-right: 0px;">					
<div class="form-group">
	<select class="form-control" id="rcompany" name="rcompany" onchange="branch_change(this.value);">
	<option value="">Company</option>
	<?php
	$sq2 = mysqli_query($con,"SELECT cid,c_comp FROM `p_company` ");
	while($res2 = mysqli_fetch_array($sq2)){
		if($rs['vcomp'] == $res2['cid']){
	?>	
	<option value="<?php echo $res2['cid']; ?>" selected><?php echo $res2['c_comp']; ?></option>
	<?php } else { ?>
		<option value="<?php echo $res2['cid']; ?>"><?php echo $res2['c_comp']; ?></option>
    <?php } } ?>
	</select>	
</div></div>

<div class="col-md-2" style="padding-left: 2px; padding-right: 0px;">					
  <div class="form-group">
	<select class="form-control" id="rbranch" name="rbranch">
		<option value="">Branch</option>
		<?php
		$p_bran = $rs['vbranch'];
		$p_comp = $rs['vcomp'];
		$bselect = mysqli_query($con,"SELECT * FROM `p_branch` WHERE `b_comp`='$p_comp' ");
		while($rsult = mysqli_fetch_array($bselect)) { 
		    if($p_bran == $rsult['b_branchna']){ ?>
		  <option value="<?php echo $rsult['b_branchna']; ?>" selected><?php echo $rsult['b_branchna']; ?></option> 	
	     <?php } else { ?>		
		  <option value="<?php echo $rsult['b_branchna']; ?>"><?php echo $rsult['b_branchna']; ?></option>	
		<?php } } ?>
	</select>
 </div></div>
 
 <div class="col-md-2" style="padding-left: 2px; padding-right: 0px;">					
  <div class="form-group">
	<select class="form-control" id="vaccounth" name="vaccounth" onchange="account_head(this.value);">
		<option value="" disabled selected="selected">Account Head</option>
	<?php
	$accselect = mysqli_query($con, "SELECT * FROM `p_accnt_head` ");
	while($resacc = mysqli_fetch_array($accselect)) {
		if($rs['vaccnt_head1'] == $resacc['mid']){
		  ?>
		<option value="<?php echo $resacc['mid']; ?>" selected><?php echo $resacc['ma_cat']; ?></option>  
     <?php } else { ?>		  
	  <option value="<?php echo $resacc['mid']; ?>"><?php echo $resacc['ma_cat']; ?></option>	
	<?php } } ?>	
	</select>
 </div></div>
 
 <div id="subacc_h1">
 	<?php
 	$vaccnt_head1 = $rs['vaccnt_head1'];
	$vaccnt_head2 = $rs['vaccnt_head2'];
	if($vaccnt_head2 != 0){ ?>
		
		<div class="col-md-2" style="padding-left: 2px; padding-right: 0px;">					
  <div class="form-group">
	<select class="form-control" id="vsubhead1" name="vsubhead1" onchange="sub_head(this.value);">
		<option value="" disabled selected="selected">Sub Head</option>
	<?php
	$accselect = mysqli_query($con, "SELECT * FROM `p_sub_head` WHERE `main_id`='$vaccnt_head1' ");
	while($resacc = mysqli_fetch_array($accselect)) {
		if($vaccnt_head2 == $resacc['sid']){
		  ?>
		<option value="<?php echo $resacc['sid']; ?>" selected><?php echo $resacc['sub_cat']; ?></option>  
    <?php } else { ?>		  
	  <option value="<?php echo $resacc['sid']; ?>"><?php echo $resacc['sub_cat']; ?></option>	
	<?php } } ?>	
	</select>
 </div></div>
	<?php } ?>
 </div>
 <div id="subacc_h2">
 	<?php 
 	$vaccnt_head2 = $rs['vaccnt_head2'];
	$vaccnt_head3 = $rs['vaccnt_head3'];
	if($vaccnt_head3 != 0){
	?>
 	<div class="col-md-3" style="padding-left: 2px; padding-right: 0px;">					
  <div class="form-group">
	<select class="form-control" id="vsubhead2" name="vsubhead2">
		<option value="" disabled selected="selected">Sub Head</option>
	<?php
	$accselect = mysqli_query($con, "SELECT * FROM `p_sub_head2` WHERE `sbsub`='$vaccnt_head2' ");
	while($resacc = mysqli_fetch_array($accselect)) {
		if($vaccnt_head3 == $resacc['sbid']){
		  ?>
	<option value="<?php echo $resacc['sbid']; ?>" selected><?php echo $resacc['secndsub']; ?></option>	  
    <?php } else { ?>		  
	<option value="<?php echo $resacc['sbid']; ?>"><?php echo $resacc['secndsub']; ?></option>	
	<?php } } ?>	
	</select>
 </div></div>
 	<?php } ?>
 </div>
 
	
 <div class="col-md-3" style="padding-left: 2px; padding-right: 0px;">					
  <div class="form-group">
	<select class="form-control" id="vvendr" name="vvendr" onchange="vend_change(this.value);">
		<option value="">Vendor</option>
	<?php 
	$sel = mysqli_query($con, "SELECT * FROM `p_vendor`");
	while($res = mysqli_fetch_array($sel)){
		if($rs['vvendr'] == $res['vid']){ 
	?>	
	<option value="<?php echo $res['vid']; ?>" selected><?php echo $res['v_company']; ?></option>
	<?php } else { ?>
	<option value="<?php echo $res['vid']; ?>"><?php echo $res['v_company']; ?></option>
	<?php } } ?>
	</select>	
 </div></div>	
 	
  <div class="col-md-2" style="padding-left: 2px; padding-right: 0px;">					
  <div class="form-group">
	<select class="form-control" id="purch_num" name="purch_num">
		<option value="">Purchase No.</option>
		<?php if($rs['vpurch_no'] != ''){ ?>
		<option value="<?php echo $rs['vpurch_no']; ?>" selected><?php echo $rs['vpurch_no']; ?></option>	
		<?php } ?>	
	</select>
 </div></div>
 
 
 
	
		
<div class="col-md-2"  style=" padding-left: 2px; padding-right: 0px; ">			
		
<div class="form-group">
  <select class="form-control" id="ramnt_type" name="ramnt_type" onchange="amount_type(this.value);">
  <option value="">Amount Type</option> 
  <option value="Cash" <?php if($rs['vamnt_type'] == 'Cash'){ ?> selected <?php } ?>>Cash</option>
  <option value="Cheque" <?php if($rs['vamnt_type'] == 'Cheque'){ ?> selected <?php } ?>>Cheque</option>
  </select> 
</div></div>


<div class="col-md-3" style="padding-left: 2px; padding-right: 0px;">					
<div class="form-group">
    <input name="vamount" id="vamount" onkeypress="return isNumber2(event)" class="form-control" placeholder="Amount" value="<?php echo $rs['vamnt']; ?>">
</div></div>



<div id="cheque_idd" style=" display: none;">
	
<div class="col-md-3" style="padding-left: 2px; padding-right: 0px;" >					
<div class="form-group">
    <input name="rcheque" id="rcheque" class="form-control" placeholder="Cheque No." value="<?php echo $rs['vcheque']; ?>">
</div></div>
<div class="col-md-2" style="padding-left: 2px; padding-right: 0px;">					
<div class="form-group">
    <input name="rbank" id="rbank" class="form-control" placeholder="Bank" value="<?php echo $rs['vbank']; ?>">
</div></div>
<div class="col-md-2" style="padding-left: 2px; padding-right: 0px;">					
<div class="form-group">
    <input name="rdate" id="rdate" class="form-control tcal" placeholder="Date" value="<?php echo $rs['vcheq_date']; ?>">
</div></div>


</div>



<div class="col-md-5" style=" padding-left: 2px; padding-right: 0px; ">					
<div class="form-group">
   <textarea name="vremarks" id="vremarks" class="form-control" placeholder="Remarks" style=" height: 35px;"><?php echo $rs['vremarks']; ?></textarea>		
</div></div>

	

<div class="col-md-2" >				
<div class="form-group">
  <?php if($idd2 != ''){ ?>
	<input type="hidden" name="hidvall" id="hidvall" value="<?php echo $rs['vid']; ?>" />
<input type="submit" class="btn btn-primary" name="frasubmit" id="frasubmit" value="Update" onclick="edit_news_voucher();" style=" float: right; 
margin-right: 20px; " /> 

<?php } else { ?>
<input type="submit" class="btn btn-primary" name="frasubmit" id="frasubmit" value="Submit" onclick="add_new_voucher();" style=" float: right; 
margin-right: 20px; " />	
<?php } ?> 
</div></div>

</div>




</div>



	
	

</div>
  </div>
  
  
  
  
  
  
<div id="marketingdiv123">


<div class="box" >
   <div class="box-body" >
        <div class="box-body table-responsive no-padding" >
   
  	                 	
                  <table id="example1" class="table table-bordered table-striped" >
                    <thead >
<tr >
<th>#</th>
<th>Branch</th>
<th>Vendor</th>
<th>Amount Type</th>
<th>Amount</th>
<th>Date</th>
<th width="8%"></th>
</tr>
                    </thead>
                    <tbody>

<?php 
$sq = mysqli_query($con, "SELECT * FROM `p_voucher` ORDER BY `vid` DESC");
$k=1;
while($rs = mysqli_fetch_array($sq)){
 $rdate = $rs['vdate'];
 $exp = explode("-",$rdate);
 $yearr =  substr($exp[0], 0, 4);
 $voucher_dat = $exp[2].'/'.$exp[1].'/'.$yearr; 
 	
 $comid = $rs['vcomp'];	
 $sq1 = mysqli_query($con,"SELECT c_comp FROM `p_company` WHERE `cid`='$comid' ");
 $rs1 = mysqli_fetch_array($sq1);	
 $cusid = $rs['vvendr'];
 $sq2 = mysqli_query($con,"SELECT v_company FROM `p_vendor` WHERE `vid`='$cusid' ");
 $rs2 = mysqli_fetch_array($sq2);
 
 $vaccnt_head1 = $rs['vaccnt_head1'];
 $sq3 = mysqli_query($con, "SELECT ma_cat FROM `p_accnt_head` WHERE `mid`='$vaccnt_head1'");
 $rs3 = mysqli_fetch_array($sq3);
 
 $vaccnt_head2 = $rs['vaccnt_head2'];
 $sq4 = mysqli_query($con, "SELECT sub_cat FROM `p_sub_head` WHERE `sid`='$vaccnt_head2'");
 $rs4 = mysqli_fetch_array($sq4);
?>
<tr>
<td><?php echo $k; ?></td>

<td><?php echo $rs['vbranch']; ?></td>
<td><?php echo $rs2['v_company']; ?></td>
<td><?php echo $rs['vamnt_type']; ?></td>
<td><?php echo $rs['vamnt']; ?></td>
<td><?php echo $voucher_dat; ?></td>
<td>
   <a href="" data-toggle="modal" data-target="#myModal<?php echo $rs['vid']; ?>" style=" cursor: pointer;"><span class="glyphicon glyphicon-eye-open" style="font-size:14px;"></span></a> &nbsp;                	
    <a onClick="edit_voucher('<?php echo base64_encode($rs['vid']); ?>');" style=" cursor: pointer;" ><span class="fa fa-pencil" style="font-size:14px;"></span></a> &nbsp;
    <a onClick="delete_voucher('<?php echo base64_encode($rs['vid']); ?>');" style=" cursor: pointer;" ><span class="fa fa-trash-o" style="font-size:14px;"></span></a>	
</td>	
</tr>


<div class="modal fade" id="myModal<?php echo $rs['vid']; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header" style=" background-color: #E8E8E8;">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">Voucher #<?php echo $rs['vid']; ?></h4>
      </div>
      <div class="modal-body" id="myModal2">
  
 <div style=" width:550px; ">
  <div style=" float:left; width:150px;  font-size:14px; color:#0000FF; ">Company Name</div><div style="width:375px; ">: &nbsp;&nbsp; <?php echo $rs1['c_comp']; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Branch</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs['vbranch']; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Account Head </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs3['ma_cat']; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Sub Head </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs4['sub_cat']; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Vendor </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs2['v_company']; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Purchase No.</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs['vpurch_no']; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Amount Type</div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs['vamnt_type']; ?></div>
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Amount </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs['vamnt']; ?></div>
  <?php if($rs['vamnt'] == 'Cheque'){ ?>
  	
  	<div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Cheque No. </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs['vcheque']; ?></div>
  	<div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Bank </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs['vbank']; ?></div>
  	<div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Date </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs['vcheq_date']; ?></div>
  	
 <?php } ?>
  
  <div style=" float:left; width:150px;font-size:14px;color:#0000FF;">Remarks </div><div style="width:375px;">: &nbsp;&nbsp; <?php echo $rs['vremarks']; ?></div>
  
 </div>
  
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
       
      </div>
    </div>
  </div>
</div>   

<?php $k=$k+1; } ?>
                    </tbody>
                    </table>
  
         		  </div>
                </div><!-- /.box-body -->
              </div><!-- /.box -->
	
	
</div>
	
		
			
			
			








                           
            </div><!-- /.col -->
          </div><!-- /.row -->
        </section><!-- /.content -->
  </div><!-- /.content-wrapper -->
  </div>
	<!-- <?php include("footer.php"); ?> -->
 <!-- jQuery 2.1.4 -->
    <script src="<?php echo $sujpath; ?>plugins/jQuery/jQuery-2.1.4.min.js"></script>
    <!-- Bootstrap 3.3.5 -->
    <script src="<?php echo $sujpath; ?>bootstrap/js/bootstrap.min.js"></script>
    <!-- DataTables -->
	<script src="<?php echo $sujpath; ?>plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="<?php echo $sujpath; ?>plugins/datatables/dataTables.bootstrap.min.js"></script>
    <!-- SlimScroll -->
    <script src="<?php echo $sujpath; ?>plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <!-- FastClick -->
    <script src="<?php echo $sujpath; ?>plugins/fastclick/fastclick.min.js"></script>
    <!-- AdminLTE App -->
    <script src="<?php echo $sujpath; ?>dist/js/app.min.js"></script>
    <!-- AdminLTE for demo purposes -->
    <script src="<?php echo $sujpath; ?>dist/js/demo.js"></script>
    <!-- page script -->
    
  <script type="text/javascript">
    function PreviewImage(no) {
    	var oFReader = new FileReader();
        oFReader.readAsDataURL(document.getElementById("uploadImage"+no).files[0]);
        oFReader.onload = function (oFREvent) {
            document.getElementById("uploadPreview"+no).src = oFREvent.target.result;
        };
    }
</script>

<style>
label.filebutton {
    width:120px;
    height:80px;
    overflow:hidden;
    position:relative;
}
label span input {
    z-index: 999;
    line-height: 0;
    font-size: 50px;
    position: absolute;
    top: -2px;
    left: -700px;
    opacity: 0;
    filter: alpha(opacity = 0);
    -ms-filter: "alpha(opacity=0)";
    cursor: pointer;
    _cursor: hand;
    margin: 0;
    padding:0;
}
</style>



    <script>
      $(document).ready(function() {
        $("#example1").DataTable();
      });
      
	function datat(){
	  alert("Data Deleted Successfully.");
      $(document).ready(function() {
        $("#example1").DataTable();
       
      });
    }
    function datat2(){
	  alert("Data Added Successfully");
      $(document).ready(function() {
        $("#example1").DataTable();
       
      });
    }
    function datat3(){
	  alert("Updated Successfully");
      $(document).ready(function() {
        $("#example1").DataTable();
       
      });
    }
   </script>  
   
   
   
  </body>
</html>
