<?php 
  include('database/connection.php');

 session_start();
  if($_SESSION['email'] != 'admin@codesitex.com')
  {
    header("Location: login.php");
  }
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>codesitex | Dashboard</title>

    <!-- Google Font: Source Sans Pro -->
    <link
      rel="stylesheet"
      href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback"
    />
    <!-- Font Awesome -->
    <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css" />
    <!-- Ionicons -->
    <link
      rel="stylesheet"
      href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css"
    />
    <!-- Tempusdominus Bootstrap 4 -->
    <link
      rel="stylesheet"
      href="plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css"
    />
    <!-- iCheck -->
    <link
      rel="stylesheet"
      href="plugins/icheck-bootstrap/icheck-bootstrap.min.css"
    />
     
    
    <!-- JQVMap -->
    <link rel="stylesheet" href="plugins/jqvmap/jqvmap.min.css" />
    <!-- Theme style -->
    <link rel="stylesheet" href="dist/css/adminlte.min.css" />
    <!-- overlayScrollbars -->
    <link
      rel="stylesheet"
      href="plugins/overlayScrollbars/css/OverlayScrollbars.min.css"
    />
    <!-- Daterange picker -->
    <link rel="stylesheet" href="plugins/daterangepicker/daterangepicker.css" />
    <!-- summernote -->
    <link rel="stylesheet" href="plugins/summernote/summernote-bs4.min.css" />
    <link rel="stylesheet" href="plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
     <link rel="stylesheet" href="plugins/datatables-responsive/css/responsive.bootstrap4.min.css">
    <style>
      .my_image {
        border-radius: 50%;
        height: 140%;
        width: 38px;
      }
      
    </style>
  </head>
  <body class="hold-transition sidebar-mini layout-fixed">
    <div class="wrapper">
      <!-- Preloader -->
      <div
        class="preloader flex-column justify-content-center align-items-center"
      >
        <img
          class="animation__shake"
          src="dist/img/AdminLTELogo.png"
          alt="AdminLTELogo"
          height="60"
          width="60"
        />
      </div>

      <!-- Navbar -->
      <nav class="main-header navbar navbar-expand navbar-white navbar-light">
        <!-- Left navbar links -->
        <ul class="navbar-nav">
          <li class="nav-item">
            <a class="nav-link" data-widget="pushmenu" href="#" role="button"
              ><i class="fas fa-bars"></i
            ></a>
          </li>
          <!-- <li class="nav-item d-none d-sm-inline-block">
            <a href="index3.html" class="nav-link">Home</a>
          </li>
          <li class="nav-item d-none d-sm-inline-block">
            <a href="#" class="nav-link">Contact</a>
          </li> -->
        </ul>

        <!-- Right navbar links -->
        <ul class="navbar-nav ml-auto">
          <!-- Navbar Search -->
          <!--<li class="nav-item">-->
          <!--  <a-->
          <!--    class="nav-link"-->
          <!--    data-widget="navbar-search"-->
          <!--    href="#"-->
          <!--    role="button"-->
          <!--  >-->
          <!--    <i class="fas fa-search"></i>-->
          <!--  </a>-->
            
          <!--</li>-->

          <!-- Messages Dropdown Menu -->
          <!--<li class="nav-item dropdown">-->
          <!--  <a class="nav-link" data-toggle="dropdown" href="#">-->
          <!--    <i class="far fa-comments"></i>-->
          <!--    <span class="badge badge-danger navbar-badge">3</span>-->
          <!--  </a>-->
          <!--  <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">-->
          <!--    <a href="#" class="dropdown-item">-->
                <!-- Message Start -->
          <!--      <div class="media">-->
          <!--        <img-->
          <!--          src="dist/img/user1-128x128.jpg"-->
          <!--          alt="User Avatar"-->
          <!--          class="img-size-50 mr-3 img-circle"-->
          <!--        />-->
          <!--        <div class="media-body">-->
          <!--          <h3 class="dropdown-item-title">-->
          <!--            Brad Diesel-->
          <!--            <span class="float-right text-sm text-danger"-->
          <!--              ><i class="fas fa-star"></i-->
          <!--            ></span>-->
          <!--          </h3>-->
          <!--          <p class="text-sm">Call me whenever you can...</p>-->
          <!--          <p class="text-sm text-muted">-->
          <!--            <i class="far fa-clock mr-1"></i> 4 Hours Ago-->
          <!--          </p>-->
          <!--        </div>-->
          <!--      </div>-->
                <!-- Message End -->
          <!--    </a>-->
          <!--    <div class="dropdown-divider"></div>-->
          <!--    <a href="#" class="dropdown-item">-->
                <!-- Message Start -->
          <!--      <div class="media">-->
          <!--        <img-->
          <!--          src="dist/img/user8-128x128.jpg"-->
          <!--          alt="User Avatar"-->
          <!--          class="img-size-50 img-circle mr-3"-->
          <!--        />-->
          <!--        <div class="media-body">-->
          <!--          <h3 class="dropdown-item-title">-->
          <!--            John Pierce-->
          <!--            <span class="float-right text-sm text-muted"-->
          <!--              ><i class="fas fa-star"></i-->
          <!--            ></span>-->
          <!--          </h3>-->
          <!--          <p class="text-sm">I got your message bro</p>-->
          <!--          <p class="text-sm text-muted">-->
          <!--            <i class="far fa-clock mr-1"></i> 4 Hours Ago-->
          <!--          </p>-->
          <!--        </div>-->
          <!--      </div>-->
                <!-- Message End -->
          <!--    </a>-->
          <!--    <div class="dropdown-divider"></div>-->
          <!--    <a href="#" class="dropdown-item">-->
                <!-- Message Start -->
          <!--      <div class="media">-->
          <!--        <img-->
          <!--          src="dist/img/user3-128x128.jpg"-->
          <!--          alt="User Avatar"-->
          <!--          class="img-size-50 img-circle mr-3"-->
          <!--        />-->
          <!--        <div class="media-body">-->
          <!--          <h3 class="dropdown-item-title">-->
          <!--            Nora Silvester-->
          <!--            <span class="float-right text-sm text-warning"-->
          <!--              ><i class="fas fa-star"></i-->
          <!--            ></span>-->
          <!--          </h3>-->
          <!--          <p class="text-sm">The subject goes here</p>-->
          <!--          <p class="text-sm text-muted">-->
          <!--            <i class="far fa-clock mr-1"></i> 4 Hours Ago-->
          <!--          </p>-->
          <!--        </div>-->
          <!--      </div>-->
                <!-- Message End -->
          <!--    </a>-->
          <!--    <div class="dropdown-divider"></div>-->
          <!--    <a href="#" class="dropdown-item dropdown-footer"-->
          <!--      >See All Messages</a-->
          <!--    >-->
          <!--  </div>-->
          <!--</li>-->
          <!-- Notifications Dropdown Menu -->
          
          <li class="nav-item">
            <a class="nav-link" data-widget="fullscreen" href="#" role="button">
              <i class="fas fa-expand-arrows-alt"></i>
            </a>
          </li>
          <li class="nav-item">
            <a
              class="nav-link"
              data-widget="control-sidebar"
              data-controlsidebar-slide="true"
              href="#"
              role="button"
            >
              <i class="fas fa-th-large"></i>
            </a>
          </li>
        </ul>
      </nav>
      <!-- /.navbar -->

      <!-- Main Sidebar Container -->
      <?php include 'includes/aside.php' ?>

      <!-- Content Wrapper. Contains page content -->
      <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <div class="content-header">
          <div class="container-fluid">
            <div class="row mb-2">
              <div class="col-sm-6">
                <h1 class="m-0">Dashboard</h1>
              </div>
              <!-- /.col -->
              <div class="col-sm-6">
                <ol class="breadcrumb float-sm-right">
                   <li class="breadcrumb-item"><a href="https://kindlesdirectpublishing.com/questionnaire/web">Fill The Form Again</a></li>
                 
                </ol>
              </div>
              <!-- /.col -->
            </div>
            <!-- /.row -->
          </div>
          <!-- /.container-fluid -->
        </div>
        <!-- /.content-header -->

        <!-- Main content -->
        <section class="content">
          <div class="container-fluid">
          <div class="row">
          <!-- left column -->
          <div class="col-md-12">
            <!-- general form elements -->
            <div class="card card-primary">
              <div class="card-header">
                <h3 class="card-title">Web</h3>
              </div>
              <!-- /.card-header -->
              <!-- form start -->
              <div class="card-body">
              <p id="showMessage" style="color:green"></p>
               <table id="example1" class="table table-bordered table-striped">
                  <thead>
                  <tr>
                    <th>Name</th>
                    <th>Buisness Name</th>
                    <th>Email</th>
                    <th>Zib</th>
                    <th>Domain</th>
                    <th>Url</th>
                   
                  </tr>
                  </thead>
                  <tbody>
                   <?php
                         $sql = "SELECT * FROM web ORDER BY `id` DESC";
                        
                       
                           
                        if($result = mysqli_query($link, $sql)){
                            
                            
                          if(mysqli_num_rows($result) > 0){
                            
                            while($row = mysqli_fetch_array($result)){
                               
                                $data = json_decode($row['web']);
                                 $new_id = json_decode($row['id']);
                                 
                                  
                              ?>
                              <tr>
                                <td><?php echo $data->company_name??null; ?></td>
                                <td><?php echo $data->company_business??null; ?></td>
                                <td> <?php echo $data->company_email??null; ?></td>
                                <td> <?php echo $data->company_zip??null; ?></td>
                                <td> <?php echo $data->company_domain??null; ?></td>
                               <td style="width: 20%;">https://codesitex.com/questionnaire/web/show_data.php?id=<?php echo $new_id; ?></td>
                                
                              </tr>
                              <?php
                            }
                          }else{
                            ?> <option value="">No data found</option> <?php
                          }
                        }
                      ?>
                 
                 
                  </tfoot>
                </table>
                </div>
            </div>
            <!-- /.card -->

           

            
            

          </div>
          <!--/.col (left) -->
         
        </div>
          </div>
          <!-- /.container-fluid -->
        </section>
        <!-- /.content -->
      </div>
      <!-- /.content-wrapper -->
      <footer class="main-footer">
        <strong
          >Copyright &copy; 2014-2021
          <a href="https://adminlte.io">AdminLTE.io</a>.</strong
        >
        All rights reserved.
        <div class="float-right d-none d-sm-inline-block">
          <b>Version</b> 3.2.0
        </div>
      </footer>

      <!-- Control Sidebar -->
      <aside class="control-sidebar control-sidebar-dark">
        <!-- Control sidebar content goes here -->
      </aside>
      <!-- /.control-sidebar -->
    </div>
    <!-- ./wrapper -->

    <!-- jQuery -->
    <!-- <script src="plugins/jquery/jquery.min.js"></script> -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <!-- jQuery UI 1.11.4 -->
    <script src="plugins/jquery-ui/jquery-ui.min.js"></script>
    <script src="plugins/datatables/jquery.dataTables.min.js"></script>
<script src="plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
<script src="plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
    <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
    <script>
      $.widget.bridge("uibutton", $.ui.button);
    </script>
    <!-- Bootstrap 4 -->
    <script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
    <!-- ChartJS -->
    <script src="plugins/chart.js/Chart.min.js"></script>
    <!-- Sparkline -->
    <script src="plugins/sparklines/sparkline.js"></script>
    <!-- JQVMap -->
    <script src="plugins/jqvmap/jquery.vmap.min.js"></script>
    <script src="plugins/jqvmap/maps/jquery.vmap.usa.js"></script>
    <!-- jQuery Knob Chart -->
    <script src="plugins/jquery-knob/jquery.knob.min.js"></script>
    <!-- daterangepicker -->
    <script src="plugins/moment/moment.min.js"></script>
    <script src="plugins/daterangepicker/daterangepicker.js"></script>
    <!-- Tempusdominus Bootstrap 4 -->
    <script src="plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
    <!-- Summernote -->
    <script src="plugins/summernote/summernote-bs4.min.js"></script>
    <!-- overlayScrollbars -->
    <script src="plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script>
    <!-- AdminLTE App -->
    <script src="dist/js/adminlte.js"></script>
    <!-- AdminLTE for demo purposes -->
    <script src="dist/js/demo.js"></script>
    <!-- AdminLTE dashboard demo (This is only for demo purposes) -->
    <script src="dist/js/pages/dashboard.js"></script>
  



    <script>



       $(function () {
      $('#selec2').summernote()

        // CodeMirror.fromTextArea(document.getElementById("codeMirrorDemo"), {
        //   mode: "htmlmixed",
        //   theme: "monokai"
        // });
      })

     





    
   
    </script>
    
    
    <script>
  $(function () {
    $("#example1").DataTable({
      "responsive": true, "lengthChange": false, "autoWidth": false,
      "buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"],
      "ordering": false
    }).buttons().container().appendTo('#example1_wrapper .col-md-6:eq(0)');
    
    
  });
</script>
  </body>
</html>
