<?php 
    session_start(); include"../connect/db.php"; 
?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="optinum Bank Plc is a full service commercial Bank operating through a network of about 305 branches and service outlets located in major centres across Uk, Asia and Sub Saharan Africa . The Bank serves its various markets through 4 business segments: Personal, Business, Commercial and Corporate & Investment banking. ">
    <meta name="keywords" content="optinum Bank Plc, optinum Bank, optinum Uk, optinum Bank, Gold Bank, optinum PLC, optinum Bank, Banks In Uk">
    <meta name="author" content="optinum Bank PLC">

    <!-- Title Page-->
    <title>E-Banking | Transactions</title>

      <!-- fav icon -->
    <link href="images/icon/favicon-32x32.png" rel="shortcut icon" type="image/png">  

    <!-- Fontfaces CSS-->
    <link href="css/font-face.css" rel="stylesheet" media="all">
    <link href="vendor/font-awesome-4.7/css/font-awesome.min.css" rel="stylesheet" media="all">
    <link href="vendor/font-awesome-5/css/fontawesome-all.min.css" rel="stylesheet" media="all">
    <link href="vendor/mdi-font/css/material-design-iconic-font.min.css" rel="stylesheet" media="all">

    <!-- Bootstrap CSS-->
    <link href="vendor/bootstrap-4.1/bootstrap.min.css" rel="stylesheet" media="all">

    <!-- Vendor CSS-->
    <link href="vendor/animsition/animsition.min.css" rel="stylesheet" media="all">
    <link href="vendor/bootstrap-progressbar/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet" media="all">
    <link href="vendor/wow/animate.css" rel="stylesheet" media="all">
    <link href="vendor/css-hamburgers/hamburgers.min.css" rel="stylesheet" media="all">
    <link href="vendor/slick/slick.css" rel="stylesheet" media="all">
    <link href="vendor/select2/select2.min.css" rel="stylesheet" media="all">
    <link href="vendor/perfect-scrollbar/perfect-scrollbar.css" rel="stylesheet" media="all">
    <link href="vendor/vector-map/jqvmap.min.css" rel="stylesheet" media="all">

    <!-- Main CSS-->
    <link href="css/theme.css" rel="stylesheet" media="all">

    <style>
        .gradient-mountain{
            background: #005939;
            background: -webkit-linear-gradient(45deg, #08005b, #4236bd)!important;
            background: linear-gradient(45deg, #08005b, #4236bd)!important;
        }
    </style>

</head>

<body class="animsition">
    <div class="page-wrapper">

        <!-- MENU SIDEBAR-->
            <?php include"includes/sidebar.php"; ?>
        <!-- END MENU SIDEBAR-->

        <!-- PAGE CONTAINER-->
        <div class="page-container2">
            <!-- HEADER DESKTOP-->
                <?php include"includes/header.php"; ?>
            <!-- END HEADER DESKTOP-->
            <br>
            <section>
                    <div style="margin-top: 100px;" class="row">
                      <div class="col-lg-4"></div>
                      <div style="text-align:center" class="col-lg-4">
                        <span data-toggle="modal" data-target="#CreateMsg" class="btn btn-dark">&nbsp;<i class="fa fa-plus"></i>&nbsp; Create Error Message</span>
                      </div>
                      <div class="col-lg-4"></div>
                    </div></br>
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="card">
                                <div class="card-body">
                                    <h5 class="card-title">Transaction History</h5>
                                    <div class="table-responsive">
                                       <table class="table table-striped">
                                          <thead>
                                            <tr>
                                                <th scope="col">#</th>
                                                <th scope="col">User</th>
                                                <th scope="col">Purpose</th>
                                                <th scope="col">Message</th>
                                                <th scope="col"></th>
                                            </tr>
                                          </thead>
                                          <tbody>
                                                <?php

                                                    $bola = mysqli_query($con,"SELECT * FROM errormsg");
                                                    
                                                    if( mysqli_num_rows($bola) == 0 ){
                                                      echo
                                                      '
                                                        <tr>
                                                          <td>Oops!!! There is no data Yet</td>
                                                        </tr>
                                                      
                                                      ';
                                                    }
                                                    else{
                                                      $i = 1;                                                      
                                                      while( $brow = mysqli_fetch_assoc($bola) ){

                                                          echo
                                                          '
                                                              <tr>
                                                                  <td>'.$i.'</td>
                                                                  <td>'.$brow['user'].'</td>
                                                                  <td>'.$brow['purpose'].'</td>
                                                                  <td style="text-overflow: ellipsis;overflow: hidden;text-overflow: ellipsis;max-width: 300px;">'.$brow['msg'].'</td>
                                                                  <td><span onclick={deleteMsg("'.$brow['purpose'].'","'.$brow['user'].'")} class="btn btn-sm btn-danger"><i class="fa fa-trash"></i></span></td>
                                                                  <td><span onclick={editMsg1("'.$brow['purpose'].'","'.$brow['user'].'")} class="btn btn-sm btn-dark"><i class="fa fa-edit"></i></span></td>
                                                              </tr>
                                                          ';
                                                          $i++;
                                                      }                                                      
                                                    }
                                                     
                                                ?>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>  
                    </div><!--End Row-->

                      <br>
                  </div>
                </div>
            </section>
            <!-- END PAGE CONTAINER-->
        </div>

        <!-- Button trigger modal -->
        <span id="scamBtn" style="display: none;" data-toggle="modal" data-target="#exampleModalCenter"></span>

        <!-- Modal -->
        <div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
          <div class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">&times;</span>
                </button>
              </div>
              <div class="modal-body">
                <div class="card">
                    <div id="editMsg" class="card-body">
                        
                    </div>
                </div>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
              </div>
            </div>
          </div>
        </div>



        <!-- Modal Create-->
        <div class="modal fade" id="CreateMsg" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
          <div class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">&times;</span>
                </button>
              </div>
              <div class="modal-body">
                <div class="card">
                    <div class="card-body">
                      <div class="login-form">
                        <form class="regForm form">
                            <div class="form-group">
                                <input class="au-input au-input--full" type="text" name="user" placeholder="User">
                            </div>
                            <div class="form-group">
                                <input class="au-input au-input--full" type="text" name="purpose" placeholder="Purpose">
                            </div>                            
                            <div class="form-group">
                                <textarea rows="4" class="au-input au-input--full" name="msg" id="msg" ></textarea>
                            </div>
                            <span onclick="createmsg()" class="au-btn au-btn--block au-btn--green m-b-20">Update</span>
                        </form>    
                      </div>                        
                    </div>
                </div>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
              </div>
            </div>
          </div>
        </div>        
    </div>

    <!-- Jquery JS-->
    <script src="vendor/jquery-3.2.1.min.js"></script>
    <!-- Bootstrap JS-->
    <script src="vendor/bootstrap-4.1/popper.min.js"></script>
    <script src="vendor/bootstrap-4.1/bootstrap.min.js"></script>
    <!-- Vendor JS       -->
    <script src="vendor/slick/slick.min.js">
    </script>
    <script src="vendor/wow/wow.min.js"></script>
    <script src="vendor/animsition/animsition.min.js"></script>
    <script src="vendor/bootstrap-progressbar/bootstrap-progressbar.min.js">
    </script>
    <script src="vendor/counter-up/jquery.waypoints.min.js"></script>
    <script src="vendor/counter-up/jquery.counterup.min.js">
    </script>
    <script src="vendor/circle-progress/circle-progress.min.js"></script>
    <script src="vendor/perfect-scrollbar/perfect-scrollbar.js"></script>
    <script src="vendor/chartjs/Chart.bundle.min.js"></script>
    <script src="vendor/select2/select2.min.js">
    </script>
    <script src="vendor/vector-map/jquery.vmap.js"></script>
    <script src="vendor/vector-map/jquery.vmap.min.js"></script>
    <script src="vendor/vector-map/jquery.vmap.sampledata.js"></script>
    <script src="vendor/vector-map/jquery.vmap.world.js"></script>

    <script src="js/sweetalert2.all.min.js" ></script>

    <!-- Main JS-->
    <script src="js/main.js"></script>
    <script src="js/custom.js"></script>

</body>

</html>
<!-- end document-->
