EVOLUTION-NINJA
Edit File: institutions_list.php
<?php echo view('includes/admin_header.php') ?> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('public/assets/css/jquery-ui.css'); ?>" /> <link rel="stylesheet" href="<?php echo base_url('public/assets/toastr/toastr.min.css'); ?>"> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('public/assets/jqgrid/css/ui.jqgrid.css'); ?>" /> <!--<link rel="stylesheet" type="text/css" href="<?php echo base_url('public/assets/website_assets/css/innerpage.css'); ?>"/>--> <link rel="stylesheet" href="<?php echo base_url('public/assets/sweet_alert/sweet-alert.css'); ?>"> <script type="text/javascript" src="<?php echo base_url('public/assets/toastr/toastr.min.js'); ?>"></script> <script type="text/ecmascript" src="<?php echo base_url('public/assets/jqgrid/js/jquery.jqGrid.min.js'); ?>"></script> <script type="text/ecmascript" src="<?php echo base_url('public/assets/jqgrid/js/i18n/grid.locale-en.js'); ?>"></script> <script src="<?php echo base_url('public/assets/js/jquery-ui.js'); ?>" type="text/javascript"></script> <script src="<?php echo base_url('public/assets/sweet_alert/sweet-alert.js'); ?>"></script> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1 style="padding-bottom:10px;border-bottom:2px dashed #ccc;margin-bottom:20px;"> Institution List <small></small> </h1> </section> <!-- Main content --> <!-- Button trigger modal --> <section class="content"> <div id="jaytab" style="margin-top:3%" class="grid"> <table id="list2"></table> <div id="pager2"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel">Add Comment</h4> </div> <div class="modal-body"> <form id="add_comment" class="comment_form"> <input type="hidden" name="mapping_id" class="mapping_id"> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-12"> <label class="col-sm-4">Comment</label> <input type="hidden" name="faculty_id" class="faculty_id"> <textarea row="3" cols="40" name="comment" required="required"></textarea> </div> </div> <!-- row 1--> <div class="row land_owner_a"> <div class="col-sm-4 col-md-4"></div> <div class="col-sm-4 col-md-4"> <button type="submit" class="btn btn-primary center-block submit">Submit</button> </div> <div class="col-sm-4 col-md-4"></div> </div> <!-- row 6--> </form> </div> </div> </div> </div> <div class="modal fade" id="approval_subjects" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel">Added Subjects</h4> </div> <div class="modal-body"> <form id="approve_subjects"> <div class="row land_owner_a col-sm-11"> <div class="col-sm-5 sub_categories"> </div> <!-- row 1--> <div class="col-sm-6 sub_timings"> </div> </div> <div class="row land_owner_a"> <div class="col-sm-4 col-md-4"></div> <div class="col-sm-4 col-md-4"> <button type="submit" class="btn btn-primary center-block submit">Approve</button> </div> <div class="col-sm-4 col-md-4"></div> </div> <!-- row 6--> </form> </div> </div> </div> </div> </section> </div> <!--- col-sm-8 --> <script type="text/javascript"> $(document).ready(function() { CallGrid(); function CallGrid(access_rights_global, access_result_global) { jQuery("#list2").jqGrid({ url: "<?php echo site_url('institution_details') ?>", mtype: "get", datatype: "json", colNames: ['SI', 'Action', 'Institution Name', 'Email', 'Phone', 'Address', 'Registered Date', 'Status'], colModel: [{ name: 'login_id', index: 'login_id', width: 10, hidden: true, editable: false, key: true }, { name: '', index: '', search: false, width: 200, editable: false, formatter: function(cellvalue, options, rowObject) { var retVal = ""; var retVal = '<a data-toggle="tooltip" title="View" class="" href="<?php echo site_url('institutions-details'); ?>/' + rowObject.login_id + '"><span class="glyphicon glyphicon-search"></span></a> <a data-toggle="tooltip" title="View" class="action_btn" href="<?php echo site_url('enrolled-institution-users-list'); ?>/' + rowObject.login_id + '">Users</a> <a data-toggle="tooltip" title="View" class="action_btn" href="<?php echo site_url('enrolled-institution-faculty-list'); ?>/' + rowObject.login_id + '">Faculties</a> <a data-toggle="tooltip" title="View" class="action_btn" href="<?php echo site_url('enrolled-institution-batch-list'); ?>/' + rowObject.login_id + '">Batches</a> <a data-toggle="tooltip" title="Delete" class="delete' + rowObject.login_id + '" onclick="fun_del(' + rowObject.login_id + ')"; href="javascript:void(0);"><span class="glyphicon glyphicon-trash"></span></a>'; return retVal; } }, { name: 'username', index: 'username', editable: false, width: 220 }, { name: 'email', index: 'email', editable: false, width: 200 }, { name: 'inst_phone', index: 'inst_phone', editable: false, width: 200 }, { name: 'address', index: 'address', editable: false, width: 200 }, { name: "created_at", index: "created_at", editable: false, width: 150 }, { name: 'approval_status', index: 'approval_status', editable: false, width: 160 }, ], rowNum: 20, rowTotal: 2000, rowList: [20, 30], rownumbers: true, //rownumWidth: 60, pager: "#pager2", sortname: 'id', viewrecords: true, gridview: true, // autowidth: true, sortorder: "asc", shrinkToFit: true, loadonce: true, caption: "Institution List", }); $("#list2").jqGrid("setLabel", "rn", "SL"); $("#list2").jqGrid('filterToolbar', { searchOperators: false, stringResult: true, searchOnEnter: false, defaultSearch: "cn" }); //for multisearch code,remove if not required $("#list2").jqGrid('navGrid', '#pager2', { edit: false, add: false, del: false, search: false, refreshstate: "current" }, {}, {}, {}, { sopt: ['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true, closeAfterDelete: true, closeAfterEdit: true }, ); } }); function fun_del(id) { var type = "post"; swal({ title: "Are you sure?", text: "You will not be able to recover this data!", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes, delete it!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm) { if (isConfirm) { $('.delete' + id + '').text('Deleting..'); $(".sweet-alert").hide(); $(".sweet-overlay").hide(); $.ajax({ type: type, url: "<?php echo site_url('delete_institution'); ?>", data: { 'id': id }, success: function(response) { // response = jQuery.parseJSON(response); console.log(response); if (response.result == 1) { toastr["success"]('Deleted Successfully'); $("#list2").setGridParam({ datatype: 'json', page: 1 }).trigger('reloadGrid'); } else { toastr["error"]('Something Went Wrong..'); } } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } function fun_approve(id) { var type = "post"; swal({ title: "Are you sure?", text: "Do You Want to Approve!", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes, approve it!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm) { if (isConfirm) { $(".approve" + id).val("Approving.."); $(".sweet-alert").hide(); $(".sweet-overlay").hide(); $.ajax({ type: type, url: "<?php echo site_url('approve_institution'); ?>", data: { 'id': id }, success: function(response) { // response = jQuery.parseJSON(response); console.log(response); if (response.result == 1) { $(".approve" + id).text("Approve"); toastr["success"](response.message); $("#list2").setGridParam({ datatype: 'json', page: 1 }).trigger('reloadGrid'); } else { $(".approve" + id).text("Approve"); toastr["error"](response.message); $("#list2").setGridParam({ datatype: 'json', page: 1 }).trigger('reloadGrid'); } } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } //IN INSTITUTION LIST PAGE $('#add_comment').submit(function(e) { e.preventDefault(); formdata = new FormData($(this)[0]); $(".submit").attr('disabled', 'disabled'); $(".submit").text("Submitting..."); $.ajax({ type: 'post', url: '<?php echo site_url("institution_return") ?>', data: formdata, contentType: false, processData: false, success: function(response) { // response = jQuery.parseJSON(response); console.log(response); if (response.result == 1) { $("#myModal").modal("hide"); toastr["success"](response.message); $('.comment_form')[0].reset(); $(".submit").text("Submit"); $(".submit").removeAttr('disabled'); $("#list2").setGridParam({ datatype: 'json', page: 1 }).trigger('reloadGrid'); } else { $("#myModal").modal("hide"); toastr["error"](response.message); $(".submit").text("Submit"); $(".submit").removeAttr('disabled'); } } }); }); function fun_return(id) { var type = "post"; swal({ title: "Are you sure?", text: "Do You Want to Return!", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes, Return it!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm) { if (isConfirm) { $('.faculty_id').val(id); $(".sweet-alert").hide(); $(".sweet-overlay").hide(); $("#myModal").modal("show"); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } </script> <?php echo view('includes/admin_footer') ?> <style type="text/css"> #pager2_left { display: none !important; } #pager2_center { padding-left: 350px !important; } .form-control:focus, input[type="Submit"]:focus, input[type="button"]:focus { border-color: #FF0000; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(255, 0, 0, 0.6); } #FrmGrid_list2 { width: 100% !important; } .ui-jqdialog .ui-jqdialog-titlebar { height: 29px !important; background-color: #001a00; color: white; padding-left: 10px; } .fm-button { height: 21px !important; padding: 1px; margin-right: 10px !important; height: 21px !important; width: 43%; margin-top: -7px !important; } .ui-jqdialog-content td.navButton { padding-top: 12px !important; } .ui-jqgrid .ui-jqgrid-titlebar { height: 27px !important; /*background:#1e7ad7 !important;*/ color: white !important; } .ui-jqgrid-bdiv { height: auto !important; } .ui-widget-overlay { z-index: 0 !important; } .ui-jqgrid-hdiv ui-state-default { cursor: default !important } ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight { border: 1px solid #fed22f; background: #ffe45c; } .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { font-weight: bold; color: black; } #jaytab { overflow-x: scroll; } .action_btn { border: 1px solid #555; padding: 3px 3px; background-color: #e4e4e4; } @media only screen and (min-width:320px) and (max-width:640px) { #jaytab { width: auto !important; overflow-x: scroll !important; } .ui-jqgrid ui-widget ui-widget-content ui-corner-all { width: 900px !important; } .ui-jqgrid-view { width: 900px !important; } .ui-jqgrid-hdiv { width: 900px !important; } .ui-jqgrid-htable { width: 900px !important; } .ui-jqgrid-bdiv { width: 900px !important; } #list2 { width: 900px !important; } #pager2 { width: 900px !important; } } @media only screen and (min-width:641px) and (max-width:991px) { #jaytab { width: auto !important; overflow-x: scroll !important; } .ui-jqgrid ui-widget ui-widget-content ui-corner-all { width: 900px !important; } .ui-jqgrid-view { width: 900px !important; } .ui-jqgrid-hdiv { width: 900px !important; } .ui-jqgrid-htable { width: 900px !important; } .ui-jqgrid-bdiv { width: 900px !important; } #list2 { width: 900px !important; } #pager2 { width: 900px !important; } } </style>