Your IP : 52.14.173.116


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

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

if(isset($_SESSION['report'])){$report = $_SESSION['report']; }

?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Course Trainer</title>
    <!-- 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'); ?>

<script src="https://cdn.tiny.cloud/1/ouel3uwpwm72k70z91sb1tnlogecmzdka4g5vu5fpb3fheoo/tinymce/5/tinymce.min.js"></script>

  <script>tinymce.init({selector:'textarea'});</script>
</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>Course Trainer</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">Course Trainer</li>
            </ol>
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section>
        <!-- Content Header (Page header) -->
        <div class="content">
            <div class="container-fluid">


                        <div class="row">
                            <?php if(isset($_GET['index'])){ ?>
                        <div class="col-md-12">
                            <div class="card ">
                                <div class="card-header text-white bg-dark">
                                    <h5>Become a Facilitator</h5>
                                </div> 
                                <div class="card-body">
                                    
                                 

                                

                                    <form class="form-group" method="post">
                                       <table class="table table-sm"> 
                                        <tr><th>Course Title</th><td><?php echo sqLx('training','sn',$_GET['index'],'title') ?></td></tr> 
                                        <tr><th>Course Price</th><td>$<?php echo sqLx('training','sn',$_GET['index'],'cost1') ?> / $<?php echo sqLx('training','sn',$_GET['index'],'cost2') ?></td></tr> 
                                        <tr><th>Course Date</th><td><?php echo sqLx('training','sn',$_GET['index'],'date') ?></td></tr>
                                    </table>

                                        <select class="form-control" name="location" required>
                                            <option value="">Select Location</option>
                                            <?php $location = explode(';', sqLx('training','sn',$_GET['index'],'locations'));
                                            $count = count($location);
                                            $i = 0;
                                            while($i<$count){ $e=$i++ ?>
                                                <option><?php echo $location[$e] ?></option>
                                            <?php } ?>
                                        </select>
                                         <br/>
                                         <textarea class="form-control" name="note" placeholder="Give a brief description of your self and prove that you can deliver excellent training on the selected topic" rows="10"></textarea><br>
                                        
                                        <button class="btn btn-success btn-block" name="CreateTrainer">Register as Facilitator</button>
                                        <br/><br/>
                                    </form>

                                </div>

                            </div>


                    </div>
                <?php } ?>
                            <?php if(isset($_GET['train'])){ $train = $_GET['train']; 
                            $tsn = sqLx('trainer','sn',$train,'training')  ?>
                        <div class="col-md-12">
                            <div class="card ">
                                <div class="card-header text-white bg-dark">
                                    <h5>Update Facilitator Information</h5>
                                </div> 
                                <div class="card-body">
                                    
                                 

                                

                                    <form class="form-group" method="post">
                                       <table class="table table-sm"> 
                                        <tr><th>Course Title</th><td><?php echo sqLx('training','sn',$tsn,'title') ?></td></tr> 
                                        <tr><th>Course Price</th><td>$<?php echo sqLx('training','sn',$tsn,'cost1') ?> / $<?php echo sqLx('training','sn',$tsn,'cost2') ?></td></tr> 
                                        <tr><th>Course Date</th><td><?php echo sqLx('training','sn',$tsn,'date') ?></td></tr>
                                    </table>
<?php //echo sqLx('trainer','sn',$train,'location'); ?>
                                        <select class="form-control" name="location" required>
                                        <option value="">Select Location</option>
                                            <?php $location = explode(';', sqLx('training','sn',$tsn,'locations'));
                                            $count = count($location);
                                            $i = 0;
                                            while($i<$count){ $e=$i++; $sel = trim($location[$e])==trim(sqLx('trainer','sn',$train,'location')) ? 'selected' : ''; ?>
                                                <option <?php echo $sel ?>><?php echo $location[$e] ?></option>
                                            <?php } ?>
                                        </select>
                                         <br/>
                                         <textarea class="form-control" name="note" placeholder="Give a brief description of your self and prove that you can deliver excellent training on the selected topic" rows="10"><?php echo sqLx('trainer','sn',$train,'note') ?></textarea><br>
                                        
                                        <button class="btn btn-success btn-block" name="EditTrainer">Update Facilitator Information</button>
                                       
                                    </form>

                                </div>

                            </div>


                    </div>
                <?php } ?>
                        <div class="col-md-12">
                            <div class="card ">
                                
                                    <div class="card-header text-white bg-dark">
                                        <h5>List of Training Events</h5>
                                    </div> 
                                   
                                    <div class="card-body p-0">
                                        
                                    
                                    <table class="table table-striped table-bordered dataTable table-sm" id="example1">
                                        <tr>
                                            <th>S/N</th>
                                            <th>Title</th>
                                            <th>Member Price</th>
                                            <th>Non Member Price</th>

                                            <th>Date</th>
                                            <th>Location</th>
                                        </tr>
                                        <?php $i=0;
                                        $sql = $db->query("SELECT * FROM training WHERE status=1");
                                        while($row = $sql->fetch_assoc()){ $i +=1; 
                                            ?>
                                            <tr>
                                                <td><?php echo $i  ?></th>
                                                <td><a href="?index=<?php echo $row['sn'] ?>"  ><?php echo $row['title']  ?></a></th>

                                                <td>$<?php echo $row['cost1']  ?></th>
                                                <td>$<?php echo $row['cost2']  ?></th>
                                                <td><?php echo $row['date']  ?></th>
                                                <td><?php echo $row['locations']  ?></th>
                                              
                                            </tr>
                                        <?php } ?>
                                       
                                    </table>
                                   
                                </div>
                            </div>
                           
                            <div class="card ">
                                
                                    <div class="card-header text-white bg-dark">
                                        <h5>My Facilitator Applications</h5>
                                    </div> 
                                   
                                    <div class="card-body p-0">
                                        
                                    
                                    <table class="table table-striped table-bordered dataTable table-sm" id="example1">
                                        <tr>
                                            <th>S/N</th>
                                            <th>Title</th>

                                            <th>Location</th>  
                                            <th>Note</th>
                                        </tr>
                                        <?php $i=0;
                                        $sql = $db->query("SELECT * FROM trainer WHERE id='$uid' ");
                                        while($row = $sql->fetch_assoc()){ $i +=1; 
                                            ?>
                                            <tr>
                                                <td><?php echo $i  ?></th>
                                            <td><a href="?train=<?php echo $row['sn'] ?>"  ><?php echo sqLx('training','sn',$row['training'],'title')  ?></a></th>
                                                    <td><?php echo $row['location']  ?></th>
                                                <td><?php echo $row['note']  ?></th>
                                            </tr>
                                        <?php } ?>
                                       
                                    </table>
                                   
                                </div>
                            </div>
                            </div>
                        
                    </div>



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

<!-- 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": true,
            "autoWidth": false,
        });
        $('#example2').DataTable({
            "paging": true,
            "lengthChange": false,
            "searching": false,
            "ordering": true,
            "info": true,
            "autoWidth": false,
            "responsive": true,
        });
    });

function EditTrain(a,b,c,d,e,f){
$('#EditTrain').modal('show');
$('#ShowContent').html('<div class="modal-body"><input type="hidden" value="'+f+'" name="sn"/><input type="text" value="'+a+'" class="form-control" name="title" placeholder="Training Title" required/> <br/><input type="number"  value="'+b+'" class="form-control" name="cost1" placeholder="Member Price" required/> <br/><input type="number"  value="'+c+'" class="form-control" name="cost2" placeholder="Non Member Price" required/> <br/><input type="text" value="'+d+'" class="form-control" name="date" placeholder="Training Date & Time" required/> <br/><input type="text" value="'+e+'" class="form-control" name="location" placeholder="Training Locations" required/><small>Separate multiple locations with comma</small></div><div class="modal-footer"><button type="submit" class="btn btn-warning" name="DeleteTraining">Delete Training</button><button type="submit" class="btn btn-primary" name="EditTraining">Edit Training</button><button type="button" class="btn btn-danger" data-dismiss="modal">Close</button></div>');
}
</script>
</body>
</html>

?>