EVOLUTION-NINJA
Edit File: video_list_v.php
<?php echo view('includes/admin-header', $user_management, $org); $role_id = session()->get('role_id'); ?> <div class="col-sm-10" style="padding:3%;"> <div class="row"> <div class="col-sm-12" id="upload" style="text-align:center;"> <h4>Videos e-Learn hub</h4> <!-- <h4 style="text-align: left;">Video List</h4> --> </div> </div> <div id="jaytab3" style="margin-top:6%;" > <div class="grid_div"></div> <div id="list2"> <table id="list3"> </table> <div style="display:none;"> <table border="1" style="border-spacing: 0px !important;" id="user_excel" class="user_excel"></table> </div> </div> <div id="pager3"></div> </div> </div> <div class="modal fade editDisease" > <div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-content"> <div class="modal-header" style="background-color:#439bc1;padding:10px;"> <h2 class="modal-title" id="exampleModalLabel" style="color:white;font-size:18px;font-weight: 600;">Role</h2> <button type="button" class="close" id="clos" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <form id="update-disease-form"> <input type="hidden" id="idc" name="id"> <div class="form-group"> <label for="">Are You sure You want to Delete this video</label> <!-- <input type="text" class="form-control section_name" name="section_name" > --> </div> <div class="form-group"> <button type="submit" class="btn btn-block btn-success update">Delete</button> </div> </form> </div> </div> </div> </div> <script type="text/ecmascript" src="<?php echo base_url('public/jqgrid/js/jquery.jqGrid.min.js'); ?>"></script> <!-- This is the localization file of the grid controlling messages, labels, etc.--> <!-- We support more than 40 localizations --> <script type="text/ecmascript" src="<?php echo base_url('public/jqgrid/js/i18n/grid.locale-en.js'); ?>"></script> <!-- A link to a jQuery UI ThemeRoller theme, more than 22 built-in and many more custom --> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('public/assets/css/jquery-ui.css'); ?>" /> <!-- The link to the CSS that the grid needs --> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('public/jqgrid/css/ui.jqgrid.css'); ?>" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('public/jqgrid/css/ui.jqgrid-bootstrap.css'); ?>" /> <script src="<?php echo base_url('public/assets/js/jquery-ui.js'); ?>" type="text/javascript"></script> <script type="text/ecmascript" src="<?php echo base_url('public/jqgrid/js/jquery.table2excel.js'); ?>"></script> <script src="<?php echo base_url('public/assets/js/jquery.table2excel.js');?>"></script> <script> $(document).ready(function(){ // var pickup_date = '1'; // var sales_person = '1'; // var lastSelection = ""; jQuery("#list3").jqGrid({ url:"<?php echo site_url('show-all-video-list');?>", datatype: "json", colNames:['Sl','Title','Description','Delete'], colModel:[ {name:'id',index:'id',hidden:true, width:50, editable:false}, // {name:'booking_date',index:'booking_date',width:100, editable:false, formatter: 'date', formatoptions: { newformat: 'd-m-Y' }}, {name:'title',index:'title', width:140, editable:false }, {name:'description',index:'description', width:130, editable:false}, // {name:'mobile_number',index:'mobile_number', width:90, editable:false}, // {name:'seva_price',index:'seva_price', width:70, editable:false}, // {name:'booking_pnr',index:'booking_pnr', width:90, editable:false}, // // {name:'payment_mode',index:'payment_mode', width:100, editable:false}, // {name:'crb',index:'crb', width:80, editable:false}, {name:'',index:'',search:false, width:50, editable:false,formatter: function (cellvalue, options, rowObject) { var retVal = ""; var retVal = ' <a data-toggle="tooltip" title="Edit" class="" href="javascript:void(0);"><span class="fa fa-pencil" onclick="fun_edit($(this))" style="color:blue;"></span></a'; return retVal; }}, // {name:'',index:'',search:false, // width:50, editable:false, align:'center',formatter: function (cellvalue, options, rowObject) { // var retVal = ""; // var retVal = ''; // return retVal; // }}, // {name:'',index:'',search:false, // width:30, editable:false,formatter: function (cellvalue, options, rowObject) { // var retVal = ""; // var retVal = ' <a data-toggle="tooltip" title="View"><span class="fa fa-eye" onclick="view('+rowObject.id+')" style="color:#ee6304;"></span></a>'; // return retVal; // }}, ], rowNum:20, rowList:[20,30,50,100,200,300], rownumbers: true, pager: '#pager3', sortname:'id', autowidth: true, height: '100%', // width: '100%', viewrecords: true, loadonce:true, gridview: true, sortorder:"desc", shrinkToFit: true, caption:"Video List", }); $("#list3").jqGrid("setLabel", "rn", "SL"); $("#list3").jqGrid('filterToolbar',{stringResult: true,searchOperators : true}); //for multisearch code,remove if not required $("#list3").jqGrid('navGrid','#pager3', {edit:false,add:false,del:false,search:true,refresh:true}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); }); function fun_edit(rowId){ var id = rowId.closest('tr').attr('id'); // alert(id); $.ajax({ url:"<?php echo site_url("change-action")?>", type:"POST", data:{id:id}, success:function(response) { response = jQuery.parseJSON(response); // console.log(response); if(response.result == 1){ $(".editDisease").modal("show"); $("#idc").val(response.message.id); $(".section_name").val(response.message.role_id); } } }); } $('#update-disease-form').submit(function(e){ e.preventDefault(); var id = $('#idc').val(); // alert(id); var formData = new FormData(this); $.ajax({ type : "POST", url : '<?php echo base_url("delete-video-action")?>', data : formData, contentType: false, processData: false, success:function(response){ response = jQuery.parseJSON(response); if(response.result==1){ toastr["success"](response.message); $(".editDisease").modal("hide"); history.go(0); } else{ toastr["error"](response.message); } } }); }); </script> <script> $('#add_user_manually').submit(function(e){ e.preventDefault(); var formData = new FormData(this); $(".btn-update").text("Updating..."); $(".btn-update").attr("disabled", true); $.ajax({ type : 'POST', url : '<?php echo base_url("add-user-manually")?>', data : formData, contentType: false, processData: false, success:function(response){ response = jQuery.parseJSON(response); if(response.result==1){ toastr["success"](response.message); $("#add_user_manually").modal("hide"); $('.btn-update').removeAttr("disabled"); $(".btn-update").text("Save"); history.go(0); } else{ toastr["error"](response.message); $('.btn-update').removeAttr("disabled"); $(".btn-update").text("Update"); } } }); }); </script> <script type="text/javascript"> function usermanagement_excel(){ $(".user_excel").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "User Management Report", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } </script> <!-- only for alphabetics and space --> <script> function validateInput(inputField) { var regex = /^[a-zA-Z\s]+$/; var inputValue = inputField.value; if (!regex.test(inputValue)) { inputField.value = inputValue.replace(/[^a-zA-Z\s]/g, ''); toastr.error('Only alphabetic characters are allowed.'); } } </script> <!-- only for numbers and space--> <script> function validateInputnum(inputField) { var regex = /^[0-9\s]+$/; var inputValue = inputField.value; if (!regex.test(inputValue)) { inputField.value = inputValue.replace(/[^0-9\s]/g, ''); toastr.error('Only numerical numbers are allowed.'); } } </script> <style> .ui-jqgrid-sdiv{ display : none !important; } .ui-jqgrid-titlebar { background-color:#0065A3; } .ui-jqgrid-title{ color:#fff; font-weight: 600; font-size: 18px; } .user-tag{ color: #0065A3; font-weight: 600; font-size: 24px; } .soptclass{ display : none; } @media only screen and (max-width:600px){ #mobile-div{ padding: 20px; } .u_e{ margin-bottom:5px; } .u_s{ margin-bottom:5px; } } </style> <?php echo view('includes/admin-footer'); ?>