Backups Created:
/home/japatmex/public_html/wp-content/edit-wolf.php
Savvy
W
olf -
MANAGER
Edit File: order_new.php
<?php $rwCrncy = fetch_currency_data(true); $CurrencySymbol = $rwCrncy->CurrencySymbol; ?> <div class="container"> <div class="inner-heading"> <h1><? echo $this->lang->line('CDVAR178') . $title; ?></h1> </div> </div> <section class="vprod_cart"> <div class="container"> <div class="row"> <div class="col-12"> <?php if ($message != '') echo '<div class="alert alert-success mt-lg" id="contactSuccess"><strong>Success!</strong> ' . $message . '</div>'; if (trim($errorMsg) != '') echo '<div class="alert alert-danger mt-lg" id="contactError"><strong>Error!</strong> ' . $errorMsg . '</div>'; ?> </div> <div class="col-xl-6 col-lg-6 col-md-12 col-sm-12"> <?php echo form_open(base_url().'home/order'.get_query_string(),'class="Qnt_req contact-form green_register_fm" method="post" name="frmOrder" id="frmOrder" novalidate="novalidate" onsubmit="return validate(this);"');?> <? echo $strFields; if ($totalBrands > 0) { ?> <div class="form-group "> <label style="text-transform:capitalize;">Brands *</label> <select name="brandId" id="brandId" class="form-control"> <option value="0" selected="selected"><? echo $this->lang->line('CDVAR179'); ?></option> <? foreach ($rsBrands as $row ) { $brandAPIId = $row->APIId; ?> <option value="<? echo $row->Id; ?>"><? echo $row->Value; ?></option> <? } ?> </select> <span id="spnBrLoader" style="display:none;"><img src="<? echo base_url(); ?>assets/img/loading.gif" /></span> </div> <div class="form-group" id="dvModels"> <label style="text-transform:capitalize;">Model *</label> <select name="modelId" id="modelId" class="form-control"> <option value="0" selected="selected"><? echo $this->lang->line('CDVAR180'); ?></option> </select> </div> <? } ?> <div class="form-group"> <label>Your Name *</label> <input name="txtName" id="txtName" value="<?php echo $name; ?>" type="text" class="form-control" required="required" /> </div> <div class="form-group"> <label>Your Email Address *</label> <input name="txtEmail" id="txtEmail" value="<?php echo $email; ?>" type="text" class="form-control" required="required" /> </div> <div class="form-group"> <label>Your Phone *</label> <input name="txtPhone" id="txtPhone" value="<? echo $phone; ?>" type="text" class="form-control" required="required" /> </div> <input type="hidden" name="chkSm" id="chkSm" value="<?php echo $rsStngs->CheckSumIMEI; ?>" /> <input type="hidden" id="serviceId" name="serviceId" value="<? echo $id; ?>" /> <input type="hidden" id="hdPckTitle" name="hdPckTitle" value="<?php echo $pckTitle; ?>" /> <input type="hidden" id="brandAPIId" name="brandAPIId" value="<?php echo $brandAPIId; ?>" /> <input type="hidden" id="imeiFType" name="imeiFType" value="<? echo $imeiFType; ?>" /> <input type="hidden" id="customimeiFType" name="customimeiFType" value="<? echo $customimeiFType; ?>" /> <input type="hidden" id="customFldMinLen" name="customFldMinLen" value="<? echo $imei_custom_length; ?>" /> <input type="hidden" id="customFldMaxLen" name="customFldMaxLen" value="<? echo $imei_custom_max_length; ?>" /> <input type="hidden" id="imei_allow_alphabit" name="imei_allow_alphabit" value="<? echo $imei_allow_alphabit; ?>" /> <input type="hidden" id="imei_allow_digits" name="imei_allow_digits" value="<? echo $imei_allow_digits; ?>" /> <input type="hidden" id="imei_capital_alphabets" name="imei_capital_alphabets" value="<? echo $imei_capital_alphabets; ?>" /> <input type="hidden" id="imei_small_alphabets" name="imei_small_alphabets" value="<? echo $imei_small_alphabets; ?>" /> <input type="hidden" id="bulkimeiFType" name="bulkimeiFType" value="<? echo $bulkimeiFType; ?>" /> <input type="hidden" id="baseURL" name="baseURL" value="<? echo base_url('home'); ?>" /> <input type="hidden" id="serviceType" name="serviceType" value="<? echo $serviceType; ?>" /> <input type="hidden" name="mdlVal" id="mdlVal" value="" /> <input type="hidden" name="rtlType" value="<? echo $rtlType; ?>" /> <input type="hidden" id="pPrice" name="pPrice" class="pPrice" value="<? echo $promoPrice; ?>" /> <input type="hidden" id="currSymbol" name="currSymbol" value="<?php echo $CurrencySymbol; ?>" /> <div class="form-group"> <label>Comments</label> <textarea name="txtComments" id="txtComments" cols="" rows="" class="form-control"><?php echo $comments; ?></textarea> </div> <div class="form-row"> <? $k = 0; $themeId = $rsStngs->Theme; /*echo '<pre>'; print_r($rsPMethods);*/ foreach ($rsPMethods as $row) { $imgName = 'file.png'; if ($row->PayMethodTypeId == '1') $imgName = 'paypal.png'; else if ($row->PayMethodTypeId == '10') $imgName = 'easypaisa.png'; else if ($row->PayMethodTypeId == '11') $imgName = 'stripe.png'; $imageFlag = true; if($row->PayImage && file_exists(FCPATH."uplds$themeId/" . $row->PayImage)) { $imgName = $row->PayImage; $imageFlag = false; } ?> <div class="form-group col-md-6"> <input type="radio" style="margin:0;" class="gateways" data-id="<?php echo $row->PayMethodTypeId; ?>" name="pMethod" value="<? echo $row->PayMethodTypeId . '|' . $row->PaymentMethodId; ?>" <? if ($row->PaymentMethodId == 1 || $k == 0) echo 'checked'; ?> /> <img style="max-width: 130px; margin-bottom: 10px;" src="<?php if($imageFlag) { echo base_url('assets')?>/images/<? echo $imgName; } else { echo base_url('uplds' . $themeId) . "/" . $imgName; } ?>" /> <p style="margin-left: 20px;"><? echo stripslashes($row->PaymentMethod) . ' (' . $row->RetailFee . '% fee)'; ?></p> </div> <? $k++; } ?> </div> <div id="dvError" class="alert alert-danger" style="display: none;"></div> <div class="form-group"> <label class="hidden-xs"> </label> <button type="submit" class="btn qnt_submit"><? echo ($this->lang->line('CDVAR165')?:'Buy Now'); ?></button> </div> <?php echo form_close();?> </div> <div class="col-xl-6 col-lg-6 col-md-12 col-sm-12"> <div class="vprod_cart_detail"> <div class="pnl_head"> <h2> <label class="priceLbl" style="color: inherit; font: inherit;" data-price = "<?php echo $promoPrice;?>"><?php echo $CurrencySymbol . ' ' . $promoPrice ;?></label> <span class="d_time"><?php echo $delTime; ?> Delivery Time</span> </h2> </div> <div class="c_hr"></div> <? echo $desc; ?> <!-- The Modal --> <div class="modal" id="rev_model"> <div class="modal-dialog"> <div class="modal-content"> <!-- Modal Header --> <div class="modal-header"> <h4 class="modal-title">Customer Review</h4> <button type="button" class="close" data-dismiss="modal">×</button> </div> <!-- Modal body --> <div class="modal-body"> <form class="rev_form"> <div class="row"> <div class="col-xl-6 col-lg-6 col-md-6 col-sm-12"> <div class="form-group"> <label for="name">Name</label> <input type="text" class="form-control" id="name" required> </div> </div> <div class="col-xl-6 col-lg-6 col-md-6 col-sm-12"> <div class="form-group"> <label for="email">Email</label> <input type="email" class="form-control" id="email" required> </div> </div> <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12"> <div class="form-group"> <label for="comments">Comments</label> <textarea type="text" class="form-control" id="comments" required></textarea> </div> </div> <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12"> <div class="form-group"> <div class="capchta"><img src="images/capchta.jpg" class="img-fluid"></div> </div> </div> <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12"> <div class="form-group"> <input type="text" class="form-control" id="capchta" required> </div> </div> <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12"> <button type="submit" class="btn btn-primary">Save</button> </div> </div> </form> </div> </div> </div> </div> </div> </div> </div> </div> </section> <script type="text/javascript"> var currency_symbol = '<?php echo $CurrencySymbol;?>'; $(function(){ $(document).on('keyup', "#txtIMEI", function() { if($("#chkSm").val() == '1') { var lastDigit = calculateLastIMEIDigit($(this).val()); $("#txtIMEILastDigit").val(lastDigit); } }); }); function calculateLastIMEIDigit(imei) { if(imei.length < 14) return ''; if (!isDigit(imei)) return ''; var j = 0; var k = 0; var numbersLeft = ''; var toDouble = ''; var doubled = ''; var totalSum = 0; for(var i=imei.length-1; i>=0; i--) { if(i%2 == 0) { numbersLeft+= imei[i]; j++; } else { toDouble += imei[i]; k++; } } for(var i=0; i<toDouble.length; i++) { doubled += toDouble[i] * 2; } for(var i=0; i<doubled.length; i++) { totalSum += parseInt(doubled[i]); } for(var i=0; i<numbersLeft.length; i++) { totalSum += parseInt(numbersLeft[i]); } var lastDigit = totalSum % 10; if(lastDigit > 0) lastDigit = parseInt(10 - lastDigit); return lastDigit; } function numberWithCommas(x) { return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); } function checkImeiNew(val) { if(val.length <= 16) return false; return true; } function calculateAmountAsPerQty(qty) { qty = (qty && qty.trim()) ? qty : 1; var price = parseFloat($('[name="pPrice"]').val().replace(/,/g, '')); var cur = $('[name="currSymbol"]').val(); qty = parseInt(qty); $('.priceLbl').text(cur+' '+numberWithCommas(parseFloat(price * qty).toFixed(2))); } function validate(form) { var PackType = $('[name=rtlType]').val(); PackType = PackType == 1 ? 4 : 3; // 3 = imei, 4 = server $("#dvError").html("").hide(); try { var errors = ''; $(form).find('[name^="fld"]').each(function(){ var id = $(this).attr('name').match(/^fld(\d+)$/); id = id[1]; if($('[name="mndtry'+id+'"]').val() == 1) { if(!$(this).val().trim()) { errors += "- "+($('[name="lbl'+id+'"]').val())+" field is required.<br />"; } } if(PackType == 3) { var reg = ''; var regMsg = ''; var rstrctnAD = $('[name="rstrctnAD'+id+'"]').val(); if(rstrctnAD == 1) { reg += '\\d'; regMsg += ' digits, '; } var rstrctnASA = $('[name="rstrctnASA'+id+'"]').val(); if(rstrctnASA == 1) { reg += 'a-z'; regMsg += ' small alphabets, '; } var rstrctnACA = $('[name="rstrctnACA'+id+'"]').val(); if(rstrctnACA == 1) { reg += 'A-Z'; regMsg += ' capital alphabets, '; } regMsg = regMsg.replace(/^\s+|,\s+$/g, ''); if(reg) { var r = new RegExp('^['+reg+']+$', 'g'); if(!r.test($(this).val().trim())) { errors += "- "+$('[name="lbl'+id+'"]').val()+" field must contain "+regMsg+" only.<br />"; } } }else{ var useAsQnt = parseInt($('[name="useAsQty'+id+'"]').val()); var minQnt = parseInt($('[name="minQnt'+id+'"]').val()); var maxQnt = parseInt($('[name="maxQnt'+id+'"]').val()); if(useAsQnt && (minQnt && maxQnt)) { var $val = parseFloat($(this).val()); minQnt = parseFloat(minQnt); maxQnt = parseFloat(maxQnt); if($val > maxQnt || $val < minQnt) { errors += "- "+($('[name="lbl'+id+'"]').val())+" must be between "+minQnt+" and "+maxQnt+".<br />"; } } } var minLen = parseInt($(this).attr('minlength')); var maxLen = parseInt($(this).attr('maxlength')); if(minLen && maxLen) { if($(this).val().trim().length < minLen || $(this).val().trim().length > maxLen) { errors += "- "+($('[name="lbl'+id+'"]').val())+" length must be between "+minLen+" and "+maxLen+".<br />"; } }else{ if(minLen && ($(this).val().trim().length < minLen)) { errors += "- "+($('[name="lbl'+id+'"]').val())+" length must be greater than "+minLen+".<br />"; } if(maxLen && ($(this).val().trim().length > maxLen)) { errors += "- "+($('[name="lbl'+id+'"]').val())+" length must not exceed "+maxLen+".<br />"; } } }); $(form).find('[required]').each(function(){ if(!$(this).val().trim()) { errors += "- "+($(this).closest('div').find('label').text().replace(/[\*\:]/g, '').trim())+" field is required.<br />"; } }); if(errors) { $("#dvError").html(errors).show(); return false; }else{ return true; } } catch(e) { // $("#dvError").html(`- ${e.message} at line: ${e.lineNumber}<br />`).show(); } } </script>