EVOLUTION-NINJA
Edit File: courselist.php
<?php echo view('includes/admin-header'); ?> <link rel="stylesheet" type="text/css" href="<?php echo base_url('public/assets/css/jquery-ui.css'); ?>"/> <link rel="stylesheet" type="text/css" href="<?php echo base_url('public/assets/css/conference.css'); ?>"> <div class="col-sm-10"> <div class="add-conference-right"> <div class="container"> <h3 class="conf-tag">Course List</h3> <div class="prog-schedule"> <input type="hidden" class="form-control insert_id" id="insert_id" name="insert_id" value = '0'> <p class="mt-5" style="font-size:16px;"><b>Select the section to view its categories and edit courses </b></p> <div class="table-responsive pt-3"> <!-- hide the id --> <table class="table table-bordered" > <thead> <tr > <th>Section Name</th> <th>Action</th> <!-- <th>View Details</th> --> </tr> </thead> <tbody id="ps"> <?php foreach($master_name as $key => $val){ ?> <tr> <td><?php echo $val['master_name'] ?></td> <!-- <td> <button onclick="myfun(<?php echo $val['id'] ?>)">Edit</button> <select class="form-select" id='status<?php echo $val['id'] ?>' onchange="changestatus(<?php echo $val['id'] ?>)"> <?php if($val['active_status'] == 'ACTIVE'){ ?> <option>INACTIVE</option> <option selected >ACTIVE</option> <?php }else{ ?> <option selected >INACTIVE</option> <option>ACTIVE</option> <?php } ?> </select> </td> --> <td><button onclick="myfun(<?php echo $val['id'] ?>)">Click Here</button></td> </tr> <?php } ?> </tbody> </table> </div><!--table-responsive--> </div><!--prog-schedule--> </div> </div><!--add-conference-right---> </div><!----> <script> function myfun(id){ // console.log(id); window.location = '<?php echo base_url("Online-course")?>?id='+id; } </script> <script> function changestatus(id){ var status = $('#status'+id).val(); console.log(id); console.log(status); $.ajax({ type : 'POST', url : '<?php echo base_url('onlineprep-status'); ?>', data : {id : id, status: status}, success:function(response){ response = jQuery.parseJSON(response); if(response.result==1){ toastr["success"](response.message); } else{ toastr["error"](response.message); } } }); } </script> <?php echo view('includes/admin-footer'); ?>