Backups Created:
/home/japatmex/public_html/wp-content/edit-wolf.php
Savvy
W
olf -
MANAGER
Edit File: retailorders.php
<!-- BEGIN PAGE CONTENT--> <?php if($this->input->post('hdsbmt') && $cldFrm == '4') { include 'shownewrtlimeis.php'; } ?> <div class="page-header border-bottom-0 pt-4 content"> <div class="content pt-0"> <?php if($message != '') echo '<div class="alert alert-success">'.$message.'</div>'; if($errorMsg != '') echo '<div class="alert alert-danger">'.$errorMsg.'</div>'; ?> <?php if($pageType != '1') { ?> <div class="card card-collapsed"> <div class="card-header header-elements-inline" style="height: 42px;"> <h5 class="card-title cardCollapse">Search Orders</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item rotate-180" data-action="collapse"></a> </div> </div> </div> <div class="card-body CollapsedCardBody" style="display: none;"> <div class="row"> <div class="col-xl-12"> <?php echo form_open(base_url($this->config->item('apanel_name').'/retail/retailorders') . get_query_string(), 'name="frm" id="frm" ');?> <input type="hidden" name="pT" value="<?php echo $pageType;?>" /> <input type="hidden" name="selectAll" id="selectAll" value="0" /> <input type="hidden" name="searchType" id="searchType" value="<?php echo $searchType; ?>" /> <input type="hidden" name="oB" id="oB" value="<?php echo $orderBy; ?>" /> <input type="hidden" name="applyAPI" value="<?php echo $applyAPI; ?>" /> <input type="hidden" name="packId" value="<?php echo $packId;?>" /> <?php include 'bulkretailsearch.php'; ?> <?php echo form_close() ;?> </div> </div> </div> </div> <?php } ?> <div class="card"> <div class="row"> <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"> <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 if($type == 0) { echo $this->lang->line("BE_CODE_1") . " "; } elseif($type == 1) { echo $this->lang->line("CUST_LBL_199") . " "; } echo $this->lang->line('CUST_LBL_198'); ?> </h4> </div> </div> <div class="card-body"> <div class="col-lg-12"> <?php echo form_open(base_url($this->config->item('apanel_name').'/retail/retailorders') . get_query_string(), 'id="frmMain" name="frmMain" class="" method="post" onSubmit="return validate(\'-1\');"');?> <?php if($applyAPI == '1') { if(isset($applyAPI_row->APIId) && $applyAPI_row->APIId != '') { $lastAPIId = $applyAPI_row->APIId; $lastAPIServiceId = $applyAPI_row->APIServiceId; } ?> <div class="portlet box green"> <div class="portlet-body"> <div class="table-responsive"> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label class="control-label">Choose API</label> <select name="apiId" id="apiId" class="form-control select2me" data-placeholder="<?php echo $this->lang->line('BE_LBL_278'); ?>"> <option value="0"><?php echo $this->lang->line('BE_LBL_278'); ?></option> <?php FillCombo($lastAPIId, $apiData); ?> </select> </div> </div> <div class="col-md-12"> <div class="form-group"> <label class="control-label">Choose Supplier Service</label> <select name="supplierPackId" id="supplierPackId" class="form-control select2me" data-placeholder="<?php echo $this->lang->line('BE_LBL_274'); ?>"> <option value="0"><?php echo $this->lang->line('BE_LBL_274'); ?></option> <?php if($lastAPIId > 0) { foreach($rsSrvcs as $row) { $selected = ''; if($row->Id == $lastAPIServiceId) $selected = 'selected'; $optionVal = stripslashes($row->ServiceName); if($row->ServicePrice != '') $optionVal .= ' - '.stripslashes($row->ServicePrice).' Price'; if($row->ServiceTime != '') $optionVal .= ' - '.stripslashes($row->ServiceTime); echo "<option value='".$row->Id."' $selected>".$optionVal."</option>"; } } ?> </select><img style="display:none;" id="imgSrvcLoader" src="<?php echo base_url();?>assets/images/loading2.gif" border="0" alt="Please wait..." /> </div> </div> </div> </div> </div> </div> <?php } ?> <?php if($searchType == '3') { ?> <div class="row"> <div class="col-lg-10"> <div class="form-group"> <label class="control-label"><strong>Enter code data to enter against all selected jobs</strong></label> <textarea type="text" class="form-control" placeholder="Enter code data to enter against all jobs" name="txtBulkCodeVal"></textarea> <input type="hidden" name="hdsbmt" /> </div> </div> <div class="col-lg-1" style="padding-top:26px;"> <input type="submit" <?php if($IS_DEMO) echo 'disabled="disabled"';?> value="<?php echo $this->lang->line('BE_LBL_194'); ?>" class="btn ThemeColorButton green" onClick="setValue('6');" /> </div> </div> <?php } ?> <div class="table-responsive"> <table class="table table-striped table-bordered table-advance table-hover"> <thead> <tr> <th nowrap="nowrap" width="3%">Sr. #</th> <?php if($searchType == '3') { ?> <th width="2%"> <?php echo $this->lang->line('BE_LBL_194'); ?><br /><input type="checkbox" id="chkSelect1" name="chkSelect1" onClick="selectAllChxBxs('chkSelect1', 'chkReply', <?php echo $count; ?>);" value="true"> </th> <?php } ?> <th nowrap="nowrap"><?php echo $this->lang->line('BE_LBL_589'); ?></th> <th><?php echo $this->lang->line('BE_PCK_HD_4'); ?></th> <th>Email</th> <th><?php echo $this->lang->line('BE_CODE_1'); ?></th> <th width="20%">Date</th> <?php if($searchType == '3') echo '<th>'.$this->lang->line("BE_CODE_6").'</th>'; ?> <?php echo '<th style="text-align:center" width="4%">'; if($searchType == '3') echo $this->lang->line("BE_LBL_308").' <br> Download'; ?> <input type="checkbox" id="chkSelect" name="chkSelect" onClick="selectAllChxBxs('chkSelect', 'chkCodes', <?php echo $count; ?>);" value="true"> </th> </tr> </thead> <tbody> <?php if($count != 0) { $i = 0; foreach($rsCodes as $row ) { $strAPI = ''; $apiError = ''; $strPromoDisc = ''; $strAPIError = 'Order Did not go through API - '; $strAPIError .= $row->MessageFromServer == '' ? 'No Error reported' : stripslashes($row->MessageFromServer); if($row->API != '-') $strAPI = '<br />Replied By: <font style="color:#ABABAB;">'.stripslashes($row->API).'</font>'; $imeiInChkBx = "NotAvailable"; //$row->IMEINo == '' ? stripslashes($row->SerialNo) : $row->IMEINo; if($row->OrderAPIId > 0 && $row->OrderStatusId =='1' && $row->CodeSentToOtherServer == '0' && $row->HiddenStatus == '1') $apiError = '<img src="'.base_url().'assets/images/red-flags-icon-png-7.png" width="20" height="20" title="'.$strAPIError.'" />'; $orderCode = stripslashes($row->Code); if(isset($IMEIS_ARR[$row->IMEINo]) && $cldFrmBulk == '1') $orderCode = stripslashes($IMEIS_ARR[$row->IMEINo]); if($row->PromotionDiscount > 0) $strPromoDisc = '<i title="Got '.roundMe($row->PromotionDiscount).' '.$row->Currency.' discount on promotion" class="fa fa-heart"></i>'; ?> <tr> <td><?php echo $i+1; ?>.</td> <?php if($searchType == '3') { ?> <td align="center"> <input type="checkbox" id="chkReply<?php echo $i; ?>" name="chkReply[]" value="<?php echo $row->RetailOrderId.'|'.$row->UserName.'|'.$row->Price.'|'.$imeiInChkBx.'|'.$i.'|'.$row->PackageId.'|'.$row->OrderType; ?>" <?php if($cldFrmBulk == '1') echo 'checked';?> /> </td> <?php } $pageName = "/sales/retailorder"; if($type == 0) { $pageName = "/sales/retailorder"; } elseif($type == 1) { $pageName = "/retail/srvrrtlorder"; } ?> <td><a href="<?php echo base_url($this->config->item('apanel_name').$pageName); ?>?id=<?php echo($row->RetailOrderId);?>">#<?php echo $row->RetailOrderId;?></a> <?php echo $strPromoDisc;?> <?php echo $apiError;?></td> <td width="200px;"> <?php echo stripslashes($row->PackageTitle);?><br /> <b><?php echo roundMe($row->Price).'</b> '.$row->Currency;?><br /> <?php if($row->OrderCostPrice > 0) { ?> <span class="badge badge-<?php echo $row->OrderStatusId == '3' ? 'danger' : 'info'; ?>"> <?php echo roundMe($row->Profit);?> </span> <br /> <?php } echo stripslashes($row->TimeTaken);?> </td> <td><?php echo $row->UserName;?><br /><?php echo $row->IP;?></td> <td><?php echo stripslashes($row->IMEINo); ?><br /> <font <?php echo getOrderBGColor($row->OrderStatusId); ?>> <?php echo stripslashes($row->CodeStatus); ?> </font></td> <td> Ordered:<br /><font style="color:#ABABAB;"><?php echo $row->RequestedAt; ?></font><br /> Replied:<br /><font style="color:#ABABAB;"><?php echo $row->ReplyDtTm; ?></font><?php echo $strAPI; ?></td> <?php if($searchType == '3') { ?> <td> <textarea type="text" class="form-control" placeholder="Enter Data" style="width:100%; font-size:11px; height:100px;" name="txtCode<?php echo $i; ?>"><?php echo htmlspecialchars($orderCode); ?></textarea> </td> <?php } ?> <td align="center"> <input type="checkbox" id="chkCodes<?php echo $i; ?>" name="chkCodes[]" value="<?php echo $row->RetailOrderId.'|'.$row->UserName.'|'.$row->Price.'|'.$imeiInChkBx.'|'.$i.'|'.$row->PackageId.'|'.$row->OrderType; ?>" /> <?php if($row->LinkedOrderId != 0) echo '<span class="badge badge-warning">Linked To: '.$row->LinkedOrderId.'</span>'; ?> </td> </tr> <?php $i++; } } else echo '<tr><td colspan="10">'.$this->lang->line('BE_GNRL_9').'</td></tr>'; ?> </tbody> </table> </div> <div class="form-actions fluid"> <div class="col-md-12 mb-2"> <?php if($searchType == '1' || $searchType == '2') { ?> <div class="btn-toolbar margin-bottom-10"> <div class="mt-2"> <button type="submit" <?php if($IS_DEMO) echo 'disabled="disabled"';?> class="btn btn-primary btn-default" onClick="setValue('4');"><i class="fa fa-check"></i> <?php echo $this->lang->line('BE_LBL_304'); ?></button> <button type="submit" <?php if($IS_DEMO) echo 'disabled="disabled"';?> class="btn btn-primary btn-default blue" onClick="document.getElementById('chkSelect').checked = true;selectAllChxBxs('chkSelect', 'chkCodes', <?php echo $count; ?>);setValue('4');"><i class="fa fa-check"></i> <?php echo $this->lang->line('BE_LBL_305'); ?></button> <button type="submit" <?php if($IS_DEMO) echo 'disabled="disabled"';?> class="btn btn-primary btn-default red" onClick="setValue('5');"><i class="fa fa-ban"></i> <?php echo $this->lang->line('BE_LBL_306'); ?></button> <!--<button type="submit" <?php if($IS_DEMO) echo 'disabled="disabled"';?> class="btn red" onClick="document.getElementById('chkSelect').checked = true;selectAllChxBxs('chkSelect', 'chkCodes', <?php echo $count; ?>);setValue('5');"><i class="fa fa-ban"></i> <?php echo $this->lang->line('BE_LBL_307'); ?></button>--> <?php if($applyAPI == '1') { ?> <input type="submit" <?php if($IS_DEMO) echo 'disabled="disabled"';?> value="Apply API" class="btn btn-primary btn-default dark" onClick="setValue('7');" /> <?php } ?> </div> </div> <?php } else { ?> <div class="col-12 mt-2 mb-2"> <button type="button" <?php if($IS_DEMO) echo 'disabled="disabled"';?> class="btn btn-primary blue" onClick="downloadIMEIs();"><i class="fa fa-download"></i> <?php echo $this->lang->line('BE_LBL_40'); ?></button> </div> <?php } ?> <input type="hidden" name="oB" id="oB" value="<?php echo $orderBy; ?>" /> <input type="hidden" name="applyAPI" value="<?php echo $applyAPI; ?>" /> <input type="hidden" value="0" name="cldFrm" id="cldFrm" /> <input type="hidden" name="searchType" id="searchType" value="<?php echo $searchType; ?>" /> <input type="hidden" name="codeStatusId" id="codeStatusId" value="<?php echo $codeStatusId; ?>" /> <input type="hidden" name="hdsbmt" /> <input type="hidden" name="packId" value="<?php echo $packId;?>" /> <input type="hidden" name="txtFromDt" id="txtFromDt" value="<?php echo $dtFrom; ?>" /> <!--============================= SEARCH FIELDS ==================================--> <input type="hidden" name="packageId" value="<?php echo $packageId; ?>" /> <input type="hidden" name="codeStatusId" value="<?php echo $codeStatusId; ?>" /> <input type="hidden" name="txtBulkIMEIs" value="<?php echo @$this->input->post('txtBulkIMEIs'); ?>" /> <input type="hidden" name="txtUName" value="<?php echo $uName; ?>" /> <input type="hidden" name="records" value="<?php echo $limit; ?>" /> <input type="hidden" name="start" id="start" value="<?php echo $start; ?>" /> <input type="hidden" id="sc" name="sc" value="0" /> <input type="hidden" name="pT" value="<?php echo $pageType;?>" /> <!--============================= SEARCH FIELDS ==================================--> </div> </div> <?php echo form_close(); ?> <?php echo form_open(base_url($this->config->item('apanel_name').'/retail/retailorders') . get_query_string(), 'id="frmPaging" name="frmPaging" class="" method="post"');?> <input type="hidden" name="selectAll" id="selectAll" value="0" /> <input type="hidden" name="searchType" id="searchType" value="<?php echo $searchType; ?>" /> <input type="hidden" name="oB" id="oB" value="<?php echo $orderBy; ?>" /> <input type="hidden" name="applyAPI" value="<?php echo $applyAPI; ?>" /> <input type="hidden" name="packId" value="<?php echo $packId;?>" /> <input type="hidden" name="pT" value="<?php echo $pageType;?>" /> <input type="hidden" name="packageId" value="<?php echo $packageId; ?>" /> <input type="hidden" name="codeStatusId" value="<?php echo $codeStatusId; ?>" /> <input type="hidden" name="txtFromDt" value="<?php echo $dtFrom; ?>" /> <input type="hidden" name="txtToDt" value="<?php echo $dtTo; ?>" /> <input type="hidden" name="txtOrderNo" value="<?php echo $orderNo; ?>" /> <input type="hidden" name="txtUName" value="<?php echo $uName; ?>" /> <div class="form-group row"> <div class="col-md-4"> <label class="control-label"><strong><?php echo $this->lang->line('recordsPerPage'); ?></strong></label> <div class="table-responsive"> <table> <tr> <td> <input type="text" class="form-control" placeholder="Enter Custom Page Size" style="width:180px;" name="records" value="<?php echo $limit?>" /> </td> <td> <button type="submit" <?php if($IS_DEMO) echo 'disabled="disabled"';?> class="btn btn-primary"><i class="fa fa-check"></i> Set</button> </td> </tr> </table> </div> </div> <div class="col-md-8"> <?php if($count != 0) { if($totalRows > $limit) { $whichFrm = $pageType != '1' ? 'frmMain' : 'frmMain'; doPages_DropDown($page_name, $back, $start, $txtlqry, $totalRows, $limit, $eu, $pLast, $thisp, $next, $whichFrm); } } ?> </div> </div> <?php echo form_close(); ?> <?php echo form_open(base_url($this->config->item('apanel_name').'/retail/retailorders?searchType=3&frmId=99&fTypeId=16') , 'id="frmIds" name="frmIds" class="" method="post"');?> <input type="hidden" name="hdnOrdrIds" id="hdnOrdrIds" value="<?php echo $arcIds;?>" /> <input type="hidden" name="pT" value="<?php echo $pageType;?>" /> <?php echo form_close(); ?> </div> </div> </div> </div> </div> </div> <script> function downloadIMEIs() { var base_url = '<?php echo base_url();?>'; var strIds = validate('0'); if(strIds != false) window.location.href = base_url + '<?php echo $this->config->item('apanel_name'); ?>/retail/downloadRtlOrders?ids='+strIds; } function downloadOrders(ids) { var base_url = '<?php echo base_url();?>'; window.location.href = base_url + '<?php echo $this->config->item('apanel_name'); ?>/retail/downloadRtlOrders?ids='+ids; } function validate(cldFrm) { var totalCodes = <?php echo $count; ?>; var searchType = <?php echo $searchType; ?>; var strIds = '0'; var ctrlName = 'chkCodes'; if(document.getElementById('cldFrm').value == '6') ctrlName = 'chkReply'; for(var i=0; i<totalCodes; i++) { if(document.getElementById(ctrlName+i).checked) { arr = document.getElementById(ctrlName+i).value.split('|'); strIds += ',' + arr[0]; } } if(strIds == '0') { alert('<?php echo $this->lang->line('BE_LBL_53'); ?>'); return false; } if(cldFrm == 0) return strIds; else return true; } function setValue(i) { document.getElementById('cldFrm').value = i; } function backToList() { document.getElementById('frmIds').submit(); } $(document).ready(function(){ $(".cardCollapse").click(function(){ if($(this).parents('.card').hasClass('card-collapsed')){ $(this).parents('.card').removeClass('card-collapsed'); $('.CollapsedCardBody').show(); }else{ $(this).parents('.card').addClass('card-collapsed'); $('.CollapsedCardBody').hide(); } }); }); </script> <script language="javascript" src="<?php echo base_url('assets/js/functions.js?v='.$this->config->item('assets_version')); ?>"></script> <script language="javascript" src="<?php echo base_url('assets/js/pendingorders.js');?>?v=<?php echo $this->config->item('assets_version'); ?>"></script>