<?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 -->
    <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">
    <!-- 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">
    <!-- iCheck -->
    <!-- bootstrap wysihtml5 - text editor -->
    <link rel="stylesheet" href="<?php echo $sujpath; ?>plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
    
      <!-- DataTables -->
    <link rel="stylesheet" href="<?php echo $sujpath; ?>plugins/datatables/dataTables.bootstrap.css">
    <script>
     function add_main_cat(){
             var maincat = $('#maincat').val();
             var mainstatus = $('#mainstatus').val();
             if(maincat == ''){
                alert("Enter Category");   	
              }  else {                    
                  $.ajax({
                    type: "POST",
                    url: "ajaxmarket.php",
                     data: {
                          add_new_main_cat : 1,
                          maincat          : maincat,
                          mainstatus       : mainstatus
                     },
                     cache: true,
                     success: function(res23)
                     {
                     	$('#maincat').val('');
                        $("#marketingdiv123").load("account_head.php #marketingdiv123");
                        datat2();                        
                      }
                   }); 
    	    }
       }
      function edit_cat_update() {
             var maincat = $('#maincat').val();
             var mainstatus = $('#mainstatus').val();
             var hidcat = $('#hidcat').val();
             if(maincat == ''){
                alert("Enter Category");   	
              }  else {                    
                  $.ajax({
                    type: "POST",
                    url: "ajaxmarket.php",
                     data: {
                          edit_new_main_cat : 1,
                          maincat          : maincat,
                          mainstatus       : mainstatus,
                          hidcat           : hidcat
                     },
                     cache: true,
                     success: function(res23)
                     {
                     	$('#maincat').val('');
                        $("#marketingdiv123").load("account_head.php #marketingdiv123");
                        datat2();                        
                      }
                   }); 
    	    }
       }
       
       
  function delete_maincat(id)
    	   {
    		var result = confirm("Want to delete?");
			if (result) 
			{
     		$.ajax({
			type: "POST",
			url: "ajaxmarket.php",
			data: {
			btn_delete_macat: 1,
			id:id
			},
			cache: true,
			success: function(res)
			{
			      $("#marketingdiv123").load("account_head.php #marketingdiv123");
			      datat();
         	
			}  
			});
   			}
    	   }

       
       
       function add_subcat(){
             var submain = $('#submain').val();
             var subcat = $('#subcat').val();
             var substatus = $('#substatus').val();
             if(submain == ''){
                alert("Select Main Category");   	
              } else if(subcat == ''){
              	alert("Enter Sub Category");
              } else {                    
                  $.ajax({
                    type: "POST",
                    url: "ajaxmarket.php",
                     data: {
                          add_new_sub_cat : 1,
                          submain          : submain,
                          subcat           : subcat,
                          substatus        : substatus
                     },
                     cache: true,
                     success: function(res23)
                     {
                     	$('#submain').val('');
                     	$('#subcat').val('');
                        $("#tab_2").load("account_head.php #tab_2");
                        datat2();                        
                      }
                   }); 
    	    }
       }


        function edit_sub_cat(){
             var submain = $('#submain').val();
             var subcat = $('#subcat').val();
             var substatus = $('#substatus').val();
             var hiddsubcat = $('#hiddsubcat').val();
             if(submain == ''){
                alert("Select Main Category");   	
              } else if(subcat == ''){
              	alert("Enter Sub Category");
              } else {                    
                  $.ajax({
                    type: "POST",
                    url: "ajaxmarket.php",
                     data: {
                          edit_new_sub_cat : 1,
                          submain          : submain,
                          subcat           : subcat,
                          substatus        : substatus,
                          hiddsubcat       : hiddsubcat
                     },
                     cache: true,
                     success: function(res23)
                     {
                     	$('#submain').val('');
                     	$('#subcat').val('');
                        $("#tab_2").load("account_head.php #tab_2");
                        datat2();                        
                      }
                   }); 
    	    }
       }

         
         
         
           function edit_subsub_cate(){
             var ssubmain = $('#ssubmain').val();
             var ssubsub = $('#ssubsub').val();
             var subsubcat = $('#subsubcat').val();
             var subsubstatus = $('#subsubstatus').val();
             var hiddsubsub = $('#hiddsubsub').val();
             if(ssubmain == ''){
                alert("Select Main Category");   	
              } else if(ssubsub == ''){
              	alert("Enter Sub Category");
              } else if(subsubcat == ''){
              	alert("Enter Sub Category");
              } else {                    
                  $.ajax({
                    type: "POST",
                    url: "ajaxmarket.php",
                     data: {
                          edit_new_subsub_cat  : 1,
                          ssubmain          : ssubmain,
                          ssubsub           : ssubsub,
                          subsubcat         : subsubcat,
                          subsubstatus      : subsubstatus,
                          hiddsubsub        : hiddsubsub
                     },
                     cache: true,
                     success: function(res23)
                     {
                     	$('#ssubmain').val('');
                     	$('#subsubcat').val('');
                     	$('#subsubcat').val('');
                        $("#tab_3").load("account_head.php #tab_3");
                        datat2();                        
                      }
                   }); 
    	    }
       }

       function delete_subcat(id)
    	{
    		var result = confirm("Want to delete?");
			if (result) 
			{
     		$.ajax({
			type: "POST",
			url: "ajaxmarket.php",
			data: {
			btn_delete_subcat: 1,
			id:id
			},
			cache: true,
			success: function(res)
			{
			      $("#tab_2").load("account_head.php#tab_2 #tab_2");
			      datat();
         	
			}  
			});
   			}
    	}

    	
    	
    	 function sub_sub_add(){
             var ssubmain = $('#ssubmain').val();
             var ssubsub = $('#ssubsub').val();
             var subsubcat = $('#subsubcat').val();
             var subsubstatus = $('#subsubstatus').val();
             if(ssubmain == ''){
                alert("Select Main Category");   	
              } else if(ssubsub == ''){
              	alert("Enter Sub Category");
              } else if(subsubcat == ''){
              	alert("Enter Secons SubCategory");
              } else {                    
                  $.ajax({
                    type: "POST",
                    url: "ajaxmarket.php",
                     data: {
                          add_new_subsub_cat : 1,
                          ssubmain          : ssubmain,
                          ssubsub           : ssubsub,
                          subsubcat        : subsubcat,
                          subsubstatus     : subsubstatus
                     },
                     cache: true,
                     success: function(res23)
                     {
                     	$('#ssubmain').val('');
                     	$('#ssubsub').val('');
                     	$('#subsubcat').val('');
                        $("#tab_3").load("account_head.php #tab_3");
                        datat2();                        
                      }
                   }); 
    	    }
         }
       
    function delete_subsubcat(id)
    	{
    		var result = confirm("Want to delete?");
			if (result) 
			{
     		$.ajax({
			type: "POST",
			url: "ajaxmarket.php",
			data: {
			btn_del_subsubcat: 1,
			id:id
			},
			cache: true,
			success: function(res)
			{
			      $("#tab_3").load("account_head.php #tab_3");
			      datat();
         	
			}  
			});
   			}
    	}
        
    
    
    	
    	function edit_cat(id)
    	{
    		$.ajax({
			type: "POST",
			url: "ajaxmarket.php",
			data: {
			btn_edit_market: 1,
			id:id
			},
			cache: true,
			success: function(res)
			{
			
	         	$("#gal_catid").load("account_head.php?idd2="+id+" #gal_catid"); 	
			}  
			});
    	}
    		
    	function edit_sub(id)
    	{
    		$.ajax({
			type: "POST",
			url: "ajaxmarket.php",
			data: {
			btn_edit_market: 1,
			id:id
			},
			cache: true,
			success: function(res)
			{
			
	         	$("#gal_imgid").load("account_head.php?idd3="+id+" #gal_imgid"); 	
			}  
			});
    	}
    	
    	function edit_subsub(id)
    	{
    		
    		$.ajax({
			type: "POST",
			url: "ajaxmarket.php",
			data: {
			btn_edit_market: 1,
			id:id
			},
			cache: true,
			success: function(res)
			{
				
			 	$("#gal_imgid222").load("account_head.php?idd4="+id+" #gal_imgid222"); 	
			}  
			});
    	}
    	
    	
function main_category(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("ssubsub").innerHTML=xmlhttp.responseText;
    }
  }
  xmlhttp.open("GET","ajaxmarket.php?main_idd="+str,true);
  xmlhttp.send();
}
    </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> Account Head
               <small>- Control panel</small>
          </h1>
          <ol class="breadcrumb">
            <li><a href="index.php"><i class="fa fa-dashboard"></i> Home</a></li>
            <li class="active">Account Head</li> 
          </ol>
        </section>
  <!-- Main content -->
        <section class="content" >



      <div class="row">
            <div class="col-md-12">
            <br>
        <div id="marketingdiv123">
        
          <div class="row">
            <div class="col-md-12">
              <!-- Custom Tabs -->
              <div class="nav-tabs-custom">
                <ul class="nav nav-tabs">
                  <li class="active"><a href="#tab_1" data-toggle="tab" style="background-color	:#696969; color:#FFFFFF; width: 133px;">Main Head</a></li>
                  <li><a href="#tab_2" data-toggle="tab" style="background-color:#696969;width: 133px;color:#FFFFFF;">Sub Head</a></li>
                   <li><a href="#tab_3" data-toggle="tab" style="background-color:#696969;width: 150px;color:#FFFFFF;">Second Sub Head</a></li>
                 
                  
                </ul>
                <div class="tab-content">
                  <div class="tab-pane active" id="tab_1">
                    <!--<b>Add Category</b> --><br>
                    
          <div id="gal_catid">
          	          
         <div class="row" >
            <div class="col-xs-12" >
            <?php
            if(empty($_GET)){
        
              //$idd2 = strip_tags(base64_decode($_GET['idd2']));
              $status11='';
              $cat11='';

      }else{
            $idd2 = strip_tags(base64_decode($_GET['idd2']));
	        $sql2= mysqli_query($con, "SELECT * FROM `p_accnt_head` WHERE `mid`='$idd2' ");      
	        $resul2= mysqli_fetch_array($sql2);  
          $status11=$resul2['ma_status'];
          $cat11=$resul2['ma_cat'];
          }    
            ?>    	 
      <div class="col-md-3"  style="padding-left: 2px; padding-right: 0px; ">				
      <div class="form-group">
      <input type="text" class="form-control" id="maincat" name="maincat" placeholder="Category*" value="<?php echo $cat11; ?>" >
      </div></div>	
   
      <div class="col-md-3"  style=" padding-left: 2px; padding-right: 0px; ">				
      <div class="form-group">
      <select name="mainstatus" id="mainstatus" class="form-control">
      	<option value="1" <?php if($status11 == '1'){ ?> selected <?php } ?>>Active</option>
        <option value="0" <?php if($status11 == '0'){ ?> selected <?php } ?>>InActive</option>
      </select>
      </div></div>	
      
        <div class="col-md-3"  style=" padding-left: 2px; padding-right: 0px; ">				
      <div class="form-group">
      <?php if(!empty($_GET)){ ?>	
      	<input type="hidden" name="hidcat" id="hidcat" value="<?php echo $resul2['mid']; ?>" />
      	<input type="submit" class="btn btn-primary" name="frasubmit" id="frasubmit" value="Update" onclick="edit_cat_update();" />
      <?php } else { ?>
      	<input type="submit" class="btn btn-primary" name="frasubmit" id="frasubmit" value="Submit" onclick="add_main_cat();" />
      <?php } ?>	
      </div></div>	
      
      </div></div>

      </div>




<div class="box-body" >
        <div class="box-body table-responsive no-padding">
   
  	                 	
                  <table id="example1" class="table table-bordered table-striped">
                    <thead >
                     <tr >
                     <th style="width: 25px;">#</th>                    	
                     <th>Category</th>
                     <th>Status</th>
                     <th></th>
                    </tr>
                    </thead>
                    <tbody>
 
 <?php
 $sq2= mysqli_query($con, "SELECT * FROM `p_accnt_head` ORDER BY `mid` DESC ");
 $k=1;
 while($res2=mysqli_fetch_array($sq2)){
 ?>
  <tr>
  	<td><?php echo $k; ?></td>
  	 <td style=" text-align: center;"><?php echo $res2['ma_cat']; ?></td>
  	 <td ><?php if($res2['ma_status'] == 1) { echo "Active"; } else { echo "InActive"; } ?></td>
    <td >
    <a onClick="edit_cat('<?php echo base64_encode($res2['mid']); ?>');" style=" cursor: pointer;" ><span class="fa fa-pencil" style="font-size:14px;"></span></a> &nbsp; &nbsp;
    <a onClick="delete_maincat('<?php echo base64_encode($res2['mid']); ?>');" style=" cursor: pointer;" ><span class="fa fa-trash-o" style="font-size:14px;"></span></a> &nbsp;
    </td>
  </tr> 
  <?php $k=$k+1; } ?>               
                    </tbody>
                    </table>
  
         		  </div>
            </div> 
           
	


                    
                  </div><!-- /.tab-pane -->
    






             
        <div class="tab-pane" id="tab_2">
        <br>  
            
        <div id="gal_imgid">
        <?php 
        if(empty($_GET)){
        
              //$idd2 = strip_tags(base64_decode($_GET['idd2']));

              $status11='';
              $sub_cat11='';

      }else{
        $idd3 = strip_tags(base64_decode($_GET['idd3']));
		    $sj = mysqli_query($con, "SELECT * FROM `p_sub_head` WHERE `sid`= '$idd3' ");
		    $rj= mysqli_fetch_array($sj);
        $status11=$rj['sub_status'];
        $sub_cat11=$rj['sub_cat'];
      }
        ?> 	          
        <div class="row" >
        <div class="col-xs-12" >
             

      <div class="col-md-3"  style=" padding-left: 2px; padding-right: 0px; ">				
      <div class="form-group">
      <select name="submain" id="submain" class="form-control">
      	<option value="">Select Category</option>
      	<?php
      $select = mysqli_query($con, "SELECT * FROM `p_accnt_head` WHERE `ma_status`='1' ");
	  while($ress = mysqli_fetch_array($select)){
	  	if($rj['main_id'] == $ress['mid']){	?>
      	<option value="<?php echo $ress['mid']; ?>" selected><?php echo $ress['ma_cat']; ?></option>
      <?php } else { ?>	
      <option value="<?php echo $ress['mid']; ?>"><?php echo $ress['ma_cat']; ?></option>	
      <?php } } ?>	
      	</select>
      </div></div>	
      
       	
     <div class="col-md-3"  style=" padding-left: 2px; padding-right: 0px; ">				
      <div class="form-group">
      <input type="text" class="form-control" id="subcat" name="subcat" placeholder="Sub Category*" value="<?php echo $sub_cat11; ?>" >
      </div></div>	
   
      <div class="col-md-3"  style=" padding-left: 2px; padding-right: 0px; ">				
      <div class="form-group">
      <select name="substatus" id="substatus" class="form-control">
      	<option value="1" <?php if($status11 == '1'){ ?> selected <?php } ?>>Active</option>
        <option value="0" <?php if($status11 == '0'){ ?> selected <?php } ?>>InActive</option>
      </select>
      </div></div>		
        
        
        <div class="col-md-3"  style=" padding-left: 2px; padding-right: 0px; ">				
        <div class="form-group">
        <?php if(!empty($_GET)){ ?>
        <input type="hidden" name="hiddsubcat" id="hiddsubcat" value="<?php echo $rj['sid']; ?>" />	
        <input type="submit" class="btn btn-primary" name="frasubmit2" id="frasubmit2" value="Update" onclick="edit_sub_cat();" />	
        <?php } else { ?>	 	
      	<input type="submit" class="btn btn-primary" name="frasubmit2" id="frasubmit2" value="Submit" onclick="add_subcat();" />
        <?php } ?>	
        </div></div>	
      
        </div></div>
        
        </div>
        
        
        
         <div class="box-body" >
        <div class="box-body table-responsive no-padding">
   
  	                 	
                  <table id="example2" class="table table-bordered table-striped">
                    <thead >
                     <tr >
                     <th style="width: 25px;">#</th>                    	
                     <th>Category</th>
                     <th>Sub Category</th>
                     <th></th>
                    </tr>
                    </thead>
                    <tbody>
 
 <?php
 $sq2= mysqli_query($con, "SELECT * FROM `p_sub_head` ORDER BY `sid` DESC  ");
 $j=1;
 while($res2=mysqli_fetch_array($sq2)){
$gcat = $res2['main_id']; 	
$sqq= mysqli_query($con,"SELECT ma_cat FROM `p_accnt_head` WHERE `mid`='$gcat' ");
$rss = mysqli_fetch_array($sqq) ?>
  <tr>
  	<td><?php echo $j; ?></td>
  	 <td style=" text-align: center;"><?php echo $rss['ma_cat']; ?></td>
  	 <td><?php echo $res2['sub_cat']; ?></td>
  	<td >
    <a onClick="edit_sub('<?php echo base64_encode($res2['sid']); ?>');" style=" cursor: pointer;" ><span class="fa fa-pencil" style="font-size:14px;"></span></a> &nbsp; &nbsp;
    <a onClick="delete_subcat('<?php echo base64_encode($res2['sid']); ?>');" style=" cursor: pointer;" ><span class="fa fa-trash-o" style="font-size:14px;"></span></a> &nbsp;
    </td>
  </tr> 
  <?php $j=$j+1; } ?>               
                    </tbody>
                    </table>
  
         		  </div>
                </div>     
                    
                    
      
                    
                    
                  </div><!-- /.tab-pane -->
                  
                  
   <div class="tab-pane" id="tab_3">
        <br>      
        <div id="gal_imgid222">
        <?php
        if(empty($_GET)){
        
              //$idd2 = strip_tags(base64_decode($_GET['idd2']));

              $status11='';
              $secndsub11='';

      }else{ 
        $idd4 = strip_tags(base64_decode($_GET['idd4']));
		    $sj2 = mysqli_query($con, "SELECT * FROM `p_sub_head2` WHERE `sbid`= '$idd4' ");
		    $rj3= mysqli_fetch_array($sj2);
        $secndsub11=$rj3['secndsub'];
        $status11=$rj3['sb_status'];
      }
        ?> 	          
        <div class="row" >
        <div class="col-xs-12" >
             

           <div class="col-md-2"  style=" padding-left: 2px; padding-right: 0px; ">				
      <div class="form-group">
      <select name="ssubmain" id="ssubmain" class="form-control" onchange="main_category(this.value);">
      	<option value="">Main Category</option>
      <?php
      $select = mysqli_query($con, "SELECT * FROM `p_accnt_head` WHERE `ma_status`='1' ");
	  while($ress = mysqli_fetch_array($select)){
	  	if($rj3['sbmain'] == $ress['mid']){	
      ?>
      <option value="<?php echo $ress['mid']; ?>" selected><?php echo $ress['ma_cat']; ?></option>
      <?php } else {  ?>
      <option value="<?php echo $ress['mid']; ?>"><?php echo $ress['ma_cat']; ?></option>	
      <?php } } ?>
      	</select>
      </div></div>	
      
        <div class="col-md-2" style="padding-left: 2px; padding-right: 0px; ">				
      <div class="form-group">
      <select name="ssubsub" id="ssubsub" class="form-control">
      	<option value="">Sub Category</option>
      	<?php $subca = $rj3['sbsub'];
              $mainca = $rj3['sbmain'];
		if($mainca != ''){
			  $sqq = mysqli_query($con, "SELECT * FROM `p_sub_head` WHERE `main_id`='$mainca' ");
			  while($rss = mysqli_fetch_array($sqq)){
			  	if($subca == $rss['sid']){		
		 ?>
		 <option value="<?php echo $rss['sid']; ?>" selected><?php echo $rss['sub_cat']; ?></option>
		 <?php } else { ?>
		 <option value="<?php echo $rss['sid']; ?>"><?php echo $rss['sub_cat']; ?></option>
      	<?php } }  
			  }	  
      	?>
      	</select>
      </div></div>	
      
       	
     <div class="col-md-3" style="padding-left: 2px; padding-right: 0px; ">				
      <div class="form-group">
      <input type="text" class="form-control" id="subsubcat" name="subsubcat" placeholder="Sub Category*" value="<?php echo $secndsub11; ?>" >
      </div></div>	
   
      <div class="col-md-2" style="padding-left: 2px; padding-right: 0px; ">				
      <div class="form-group">
      <select name="subsubstatus" id="subsubstatus" class="form-control">
      	<option value="1" <?php if($status11 == '1'){ ?> selected <?php } ?>>Active</option>
        <option value="0" <?php if($status11 == '0'){ ?> selected <?php } ?>>InActive</option>
      </select>
      </div></div>		
        
        
        <div class="col-md-3"  style=" padding-left: 2px; padding-right: 0px; ">				
        <div class="form-group">
        <?php if(!empty($_GET)){ ?>
        <input type="hidden" name="hiddsubsub" id="hiddsubsub" value="<?php echo $rj3['sbid']; ?>" />	
        <input type="submit" class="btn btn-primary" name="frasubmit2" id="frasubmit2" value="Update" onclick="edit_subsub_cate();" />	
        <?php } else { ?>	 	
      	<input type="submit" class="btn btn-primary" name="frasubmit2" id="frasubmit2" value="Submit" onclick="sub_sub_add();" />
        <?php } ?>	
        </div></div>	
      
        </div></div>
        
        </div>
        
        
        
         <div class="box-body" >
        <div class="box-body table-responsive no-padding">
   
  	                 	
                  <table id="example3" class="table table-bordered table-striped">
                    <thead >
                     <tr >
                     <th style="width: 25px;">#</th>                    	
                     <th>MainCategory</th>
                     <th>Sub Category</th>
                     <th>Second Sub Category</th>
                     <th></th>
                    </tr>
                    </thead>
                    <tbody>
  <?php
 $sq2= mysqli_query($con, "SELECT * FROM `p_sub_head2` ORDER BY `sbid` DESC ");
 $j=1;
 while($res2=mysqli_fetch_array($sq2)){
$gcat = $res2['sbmain']; 	
$sqq= mysqli_query($con,"SELECT ma_cat FROM `p_accnt_head` WHERE `mid`='$gcat' ");
$rss = mysqli_fetch_array($sqq);

$gsubcat = $res2['sbsub'];
$sqq2 = mysqli_query($con, "SELECT sub_cat FROM `p_sub_head` WHERE `sid`='$gsubcat' ");
$rss2 = mysqli_fetch_array($sqq2);
 ?>
  <tr>
  	<td><?php echo $j; ?></td>
  	 <td style=" text-align: center;"><?php echo $rss['ma_cat']; ?></td>
  	 <td><?php echo $rss2['sub_cat']; ?></td>
  	 <td><?php echo $res2['secndsub']; ?></td>
  	<td >
    <a onClick="edit_subsub('<?php echo base64_encode($res2['sbid']); ?>');" style=" cursor: pointer;" ><span class="fa fa-pencil" style="font-size:14px;"></span></a> &nbsp; &nbsp;
    <a onClick="delete_subsubcat('<?php echo base64_encode($res2['sbid']); ?>');" style=" cursor: pointer;" ><span class="fa fa-trash-o" style="font-size:14px;"></span></a> &nbsp;
    </td>
  </tr> 
  <?php $j=$j+1; } ?> 
               
                    </tbody>
                    </table>
  
         		  </div>
                </div>     
       </div>
                  
                  
                  
                </div><!-- /.tab-content -->
              </div><!-- nav-tabs-custom -->
            </div><!-- /.col -->


      </div>


 </div></div>
        
        
        
        
        
     
</div>









        </section><!-- /.content -->
  </div><!-- /.content-wrapper -->
  </div>

	<!-- 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>
    <!-- Morris.js charts -->
    <script src="<?php echo $sujpath; ?>dist/js/app.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>
    <!-- AdminLTE for demo purposes -->
    <script src="<?php echo $sujpath; ?>dist/js/demo.js"></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();
      });
      
      $(document).ready(function() {
        $("#example2").DataTable();
      });
      $(document).ready(function() {
        $("#example3").DataTable();
      });
      
   function datat(){
	  alert("Data Deleted Successfully.");
      $(document).ready(function() {
        $("#example1").DataTable();
        $("#example2").DataTable();
        $("#example3").DataTable();
      });
    }
    function datat2(){
	  alert("Data Added Successfully");
      $(document).ready(function() {
        $("#example1").DataTable();
        $("#example2").DataTable(); 
        $("#example3").DataTable();      
      });
    }
    function datat3(){
	  alert("Updated Successfully");
      $(document).ready(function() {
        $("#example1").DataTable();
        $("#example2").DataTable();
        $("#example3").DataTable();       
      });
    }
   </script>   
   
   
   
  </body>
</html>
