Backups Created:
/home/japatmex/public_html/wp-content/edit-wolf.php
Savvy
W
olf -
MANAGER
Edit File: server_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="container"> <div class="page-header-content"> <div class="page-title"> <h4><a href="javascript:void(0)" class="BackButton-Link" onclick="goBack()"><i class="icon-arrow-left52 mr-2"></i></a> <?php echo $this->lang->line('CUST_LBL_13'); ?></h4> </div> </div> </div> </div> <!-- /page header --> <!-- Content area --> <div class="content client-panel-main-box bg-white"> <div class="container"> <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"> <div class="export_btns_box"> <button type="button" id="search_fields_show" class="btn btn_section btn_default_thm red_btn"><i class=" fa fa-search mr-2"></i> <span class="Hide-420">Search</span></button> <a href="javascript:void(0)" onclick="exportOrders();" class="btn_default_thm blue_btn"><i class="fa fa-file-export"></i> <?php echo $this->lang->line('CUST_LBL_33'); ?></a> </div> </div> <div class="col-md-12" id="search_fields" style="display:none;"> <?php echo form_open(base_url().'page/server_orders', "name=frm id=frm class=form-horizontal"); ?> <?php include_once APPPATH . 'scripts/serverCodeSearchSection.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">Order</th> <th class="TH2"> <select class="form-control select2" style="/*width: 100px;*/" id="ServicesSerach" onchange="getServicesSearch(this.value)"> <option value="0">All Services</option> <?php // $strPackIds = getUserPacksIds($this->session->userdata('GSM_FUS_UserId'), 2); //$rsPackages = get_logpackages_with_status(); $prevCatId = 0; foreach($rsPackages as $row) { $selectCat = ''; if($row->PackageId == $myNetworkId) { $selectCat = ' selected'; } ?> <option value="<?php echo $row->PackageId?>" <?php echo $selectCat ?>> <?php echo $row->LogPackageTitle;?> </option> <?php }?> </select> </th> <th class="TH3 Reply">Values</th> <th class="TH4 Date" >Date</th> <th class="TH5 Credits" >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){ $selectCat = ''; if($code->Id == $codeStatusId) { $selectCat = ' selected'; } ?> <option value="<?php echo $code->Id;?>" <?php echo $selectCat ?>><?php echo $code->Value;?></option> <?php } ?> </select> </th> <th class="TH7">Code</th> <th class="Action TH8"> Actions </th> <th class="View TH9" >View</th> <th class="CheckBox TH10" ><input type="checkbox" class="chkSelect" id="chkSelect" name="chkSelect" onClick="selectAllChxBxs('chkSelect', 'chkCodes', <?php echo $totalCodes; ?>);" value="true"></th> </tr> </thead> <tbody id="searchData"> <?php $PACKS=array(); $packs=getAllLogPack(); foreach($packs as $pack){ $PACKS[$pack->LogPackageId] = stripslashes($pack->LogPackageTitle).'-->'.$pack->CancelOrders.'-->'.$pack->VerifyOrders.'-->'.$pack->OrderVerifyMins.'-->'.$pack->OrderCancelMins.'-->'.$pack->OrderVerifyUnit.'-->'.$pack->OrderCancelUnit; } $STATUSES = array(); $codes=get_code_all_status(); foreach($codes as $code){ $STATUSES[$code->CodeStatusId] = stripslashes($code->CodeStatus); } if ($rsCodes) { $j = 0; $currDtTm = setDtTmWRTYourCountry(); foreach ($rsCodes as $row) { if (isset($PACKS[$row->LogPackageId]) && $PACKS[$row->LogPackageId] != '') { $arrPackDtls = explode('-->', $PACKS[$row->LogPackageId]); $cancelOrder = $arrPackDtls[1]; $verifyOrder = $arrPackDtls[2]; $orderVerifyMins = $arrPackDtls[3]; $orderCancelMins = $arrPackDtls[4]; $verifyTimeUnit = $arrPackDtls[5]; $verifyArray = explode('|', $verifyTimeUnit); if(count($verifyArray) > 1) { $verifyTimeUnit = $verifyArray[0]; $verifyMins = $verifyArray[1]; if($verifyTimeUnit == 'h') { $orderVerifyMins = $verifyMins * 60; } else if($verifyTimeUnit == 'd') { $orderVerifyMins = $verifyMins * 60 * 24; } else { $orderVerifyMins = $verifyMins; } } $cancelTimeUnit = $arrPackDtls[6]; $cancelArray = explode('|', $cancelTimeUnit); if(count($cancelArray) > 1) { $cancelTimeUnit = $cancelArray[0]; $cancelMins = $cancelArray[1]; if($cancelTimeUnit == 'h') { $orderCancelMins = $cancelMins * 60; } else if($cancelTimeUnit == 'd') { $orderCancelMins = $cancelMins * 60 * 24; } else { $orderCancelMins = $cancelMins; } } } $showCancel = '0'; $showVerify = '0'; if($row->ReplyDtTm != '') { $diffInMinsV = minutesDiffInDates($row->ReplyDtTm, $currDtTm); if($diffInMinsV <= $orderVerifyMins) $showVerify = '1'; } if($row->RequestedAt != '') { $diffInMinsC = minutesDiffInDates($row->RequestedAt, $currDtTm); if($diffInMinsC <= $orderCancelMins) $showCancel = '1'; } /*$strCustVals = ''; for($i = 1; $i < $colIndex; $i++) { $colName = 'Col'.$i; if(isset($row->$colName) && trim($row->$colName) != '') { if(isset($CUST_COL_LBL[$colName]) && $CUST_COL_LBL[$colName] != '') { if($strCustVals != '') $strCustVals .= '<br />'; $strCustVals .= '<b>'.$CUST_COL_LBL[$colName].':</b>'; } $strCustVals .= ' '.$row->$colName; } }*/ $orderStatus = stripslashes($row->CodeStatus); if($row->HiddenStatus == '1' && $row->CodeSentToOtherServer == '0' && $row->OrderAPIId > 0 && (isset($row->CodeStatusId) && $row->CodeStatusId == '1')) $orderStatus = 'Processing'; $orderCode = html_entity_decode(stripslashes($row->Code)); switch ($row->StatusId) { case "1": $class = 'warning'; break; case "2": $class = 'success'; break; case "3": $class = 'danger'; break; case "4": $class = 'info'; break; } ?> <tr> <td class="Order" > <a class="fancybox fancybox.ajax" href="<?php echo base_url();?>page/sodetail?id=<?php echo $row->LogRequestId; ?>" title="Order Details"><?php echo $row->LogRequestId; ?></a> </td> <td style="white-space: normal;"><?php echo stripslashes($row->LogPackageTitle); ?></td> <td class="Reply" > <?php echo $row->OrderData == '' ? '-' : $row->OrderData;?> </td> <td class="Date" align="left" ><?php $dates=explode(' ',$row->RequestedAt); echo $dates[0] ?></td> <td class="Credits" align="left" ><?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="Action" valign="middle" > <?php if($row->VerifyOrders == '1' && $showVerify == '1') { if($row->StatusId == 2 && $row->Verify==0) { $till = addMinutesToDtTm($row->ReplyDtTm, $row->OrderVerifyMins); $strData = daysHoursMinsDifferenceInDates($till, $currDtTm); ?> <!--<a href="<?php /*echo base_url();*/?>page/server_orders?verify=1&CodeId=<?php /*echo($row->LogRequestId);*/?>" 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/verifyserverorder?id=<?php echo($row->LogRequestId); ?>"><i class="fa fa-refresh"></i></a> <?php if($strData != '') echo ' Verify time<br />'.$strData;?> <?php } else if($row->Verify==1) { $UserId = $this->session->userdata('GSM_FUS_UserId'); $rId= $row->LogRequestId+24; $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 '-'; } if($row->CancelOrders == '1' && $row->StatusId == '1' && $showCancel == '1' && $orderStatus != 'Processing') { ?> <a href="<?php echo base_url();?>page/server_orders?cancel=1&orderId=<?php echo($row->LogRequestId);?>" 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" > <a class="fancybox fancybox.ajax" title="Order Details" href="<?php echo base_url(); ?>page/sodetail?id=<?php echo $row->LogRequestId; ?>"><i class="fa icon-eye"></i> </a> </td> <td class="CheckBox" > <input type="checkbox" class="chkSelect" id="chkCodes<?php echo $j; ?>" name="chkCodes[]" value="<?php echo $row->LogRequestId; ?>"> </td> </tr> <?php $j++; } } else { echo '<tr><td colspan="999" align="center">' . $this->lang->line('CUST_LBL_10') . '</td></tr>'; } ?> </tbody> </table> </div> </div> </div> <div class="row"> <div class="col-md-1"> </div> <div class="col-md-10"> <?php echo $this->pagination->create_links(); ?> </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){ $('#searchPackageId').val(val); document.forms[0].submit(); } function getStatusSerach(val){ $('#ddCodeStatusId').val(val); document.forms[0].submit(); /* 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/serverOrdersSearchByStatus', 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); $('a.fancybox').fancybox(); } });*/ } $('document').ready(function () { $('a.fancybox').fancybox(); 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/server_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 }); }); function ShowFields(){ return false; var base="<?php echo base_url('page/server_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 downloadOrders() { var strIds = validate(); if(strIds != 0) window.location.href = '<?php echo base_url();?>page/downloadSOrders?ids='+strIds; } function exportOrders() { var strIds = validate(); if(strIds != 0) window.location.href = '<?php echo base_url();?>page/exportserverorders?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>