<?php include("includes/header.php"); ?>
<?php // include("includes/auto_out.php"); ?>
<!DOCTYPE html>
<html>
<head>
  <title>Change Codes | <?php echo $sitename;  ?></title>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.css">
    <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.min.css">

   <!--CSS-->
  <link rel="stylesheet" href="style.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.css">
  <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.min.css">

    <!-- Bootstrap Core CSS -->
      <link href="css/bootstrap.min.css" rel="stylesheet">

     <!-- Font Awesome -->
    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">

      <!-- Custom CSS -->
      <link href="css/blog-home.css" rel="stylesheet">

      <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
      <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
      <!--[if lt IE 9]-->
          <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
          <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
          <script src="js/jquery.js"></script>
          <script src="js/bootstrap.js"></script>



</head>

<body>
  <?php  include("includes/dashboard_navbar.php"); ?>
  <!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here-->
  <style>
    body{
      background-color: #f5f5f5;
    }
    .destop-siderbar{
      background-color: #131e2a;
      height: 100%;
      width:240px;
      box-shadow: 0 0 4px 0 rgba(0,0,0,.50), 0 2px 4px 0 rgba(0,0,0,.50);
      position: fixed;
      margin-left:-20px;
      padding:50px 25px;
    }
    .destop-siderbar li{
       padding: 30px 20px;
       list-style: none;
    }
    .destop-siderbar li a{
      color: #fff;
      font-size: 17px;
      padding:10px 0px;
    }
    .destop-siderbar li a i{
      color:rgb(45, 156, 219);
      font-weight: lighter;
    }
    .destop-siderbar .active {
      background-color:#123962;
      box-shadow: 0 0 4px 0 rgba(0,0,0,.50), 0 2px 4px 0 rgba(0,0,0,.50);
      
    }
    .destop-siderbar .active a{
      color:#fff;
    }
    .destop-siderbar .active a:hover{
      color:#fff;
    }
    .destop-siderbar li a:hover{
      color: #a5bdd9;
      text-decoration: none;
    }
    .panel{
      border-radius: 0px;
      border-color: transparent;
    }
    .input-danger{
       border:1px solid darkred;
       color:darkred;
     }
     .input-danger::placeholder{
       opacity: 0.6;
       color:darkred;
     }
  </style>

  <div class="container-fluid">
    <div class="row">
      <!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here-->
      <div class="col-sm-2 hidden-xs" style="height: 100%;">
               <?php include("includes/desktop_side.php"); ?>
      </div>
      <!--/////////////////////// DESTOP Side bar starts here--><!-- DESTOP Side bar starts here--><!-- DESTOP Side bar starts here-->
      <div class="col-sm-10">
        <br><br><br><br>
        

        <!----------------------------------------------------------------------------------->

        <div class="row">
          <div class="col-sm-8">
            <div class="row">
              

              <div class="col-sm-6">
                 <div class="panel panel-default">
                  <div class="panel-body">
                    <img src="images/password.png" width="35">&nbsp;&nbsp;<b>CHANGE CODES</b>
                <br><hr>
                
                    <?php
                 $query = mysqli_query($conn, "SELECT * FROM admin");
                 $row = mysqli_fetch_assoc($query);
                 
                 
                  // Local bnk trans codes
                 $db_cot_code = $row["cot_code"];
                 $db_aml_code = $row["aml_code"];
                 $db_nrt_code = $row["nrt_code"];
                 $db_tax_code = $row["tax_code"];
                 $db_access_code = $row["access_code"];
                 $db_snbac_code = $row["snbac_code"];
                 $db_imf_code = $row["imf_code"];
                 
                 //Intrtnational wire trans codes
                 $db_Icot_code = $row["icot_code"];
                 $db_Iaml_code = $row["iaml_code"];
                 $db_Inrt_code = $row["inrt_code"];
                 $db_Itax_code = $row["itax_code"];
                 $db_Iaccess_code = $row["iaccess_code"];
                 $db_Isnbac_code = $row["isnbac_code"];
                 $db_Iimf_code = $row["iimf_code"];
                 
                 //echo "<script>alert('$cot_code');</script>";
                 
                 
                 
                ?>
                <h4>Local Bank Transfer Codes</h4>
                <?php
                 if(isset($_POST["codebtn"])){
                     $cot_code = $_POST["cot_code"];
                     $aml_code = $_POST["aml_code"];
                     $nrt_code = $_POST["nrt_code"];
                     
                     $tax_code = $_POST["tax_code"];
                     $access_code = $_POST["access_code"];
                     $snbac_code = $_POST["snbac_code"];
                     $imf_code = $_POST["imf_code"];
                     
                     $query = mysqli_query($conn, "UPDATE admin SET cot_code = '$cot_code', aml_code = '$aml_code', nrt_code = '$nrt_code', tax_code = '$tax_code', access_code = '$access_code', snbac_code = '$snbac_code', imf_code = '$imf_code'");
                     
                     echo "<script>alert('Updated Successfully!');</script>";
                     echo "<script>window.location.assign('change-codes.php');</script>";
                 }
                ?>
                <hr>
                
                <form action="" method="POST">
                    <label>COT CODE</label><br>
                    <input type="text" name="cot_code" value="<?php echo $db_cot_code; ?>"/>
                    <br><br>
                    <label>Anti Fraud Agency CODE/AML</label><br>
                    <input type="text" name="aml_code" value="<?php echo $db_aml_code; ?>"/>
                    <br><br>
                    <label>NRT CODE</label><br>
                    <input type="text" name="nrt_code" value="<?php echo $db_nrt_code; ?>"/>
                    
                    <br><br>
                    
                    <label>TAX CODE</label><br>
                    <input type="text" name="tax_code" value="<?php echo $db_tax_code; ?>"/>
                    
                    <br><br>
                    
                    <label>ACCESS CODE</label><br>
                    <input type="text" name="access_code" value="<?php echo $db_access_code; ?>"/>
                    
                    <br><br>
                    
                    <label>SNBAC CODE</label><br>
                    <input type="text" name="snbac_code" value="<?php echo $db_snbac_code; ?>"/>
                    
                    <br><br>
                    
                    <label>IMF CODE</label><br>
                    <input type="text" name="imf_code" value="<?php echo $db_imf_code; ?>"/>
                    
                    <br><br>
                    
                    <button type="submit" name="codebtn" class="btn btn-primary" style="border-radius:0px;">Update Code</button>
                    
                    <br><hr>
                     
                </form>
                
                
                <h4>International Bank Transfer Codes</h4>
                <?php
                 if(isset($_POST["codebtn2"])){
                     $Icot_code = $_POST["icot_code"];
                     $Iaml_code = $_POST["iaml_code"];
                     $Inrt_code = $_POST["inrt_code"];
                     
                     $Itax_code = $_POST["itax_code"];
                     $Iaccess_code = $_POST["iaccess_code"];
                     $Isnbac_code = $_POST["isnbac_code"];
                     $Iimf_code = $_POST["iimf_code"];
                     
                     $query = mysqli_query($conn, "UPDATE admin SET icot_code = '$Icot_code', iaml_code = '$Iaml_code', inrt_code = '$Inrt_code', itax_code = '$Itax_code', iaccess_code = '$Iaccess_code', isnbac_code = '$Isnbac_code', iimf_code ='$Iimf_code'");
                     
                     echo "<script>alert('Updated Successfully!');</script>";
                     echo "<script>window.location.assign('change-codes.php');</script>";
                 }
                ?>
                
                <form action="" method="POST">
                    <label>COT CODE</label><br>
                    <input type="text" name="icot_code" value="<?php echo $db_Icot_code; ?>"/>
                    <br><br>
                    <label>AML CODE</label><br>
                    <input type="text" name="iaml_code" value="<?php echo $db_Iaml_code; ?>"/>
                    <br><br>
                    <label>NRT CODE</label><br>
                    <input type="text" name="inrt_code" value="<?php echo $db_Inrt_code; ?>"/>
                    
                    <br><br>
                    <label>TAX CODE</label><br>
                    <input type="text" name="itax_code" value="<?php echo $db_Itax_code; ?>"/>
                    
                    <br><br>
                    <label>ACCESS CODE</label><br>
                    <input type="text" name="iaccess_code" value="<?php echo $db_Iaccess_code; ?>"/>
                    
                    <br><br>
                    <label>SNBAC CODE</label><br>
                    <input type="text" name="isnbac_code" value="<?php echo $db_Isnbac_code; ?>"/>
                    
                    <br><br>
                    <label>IMF CODE</label><br>
                    <input type="text" name="iimf_code" value="<?php echo $db_Iimf_code; ?>"/>
                    
                    <br><br>
                    
                    <button type="submit" name="codebtn2" class="btn btn-primary" style="border-radius:0px;">Update Code</button>
                    
                    <br><hr>
                     
                </form>


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

              <div class="col-sm-6">
                
              </div>

            </div>

            <!--------------------------->







          </div>


          <div class="col-sm-4">
            
            </div>
          </div>
        </div>
        
        
        
        
        
        
      </div>
    </div>
  </div>
</body>
</html>