<?php include("conn.php");
$page='General Settings';?>
<!DOCTYPE html>
<html lang="en">
<?php include("common/head.php")?>
<body>
<?php include("common/menu.php")?>
<!---side nav bar end-->
<?php include("common/tittle.php")?>

            <!--Main body Start-->
            <div id="accordions" class="col-sm-12 mt-2">
            <center>
        <div class="row">
        <div class="col-sm-12">
                <div id="filters" class="d-flex button-group">
                  
                    <div class="col-sm-2 ">
                        <a   href="settings" class="btn-order text-center btn ">
                            <p class="text-center order-text-order-managment">Store Details</p>
                        </a>
                    </div>

                    <div class="col-sm-2 ">
                        <a   href="general_settings" class="collapsed btn-primary text-center btn ">
                            <p class="text-center order-text-order-managment">Currency Settings</p>
                        </a>
                    </div>
                 
                </div>
            </div>
        </div>
      
      </center>
              
                   <hr class="bg-success">
   
                   <div  id="collapseOne" class="orders collapse show " data-parent="#accordions">
                    <h5 class="text-center">Currency Settings</h5>
                   <div class="row">

                    <div style="background-color:#e3f5fa; border-radius:20px" class="col-sm-4 m-4">
                    <h5  class="m-2">Currency</h5>
                    <form action="edit/edit_currency.php" method="post" class="form-inline m-4">
                        <?php
                        $sql="select * from currency ";
                        $result = mysqli_query($conn,$sql)or die( mysqli_error($conn));
                        while ($row=mysqli_fetch_array($result)) {
                            $currency=$row['curency'];
                            $id=$row['id'];
                        }
                        ?>
                        <p>* <?php echo $currency ?></p>
                       <div class="form-group mx-sm-3 mb-2">
                       <select id="inputState" name="currency" class="form-control">
                        <option selected>Change Cur...</option>
                        <option value="$">$</option>
                        <option value="₦">₦</option>
                        <option value="₵">₵</option>
                        <option value="GHC">GHC</option>
                      </select>
                       </div>
                       <input type="hidden" name="id" value="<?php echo $id ?>">
                       <input type="hidden" name="by" value="<?php echo $id_user ?>">
                <input type="hidden" name="date" value="<?php echo date("F j, Y") ?>">
                       <button type="submit" name="submit" class="btn btn-primary mb-2">Confirm Currency</button>
                    </form>
                    </div>
                   </div>

                
    
    
    
                        
                        
               
    

                </div>

          
         

              

 


  <?php 


include('conn.php');


if(isset($_POST['submit'])){

	$name =$_POST['name'];
    $percent=$_POST['percent'];
    $date=$_POST['date'];
    $by=$_POST['by'];


		$sql = "INSERT INTO `tax`( `tax`, `percent`, `date`, `by`) VALUES ('$name','$percent','$date','$by')";
		if(mysqli_query($conn,$sql)){
      echo"<script>alert('You Have Successfully added a new tax'); window.location=''</script>";
		}
		else{
		  echo 'Error: '.mysqli_error($conn);
		}
	}
 

?>


       

   
    
    <!--  isotope plugin cdn  -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/3.0.6/isotope.pkgd.min.js" integrity="sha256-CBrpuqrMhXwcLLUd5tvQ4euBHCdh7wGlDfNz8vbu/iI=" crossorigin="anonymous"></script>
    <script src="js/script.js"></script>
     <!-- jQuery js-->
 
     <!-- Bootstrap js -->
     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
     <!-- jQuery Datatable js -->
     <script src="https://cdn.datatables.net/1.10.21/js/jquery.dataTables.min.js"></script>
     <!-- Bootstrap Datatable js -->    
     <script src="https://cdn.datatables.net/1.10.21/js/dataTables.bootstrap4.min.js"></script>
     <script>
       $(document).ready( function () {
           $('#example_table').DataTable();
       } );

       $(document).ready(function(){  
      $('.view_data').click(function(){  
           var employee_id = $(this).attr("id");  
           $.ajax({  
                url:"tax_status_ajax.php",  
                method:"post",  
                data:{employee_id:employee_id},  
                success:function(data){  
                     $('#employee_detail').html(data);  
                     $('#dataModal').modal("show");  
                }  
           });  
      });  
 });  

 $(document).ready(function(){  
      $('.view_datas').click(function(){  
           var employee_ids = $(this).attr("id");  
           $.ajax({  
                url:"tax_del_ajax.php",  
                method:"post",  
                data:{employee_ids:employee_ids},  
                success:function(data){  
                     $('#employee_detail1').html(data);  
                     $('#dataModal1').modal("show");  
                }  
           });  
      });  
 });  

 $(document).ready(function(){  
      $('.view_datase').click(function(){  
           var employee_idse = $(this).attr("id");  
           $.ajax({  
                url:"tax_edit_ajax.php",  
                method:"post",  
                data:{employee_idse:employee_idse},  
                success:function(data){  
                     $('#employee_detailse').html(data);  
                     $('#dataModalse').modal("show");  
                }  
           });  
      });  
 });
     </script>

</body>

</html>