EVOLUTION-NINJA
Edit File: employee_form.php
<?php //include("menu.php"); error_reporting(E_ALL); ?> <script> function displaycustomer(str) { $.ajax({ type:"post", url:"<?php echo base_url(); ?>display_data/testingcustomer", data:"id="+str, success:function(data) { document.getElementById("dynamicdatamster").innerHTML=data; } }); } </script> <script> $(function () { $("#orderDate").datepicker({ dateFormat: "d-m-yy", changeMonth: true, changeYear: true }); }); </script> <style> .ui-jqgrid { text-transform: capitalize !important; } .tablediv { text-transform: uppercase !important; } .ui-jqgrid tr.jqgrow td{ text-transform: uppercase !important; } </style> <?php //include("menu.php"); ?> <!-- BEGIN CONTENT --> <div class="page-content-wrapper"> <div class="page-content"> <!-- BEGIN PAGE HEADER--> <h3 class="page-title"> Employee Master </h3> <div class="page-bar"> <ul class="page-breadcrumb"> <li><i class="fa fa-home"></i> <a href="<?php echo base_url();?>dashboard/dashboard_fun">Home</a> <i class="fa fa-angle-right"></i> <a href="#" > Employee Matser </a></li> </ul> </div> <?php $this->load->view('import_module/masters_data_display'); ?> <?php if(empty($access_row)) { } else { if($access_row->insert_id == '1') { ?> <form action="<?php echo base_url(); ?>access/add_employee_details" method="post" class="form-horizontal"> <b>To insert data click here:</b> <input type="submit" name="Insert" value="Insert" /><br><br> </form> <?php } else { ?> <?php } }?> <input type="hidden" id="edit_id" class="edit_id" value="<?php if(empty($access_row)){ } else { echo $access_row->edit_id; } ?>" > <input type="hidden" id="delete_id" class="delete_id" value="<?php if(empty($access_row)){ } else { echo $access_row->delete_id; } ?>" > <!-- END DASHBOARD STATS --> <div id = "jaytab" class="jaytab"> <table id="list2"></table> <div id="pager2"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div></div> <!-- End BEGIN CONTAINER --> <!-- BEGIN FOOTER --> <!-- BEGIN FOOTER --> <script> $(document).ready(function(){ $('#phone').on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#name').on('change keyup', function() { var sanitized = $(this).val().replace(/[^a-zA-Z -]+$/,''); $(this).val(sanitized); }); }); </script> <script src="<?php echo base_url(); ?>assets/js/sweetalert.min.js" type="text/javascript"></script> <link href="<?php echo base_url(); ?>assets/css/sweetalert.min.css" rel="stylesheet" type="text/css" > <script src="<?php echo base_url(); ?>assets/js/rowedex3.min.js" type="text/javascript"></script> <script> $("#land_owner").submit(function(e) { e.preventDefault(); formdata = new FormData($(this)[0]); $.ajax({ url:"<?php echo base_url('access/insert_access_control_data');?>", type:"POST", data: formdata, contentType: false, processData: false, success:function(data) { window.location.href = '<?php echo base_url('access/employee_details');?>'; } }); }); $(function () { $("#date_of_birth").datepicker({ dateFormat: "dd/mm/yy", changeMonth: true, changeYear: true }); }); </script> <style> body{ overflow-y:hidden;} .portlet > .portlet-body.blue-madison, .portlet.blue-madison { background-color:transparent !important; } .portlet.box.blue-madison{ border:transparent !important;} input:required { border-color: #ccc !important; box-shadow: none !important; -webkit-box-shadow: none !important; } </style> <!-- The link to the CSS that the grid needs --> <script type="text/ecmascript" src="<?php echo base_url('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('jqgrid/js/i18n/grid.locale-en.min.js'); ?>"></script> <!-- A link to a jQuery UI ThemeRoller theme, more than 22 built-in and many more custom --> <!-- The link to the CSS that the grid needs --> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('jqgrid/css/ui.jqgrid.min.css'); ?>" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('jqgrid/css/ui.jqgrid-bootstrap.min.css'); ?>" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('jqgrid/css/ui.jqgrid-bootstrap-ui.min.css'); ?>" /> <style type="text/css"> .ss{ padding-right: 0 !important; padding-left: 0 !important; } label { font-weight: normal; text-align: left; } .hr-line{ border-top: 1px solid #465A81; } .well-sm { padding: 3px !important; border-radius: 0px !important; } input[type="file"] { padding-bottom: 28px !important; height: 25px !important; color:transparent; } .portlet.box.blue-madison { border: 1px solid #fff !important; border-top: 0; background:#fff !important; } #list2_122_t { height:0px !important; } list2_136_t { height:12px !important; } .scroll { height:12px !important; } .ui-jqgrid-btable { } .ui-common-table { height:12px !important; } #refresh_list2 { display:none !important; } #client_edit { padding-right:18px !important; } #list2 { width: 1050px; height: 0px !important; } #gview_list2 { height: auto !important; } @media only screen and (min-width:320px) and (max-width:641px){ .ui-jqgrid { margin-left: 1px !important; } #jaytab{ margin-top: 0 !important; margin-left: 0 !important; overflow-x: scroll; width: 100% !important; padding-left: 0 !important; } #editmodlist2 { width:90% !important; } #sData span, #cData span { margin-left: 0 !important; } } @media only screen and (min-width:641px) and (max-width:991px){ .ui-jqgrid { margin-left: 1px !important; } #jaytab{ margin-top: 0 !important; margin-left: 0 !important; overflow-x: scroll; width: 100% !important; padding-left:0 !important; padding-right:9px !important; } } #search_list2 { display:none !important; } .ss{ padding-right: 0 !important; padding-left: 0 !important; } .form-control { width:65% !important; height:27px !important; padding: 3px 12px !important; border-radius: 0px !important; //margin-bottom:15px; } label { font-weight: normal; text-align: left; } .hr-line{ border-top: 1px solid #465A81; } .well-sm { padding: 3px !important; border-radius: 0px !important; } input[type="file"] { padding-bottom: 28px !important; height: 25px !important; color:transparent; } .portlet.box.blue-madison { border: 1px solid #fff !important; border-top: 0; background:#fff !important; } .ui-jqgrid .ui-jqgrid-caption { text-align: left; background: rgb(72,91,127); color: white; } .ui-jqdialog .ui-jqdialog-titlebar { padding: .1em .1em; min-height: 35px; background: rgb(72,91,127); color: white; } .ui-jqdialog .ui-jqdialog-titlebar-close span { display: block; margin: -9px !important; } .ui-jqdialog .ui-jqdialog-titlebar-close span { display: block; margin: -9px !important; } #sData { height: 27px; } #cData { height: 27px; } #dData { height: 27px; } #eData { height: 27px; } </style> <style> </style> <!-----------------datepicker-------------> <!-- The link to the CSS that the grid needs --> <script> var swan_id=''; $(document).ready(function (){ //var swan_id=''; jQuery("#list2").jqGrid({ url:"<?php echo base_url('access/employee_fetch')?>", mtype : "post", datatype: "json", colNames:['Id','Employee Name','User Name','Date Of Birth','Gender','Address','Phone','Email','Blood Group','Designation','Pan/Aadhar','Location','Action'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'name',index:'name', width:50,editable:false,width:100}, {name:'username',index:'username',editable:true, width:100}, {name:'date_of_birth',index:'date_of_birth',edittype:'text',editable:true,editrules:{required: true}, width:100}, {name:'gender',index:'gender', width:50,editable:false,width:100}, {name:'address',index:'address', width:50,editable:false,width:100}, {name:'phone',index:'phone',editable:true, width:100}, {name:'email',index:'email',edittype:'text',editable:true,editrules:{required: true}, width:100}, {name:'blood_group',index:'blood_group', width:50,editable:false,width:100}, {name:'designation',index:'designation',editable:true, width:100}, {name:'pan/aadhar',index:'pan/aadhar',edittype:'text',editable:true,editrules:{required: true}, width:100}, {name:'location',index:'location',edittype:'text',editable:true,editrules:{required: true}, width:100}, {name:'',index:'',align: "center",editable:false,editrules:{required: true}, width:200,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_edit($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' class='fa fa-eye' value='SELECT' \>"; }}, ], height: 'auto', rowNum:50, rowTotal: 200000, rowList : [50,100,200,300], rownumbers: true, rownumWidth: 40, pager:"#pager2", sortname:'id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", //multiple: true, loadonce:true, caption:"Employee Details", }); //$("#list2").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required jQuery("#list2").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false, defaultSearch: "cn" }); $("#list2").jqGrid('navGrid','#pager2', {edit:false,add:false,del:false,search:false,refreshstate:false}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); $("#list2").navButtonAdd('#pager2', { caption:"Delete", buttonicon:"ui-icon-trash", onClickButton: deleteRow, position: "last", title:"", cursor: "pointer", id:"client_delete" } ); }); function fun_edit(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; var v=$('#edit_id').val(); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("access/employee_id"); ?>', data:{'as':as}, async:false, success:function() { window.location.href = '<?php echo base_url('access/employee_id');?>/'+ '?id='+as; } }); } else { swal({ title: "You Don't Have Access For This Edit", text: "", }); } } function deleteRow() { var v=$('#delete_id').val(); if(v == 1) { // Get the currently selected row var row = $("#list2").jqGrid('getGridParam','selrow'); $("#id").val(row); // A pop-up dialog will appear to confirm the selected action if( row != null ) $("#list2").jqGrid( 'delGridRow', row, { modal:true,jqModal:true, recreateForm: true, beforeSubmit: function(postdata,formid){ $.ajax({ url:"<?php echo base_url('access/employee_details_delete')?>", type:"POST", data:{'id':row}, async:false, success:function(data){ if(data==""){ //alert('Successfully Updated.'); $("#delmodlist2").remove(); window.location.reload(); //$("#list2").trigger("reloadGrid"); } else{ // alert('Successful'); $("#delmodlist2").remove(); window.location.reload(); $("#list2").trigger("reloadGrid"); } } }); }, reloadAfterSubmit:false, closeAfterDelete: true, afterSubmit : function(response, postdata) { } }); else $( "#dialogSelectRow" ).dialog(); } else { swal({ title: "You Don't Have Access For This Delete", text: "", }); } } </script>