Your IP : 3.145.110.145


Current Path : /home/lentoinv/covisclubinternational.com/profile/
Upload File :
Current File : /home/lentoinv/covisclubinternational.com/profile/upload.php

<?php
session_start();
include("lib/connect.inc.php");
$uid = $covis->Uid();

if(isset($_GET['cat'])){
    $cat=$_GET['cat'];
    if(sqL1('material','cat',$cat)==0){
    $q = $db->query("DELETE FROM bookcat WHERE sn = '$cat' ");
if($q){ $report = 'Operation Successful'; }
}
}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Manage e-library</title>
    <link rel="shortcut icon" href="img/fav.png" />
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Font Awesome -->
    <?php include('head.php'); ?>
</head>
<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper">

    <?php include('nav.php'); ?>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
    <section class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1> Uploads</h1>
          </div>
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="index.php">Home</a></li>
              <li class="breadcrumb-item active">Uploads</li>
            </ol>
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section>
        <!-- Content Header (Page header) -->
        <div class="content-header">
            <div class="container-fluid">

                <!-- Content -->


                    <div id="refresh"><?php if(isset($report)){$covis->Alert(); } ?></div>

                    <div class="content-">
                        <div class="container-fluid">
                             <div class="row">
                            <div class="col-md-7">
                                <div class="card ">
                                   
                        <div class="card-header text-white bg-dark text-center">
                                     <h5>Recently Uploaded</h5>
                        </div>
                        
                       <div class="card-body">
                        <div class="table-responsive">
                            <table class="table table-striped table-bordered dataTable" id="example1">
                                <thead>
                                <tr>
                                    <th>S/N</th>
                                    <th>Title</th>
                                 <!--    <th>Description</th> -->
                                    <th>#D</th>
                                    <th>Action</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php $sql = $db->query("SELECT * FROM material ORDER BY created DESC "); $e = 0;
                                while($row = $sql->fetch_assoc()){ $e +=1;
                                ?>
                                    <tr>
                                        <td><?php  echo $e ?></td>
                                        <td><b><?php  echo $row['title'] ?></b><br><?php  echo $row['description'] ?></td>
                                   <!--      <th></th> -->
                                        <td><?php  echo $row['downloads'] ?></td>
                                        <td>
                                            
                                             <form method="get">
                                                
                                                <button class="btn-primary btn-xs" type="submit" value="<?php echo $row['sn'] ?>" name="ebookid">Update</button>

                                            </form>
                                        </td>
                                    </tr>
                                <?php } ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>

                                        <?php if(isset($_GET['ebookid'])){ $ebook = $_GET['ebookid'];

                            $sql = $db->query("SELECT * FROM material WHERE sn='$ebook'"); 
                                $row = $sql->fetch_assoc(); $scat = $row['cat'];
                                 ?>


      <div class="card ">

                                        
                                       <div class="card-header text-white bg-dark text-center mt-3">
                                                     <h5>Update Materials</h5>
                                                 </div>
                                                 <div class="card-body">
                                                     <form method="post">
                                                <input type="hidden" name="name" vlaue="<?php echo $row['material'] ?>"/>
                                                <button class="btn-danger btn-xs" type="submit" value="<?php echo $row['sn'] ?>" name="DeleteMaterial">Delete</button>

                                            </form>

                                                    <img src="material/<?= $row['cover'] ?>" width="100%">
                     

                                        <form method="post" enctype="multipart/form-data">
                                            <div class="row">
                                                <div class="col-md-12">Category: </div>
                                                <div class="col-md-12 form-group">
                                                    <select class="form-control" name="cat" required/>
                                                    <option>Select Category...</option>
                                                    <?php $sq = $db->query("SELECT * FROM bookcat ORDER BY cat ");
                                                 while($ro = mysqli_fetch_assoc($sq)){ $ca = $ro['sn']==$scat ? ' selected': ''; echo '<option value="'.$ro['sn'].'" '.$ca.'>'.$ro['cat'].'</option>';} ?>
                                                    </select>
                                                </div>
                                                <div class="col-md-12">Title: </div>
                                                <div class="col-md-12 form-group">
                                                    <input type="text" class="form-control" name="title" placeholder="Title" value="<?php echo $row['title'] ?>" required/>
                                                </div>
                                                <div class="col-md-12">Description: </div>
                                                <div class="col-md-12 form-group">
                                                    <input type="text" value="<?php echo $row['description'] ?>" class="form-control" name="description" placeholder="Description" required/>
                                                </div>
                                                 <div class="col-md-12">Stage 1 Price: </div>
                                            <div class="col-md-12 form-group">
                                                <input type="number" class="form-control" name="price1" value="<?php echo $row['p1'] ?>" placeholder="Stage 1 Price" required/>
                                            </div>
                                            <div class="col-md-12">Stage 2 Price: </div>
                                            <div class="col-md-12 form-group">
                                                <input type="number" class="form-control" name="price2" value="<?php echo $row['p2'] ?>" placeholder="Stage 2 Price" required/>
                                            </div>
                                            <div class="col-md-12">Stage 3 Price: </div>
                                            <div class="col-md-12 form-group">
                                                <input type="number" class="form-control" value="<?php echo $row['p3'] ?>" name="price3" placeholder="Stage 3 Price" required/>
                                            </div>
                                            <div class="col-md-12">Stage 4 Price: </div>
                                            <div class="col-md-12 form-group">
                                                <input type="number" class="form-control" value="<?php echo $row['p4'] ?>" name="price4" placeholder="Stage 4 Price" required/>
                                            </div>
                                                <div class="pull-right">
                                                    <button type="submit" class="btn btn-primary" name="UpdateMaterial">UPDATE BOOK INFORMATION</button>
                                                </div>
                                        </form>
    
   </div>    </div> 
                                
<div class="p-3">
<form method="post" enctype="multipart/form-data">

                                            <div class="col-md-12 form-group">PDF Book Material:
                                                <input type="file" name="material" class="form-control" required/>
                                            </div>

                                           <div class="col-md-12 form-group">Book Cover:
                                                 <input type="file" name="cover" id="input-file-now-custom-1" class="form-control" required/>
                                            </div>
   <button type="submit" class="btn btn-primary" name="UpdateMaterial2">Update Book </button>
</form></div>


                                 </div>



                                    <?php } ?>

                                </div>
                            
                      
                        <div class="col-md-5">
                            <div class="card ">
                               
                                    <div class="card-header text-white bg-dark text-center">
                                                     <h5>Upload Materials</h5>
                                                 </div>
                                   
                                    <br/>
                                     <div class="card-body">
                                 

                                    <form method="post" enctype="multipart/form-data">
                                        <div class="row">
                                            <div class="col-md-12">Category: </div>
                                            <div class="col-md-12 form-group">
                                                <select class="form-control" name="cat" required/>
                                                <option value="">Select Category...</option>
                                              <?php $sql = $db->query("SELECT * FROM bookcat ORDER BY cat ");
                                                 while($row = mysqli_fetch_assoc($sql)){  echo '<option value="'.$row['sn'].'">'.$row['cat'].'</option>';} ?>
                                                </select>
                                            </div>
                                            <div class="col-md-12">Title: </div>
                                            <div class="col-md-12 form-group">
                                                <input type="text" class="form-control" name="title" placeholder="Title" required/>
                                            </div>
                                            <div class="col-md-12">Description: </div>
                                            <div class="col-md-12 form-group">
                                                <input type="text" class="form-control" name="description" placeholder="Description" required/>
                                            </div>
                                            <div class="col-md-12">Stage 1 Price: </div>
                                            <div class="col-md-12 form-group">
                                                <input type="number" class="form-control" name="price1" placeholder="Stage 1 Price" required/>
                                            </div>
                                            <div class="col-md-12">Stage 2 Price: </div>
                                            <div class="col-md-12 form-group">
                                                <input type="number" class="form-control" name="price2" placeholder="Stage 2 Price" required/>
                                            </div>
                                            <div class="col-md-12">Stage 3 Price: </div>
                                            <div class="col-md-12 form-group">
                                                <input type="number" class="form-control" name="price3" placeholder="Stage 3 Price" required/>
                                            </div>
                                            <div class="col-md-12">Stage 4 Price: </div>
                                            <div class="col-md-12 form-group">
                                                <input type="number" class="form-control" name="price4" placeholder="Stage 4 Price" required/>
                                            </div>
                                         
                                            <div class="col-md-12">PDF Book Material: </div>
                                            <div class="col-md-12 form-group">
                                                <input type="file" name="material" class="form-control" required/>
                                            </div>

                                            <div class="col-md-12">Book Cover: </div>
                                           <div class="col-md-12 form-group">
                                                 <input type="file" name="cover" id="input-file-now-custom-1" class="dropify" required/>
                                            </div>



                                        </div>
                                        <div class="row">
                                            <div class="col-md-12">
                                                <div class="pull-right">
                                                    <button type="submit" class="btn btn-primary" name="UploadMaterial">Upload Book</button>
                                                </div>
                                    </form>

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

                             <div class="card ">
                             <div class="card-header text-white bg-dark text-center">
                                                     <h5>CREATE CATEGORY</h5>
                                                 </div>
                                   
                           
                                     <div class="card-body">
                                 
                                    <form method="post">
                                       <label>Category Title</label>
                                            <input type="text" name="cat" class="form-control mb-3" style="display: inline;"> <button type="submit" class="btn btn-primary" name="BookCat" style="float: right">Create New Book Category</button></h5></form>


<br><br>
                                         
                                    <b>CATEGORIES</b>
                                    <table class="table">
                                        <tr>
                                            <th>Category</th><th>Books</th><th>Action</th>
                                        </tr>
                                        <?php  $sq = $db->query("SELECT * FROM bookcat ORDER BY cat ");
                                                 while($row = mysqli_fetch_assoc($sq)){ $c=sqL1('material','cat',$row['sn']);  ?>
                                        <tr>
                                            <td><?= $row['cat'] ?></td><td><?= $c ?></td><td><?php if($c==0){ ?> <a href="?cat=<?= $row['sn'] ?>">DELETE</a>  <?php } ?></td>
                                        </tr>
                                    <?php } ?>
                                    </table>
                                </div>
                            </div>




                        </div>

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


        </div>
    </div>
        <!-- /.card-body -->

        <!-- /.card -->
    </div>
    <!-- right col -->
</div>
<!-- /.row (main row) -->
</div><!-- /.container-fluid -->

<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php include('foot.php'); ?>

<!-- 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>
<!-- jQuery UI 1.11.4 -->
<script src="../plugins/jquery-ui/jquery-ui.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 dashboard demo (This is only for demo purposes) -->
<script src="../dist/js/pages/dashboard.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../dist/js/demo.js"></script>
<!-- DataTables -->
<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>
<script src="../plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>


<!-- page script -->
<script>
    $(function () {
        $("#example1").DataTable({
            "responsive": false,
            "autoWidth": false,
        });
        $('#example2').DataTable({
            "paging": true,
            "lengthChange": true,
            "searching": true,
            "ordering": true,
            "info": true,
            "autoWidth": false,
            "responsive": true,
        });
    });
</script>



<!-- page script -->
<script type="text/javascript">
    <?php
    // if($covis->globeStage($uidy)==1 ){
    if($stages==1 ){
        echo $covis->covisTreeGlobe($uid);
    }else{
        echo $covis->covisTree4Globe($uid);
    }
    ?>
</script>

<script src="treant/vendor/raphael.js"></script>
<script src="treant/Treant.js"></script>


<script>
    new Treant( chart_config );
</script>


</body>
</html>

?>