Backups Created:
/home/japatmex/public_html/wp-content/edit-wolf.php
Savvy
W
olf -
MANAGER
Edit File: file_orders_new.php
<!-- Page header --> <style> .TH1{ width: 8% !important; } .TH2{ width: 25% !important; } .TH3{ width: 10% !important; } .TH4{ width: 10% !important; } .TH5{ width: 7% !important; } .TH6{ width: 10% !important; } .TH7{ width: 10% !important; } .TH8{ width: 8% !important; } .TH9{ width: 6% !important; } .TH10{ width: 5% !important; } .btn-info{ background: #324148 !important; } .Order a{ color: #333 !important; } .multiselect.btn-light, .btn_section { background-color: #efeded !important; border: 0px !important; border-bottom: 0px !important; margin-right: 10px !important; color: black !important; } .multiselect-item.active:not(.disabled) input[type=checkbox]~.form-check-control-indicator{ border-color: #0d0d0d; color: #111; } .dropdown-item.active{ color: #111; } .table-striped tbody tr:nth-of-type(odd){ background-color: rgba(0,0,0,.02) !important; } div.complete { position: relative; z-index: 1; } div.complete:before { content: ""; position: absolute; left: 0; bottom: -5px; height: 15px; width: 62px; border-bottom: 3px solid #5cb85c; } div.reject { position: relative; z-index: 1; } div.reject:before { content: ""; position: absolute; left: 0; bottom: -5px; height: 15px; width: 55px; border-bottom: 3px solid #a0241d; } div.pending { position: relative; z-index: 1; } div.pending:before { content: ""; position: absolute; left: 0; bottom: -5px; height: 15px; width: 46px; border-bottom: 3px solid #324148; } div.inprocess { position: relative; z-index: 1; } div.inprocess:before { content: ""; position: absolute; left: 0; bottom: -5px; height: 15px; width: 60px; border-bottom: 3px solid #ff7800; } .has-fixed-height { height: 223px; } .bln > i{ font-size: 18px !important; } .servicetext{ white-space: nowrap; width: 50px; overflow: hidden; text-overflow: ellipsis; border: 1px solid #000000; } </style> <div class="page-header border-bottom-0"> <div class="page-header-content header-elements-md-inline"> <div class="page-title d-flex"> <h4><a href="javascript:void(0)" class="BackButton-Link" onclick="goBack()"><i class="icon-arrow-left52 mr-2"></i></a> <?php echo 'File Orders'; ?></h4> </div> <div align="right"> </div> </div> </div> <!-- /page header --> <!-- Content area --> <div class="content pt-0"> <div class="card"> <div class="form-group row"> <div class="col-12 col-lg-12 col-md-12 col-lg-12 col-xl-12"> <div class="card-body"> <!-- Our Working Area Start --> <?php if (isset($message) && $message != '') { ?> <div class="form-group row"> <div class="col-lg-12"> <div class="alert alert-success"><?php echo $message; ?></div> </div> </div> <?php } ?> <div class="row"> <div class="col-md-12" style="justify-content: flex-end;align-items: flex-end;display: flex;"> <div class="form-group" style="display: flex"> <button type="button" id="search_fields_show" class="btn btn-outline-success btn-sm btn_section"><i class=" fa fa-search mr-2"></i> <span class="Hide-420">Search</span></button> <div class="btn-group"> <button type="button" class="btn btn-default dropdown-toggle btn_section" data-toggle="dropdown"><i class="fa-cog5 mr-2"></i> <span class="Hide-420">Export</span></button> <div class="dropdown-menu dropdown-menu-right"> <a href="javascript:void(0)" onclick="exportOrders();" class="dropdown-item"><i class="fa fa-file-export"></i> <?php echo $this->lang->line('CUST_LBL_33'); ?></a> </div> </div> <select style="background-color: lightgray;border:0" class="form-control " id="showData" multiple="multiple" data-fouc> <option value="Order">Order</option> <option value="Date">Date</option> <option value="Credits">Credits</option> <option value="Reply">Reply File</option> <option value="Action">Action</option> <option value="View">View</option> <option value="CheckBox">Check Box</option> </select> </div> </div> <div class="col-md-12" id="search_fields" style="display:none;"> <?php echo form_open('page/file_orders', "name=frm id=frm class=form-horizontal"); ?> <?php include_once APPPATH . 'scripts/searchCodeSection.php'; ?> <input type="hidden" name="filedsShow" id="filedsShow" value="<?php echo $filedsShow;?>" /> <?php echo form_close(); ?> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="table-responsive"> <table class="table table-striped"> <thead> <tr> <th class="TH1 Order" style="display: none">Order</th> <th class="TH2"> <select class="form-control select2" style="/*width: 100px;*/" id="ServicesSerach" onchange="getServicesSearch(this.value)"> <option value="all">All Services</option> <?php if(@$verifyPage == '1') { $rsPackages = $this->General_model->get_package_cat($CATEGORY ,$PCK_TITLE ,$strPckWhere ); } else { $tblOrders = 'tbl_gf_codes'; if(@$serviceType == '1') $tblOrders = 'tbl_gf_codes_slbf'; $rsPackages = $this->General_model->get_package_cat_2($CATEGORY ,$PCK_TITLE ,$strPckWhere , $strPackIds); } $totalPackages = count($rsPackages); if($totalPackages > 0) { $prevCatId = 0; foreach($rsPackages as $row) {?> <option value="<?php echo $row->PackageId?>" > <?php echo $row->$PCK_TITLE.$srvcStatus;?> </option> <?php $prevCatId = $row->CategoryId; } }?> </select> </th> <th class="TH3">IMEI</th> <th class="TH4 Date" style="display: none">Date</th> <th class="TH5 Credits" style="display: none">Credit</th> <th class="TH6"> <select class="form-control select2" id="statusSerach" onchange="getStatusSerach(this.value)"> <option value="all">All Status</option> <?php $codes=get_code_status(); foreach($codes as $code){ ?> <option value="<?php echo $code->Id;?>"><?php echo $code->Value;?></option> <?php } ?> </select> </th> <th class="TH7">Code</th> <th style="display: none" class="TH7 Reply">Reply File</th> <th style="display: none" class="Action TH8"> Actions </th> <th class="View TH9" style="display: none">View</th> <th class="CheckBox TH10" style="display: none"><input type="checkbox" id="chkSelect" name="chkSelect" onClick="selectAllChxBxs('chkSelect', 'chkCodes', <? echo $totalCodes; ?>);"></th> </tr> </thead> <tbody id="searchData"> <?php $PACKS=array(); $packs=getAllPackData(); foreach($packs as $pack){ $PACKS[$pack->PackageId] = stripslashes($pack->PackageTitle).'-->'.$pack->CancelOrders.'-->'.$pack->VerifyOrders.'-->'.$pack->OrderVerifyMins.'-->'.$pack->OrderCancelMins; } $STATUSES = array(); $codes=get_code_all_status(); foreach($codes as $code){ $STATUSES[$code->CodeStatusId] = stripslashes($code->CodeStatus); } if ($rsCodes) { $i = 0; $currDtTm = setDtTmWRTYourCountry(); foreach ($rsCodes as $row) { $showCancel = '0'; $showVerify = '0'; if($row->ReplyDtTm != '') { $diffInMinsV = minutesDiffInDates($row->ReplyDtTm, $currDtTm); if($diffInMinsV <= $row->OrderVerifyMins) $showVerify = '1'; } if($row->RequestedAt != '') { $diffInMinsC = minutesDiffInDates($row->RequestedAt, $currDtTm); if($diffInMinsC <= $row->OrderCancelMins) $showCancel = '1'; } $orderStatus = stripslashes($row->CodeStatus); if($row->HiddenStatus == '1' && $row->CodeSentToOtherServer == '0' && $row->OrderAPIId > 0 && $row->CodeStatusId == '1') $orderStatus = 'Processing'; $orderCode = html_entity_decode(stripslashes($row->Code)); switch ($row->CodeStatusId) { case "1": $class = 'warning'; break; case "2": $class = 'success'; break; case "3": $class = 'danger'; break; case "4": $class = 'info'; break; } ?> <tr> <td class="Order" style="display: none"> <a href="<?php echo base_url();?>page/fodetail?id=<?php echo $row->CodeId; ?>&cr=<?php echo $userDetails->CurrencySymbol; ?>" class="fancybox fancybox.ajax" title="Order Details"><?php echo $row->CodeId; ?></a> </td> <? $strData = ''; ?> <td style="white-space: normal;"><?php echo stripslashes($row->PackageTitle); ?></td> <td style="white-space: normal;"><?php echo $row->IMEINo != '' ? stripslashes($row->IMEINo) : '<b>Serial #: </b>'.stripslashes(isset($row->SerialNo) && $row->SerialNo ? $row->SerialNo : '');?></td> <td class="Date" align="left" style="display: none"><?php $dates=explode(' ',$row->RequestedAt); echo $dates[0] ?></td> <td class="Credits" align="left" style="display: none"><?php echo $row->Credits; ?></td> <td align="left" nowrap> <?php $status_class=''; echo $status_class; switch ($orderStatus) { case "Pending": $status_class='pending'; break; case "Completed": $status_class='complete'; break; case "Rejected": $status_class='reject'; break; case "In Process": $status_class='inprocess'; break; echo $status_class; } ?> <div class="<?php echo $status_class; ?>"><?php echo $orderStatus; ?></div> </td> <td style="white-space: normal;"align="left"> <?php echo $orderCode == '' ? '-' : $orderCode; ?> </td> <td class="Reply" style="display: none"> <? if($row->ReplyFile == '') echo '-'; else { ?> <a href="<?php echo base_url();?>page/downloadsl3replyfile?id=<?php echo($row->CodeId);?>"><i class="fa fa-download"></i></a> <? } ?> </td> <td class="Action" valign="middle" style="display: none"> <?php if($row->VerifyOrders == '1' && $showVerify == '1') { if($row->CodeStatusId == 2 && $row->Verify==0) { $till = addMinutesToDtTm($row->ReplyDtTm, $row->OrderVerifyMins); $strData = daysHoursMinsDifferenceInDates($till, $currDtTm); ?> <!--<a href="<?php /*echo base_url();*/?>page/file_orders?verify=1&CodeId=<?php /*echo($row->CodeId);*/?>" onclick="return confirm('<?/* echo $this->lang->line('CUST_LBL_186'); */?>')"><i class="fa fa-refresh"></i></a>--> <a class="fancybox fancybox.ajax" title="Verify Order" href="<?php echo base_url()?>page/verifyfileorder?id=<?php echo($row->CodeId); ?>"><i class="fa fa-refresh"></i></a> <?php if($strData != '') echo ' Verify time<br />'.$strData;?> <?php } elseif($row->Verify==1) { $UserId = $this->session->userdata('GSM_FUS_UserId'); $rId= $row->CodeId+26; $tkt_id=getVerifyOrderTicketId($UserId,$rId); if($tkt_id){?> <a href="<?php echo base_url("ticket/view/"); ?><?php echo($tkt_id->TicketId); ?>"><?php echo 'Ticket# '.stripslashes($tkt_id->TicketNo); ?></a> <?php } } else { echo '-'; } } else { echo '-'; }?> <?php if($row->CancelOrders == '1' && $row->CodeStatusId == '1' && $showCancel == '1' && $orderStatus != 'Processing') { ?> <a href="<?php echo base_url();?>file_orders?cancel=1&orderId=<?php echo($row->CodeId);?>" onclick="return confirm('<? echo $this->lang->line('CUST_LBL_230'); ?>')"><i class="fa icon-trash" data-toggle="tooltip" data-placement="top" title="Delete"></i></a> <?php } else echo '-'; ?> </td> <td class="View" style="display: none"> <a class="fancybox fancybox.ajax" title="Order Details" href="<?php echo base_url(); ?>page/fodetail?id=<?php echo $row->CodeId; ?>"><i class="fa icon-eye"></i> </a> </td> <td class="CheckBox" style="display: none"> <input type="checkbox" class="chkSelect" id="chkCodes<?php echo $i; ?>" name="chkCodes[]" value="<?php echo $row->CodeId; ?>"> </td> </tr> <?php $i++; } } else { echo '<tr><td colspan="999" align="center">' . $this->lang->line('CUST_LBL_10') . '</td></tr>'; } ?> </tbody> </table> </div> </div> </div> </div> </div> </div> </div> </div> <script src="<?php echo base_url('assets/js/functions.js?v='.$this->config->item('assets_version')); ?>"></script> <script> var baseurl = "<?php echo base_url() ?>"; function getServicesSearch(val){ var csrfName = '<?php echo $this->security->get_csrf_hash(); ?>'; console.log(csrfName,val); $.ajax({ type: "POST", data: {csrf_test_name:csrfName,id:val}, url:baseurl+'page/fileOrdersSearchByService', complete: function () { var myArray = ['Order', 'Date', 'Credits','Reply', 'Action', 'View', 'CheckBox']; var vals = $('#showData').val(); myArray = myArray.filter( ( el ) => !vals.includes( el ) ); for(var i=0;i<vals.length;i++){ $('.'+vals[i]).show(); } for(var j=0;j<myArray.length;j++){ $('.'+myArray[j]).hide(); } }, success:function(response){ var myArray = ['Order', 'Date', 'Credits','Reply', 'Action', 'View', 'CheckBox']; for(var j=0;j<myArray.length;j++){ $('.'+myArray[j]).hide(); } $("#searchData").html(response); $('.fancybox').fancybox(); } }); } function getStatusSerach(val){ var csrfName = '<?php echo $this->security->get_csrf_hash(); ?>'; console.log(csrfName,val); $.ajax({ type: "POST", data: {csrf_test_name:csrfName,status:val}, url:baseurl+'page/fileOrdersSearchByStatus', complete: function () { var myArray = ['Order', 'Date', 'Credits','Reply', 'Action', 'View', 'CheckBox']; var vals = $('#showData').val(); myArray = myArray.filter( ( el ) => !vals.includes( el ) ); for(var i=0;i<vals.length;i++){ $('.'+vals[i]).show(); } for(var j=0;j<myArray.length;j++){ $('.'+myArray[j]).hide(); } }, success:function(response){ var myArray = ['Order', 'Date', 'Credits','Reply', 'Action', 'View', 'CheckBox']; for(var j=0;j<myArray.length;j++){ $('.'+myArray[j]).hide(); } $("#searchData").html(response); $('.fancybox').fancybox(); } }); } $('document').ready(function () { ShowFields(); $("#showData").multiselect({ nonSelectedText: '<i class="fa fa-eye"></i> <span class="Hide-420">View</span>', allSelectedText: '<i class="fa fa-eye"></i> <span class="Hide-420">View</span>', nSelectedText : '<i class="fa fa-eye"></i> <span class="Hide-420">View</span>', numberDisplayed:false, includeSelectAllOption: false, buttonText: function(options) { if (options.length == 0) { return '<i class="fa fa-eye"></i> <span class="Hide-420">View</span>'; } else if (options.length > 1) { return '<i class="fa fa-eye"></i> <span class="Hide-420">View</span>'; } } //... }); $('#showData').on('change',function() { var base="<?php echo base_url('page/file_orders')?>"; var myArray = ['Order', 'Date', 'Credits','Reply', 'Action', 'View', 'CheckBox']; console.log($(this).val()); var vals = $(this).val(); $('#filedsShow').val(vals.toString()); myArray = myArray.filter( ( el ) => !vals.includes( el ) ); for(var i=0;i<vals.length;i++){ Cookies.set(vals[i], vals[i], { expires: 2 },{ path: base }); $('.'+vals[i]).show(); } for(var j=0;j<myArray.length;j++){ Cookies.remove(myArray[j], myArray[j], { expires: 2 },{ path: base }); $('.'+myArray[j]).hide(); } }); $('#search_fields_show').on('click', function(event) { $('#search_fields').toggle('show'); }); $(".select2").select2(); $('#datepicker-autoclose').datepicker({ format: "yyyy-mm-dd", autoclose: true, todayHighlight: true }); $('#datepicker1-autoclose').datepicker({ format: "yyyy-mm-dd", autoclose: true, todayHighlight: true }); $('.fancybox').fancybox(); }); function ShowFields(){ var base="<?php echo base_url('page/file_orders')?>"; var myArray = ['Order', 'Date', 'Credits','Reply', 'Action', 'View', 'CheckBox']; var vals=$('#filedsShow').val(); vals=vals.split(","); $('#showData').multiselect({ nonSelectedText: '<i class="fa fa-eye"></i> <span class="Hide-420">View</span>', allSelectedText: '<i class="fa fa-eye"></i> <span class="Hide-420">View</span>', nSelectedText : '<i class="fa fa-eye"></i> <span class="Hide-420">View</span>', numberDisplayed:false, includeSelectAllOption: false, buttonText: function(options) { if (options.length == 0) { return '<i class="fa fa-eye"></i> <span class="Hide-420">View</span>'; } else if (options.length > 1) { return '<i class="fa fa-eye"></i> <span class="Hide-420">View</span>'; } } //... }); console.log(Cookies.get()); myArray = myArray.filter( ( el ) => !vals.includes( el ) ); console.log(myArray); /* for(var i=0;i<vals.length;i++){ $('.'+vals[i]).show(); }*/ for(var j=0;j<myArray.length;j++){ val_cookie=Cookies.get(myArray[j], { expires: 2 },{ path: base }); if(typeof val_cookie !="undefined"){ console.log(val_cookie); $('.'+val_cookie).show(); $('#showData').multiselect("select",val_cookie); }else{ $('.'+myArray[j]).hide(); } } } function submitMe(timeoutPeriod) { setTimeout("document.getElementById('frm').submit();", timeoutPeriod); } function validate() { var totalCodes = <?php echo $totalCodes; ?>; var strIds = '0'; for (var i = 0; i < totalCodes; i++) { if (document.getElementById('chkCodes' + i).checked) { arr = document.getElementById('chkCodes' + i).value.split('|'); strIds += ',' + arr[0]; } } if (strIds == '0') { alert("Please select a record!"); return false; } return strIds; } function exportOrders() { var strIds = validate(); if (strIds != false) window.location.href = '<?php echo base_url();?>page/exportimeiorders?ids=' + strIds; } function exportAllOrders() { window.location.href = '<?php echo base_url();?>page/exportimeiorders?cFrm=1'; } function downloadIMEIs() { var strIds = validate(); if (strIds != false) window.location.href = '<?php echo base_url();?>page/downloadIMEIs?ids=' + strIds; } function sortBy(sortBy, orderByType) { if (orderByType == 'ASC') document.getElementById('orderByType').value = 'DESC'; else document.getElementById('orderByType').value = 'ASC'; document.getElementById('sortBy').value = sortBy; document.getElementById('frm').submit(); } //submitMe(120000);// 309 seconds. = 300 * 1000 where 300 are the number of seconds. Total 5 minutes $("#btnSearch1").click(function () { $("#frm").show(); }); $("#btnClose1").click(function () { $("#frm").hide(); }); $("#btnSearch").click(function () { $("#dvSearch").show(); }); $("#btnClose").click(function () { $("#dvSearch").hide(); }); <?php if (isset($_GET['status']) && $_GET['status'] != '') { ?> var status_txt = '<?php echo $_GET['status']; ?>'; var status = 0; if (status_txt == 'Pending') status = 1; if (status_txt == 'Completed') status = 2; if (status_txt == 'Rejected') status = 3; if (status_txt == 'In Process') status = 4; if (status > 0) { // getStatusSerach(status); $('#statusSerach').val(status).trigger("change") } <?php } ?> </script>