Your IP : 3.149.24.49


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

<?php
session_start();
include("lib/connect.inc.php");
$uid = $covis->Uid();
if($uidx != 1){
    header("Location:../login.php");
}

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>Create Training</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>Create Training</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">Training</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['course'])){ $course = $_GET['course'] ?>

                        <div class="col-md-12">
                            <div class="card ">
                                <div class="card-header text-white bg-dark">
                                    <h5>Update Training Information</h5>
                                </div> 
                                <div class="card-body">
                                    
                                 

                                

                                    <form class="form-group" method="post">
                                        <input type="text" class="form-control" value="<?php echo sqLx('training','sn',$course,'title') ?>" name="title" placeholder="Training Title" required/> <br/>

                                        <input type="number" value="<?php echo sqLx('training','sn',$course,'cost1') ?>" class="form-control" name="cost1" placeholder="Member's Price" required/> <br/>
                                        <input type="number" value="<?php echo sqLx('training','sn',$course,'cost2') ?>" class="form-control" name="cost2" placeholder="Non Member's Price" required/> <br/>
                                        <input type="text" value="<?php echo sqLx('training','sn',$course,'date') ?>" class="form-control" name="date" placeholder="Training Date & Time" required/> <br/>
                                        <input type="text" value="<?php echo sqLx('training','sn',$course,'locations') ?>" class="form-control" name="location" placeholder="Training Locations" required/>
                                        <small>Separate multiple locations with semi-colon</small> 
                                        <br/><br/>
                                         <textarea class="form-control" name="note" placeholder="Detailed description of the training event" rows="10"><?php echo stripcslashes(sqLx('training','sn',$course,'note')) ?></textarea><br>
                                        
                                        <button class="btn btn-success btn-block" name="EditTraining">Update Training Information</button>
                                        
                                  
<br><hr>
<?php if(sqLx('training','sn',$course,'status')==0){ ?>
<button class="btn btn-primary" value="1" name="ActivateTraining">Activate Training</button>
<?php }else{ ?><button class="btn btn-danger" value="0" name="ActivateTraining">De-Activate Training</button>
<?php } ?><a href="?" class="btn btn-secondary" >Create New Training</a>
<hr>  </form>
                                     <h5>Update Training Graphics</h5>
                                   
                                    <form method="post" enctype="multipart/form-data">
                                        <div class="row">
                                        <div class="col-md-6 p-2">

                                            <input type="file" name="image" class="form-control">
                                            <small>Recommended graphics size is 1200px by 700px</small>
                                            <br><br>
                                            <button class="btn btn-success btn-block" name="PhotoTraining">Update Training Graphics</button>
                                        </div>

                                        <div class="col-md-6 p-2">
                                           <!--  <h6>Current Graphics</h6> -->
                                        <img width="100%" src="news/<?php echo sqLx('training','sn',$course,'photo') ?>">
                                    </div>
                                    </div>
                                    </form>
                                </div>

                            </div>

 <div class="card ">
                                
                                    <div class="card-header text-white bg-dark">
                                        <h5>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>Facilitator</th>
                                            <th>Location</th>  
                                            <th>Note</th>
                                        </tr>
                                        <?php $i=0;
                                        $sql = $db->query("SELECT * FROM trainer WHERE training='$course' ");
                                        while($row = $sql->fetch_assoc()){ $i +=1; $tid=$row['id'];
                                            ?>
                                            <tr>
                                                <td><?php echo $i  ?></th>
                                            <td><?php echo sqLx('training','sn',$row['training'],'title')  ?></th>
                                                    <td data-toggle="tooltip" title="<?php  $s = $db->query("SELECT * FROM trainer WHERE id='$tid' ");
                                        while($r = $s->fetch_assoc()){ echo sqLx('training','sn',$r['training'],'title').', '; } ?>" data-placement="top"><?php echo userName($tid)  ?></th>
                                                    <td><?php echo $row['location']  ?></th>
                                                <td><?php echo $row['note']  ?></th>
                                            </tr>
                                        <?php } ?>
                                       
                                    </table>
                                   
                                </div>
                            </div>
                    </div>

                <?php }else{ ?>
                        <div class="col-md-12">
                            <div class="card ">
                                <div class="card-header text-white bg-dark">
                                    <h5>Create New Training</h5>
                                </div> 
                                <div class="card-body">
                                    
                                 

                                

                                    <form class="form-group" method="post">
                                        <input type="text" class="form-control" name="title" placeholder="Training Title" required/> <br/>

                                        <input type="number" class="form-control" name="cost1" placeholder="Member's Price" required/> <br/>
                                        <input type="number" class="form-control" name="cost2" placeholder="Non Member's Price" required/> <br/>
                                        <input type="text" class="form-control" name="date" placeholder="Training Date & Time" required/> <br/>
                                        <input type="text" class="form-control" name="location" placeholder="Training Locations" required/>
                                        <small>Separate multiple locations with semi-colon</small> 
                                        <br/><br/>
                                         <textarea class="form-control" name="note" placeholder="Detailed description of the training event" rows="10"></textarea><br>
                                        
                                        <button class="btn btn-success btn-block" name="CreateTraining">Create New Training</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 ");
                                        while($row = $sql->fetch_assoc()){ $i +=1; 
                                            ?>
                                            <tr>
                                                <td><?php echo $i  ?></th>
                                                <td><a href="?course=<?php echo $row['sn']  ?>" onclickx="EditTrain('<?php echo $row['title']  ?>','<?php echo $row['cost1']  ?>','<?php echo $row['cost2']  ?>','<?php echo $row['date']  ?>','<?php echo $row['locations']  ?>','<?php echo $row['sn']  ?>','<?php echo $row['note']  ?>')" ><?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>
                        
                    </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 -->


<form method="post" >
    <div class="modal animated bounceInUp small-modal" id="EditTrain" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">Update Training Information</h5>
                     <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                   
                </div>
               <div id="ShowContent"></div>
            </div>
        </div>
    </div>
</form>


<!-- 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,g){
$('#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><br/><textarea class="form-control" name="note" placeholder="Detailed description of the training event" rows="10">'+g+'</textarea><br></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>

?>