Super Cobra Auto Detailing

Ceramic Coating, Paint Correction, & Professional Detailing

Trusted in Killeen, Texas since 2018, our certified team delivers paint correction, ceramic coatings, and full detailing—done right for Texas conditions.

Why Choose Super Cobra Auto Detailing

  • Certified professionals
  • Flexible financing options available
  • 100+ five-star Google reviews
  • ✓50,000+ Vehicles Serviced at our shop
  • Specialists in paint correction, coatings and auto detailing
  • CLICK HERE TO CALL NOW (254) 516-9060

 At Super Cobra Auto Detailing, we understand the value of transparent pricing in your decision-making. Unlike our competitors, our prices are fixed—what you see is exactly what you pay. There are no hidden fees or last-minute price hikes. We prioritize your convenience and budget, ensuring an upfront and honest service experience every time.

Step 1. Your Contact Details

* required
* required
* required
* required

Step 2. Choose Your Service

Auto Detailing

Paint Correction

Ceramic Coating

Tell Us About Your Vehicle

* These fields are required to submit your booking

Tell Us About Your Vehicle


Add more vehicles
You can add some additional vehicles as a note or submit your first vehicle and the form will redirect with a button to book the next vehicle after submitting.

#2
#3
#4
#5

Services

Full Interior and Exterior Detail

Full Interior and Exterior Detail

Featured Service

Our Full Detail restores your vehicle inside and out — combining deep decontamination, ceramic protection, and a refreshed interior for long-lasting beauty and cleanliness. 

Deep Clean • Gloss • Protection

A meticulous inside-and-out reset: decontamination, clay, and ceramic spray wax on the exterior — plus steam cleaning, fabric shampoo, and leather care on the interior for that “fresh car” feel.

 Ceramic sealant: 6–12 months of protection
 Paint, wheels, and glass fully decontaminated
 Interior deep-clean and fabric/leather care
 Steam sanitation for a healthier cabin
 Finished with UV protection and a slick gloss
 
 

This Package Includes:

  • Hand Wash and Dry
  • foam Cannon Shampoo
  • Bug removal from grill and windows
  • Vacuum Interior and Trunk 
  • Shampoo Seats and carpet
  • Pet Hair Removal
  • Leather Seat Conditioner
  • Clean Door Jams & Air Vents
  • Clean Mats, Seats, Carpet
  • Wipe down Dash, Console & Steering Wheel
  • Clean Windows & Mirrors
  • Dress Tires With Shine 
  • Ceramic sealant

Please note that our Full Interior and Exterior Detail service is specifically for vehicles that are in extremely poor condition, such as those with stains on seats and carpets, excessive pet hair, or excessive dirt. This service is also ideal for customers who are shipping their vehicle to another country or simply want to restore their car to a brand-new condition. Please be aware that this is a set price for your convenience, rather than a starting price. Thank you for choosing our services.

Select service

Additional Service Options

Express Detail

Express Detail

Quick • Clean • Convenient

Our Express Detail is designed for drivers who want that fresh, clean look without the wait. This service provides a thorough interior and exterior refresh in about an hour — perfect for keeping your vehicle looking its best between full details.

This Package Includes:

  • Hand Wash and Dry
  • foam Cannon Shampoo
  • Bug removal from grill and windows
  • Vacuum Interior and Trunk 
  • Wipe down Dash, Console & Steering Wheel
  • Clean Windows & Mirrors
  • Dress Tires With Shine

Please note that our Express Deatail Service is specifically for vehicles that are in good condition, such as those with NO stains on seats and carpets, NO excessive pet hair, or excessive dirt. Please be aware that this is a set price for your convenience, rather than a starting price. Thank you for choosing our services.

Select service

Deep Interior Rejuvenation

Deep Interior Rejuvenation

Featured Service

Revitalize your cabin with our Interior Detail — a deep, dry-clean style process that removes dirt, stains, and buildup while refreshing every surface with a clean, protected finish.

 Deep Clean • Sanitize • Protect

Our Interior Detail is designed to restore your cabin to like-new condition. From steam cleaning to fabric shampooing and leather conditioning, every surface is deep-cleaned, sanitized, and protected for a fresher, healthier interior.

 Deep interior vacuum & surface prep
 Steam cleaning for sanitization
 Upholstery shampoo & extraction
 Leather cleaning & conditioning
 Trim & glass cleaned and protected
 Pet hair removal
 Headliner Cleaning
 Vent Consoles Cleaning

Perfect for refreshing your cabin or preparing your vehicle for resale.

Select service

Additional Service Options

Exterior Detail + Paint Enhancement

Exterior Detail + Paint Enhancement

Featured Service

• Gloss • Protection

Exterior decontamination, clay, and ceramic sealant deliver a slick, glossy finish — a 1-step polish to all painted surfaces.

 6–12 months ceramic sealant protection
 Smooth, contaminant-free paint
 Tires & trim refreshed with a rich finish
 Ultra gloss finish

This Package Includes:

  • Exterior wash, clay & decontamination
  • Ceramic Sealant
  • Tires & trim dressed
  • 1-step paint polish 
  • Door Jambs Clean
  • Exterior and interior windows

3 hrs approx.

$250

Select service

Express Wash & Wax

Express Wash & Wax

 Fast shine • Lasting protection

Our Express Wash & Wax gives your vehicle a brilliant clean and a protective finish in one efficient service. Perfect for maintaining your paint’s gloss and shielding it from everyday dirt, road grime, and UV damage — all in under an hour.

Includes:

  • Gentle hand wash & towel dry

  • Bug and tar removal

  • Wheel and tire cleaning with tire shine

  • Premium spray wax or sealant for a deep gloss and protection (up to 1 month)

  • Exterior glass cleaned streak-free

  • Light wipe-down of door jambs

Select service

Additional Service Options

Bad Smell Removal

Bad Smell Removal

Neutralizes smoke, mildew, and pet odors.

3 hrs approx.

$100

Select service

Complete Engine Detail

Complete Engine Detail

 Clean • Protected • Like new again

 

Your engine bay deserves the same attention as the rest of your vehicle. Our Complete Engine Detail safely removes built-up grease, oil, and grime from all visible engine components, restoring a clean, well-maintained look while helping prevent corrosion and spotting leaks early.

Includes:

  • Gentle degreasing and steam cleaning of engine bay and components

  • Hand cleaning of plastic, rubber, and metal surfaces

  • Application of a non-greasy dressing for a like-new finish and UV protection

  • Final inspection for a spotless, professional appearance

Benefits:
✅ Enhances engine appearance and resale value
✅ Helps prevent premature wear and corrosion
✅ Makes future maintenance easier
✅ Ideal before selling or showing your vehicle

1 hour approx.

$45

Select service

Headlight Restoration

Headlight Restoration

Featured Service

 See clearer • Drive Safer

Over time, headlights can become cloudy, yellowed, or oxidized — making your vehicle look older and reducing nighttime visibility. Our Headlight Restoration service safely removes oxidation, restores clarity, and applies a UV sealant to protect against future fading.

Includes:

  • Deep cleaning and oxidation removal

  • Multi-stage wet sanding and polishing process

  • UV-resistant protective coating for long-lasting clarity

  • Optional ceramic sealant upgrade for extra durability

Benefits:
✅ Improved nighttime visibility
✅ Enhanced vehicle appearance
✅ Long-term protection from sun and weather damage

1 hour approx.

$100

Select service

Signature Ceramic Coating Package

Signature Ceramic Coating Package

Featured Service

Our Signature Ceramic Coating Package is the ultimate in long-term protection — powered by Gtechniq Crystal Serum Ultra for 9 years of unmatched gloss, durability, and hydrophobic performance, plus complimentary quarterly maintenance for life.

 

Luxury • Longevity • Lifetime Care

Our Signature Package features Gtechniq Crystal Serum Ultra — the pinnacle of ceramic protection. With a certified installation process and free quarterly maintenance for the lifetime of the coating, your vehicle remains in peak condition year-round. It’s our highest standard of gloss, resilience, and craftsmanship.

 9 years of ultra-durable ceramic protection
 Extreme chemical, UV, and abrasion resistance
 Mirror-like gloss and slick hydrophobic surface
 C4 trim, C5 wheel, and Glassparency coatings included
 

Professional-grade protection designed for perfectionists who want nothing less than the best.

This Package Includes:

  • Full exterior wash & decontamination
  • Single or 3-step compound & polish correction
  • Gtechniq Crystal Serum Ultra (9-year ceramic coating)
  • C4 trim, C5 wheel & Glassparency glass coatings
  • Tires dressed with satin or gloss finish

Select service

Paint Correction

Paint Correction

Featured Service

Restore your shine • Reveal your car’s true color

 Our Paint Correction service is a professional machine polishing process that removes surface imperfections like swirl marks, light scratches, oxidation, and haze caused by improper washing or environmental exposure. The result? A deep, reflective gloss that brings your paint back to life.

It will NOT remove deep scratches or clear coat failure.

Includes:

  • Detailed paint inspection & surface prep

  • Clay bar decontamination to remove bonded contaminants

  • Multi-stage machine polishing (1–3 stages)

  • Paint refinement for depth and clarity

  • Optional ceramic coating upgrade for long-term protection

Benefits:
✅ Removes swirl marks, light scratches, and oxidation
✅ Restores depth, gloss, and clarity
✅ Prepares the surface for wax or ceramic coating
✅ Adds resale value and enhances overall appearance

 

 

3 hrs approx.

$650

Select service

Free Consulatation

Free Consulatation

Select service

Free Consulatation Packages

Free Consultation

Not sure which service is right for you? Schedule a complimentary consultation and let us craft a personalized plan for your vehicle’s protection and appearance.

 Personalized • Transparent • Free

Bring your vehicle to our shop at 704 East Veterans Memorial Boulevard, Killeen, Texas 76541, United States for a no-obligation consultation. Our team will inspect your vehicle, answer your questions, and design a service plan tailored to your goals and budget.

 100% free — no obligation
 Personalized service recommendations
 Expert advice from certified professionals
 Transparent pricing and package options
 Convenient scheduling to fit your needs

Stop by or contact us today to schedule your free consultation.

What to Expect:

  • Vehicle inspection and condition review
  • Personalized service recommendations
  • Clear pricing and timeline overview
  • Opportunity to ask questions one-on-one
  • No pressure — just honest advice and guidance

15 mins approx.

Select package
Free Consulatation Packages

What is Your Vehicle's Condition?

What is Your Vehicle's Paint Condition?

LIGHT

MEDIUM

SEVERE

😎 Preferred Window Tint Level

If you're not sure don't worry we can go over options together.

70%

50%

35%

20%

5%

5% REAR + 50% FRONT

5% REAR + 35% FRONT

5% REAR + 20% FRONT

20% REAR + 50% FRONT

20% REAR + 35% FRONT

35% REAR + 50% FRONT

Do You Need Existing Tint Removed?

Yes, remove my old tint

Which PPF Coverage Would You Like?

PARTIAL HOOD

PARTIAL FRONT

FULL FRONT

FULL BODY

Do Any of the Following Apply to Your Vehicle?

Pet Hair

Seat Stains

What is Your Vehicle's Oxidation Level?

NONE

LIGHT

SEVERE

What color are your seats?

What type of seats do you have?

LEATHER

CLOTH OR FABRIC

SEAT COVER

ALCANTARA/SUEDE

Desired Date & Time

Choose a preferred date to check
Business Hours
  • Monday
    9:00 am - 6:00 pm
  • Tuesday
    9:00 am - 6:00 pm
  • Wednesday
    9:00 am - 6:00 pm
  • Thursday
    9:00 am - 6:00 pm
  • Friday
    9:00 am - 6:00 pm
  • Saturday
    9:00 am - 6:00 pm
  • Sunday
    Closed

Choose your scent to leave your car smelling brand new.

Adding fragrance will not have an additional cost.

Please Choose a fragrance below

What are Your 3 Wishes

Tell us your three wishes for your service so we know what to focus on during your appointment. This helps ensure your satisfaction and provides us with a clear game-plan to make you happy.

#1
#2
#3

Secure appointment with a $ deposit

A $25 NONREFUNDABLE DEPOSIT WILL BE NEEDED TO BOOK/SAVE APPOINTMENT TIME.

IF NEEDING TO RESCHEDULE DEPOSIT CAN BE USED FOR A FUTURE DATE (THIS OPTION IS NOT AVAILABLE IF CUSTOMER IS A NO CALL NO SHOW. OPTION ALSO NOT VALID AFTER
1 TIME OF RESCHEDULING WITH ANOTHER NO SHOW).
ALL APPOINTMENTS ARE DROP OFF ONLY FOR THE TIME BEING.

TOTAL BALANCE IS NOT EXPECTED UNTIL AFTER DETAIL IS FINISHED.

DETAIL TIME CAN BE DIFFERENT FOR EACH VEHICLE DEPENDING ON THE SIZE AND STATE OF THE VEHICLE. (HOW DIRTY). FOR EXAMPLE, PET HAIR REMOVAL/PENETRATED STAINS WILL RESULT IN EXTRA DETAIL TIME.

CUSTOMERS CAN EXPECT OUR EXPERIENCED ENTHUSIASTS OF OVER 8 YEARS IN THE INDUSTRY AS A TRUSTED PROVIDER OF PROFESSIONAL AUTO DETAILING TO UTILIZE A RANGE OF TECHNIQUES AND HIGH QUALITY PRODUCTS TO ENHANCE THE APPEARANCE OF YOUR VEHICLE.

Coupon Code

Do You Have a Gift Card?

How Did You Hear About Us?

Terms and Conditions

The terms and conditions set forth herein reflect Super Cobra Auto Detailing's policy with respect to each of its customers. All customers of Super Cobra Auto Detailing agree to be bound by the terms and conditions set forth below.

Our philosophy is to offer a stress-free detailing experience for our customers.

Your vehicle and performing proper detailing techniques is our first priority. We will not perform any service that shows potential to cause harm or damage your vehicle. Prior to Super Cobra Auto Detailing performing services on your vehicle, you, the owner, will advise us of any cosmetic or mechanical issues that would prevent us from completing the detail.

These may include low battery, trunk permanently shut, windows do not roll down, etc…

If your vehicle poses a potential threat to our health and/or safety, please let us know. If there is the threat of any harmful substances (needles, drugs, gasoline, etc.) in the vehicle, you must let your detail technician know prior to your detail. You will be held responsible for any health and/or safety issues arising from your vehicle.

Super Cobra Auto Detailing reserves the right to refuse service.

Pricing varies for each vehicle and is determined by size, package, and condition.

Additional charges apply for heavy stains, excessive pet hair, excessive debris removal, personal item removal and steam cleaning (if required) due to the additional time it takes.

Property Damage

Each customer agrees to indemnify and hold harmless Super Cobra Auto Detailing, its owners, employees and affiliates from any damage, loss, expense, cost, claim and liability (including attorney and legal fees) arising out of Super Cobra Auto Detailing services, including without limitation, any accidental property damage not relating to the services performed. I acknowledge that the unique nature of Super Cobra Auto Detailing's business may expose me to greater property damage risk, and I hereby assume such risk.

Super Cobra Auto Detailing will neither install nor remove any car seats or custom equipment from your vehicle unless deemed absolutely necessary and your approval and acceptance of these terms grants permission to do so.

We will neither remove nor install car seats from your vehicle. If you would like your car seat cleaned underneath, please have it removed prior to your appointment.

We will neither remove nor install custom equipment from your vehicle. This includes, but is not limited to, seat covers, subwoofers, light bars, pet protectors, and bumper stickers. If you would like these things cleaned underneath, please have them removed prior to your appointment.

We require a minimum 24 hours notice to change or cancel an appointment.

A hold for the full amount of your scheduled appointment may be placed on the provided credit/debit card 24 hours prior to your appointment.

An appointment is defined as one (1) scheduled car. Bookings with multiple cars will be subject to multiple cancellation fees (i.e. A $500 booking with 5 appointments at $100 each canceled after the approved timeframe can be subject to a $250 cancellation fee).

If you wish to change your appointment with less than 24 hours notice, you will have the following 3 options:

  • Reschedule your appointment at no additional cost to you. Though you will be charged for your appointment at the time of rescheduling, you may pick another day and time for Super Cobra Auto Detailing to perform the detail.
  • Cancel your appointment with a cancellation charge. The hold will be released on your card and you will be charged the cancellation fee on the same card for canceling within 24 hours. This option is valid up to six (6) hours before your scheduled appointment. Cancellations with less than six (6) hours notice are only given options 1 or 3. An appointment is not considered cancelled until the customer has confirmed the cancellation with Super Cobra Auto Detailing representative.
  • Convert your scheduled appointment to a gift card. If circumstances have changed (i.e. you sold your car and no longer have it), you may convert the full amount of your scheduled appointment to a gift card for later personal use or to give as a gift.

Super Cobra Auto Detailing reserves the right to withdrawl this option for fleet vehicle/business vehicle bookings.

There are NO GUARANTEES of bringing your vehicle back to a specific condition (i.e. Show Room New).

Payment

We accept cash and credit cards. Payment is due at the completion of the detail. If payment was made online, your card will not be charged until after completion unless a deposit is required.

There may be an additional charge for Non Sufficient Funds or Returned Payments

Photographs and Video

We have your permission to take pictures or video of your vehicle for marketing purposes. These will never be sold or given to third parties.

Damage/Accidents

Reimbursement will not be paid for any minor cosmetic damage as a result of detailing your vehicle. Reimbursement will be paid for any major damage caused to your vehicle as a result of our gross negligence or willful misconduct. Super Cobra Auto Detailing will approve the body shop and/or vendors before issuing any reimbursement.

If something arises after the detail that was not noticed during the final walk around, you must contact us within 24 hours and, if needed, schedule a touch-up detail within 5 days.

Each customer agrees to indemnify and hold harmless Super Cobra Auto Detailing, its owners, employees and affiliates from and against any and all liabilities, expenses, damages, and costs, including attorney and legal fees, resulting from any service provided or injury after our services have been completed.

I read & agree to the terms

Gift Cards Available

We have gift cards available ranging from $25 - $500 or choose a custom amount to make the perfect gift!

Buy a Gift Card Now

Super Cobra Auto Detailing

4.6 101 Google reviews


I called and spoke to Gabriel he was very helpful informing me they offered pcs details for vehicles explained to me what it included and gave me a time frame for when my truck would be done if I brought it in even without an appointment, I arrived and he explained what they would be doing to my truck and made sure to give me a chance to point out anything I felt they should focus on. The detail did take a half hour longer then expected but he and his team made sure to communicate with me and once they were done my truck looked and smelled like it never has, they out did themselves!!
Ariel Maldonado Aug 16th 2024 - a year ago

Very friendly staff and took care of the whole vehicle! Can't wait to take my vehicles back to y'all for more services, thank and bless y'all! Very happy with the outcome of their work
Justin Requenes Apr 21st 2025 - 6 months ago

They did an amazing job on my car that’s been toddler and animal destroyed. They’re fast with approving scheduled appointments online and I notice they do take walk ins also. I wanted to have a clean car for my vacation getaway. I made an appointment at 5pm for 8am the next day so availability is satisfactory. I got the interior only and will def be coming again. I forgot to take pics of my trunk that was COVERED in fur and my front seats that were pretty gross with food (I eat lunch in my car) they got every nook and cranny and I absolutely see no dog fur in my truck anymore! Yes, the website states it will be 3 hours but it can take longer. mine took 5 hours (I had no problem with that as I knew my car was a mess) so please be prepared to wait a bit extra (they make sure your car is satisfactory so just have a little patience 😇) They do have real time update trackers so that’s a huge plus. Overall, gives this place a try for your mobile detailing ! I’m definitely gonna be a reoccurring customer!
Ty Baggott Jun 20th 2024 - a year ago
Privacy & Data Collection Notice
Super Cobra Auto Detailing collects information such as your phone number or email in order to contact you regarding estimates, invoices, bookings and other business communications and promotions at various frequencies depending on your appointments, invoices etc. By submitting your information you are agreeing to receive messages from Super Cobra Auto Detailing on various intervals depending on your appointments schedules and followup reminders and that data rates may apply. You can also text HELP to get help at any time.

Your IP Address: 216.73.216.58 is tracked for fraud prevention and security.




'); setTimeout(function() { $('#global-loader').remove(); }, 5000); //} }); $('.timepicker').timepicker({ timeFormat: 'h:mm p', interval: 15, //minTime: '10', //maxTime: '11:00pm', //defaultTime: '9', //startTime: '10:00', dynamic: false, dropdown: true, scrollbar: true }); function roundToTwoDecimals(number) { return parseFloat(roundNumber(roundNumber(number * 100) / 100)).toFixed(2); } $(document).on('click', '.makePayChoices', function(){ $('#payOptionsAlert').html(''); var invoiceID = $(this).attr('invID'); var invoice = $(this).attr('invoice'); var baseURL = 'https://orbisx.ca/app'; $('#modalMakePaymentOptions a.pay-option-offline').attr('href', baseURL+'/pay-invoice-offline?inv='+invoiceID); $('#modalMakePaymentOptions a.pay-option-gift-card').attr('href', baseURL+'/pay-invoice-gift-card/VSVWJ/'+invoice); $('#modalMakePaymentOptions a.pay-option-cpos-terminal').attr('href', baseURL+'/cpos-terminal/'+invoice); $('#modalMakePaymentOptions a.pay-option-cpos-web').attr('href', baseURL+'/cpos-web/'+invoice); $('#modalMakePaymentOptions a.pay-option-stripe-web').attr('href', baseURL+'/pay-invoice?inv='+invoiceID); $('#modalMakePaymentOptions a.pay-option-qbo-payment').attr('href', baseURL+'/pay-qbo?inv='+invoiceID); $('#modalMakePaymentOptions a.pay-option-stripe-terminal').attr('href', baseURL+'/stripe-terminal/'+invoice); $('#modalMakePaymentOptions a.pay-option-stripe-chipper').attr('href', baseURL+'/chipper/'+invoiceID); $('#modalMakePaymentOptions a.pay-option-stripe-taptopay').attr('href', baseURL+'/stripe-tap-to-pay/'+invoice); $('#modalMakePaymentOptions a.pay-option-square-reader').attr('href', baseURL+'/square-reader/'+invoice); $('#modalMakePaymentOptions a.pay-option-square-terminal').attr('href', baseURL+'/square-terminal/'+invoice); $('#modalMakePaymentOptions a.pay-option-square-web').attr('href', baseURL+'/square-web/'+invoice); $('#modalMakePaymentOptions a.pay-option-clover-web').attr('href', baseURL+'/clover-web/'+invoice); $('#modalMakePaymentOptions a.pay-option-clover-terminal').attr('href', baseURL+'/clover-terminal/'+invoice); $('#modalMakePaymentOptions a.pay-option-yoco-web').attr('href', baseURL+'/yoco-web/'+invoice); $.post("https://orbisx.ca/app/exec", {dothis:'getClientCreditsBalance', invoiceID: invoiceID}, function(data) { data = $.parseJSON(data); if (data.apply_html) { $('#payOptionsAlert').html(data.apply_html); } }); $.post("https://orbisx.ca/app/exec", {dothis:'getInvoiceDepositPossible', invoiceID: invoiceID}, function(data) { data = $.parseJSON(data); if (data.success) { $('#modalMakeDepositOptions').html('

or you can collect a deposit

or custom deposit amount

'); } }); }); $('#modalMakeDepositOptions').on('change', '#liveDepositAmount', function(){ var amt = $('#liveDepositAmount option:selected').val(); var inv = $(this).attr('invoice'); if(amt > 0){ window.location.href = "https://orbisx.ca/app/depositpayment/VSVWJ/"+inv+"?percAmt="+amt; } }); $('#modalMakeDepositOptions').on('click', '#liveCustomDepositBtn', function(e){ var amt = $('#liveCustomDepositAmount').val(); var inv = $(this).attr('invoice'); if(amt > 0){ window.location.href = "https://orbisx.ca/app/depositpayment/VSVWJ/"+inv+"?customDepositAmt="+amt; }else{ snackBar('Enter a deposit amount to continue', 'error'); } e.preventDefault(); }); function saveCposCardOnFile(clientID, token, ps2000_data, approval_code, exp_date, showMessage=false, address, zip){ $.post("https://orbisx.ca/app/exec", {dothis:'saveCposWebCardOnFile', clientID:clientID, itemID:token, typeID:ps2000_data, toggle:approval_code, description:exp_date, address:address, zip:zip, businessID: '4254'}, function(data) { data = $.parseJSON(data); if(data.success == true && showMessage == true){ snackBar("Card saved to customer's profile :)"); } }); } $('document').ready(function(){ //$("#global-loader").hide(); $('.focus').focus(); $('.filter-multi').multipleSelect({ filter: true, hideOptgroupCheckboxes: true, minimumCountSelected: 0 }); $('#searchIcon').click(function(){ $('#searchForm').submit(); }); $('table th.calc_col_total').each(function(i){ calculateColumn($(this).index(), i); }); $(document).on('keyup', '.number-only', function () { this.value = this.value.replace(/[^-0-9.:\.]/g,''); }); $(document).on('keyup', '.number-only-positive', function () { this.value = this.value.replace(/[^0-9.:\.]/g,''); }); $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { $('.select2').select2({ minimumResultsForSearch: '' }); $('textarea').each(function(){ $(this).height(0).height(this.scrollHeight); }); var view = $(e.target).attr("href").replace('#', '/'); if (view == '/main') { view = '/'; } $('#view').val(view); }); $('#templates').on('shown.bs.collapse', function () { init_autogrow(); }); $(document).on('click', '#events-list .panel-heading', function(e) { $('.select2').select2({ minimumResultsForSearch: '', dropdownParent: $('#events-list') }); }); $(document).on('click', '[data-toggle="card-collapse"]', function(e) { var view = $(this).parent('div').attr('id'); $('#view').val(view); init_autogrow(); $('[data-toggle="popover"], .popoverShow').popover({ html: true, trigger: 'hover' }); $('#cuerpo-principal').on('click', '.popoverShow', function(){ swal({ title: 'Additional Info', text: $(this).attr('data-content'), html: true, timer: 15000, type: 'info', showConfirmButton: true }); }); $('.select2').select2({ minimumResultsForSearch: '' }); }); init_autogrow(); if($(".wysiwyg").length > 0){ tinymce.init({ selector: ".wysiwyg", theme: "modern", height:300, relative_urls : false, remove_script_host : false, convert_urls : true, plugins: [ "advlist autolink link image lists charmap hr anchor pagebreak", "searchreplace wordcount visualblocks visualchars code insertdatetime media nonbreaking", "save table contextmenu directionality emoticons template paste textcolor" ], menubar: 'edit insert view format table tools', toolbar: "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | preview media fullpage | forecolor backcolor emoticons", style_formats: [ {title: 'Bold text', inline: 'b'}, {title: 'Red text', inline: 'span', styles: {color: '#ff0000'}}, {title: 'Heading', block: 'h2'}, {title: 'Example 1', inline: 'span', classes: 'example1'}, {title: 'Example 2', inline: 'span', classes: 'example2'}, {title: 'Table styles'}, {title: 'Table row 1', selector: 'tr', classes: 'tablerow1'} ] }); } $(document).on('click', '[data-toggle="lightbox"]', function(event) { event.preventDefault(); $(this).ekkoLightbox(); }); $('.vehicleColorChooser').on('click', 'a', function(){ var vehicleRef = $(this).parents('.vehicleColorChooser').attr('vehicleReference'); var color = $(this).attr('data-hex'); $('#vehicleColorVal'+vehicleRef).val(color).trigger('change'); $('#vehicleDisplay'+vehicleRef+' .vehicleOverlay').css('background', '#'+color); $('#vehicleDisplay'+vehicleRef).find('.vehicleColorDefaultText').html('Color Set'); }); $('.vehicleCustomColor').on('change', function(){ var vehicleRef = $(this).parents('.vehicleColorChooser').attr('vehicleReference'); $('#vehicleColorVal'+vehicleRef).val(this.jscolor).trigger('change'); $('#vehicleDisplay'+vehicleRef+' .vehicleOverlay').css('background', '#'+this.jscolor); $('#vehicleDisplay'+vehicleRef).find('.vehicleColorDefaultText').html('Color Set'); }); $('.vehicleColorChooser li.keepOpen').on('click', function(event) { event.stopPropagation(); }); $('.spectrumPaletteVehicle').spectrum({ showPaletteOnly: false, showPalette:false, hideAfterPaletteSelect:true, showButtons: true, preferredFormat: "hex", color: '#FFFFFF', move: function(color) { color.toHexString(); var vehicleRef = $(this).parents('.vehicleColorChooser').attr('vehicleReference'); $('#vehicleColorVal'+vehicleRef).val(color).trigger('change'); $('#vehicleDisplay'+vehicleRef+' .vehicleOverlay').css('background', color); }, change: function(color){ var vehicleRef = $(this).parents('.vehicleColorChooser').attr('vehicleReference'); $('#vehicleColorVal'+vehicleRef).val(color).trigger('change'); $('#vehicleDisplay'+vehicleRef+' .vehicleOverlay').css('background', color); $('.vehicleColorChooser .dropdown-menu.show').removeClass('show'); } }); $('.table-responsive').on('shown.bs.dropdown', function (e) { var t = $(this), m = $(e.target).find('.dropdown-menu'), tb = t.offset().top + t.height(), mb = m.offset().top + m.outerHeight(true), d = 20; // Space for shadow + scrollbar. if (t[0].scrollWidth > t.innerWidth()) { if (mb + d > tb) { t.css('padding-bottom', ((mb + d) - tb)); t.css('margin-right', '5px'); } } else { t.css('overflow', 'visible'); } }).on('hidden.bs.dropdown', function () { $(this).css({'padding-bottom': '', 'overflow': ''}); }); }); function init_autogrow(){ autosize(document.querySelectorAll('textarea')); $('textarea').each(function(){ $(this).height(0).height(this.scrollHeight); }); } $('.modal').on('shown.bs.modal', function (e) { init_autogrow(); $('.select2').select2({ minimumResultsForSearch: '' }); }); $('.select2').select2({ minimumResultsForSearch: '' }); function roundNumber(value) { var value = +value; if (isNaN(value)) return NaN; value = value.toString().split('e'); value = Math.round(+(value[0] + 'e' + (value[1] ? (+value[1] + 2) : 2))); value = value.toString().split('e'); return (+(value[0] + 'e' + (value[1] ? (+value[1] - 2) : -2))).toFixed(2); } function moneyFormat(number) { var parts = number.toString().split("."); parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","); return parts.join("."); } function calculateColumn(index, i){ var total = 0; $('table tr').each(function(){ var value = parseFloat( $('td', this).eq(index).text().replace(/[^0-9\.]/g, '') ); if ($.isNumeric(value)){ total += value; } }); if ( $('th.calc_col_total').eq(i).hasClass('decimals') ) { $('table tfoot td').eq(index).text(addCommas(roundNumber(total))); }else if ( $('th.calc_col_total').eq(i).hasClass('money') ) { $('table tfoot td').eq(index).text('$'+addCommas(roundNumber(total))); }else{ $('table tfoot td').eq(index).text(addCommas(total)); } } addCommas = function(input){ return (input.toString()).replace( /^([-+]?)(0?)(\d+)(.?)(\d+)$/g, function(match, sign, zeros, before, decimal, after) { var reverseString = function(string) { return string.split('').reverse().join(''); }; var insertCommas = function(string) { var reversed = reverseString(string); var reversedWithCommas = reversed.match(/.{1,3}/g).join(','); return reverseString(reversedWithCommas); }; return sign + (decimal ? insertCommas(before) + decimal + after : insertCommas(before + after)); } ); }; $.fn.isOnScreen = function(){ var win = $(window); var viewport = { top : win.scrollTop(), left : win.scrollLeft() }; viewport.right = viewport.left + win.width(); viewport.bottom = viewport.top + win.height(); var bounds = this.offset(); bounds.right = bounds.left + this.outerWidth(); bounds.bottom = bounds.top + this.outerHeight(); return (!(viewport.right bounds.right || viewport.bottom bounds.bottom)); }; if(typeof android !== "undefined" && android !== null) { var OneSignalID = android.getOneSignalRegisteredId(); if (OneSignalID) { $.post("https://orbisx.ca/app/exec/updateUserSpecs", {OneSignalID:OneSignalID}, function(data) { data = $.parseJSON(data); }); } } function getOneSignalTokeniOS(token) { if(token){ $.post("https://orbisx.ca/app/exec/updateUserSpecs", {OneSignalID:token}, function(data) { data = $.parseJSON(data); }); } } function locationTracker(longitude,latitude){ if (longitude && latitude) { $.post("https://orbisx.ca/app/exec/updateUserSpecs", {lat:latitude, lng:longitude}, function(data) { data = $.parseJSON(data); }); } } function update_event_vehicle_from_vin(vin, eventID, clientID, vehicleID){ if (eventID && clientID && vin.length >= 11) { $.post("https://orbisx.ca/app/ajax/get-vin-details", {vin:vin, clientID:clientID, vehicleID:vehicleID}, function(data) { data = $.parseJSON(data); if(data.success && data.vehicle){ $('#eventVehicle'+eventID).text(data.vehicle); } }); } } $(document).on('click', '.clearInputGroupVal', function(e){ $(this).parents('.input-group').find('input').val(''); e.preventDefault(); }); $('.carfaxReportLookup').on('click', function(){ var vin = $(this).parents('.input-group').find('input').val(); if(vin){ location.href = 'https://orbisx.ca/app/carfax/'+(vin); }else{ swal({ title: 'Something Went Wrong', text: 'Enter a VIN and try again.', timer: 3000, type: 'error', showConfirmButton: true }); } }); function openScanner(){ if(window.webkit){ window.webkit.messageHandlers.openQRCodeScanner.postMessage({command: 'openQRCodeScanner',data:''}); }else if (typeof android !== 'undefined' && android !== null) { android.openQRCodeScanner(); } } function processScannerVIN(vin) { vin = vin.replace(/\W+/g, " ").toUpperCase().replace('I', ''); if (vin) { $('.vinScanResults').val(''); $('.vinScanResults').val(vin).blur(); }else{ swal({ title: 'Something Went Wrong', text: 'Try scanning the VIN again.', timer: 3000, type: 'error', showConfirmButton: true }); } } $(document).on('click', '.vinScanner', function(e) { openScanner(); }); $(document).on('click', '.scannerOCR', function(e){ $('.ocrResultTarget').removeClass('ocrResultTarget'); var elem = $(this).parents('.input-group').find('input'); $(elem).addClass('ocrResultTarget'); var ocrType = $(this).attr('ocrType'); $('#modalGeneric .modal-title').html('Take a Photo to Scan VIN or Plate #'); $('#modalGeneric .modal-body').html(''); $('#modalGeneric .modal-footer').html(' Close popup window'); $('#modalGeneric').modal('show'); $('.uploadOcrPic').dropify(); e.preventDefault(); }); $(document).on('click', '.ocrScanAgain', function(e){ var ocrType = $(this).attr('ocrType'); $('#modalGeneric .modal-body').html(''); $('.uploadOcrPic').dropify(); e.preventDefault(); }); $(document).on('click', '.ocrSaveRsp', function(e){ $('.ocrResultTarget').val($(this).parents('.input-group').find('input').val()).trigger('blur'); $('#modalGeneric').modal('hide'); $('.ocrResultTarget').removeClass('ocrResultTarget'); e.preventDefault(); }); $(document).on('change', '.uploadOcrPic', function(){ $('#ocrResponse').html(''); var dataimg = new FormData(); var ocrType = $('#ocrType').val(); dataimg.append('dothis', 'scanOcrImage'); dataimg.append('opVal', $(this)[0].files[0]); dataimg.append('opVal2', ocrType); $('body').append('

Luna is scanning your image...

'); $.ajax({ url: "https://orbisx.ca/app/exec", type:"POST", cache : false, processData: false, contentType: false, dataType: "json", enctype: 'multipart/form-data', data: dataimg, success: function(data) { if(data.success){ $('#modalGeneric .modal-body').html(data.html); }else{ $('#modalGeneric .modal-body').html('

'+data.message+'

'); $('.uploadOcrPic').dropify(); } $('#global-loader').remove(); } }); }); function processCamResponse(result, businessid, eventid, bayid){ if(result == 1){ swal({ title: 'Photos Captured', text: 'Your IP cameras have captured the photos', timer: 1500, type: 'success', showConfirmButton: true }); }else{ swal({ title: 'No Photos Captured', text: 'Something went wrong, try capturing your photos again.', timer: 3000, type: 'error', showConfirmButton: true }); } } function appCheck() { var appUsed = false; var appType = false; if(window.webkit){ appUsed = true; appType = 'iOS'; }else if (typeof android !== 'undefined' && android !== null) { appUsed = true; appType = 'android'; } if (appType == 'iOS') { $('.onlyWebFeature').hide(); // iOS fix for target="_blank" links (downloads + external) $('a[target="_blank"]').each(function () { const href = $(this).attr('href'); if (!href) return; // Match file downloads, allowing query strings too if (href.match(/\.(pdf|jpe?g|png|gif|webp|svg|heic|avif|docx?|xlsx?|zip|rar|csv)(\?.*)?$/i)) { $(this).removeAttr('target'); $(this).on('click', function (e) { e.preventDefault(); window.location.href = href; // Direct open or download }); } else { // Non-download links: open in same tab (avoids iOS blank failures) $(this).on('click', function (e) { e.preventDefault(); window.open(href, '_self'); }); } }); $('#cuerpo-principal .popoverShow').popover({ html: true, trigger: 'click' }); $('body').on('click', function (e) { if ($(e.target).data('toggle') !== 'popover' && $(e.target).parents('.popover.in').length === 0) { $('[data-toggle="popover"]').popover('hide'); $('.popoverShow').popover('hide'); } }); $('#cuerpo-principal').on('click', '.popoverShow', function(){ swal({ title: 'Additional Info', text: $(this).attr('data-content'), html: true, timer: 15000, type: 'info', showConfirmButton: true }); }); }else{ if (appUsed) { $('.onlyWebFeature').hide(); $('a[target="_blank"]').removeAttr('target'); $('.popoverShow').popover({ html: true, trigger: 'click' }); $('body').on('click', function (e) { if ($(e.target).data('toggle') !== 'popover' && $(e.target).parents('.popover.in').length === 0) { $('[data-toggle="popover"]').popover('hide'); $('.popoverShow').popover('hide'); } }); $('#cuerpo-principal').on('click', '.popoverShow', function(){ swal({ title: 'Additional Info', text: $(this).attr('data-content'), html: true, timer: 15000, type: 'info', showConfirmButton: true }); }); }else{ $('.onlyAppFeature').hide(); $('.popoverShow').popover({ html: true, trigger: 'hover' }); $('.nonAppPopover').popover({ html: true, trigger: 'hover' }); } } } $("#new-card").click(function(){ $("input[name=card_number], input[name=cvc]").attr("disabled",!this.checked); if($("#new-card").is(":checked")) { $("input[name=card_number]").focus().attr("oldcard", $("#card-number").val() ).val(""); }else{ $("#card-number").val($("input[name=card_number]").attr("oldcard")); } }); function get_lead_message_log(leadID){ $.post("https://orbisx.ca/app/exec", {dothis:'getSmsChatLead', leadID: leadID}, function(data) { data = $.parseJSON(data); if(data.success == true){ $('#modalGeneric .modal-body').html(data.html); $('#modalGeneric .chat-list').stop().animate({ scrollTop: $('#modalGeneric .chat-list')[0].scrollHeight }, 800); }else{ swal({ title: data.message_title, text: data.message, timer: 3000, type: 'error', showConfirmButton: true }); } }); } $(document).on('click', '.viewSmsChatLead', function(){ var leadID = $(this).attr('leadID'); var leadName = $(this).attr('leadName'); if(leadID){ $(this).find('i').removeClass('text-success'); $('#modalGeneric .modal-title').html('SMS Chat with '+leadName); $('#modalGeneric .modal-body').html('Loading chat...'); get_lead_message_log(leadID); $('#modalGeneric .modal-footer').html('
'); $('#modalGeneric').modal('show'); } }); $(document).on('click', '#sendSmsMsgLead', function(){ var leadID = $(this).attr('leadID'); var msg = $('#sendSmsMsg').val(); $('#sendSmsMsgLead').prop('disabled', true); if(msg){ $.post("https://orbisx.ca/app/exec", {dothis:'sendSmsChatLead', leadID: leadID, msg: msg}, function(data) { data = $.parseJSON(data); if(data.success == true){ $('#sendSmsMsg').val(''); init_autogrow(); get_lead_message_log(leadID); snackBar(data.message); }else{ swal({ title: data.message_title, text: data.message, timer: 3000, type: 'error', showConfirmButton: true }); } $('#sendSmsMsgLead').prop('disabled', false); return false; }); }else{ swal({ title: 'Message Blank', text: 'Please enter a message to send an SMS to the lead :)', timer: 3000, type: 'error', showConfirmButton: true }); $('#sendSmsMsgLead').prop('disabled', false); return false; } }); function get_client_message_log(clientID){ $.post("https://orbisx.ca/app/exec", {dothis:'getSmsChatClient', clientID: clientID}, function(data) { data = $.parseJSON(data); if(data.success == true){ $('#modalGeneric .modal-body').html(data.html); $('#modalGeneric .chat-list').stop().animate({ scrollTop: $('#modalGeneric .chat-list')[0].scrollHeight }, 800); }else{ swal({ title: data.message_title, text: data.message, timer: 3000, type: 'error', showConfirmButton: true }); } }); } $(document).on('click', '.viewSmsChatClient', function(){ var clientID = $(this).attr('clientID'); var clientName = $(this).attr('clientName'); if(clientID){ $(this).find('i').removeClass('text-success'); $('#modalGeneric .modal-title').html('SMS Chat with '+clientName); $('#modalGeneric .modal-body').html('Loading chat...'); get_client_message_log(clientID); var mmsSend = ''; $('#modalGeneric .modal-footer').html('
'+mmsSend+'
'); $('#modalGeneric').modal('show'); } }); $(document).on('click', '.sendMmsMsgChatGroupBtn', function(e){ e.preventDefault(); const clientID = $(this).attr('clientID') || ''; const leadID = $(this).attr('leadID') || ''; // Create input element programmatically so we don't stringify "undefined" const $input = $('', { type: 'file', name: 'mms_file', id: 'mmsFile', class: 'dn', accept: 'image/*' }); if (clientID) $input.attr('data-client-id', clientID); if (leadID) $input.attr('data-lead-id', leadID); $('body').append($input); $input.trigger('click'); }); // Handle upload + refresh log $(document).on('change', '#mmsFile', function(e){ e.preventDefault(); const file = $("#mmsFile")[0].files[0]; const MAX = 10 * 1024 * 1024; // 10MB if (!file) return; if (file.size > MAX) { snackBar('File is too large (max 10MB).', 'error'); $('#mmsFile').remove(); return; } $('body').append( '
' + '

Sending MMS

' + '

Please do not refresh or navigate away from this page

' + '
' + '
' ); // Read normalized IDs (may be undefined if not set) let clientID = $(this).data('clientId'); let leadID = $(this).data('leadId'); // Normalize stringy values just in case const isBad = (v) => v === undefined || v === null || v === '' || v === 'undefined' || v === 'null' || v === '0'; if (isBad(clientID)) clientID = ''; if (isBad(leadID)) leadID = ''; const dataimg = new FormData(); dataimg.append('dothis', 'sendMmsChatClient'); if (clientID) dataimg.append('clientID', clientID); if (leadID) dataimg.append('leadID', leadID); dataimg.append('opVal', $("#mmsFile")[0].files[0]); $.ajax({ url: "https://orbisx.ca/app/exec", type: "POST", cache: false, processData: false, contentType: false, dataType: "json", enctype: 'multipart/form-data', data: dataimg, success: function(data) { if (data.success) { setTimeout(function() { if (!isBad(leadID)) { get_lead_message_log(leadID); } else if (!isBad(clientID)) { get_client_message_log(clientID); } $('#global-loader').remove(); }, 3000); } else { snackBar(data.message, 'error'); $('#global-loader').remove(); } $('#mmsFile').remove(); }, error: function() { $('#global-loader').remove(); $('#mmsFile').remove(); snackBar('Upload failed. Please try again.', 'error'); } }); }); $(document).on('click', '#sendSmsMsgClient', function(){ var clientID = $(this).attr('clientID'); var msg = $('#sendSmsMsg').val(); $('#sendSmsMsgClient').prop('disabled', true); if(msg){ $.post("https://orbisx.ca/app/exec", {dothis:'sendSmsChatClient', clientID: clientID, msg: msg}, function(data) { data = $.parseJSON(data); if(data.success == true){ $('#sendSmsMsg').val(''); init_autogrow(); get_client_message_log(clientID); snackBar(data.message); }else{ swal({ title: data.message_title, text: data.message, timer: 3000, type: 'error', showConfirmButton: true }); } $('#sendSmsMsgClient').prop('disabled', false); return false; }); }else{ swal({ title: 'Message Blank', text: 'Please enter a message to send an SMS to the customer :)', timer: 3000, type: 'error', showConfirmButton: true }); $('#sendSmsMsgClient').prop('disabled', false); return false; } }); $('body').on('click', '.sendUserPush', function(){ var contact = $(this).attr('contact'); $('#sendUserPushMsg').val('').attr('userID', $(this).attr('userID')); $('#sendUserPushTitle').text('Send '+contact+' a Message'); $('#modalSendUserPush').modal('show'); }); $('#sendUserPushBtn').click(function(){ var msg = $('#sendUserPushMsg').val(); var userID = $('#sendUserPushMsg').attr('userID'); if (msg && userID) { $.post("https://orbisx.ca/app/ajax/send-user-push-notice", {userID:userID, msg: msg}, function(result) { result = $.parseJSON(result); if(result.recipients > 0) { $('#modalSendUserPush').modal('hide'); swal({ title: 'Message Sent', text: 'Your message has been delivered', timer: 3000, type: 'success', showConfirmButton: true }); }else { swal({ title: 'Something Went Wrong', // text: result.errors, text: typeof result.errors === 'string' ? result.errors : JSON.stringify(result.errors, null, 2), timer: 3000, type: 'error', showConfirmButton: true }); } }); }else{ swal({ title: 'Something Went Wrong', text: 'You must enter a message to send a push notice', timer: 3000, type: 'error', showConfirmButton: true }); } }); $(document).on('click', '.loadTaskList', function(){ var eventID = $(this).attr('eventID'); var checklistID = $(this).attr('checklistID'); var checklistName = $(this).attr('checklistName'); $.post("https://orbisx.ca/app/exec", {dothis:'getEventChecklistTasks', itemID:eventID, toggle:checklistID, businessID: '4254'}, function(data){ data = $.parseJSON(data); if(data.success == true){ var html = ''; if(data.start_timer_button){ html += data.start_timer_button; } html += '
'+(value.user ? '
'+value.user.contact+' '+value.timestamp+'
' : '')+''; }); html += ''; $('#modalGeneric .modal-body').html(html); $('#modalGeneric').modal('show'); return false; }else{ swal({ title: 'Something Went Wrong', text: data.message, timer: 3000, type: 'error', showConfirmButton: true }); } }); }); $(document).on('click', '.quickStartJobTimer', function (e) { e.preventDefault(); var elem = $(this).parents('.quickStartJobTimerContainer'); var btn = $(this); var btnText = $(this).html(); $(btn).prop('disabled', true).html(' Starting timer...'); var eventID = $(this).attr('eventID'); $.post("https://orbisx.ca/app/updateWorkTimerEvent", { eventID: eventID, action: 'start' }, function (data) { data = $.parseJSON(data); if (data.success == true) { $(elem).html('

Timer started for event #'+eventID+'

'); } else { swal({ title: 'Oops...', text: 'Something went wrong trying to start the timer', timer: 5000, type: 'error', showConfirmButton: true }); $(btn).prop('disabled', false).html(btnText); } }); }); $(document).on('click', '#checkAllEventChecklistTasks', function(e){ $('#modalGenericSecondary .modal-title').html('Confirm Bulk Action'); $('#modalGenericSecondary .modal-body').html('

Are you sure you want to mark all tasks complete for this checklist?

Yes, mark all complete Cancel'); $('#modalGenericSecondary .modal-footer').html('Cancel and close popup'); $('#modalGenericSecondary').modal('show'); e.preventDefault(); }); $(document).on('click', '#checkAllEventChecklistTasksConfirm', function(e){ $('#eventChecklistTaskList input').each(function(){ if(!$(this).is(':checked')){ $(this).prop('checked', true).trigger('click'); } }); $('#modalGenericSecondary').modal('hide'); snackBar('Way to go champ! All done :)', 'success'); e.preventDefault(); }); $(document).on('click', '.sendCustomerProgressTrackerLink', function(){ var sendIt = false; var eventID = $(this).attr('eventID'); var elem = $(this); $(elem).prop('disabled', true); $('#eventChecklists'+eventID+' ul li').each(function(){ if($(this).attr('shareProgress') == 1){ sendIt = true; } }); if(sendIt){ $.post("https://orbisx.ca/app/exec", {dothis:'sendCustomerProgressTracker', eventID:eventID}, function(data){ data = $.parseJSON(data); if(data.success == true){ swal({ title: 'Progress Tracker Link Sent', text: data.message, timer: 3000, type: 'success', showConfirmButton: true }); }else{ swal({ title: 'Something Went Wrong', text: data.message, timer: 3000, type: 'error', showConfirmButton: true }); } $(elem).prop('disabled', false); return false; }); }else{ swal({ title: 'Progress Sharing Disabled', text: 'Checklists have progress sharing turned off. Turn on progress sharing on these checklist types to send progress tracker links to the customer.', timer: 3000, type: 'error', showConfirmButton: true }); } }); $(document).on('click', '.assocChecklistToEvent', function(){ var eventID = $(this).attr('eventID'); var checklistID = $('#eventChecklistsAvail'+eventID+' option:selected').val(); var checklistName = $('#eventChecklistsAvail'+eventID+' option:selected').text(); var shareProgress = $('#eventChecklistsAvail'+eventID+' option:selected').attr('shareProgress'); if($('#event'+eventID+'Checklist'+checklistID).length > 0){ swal({ title: 'Already Assigned', text: 'This checklist is already assigned to this event.', timer: 3000, type: 'error', showConfirmButton: true }); return false; } if(!checklistID){ swal({ title: 'Checklist Missing', text: 'Choose a checklist to assign it to this event.', timer: 3000, type: 'error', showConfirmButton: true }); } if(checklistID > 0 && eventID > 0){ $.post("https://orbisx.ca/app/exec", {dothis:'addChecklistToEvent', eventID:eventID, itemID:checklistID}, function(data){ data = $.parseJSON(data); if(data.success == true){ if($('#eventChecklists'+eventID+' ul li').length == 0){ $('#eventChecklists'+eventID).html('

'); } $('#eventChecklists'+eventID+' ul').append('
  • '+checklistName+' Print Tasks

  • '); $('#eventChecklistsAvail'+eventID).prop('selectedIndex',0); snackBar(data.message, 'success'); }else{ snackBar(data.message, 'error'); } return false; }); } }); $(document).on('click', '.deleteChecklistEventAssoc', function(){ var eventID = $(this).attr('eventID'); var checklistID = $(this).attr('checklistID'); var checklistName = $(this).attr('checklistName'); $('#modalGeneric .modal-title').html('Confirm Deletion: '+checklistName); $('#modalGeneric .modal-body').html('

    Are you sure you want to remove the '+checklistName+' checklist from this event?

    Cancel Yes, remove checklist

    '); $('#modalGeneric .modal-footer').html('Cancel & close popup'); $('#modalGeneric').modal('show'); return false; }); $(document).on('click', '.confirmDeleteChecklistEventAssoc', function(){ var eventID = $(this).attr('eventID'); var checklistID = $(this).attr('checklistID'); $.post("https://orbisx.ca/app/exec", {dothis:'removeChecklistFromEvent', eventID:eventID, itemID:checklistID}, function(data){ data = $.parseJSON(data); if(data.success == true){ $('#event'+eventID+'Checklist'+checklistID).fadeOut().remove(); if($('#eventChecklists'+eventID+' ul li').length == 0){ $('#eventChecklists'+eventID).html(''); } $('#modalGeneric').modal('hide'); snackBar(data.message); }else{ swal({ title: 'Something Went Wrong', text: data.message, timer: 3000, type: 'error', showConfirmButton: true }); } return false; }); }); $('#modalGeneric').on('click', '.toggleChecklistTask', function(){ var parentElem = $(this).parents('.row'); var elem = $(parentElem).find('.supercheckbox'); var eventID = $(this).attr('eventID'); var taskID = $(this).attr('taskID'); var checklistID = $(this).attr('checklistID'); if($(elem).is(":checked")){ var toggle = 0; }else{ var toggle = 1; } $.post("https://orbisx.ca/app/exec", {dothis:'toggleEventChecklistTaskComplete', eventID:eventID, itemID:taskID, toggle:toggle, typeID:checklistID}, function(data){ data = $.parseJSON(data); if(data.success == true){ if(data.stats.percent){ $('#event'+eventID+'ChecklistProgressBar'+checklistID).css('width', data.stats.percent+'%'); $('#event'+eventID+'ChecklistProgressText'+checklistID).text(data.stats.percent+'% complete'); if(data.stats.percent >= 90){ $('#event'+eventID+'ChecklistProgressBar'+checklistID).addClass('bg-gradient-success').removeClass('bg-gradient-warning').removeClass('bg-gradient-info'); }else if(data.stats.percent > 50 && data.stats.percent '+txt+''); $(parentElem).after('
    '+data.timestamp+'
    '); autoSendProgressTracker(eventID); } }else{ swal({ title: 'Something Went Wrong', text: data.message, timer: 3000, type: 'error', showConfirmButton: true }); } return false; }); }); $(document).on('click', '.showSecretField', function(){ $(this).parents('.input-group').find('input').attr('type', 'text'); $(this).removeClass('showSecretField').addClass('hideSecretField').html(''); return false; }); $(document).on('click', '.hideSecretField', function(){ $(this).parents('.input-group').find('input').attr('type', 'password'); $(this).removeClass('hideSecretField').addClass('showSecretField').html(''); return false; }); function autoSendProgressTracker(eventID){ $('#eventChecklists'+eventID+' ul li').each(function(){ if($(this).attr('shareProgress') == 1){ sendIt = true; } }); if(sendIt){ $.post("https://orbisx.ca/app/exec", {dothis:'autoSendCustomerProgressTracker', eventID:eventID}, function(data){ data = $.parseJSON(data); if(data.success == true){ snackBar(data.message); } return false; }); } } async function copyElemText(element) { if (!document.hasFocus()) { console.error("Clipboard API blocked: Document is not focused."); alert("Click inside the page first, then try again."); return; } // Get raw HTML content and decode it var rawHtmlContent = $(element).html(); var textToCopy = $("").html(rawHtmlContent).text().trim(); console.log("Decoded Text to Copy:", textToCopy); try { // Delay execution slightly to ensure user interaction setTimeout(async () => { await navigator.clipboard.writeText(textToCopy); console.log("Successfully copied:", textToCopy); swal({ title: $(element).attr('alertTitle') || "Copied!", text: $(element).attr('alertMsg') || "Copied to clipboard!", timer: 2000, type: 'success', showConfirmButton: false }); }, 100); // 100ms delay ensures document focus } catch (err) { console.error("Clipboard API failed:", err); } } function copyToClipboard(element) { var $temp = $(""); var m = $(element).attr('alertMsg'); var t = $(element).attr('alertTitle'); $("body").append($temp); $temp.val($(element).text()).select(); document.execCommand("copy"); $temp.remove(); swal({ title: (t ? t : 'Link Copied'), text: (m ? m : 'The link has been copied to your clipboard'), timer: 2000, type: 'success', showConfirmButton: false }); } $(document).on('click', '.copyVar, .copyVars a', function(){ var $temp = $(""); $("body").append($temp); console.log($(this).text()); $temp.val($(this).text()).select(); document.execCommand("copy"); $temp.remove(); snackBar('Copied to clipboard: ' + $(this).text()); return false; }); $(document).on('click', '.copyTxtAttr', function(e){ var txt = $(this).attr('txt'); navigator.clipboard.writeText(txt); snackBar('Copied to clipboard :)'); e.preventDefault(); }); $(document).on('show.bs.modal', '.modal', function (event) { var zIndex = 1040 + (10 * $('.modal:visible').length); $(this).css('z-index', zIndex); setTimeout(function() { $('.modal-backdrop').not('.modal-stack').css('z-index', zIndex - 1).addClass('modal-stack'); }, 0); }); $(document).on('click', '.readMore', function(){ var elem = $(this).parents('.readMoreBox'); $(elem).find('.minText').hide(); $(elem).find('.fullText').show(); return false; }); $(document).on('click', '.showLess', function(){ var elem = $(this).parents('.readMoreBox'); $(elem).find('.minText').show(); $(elem).find('.fullText').hide(); return false; }); $(document).on('keyup change', '.tableSearch', function(){ var targetID = $(this).attr('targetID'); var table, tr, td, i, txtValue; var filter = $(this).val().toUpperCase(); table = document.getElementById(targetID); tr = table.getElementsByTagName("tr"); // Loop through all table rows, and hide those who don't match the search query for (i = 0; i -1) { tr[i].style.display = ""; } else { tr[i].style.display = "none"; } } } }); $(document).on('click', '.tableSearchCancel', function(){ $('.tableSearch').val('').change(); return false; }); $(document).on('click', '#saveWeatherZip', function(){ var zip = $('#weatherZip').val(); if (zip) { $.post("https://orbisx.ca/app/exec/updateWeatherLocation", {zip:zip}, function(data) { data = $.parseJSON(data); if(data.success) { swal({ title: 'Location Saved', text: 'Reload the page to see the weather forecast enabled', timer: 3000, type: 'success', showConfirmButton: true }); }else{ swal({ title: 'Something Went Wrong', text: data.message, timer: 3000, type: 'error', showConfirmButton: true }); } }); } }); function getMileageTrackerStatus(){ $.post("https://orbisx.ca/app/exec", {dothis:'getUserMileageTrackingInfo'}, function(result) { result = $.parseJSON(result); return result.info.mileage_tracking; }); } function toggleMileageTracker(){ $.post("https://orbisx.ca/app/exec", {dothis:'getUserMileageTrackingInfo'}, function(result) { result = $.parseJSON(result); if(result.success) { if (result.info.mileage_tracking) { var html = ' Mileage Tracker ON'; var html_nuevo = ' Mileage Tracker ON'; if(window.webkit){ window.webkit.messageHandlers.startMileageTracker.postMessage({command: 'startMileageTracker',data:''}); }else if(typeof android !== 'undefined' && android !== null) { android.startMileageTracker(); } }else{ var html = ' Mileage Tracker OFF'; var html_nuevo = ' Mileage Tracker OFF'; if(window.webkit){ window.webkit.messageHandlers.stopMileageTracker.postMessage({command: 'stopMileageTracker',data:''}); }else if(typeof android !== 'undefined' && android !== null) { android.stopMileageTracker(); } } }else { swal({ title: 'Something Went Wrong', text: result.message, timer: 3000, type: 'error', showConfirmButton: true }); var html = ' Mileage Tracker OFF'; var html_nuevo = ' Mileage Tracker OFF'; } $('#mileageTrackerMenuItem').html(html); $('#mileageTrackerMenuItemNuevo').html(html_nuevo); }); } $(document).on('click.bs.dropdown.data-api', '.dropdown.keep-inside-clicks-open a.keepOpen', function (e) { e.stopPropagation(); }); $(document).on('click', '.toggleMileageTracker', function(){ var toggle = $(this).attr('toggle'); $.post("https://orbisx.ca/app/exec", {dothis:'toggleMileageTracker', toggle:toggle}, function(result) { result = $.parseJSON(result); if(result.success) { if(typeof android !== 'undefined' && android !== null) { swal({ title: 'Data Collection Notice', text: "OrbisX collects location data to enable Mileage Tracker even when the app is closed or not in use", timer: 5000, type: 'success', showConfirmButton: true }); } toggleMileageTracker(); }else { swal({ title: 'Something Went Wrong', text: '', timer: 3000, type: 'error', showConfirmButton: true }); } }); }); (function(){ const PROTECTED = new Set(['orbisxSessionId']); const _setItem = localStorage.setItem.bind(localStorage); const _getItem = localStorage.getItem.bind(localStorage); const _removeItem = localStorage.removeItem.bind(localStorage); const _clear = localStorage.clear.bind(localStorage); // Monkey-patch clear to preserve protected keys localStorage.clear = function(){ const snapshot = {}; PROTECTED.forEach(k => { snapshot[k] = _getItem(k); }); _clear(); Object.keys(snapshot).forEach(k => { if (snapshot[k] !== null && snapshot[k] !== undefined) _setItem(k, snapshot[k]); }); }; // Monkey-patch removeItem to no-op on protected keys (optional) localStorage.removeItem = function(k){ if (PROTECTED.has(k)) return; _removeItem(k); }; })(); $(document).ajaxComplete(function() { try { } catch (e) { return e; } }); var refreshTime = 20 * 60000; window.setInterval( function() { $.ajax({ cache: false, type: "GET", url: "https://orbisx.ca/app/stay-alive", success: function(data) { } }); }, refreshTime ); appCheck(); function fillIn() { const place = this.getPlace(); let address1 = ""; let city = ""; let state = ""; let postcode = ""; let country = ""; for (const component of place.address_components) { const componentType = component.types[0]; switch (componentType) { case "street_number": { address1 = component.long_name+' '; break; } case "route": { address1 += component.short_name; break; } case "postal_code": { postcode = component.long_name+' '+postcode; break; } case "postal_code_suffix": { postcode = postcode+' '+component.long_name; break; } case "locality": city = component.long_name; break; case "administrative_area_level_1": { state = component.short_name; break; } case "country": country = component.long_name; break; } } } var inputs = document.getElementsByClassName('gsearchAddy'); var options = { types: ['address'], fields: ["address_components", "geometry"], //componentRestrictions: { country: ["us", "ca", "uk", "au", "gb"] }, }; var autocompletes = []; for (var i = 0; i '+msg).css('background', '#C71D1D').css('color', 'white'); }else if(type == 'info'){ $('#snackbar').html(' '+msg).css('background', '#11BDDE').css('color', 'white'); }else if(type == 'warning'){ $('#snackbar').html(' '+msg).css('background', '#F2EF32').css('color', 'black'); }else if(type == 'success'){ $('#snackbar').html(' '+msg).css('background', '#00C851').css('color', 'white'); }else if(type == 'general'){ $('#snackbar').html(msg).css('background', '#00adc8').css('color', 'white'); }else{ $('#snackbar').html(' '+msg).css('background', '#00C851').css('color', 'white'); } $('#snackbar').addClass('show'); if(duration > 0){ setTimeout(function(){ $('#snackbar').removeClass('show'); }, duration); } } // Function to initialize popovers function initializePopovers() { appCheck(); // Re-initialize popovers and more } // Observe changes to the DOM const observer = new MutationObserver(() => { initializePopovers(); }); // Start observing the body for added nodes observer.observe(document.body, { childList: true, // Watch for added/removed child nodes subtree: true, // Watch all levels of the DOM tree }); $(document).on('focus', '.select2-selection', function(e) { const $select = $(this).closest('.select2-container').prev('select'); if (!$select.prop('disabled')) { $select.select2('open'); } }); $(document).on('click', '.startSignupWisetack', function(e){ var btn = $(this); $(btn).html(' Processing application ...'); $('#modalGeneric .modal-title').html('Signup to Offer Your Customers Financing Options'); $('#modalGeneric .modal-body').html('
    '); $('#modalGeneric .modal-footer').html('Close popup window'); $('#modalGeneric').modal('show'); $.post("https://orbisx.ca/app/exec", {dothis:'wisetackSignup'}, function(data) { data = $.parseJSON(data); if (data.success) { $('#modalGeneric .modal-body').html(''); $(btn).html(' Continue signup application').removeClass('startSignupWisetack').addClass('continueSignupWisetack').attr('goto', data.signup_link); }else{ $('#modalGeneric .modal-body').html('

    '+data.message+'

    '); snackBar(data.message, 'error'); $(btn).html('Sign-up for '); } }); e.preventDefault(); }); $(document).on('click', '.continueSignupWisetack', function(e){ var link = $(this).attr('goto'); $('#modalGeneric .modal-title').html('Signup to Offer Your Customers Financing Options'); $('#modalGeneric .modal-body').html(''); $('#modalGeneric .modal-footer').html('Close popup window'); $('#modalGeneric').modal('show'); e.preventDefault(); }); $(document).on("click", ".modal .datepicker-single, .modal .datepicker", function() { var offsetModal = $(this).parents('.modal').offset().top; var offsetInput = $(this).offset().top; var inputHeight = $(this).height(); var customPadding = 12; var topDatepicker = (offsetInput + inputHeight + customPadding) - offsetModal; $("#ui-datepicker-div").css({top: topDatepicker}); }); $(document).on('click', '.closeSpecialAlert', function(e){ var cual = $(this).attr('cual'); $('#'+cual).fadeOut('fast'); $('.'+cual).fadeOut('fast'); e.preventDefault(); }); function update_dark_mode_elems(){ var darkModeAltColor = '#000000'; if($('body').hasClass('dark-mode')){ darkModeAltColor = '#FFFFFF'; $('.header-brand-img').attr('src', 'https://orbisx.ca/app/img/orbisx-logo-white.png'); }else{ $('.header-brand-img').attr('src', 'https://orbisx.ca/app/image/dfman0hdv/t_bandwidthsaver/ar9gtuvys718f590hqnd'); } try{ myBarChart.options.plugins.legend.labels.color = darkModeAltColor; myBarChart.options.scales.y.ticks.color = darkModeAltColor; myBarChart.options.scales.x.ticks.color = darkModeAltColor; myBarChart.update(); }catch(e) { } try{ myChart.options.plugins.legend.labels.color = darkModeAltColor; myChart.options.scales.y.ticks.color = darkModeAltColor; myChart.options.scales.x.ticks.color = darkModeAltColor; myChart.update(); }catch(e) { } try{ myBarChartOne.options.plugins.legend.labels.color = darkModeAltColor; myBarChartOne.options.scales.y.ticks.color = darkModeAltColor; myBarChartOne.options.scales.x.ticks.color = darkModeAltColor; myBarChartOne.update(); }catch(e) { } try{ myBarChart2.options.plugins.legend.labels.color = darkModeAltColor; myBarChart2.options.scales.y.ticks.color = darkModeAltColor; myBarChart2.options.scales.x.ticks.color = darkModeAltColor; myBarChart2.update(); }catch(e) { } try{ sourcesChart.options.plugins.legend.labels.color = darkModeAltColor; sourcesChart.options.scales.y.ticks.color = darkModeAltColor; sourcesChart.options.scales.x.ticks.color = darkModeAltColor; sourcesChart.update(); }catch(e) { } try{ interestsChart.options.plugins.legend.labels.color = darkModeAltColor; interestsChart.options.scales.y.ticks.color = darkModeAltColor; interestsChart.options.scales.x.ticks.color = darkModeAltColor; interestsChart.update(); }catch(e) { } try{ packagesChart.options.plugins.legend.labels.color = darkModeAltColor; packagesChart.options.scales.y.ticks.color = darkModeAltColor; packagesChart.options.scales.x.ticks.color = darkModeAltColor; packagesChart.update(); }catch(e) { } try{ warrantiesChart.options.plugins.legend.labels.color = darkModeAltColor; warrantiesChart.update(); }catch(e) { } try{ noshowsChart.options.plugins.legend.labels.color = darkModeAltColor; noshowsChart.update(); }catch(e) { } try{ propinasChart.options.plugins.legend.labels.color = darkModeAltColor; propinasChart.options.scales.y.ticks.color = darkModeAltColor; propinasChart.options.scales.x.ticks.color = darkModeAltColor; propinasChart.update(); }catch(e) { } try{ giftCertificatesChart.options.plugins.legend.labels.color = darkModeAltColor; giftCertificatesChart.options.scales.y.ticks.color = darkModeAltColor; giftCertificatesChart.options.scales.x.ticks.color = darkModeAltColor; giftCertificatesChart.update(); }catch(e) { } try{ servicesChart.options.plugins.legend.labels.color = darkModeAltColor; servicesChart.options.scales.y.ticks.color = darkModeAltColor; servicesChart.options.scales.x.ticks.color = darkModeAltColor; servicesChart.update(); }catch(e) { } try{ myChartDaily.options.plugins.legend.labels.color = darkModeAltColor; myChartDaily.options.scales.y.ticks.color = darkModeAltColor; myChartDaily.options.scales.x.ticks.color = darkModeAltColor; myChartDaily.update(); }catch(e) { } try{ myCouponChart.options.plugins.legend.labels.color = darkModeAltColor; myCouponChart.options.scales.y.ticks.color = darkModeAltColor; myCouponChart.options.scales.x.ticks.color = darkModeAltColor; myCouponChart.update(); }catch(e) { } //try{ //.options.plugins.legend.labels.color = darkModeAltColor; //.options.scales.y.ticks.color = darkModeAltColor; //.options.scales.x.ticks.color = darkModeAltColor; //.update(); //}catch(e) { //} } $(document).on('click', '.activateDarkMode', function(e){ var darkMode = ''; $('body').toggleClass('dark-mode'); if($('body').hasClass('dark-mode')){ $('.activateDarkMode').html(''); darkMode = 'active'; }else{ $('.activateDarkMode').html(''); } $.post("https://orbisx.ca/app/exec", {dothis:'setUserDarkMode', opVal:darkMode, businessID: '4254' }, function(data) {}); update_dark_mode_elems(); e.preventDefault(); }); $(document).ready(function(){ update_dark_mode_elems(); }); var entityMap = { "&": "&", "": ">", '"': '"', "'": ''', "/": '/' }; function escapeHtml(string) { return String(string).replace(/[&"'\/]/g, function (s) { return entityMap[s]; }); } const colors = [ '#ffc000', '#ff3b3b', '#ff8400' ]; const bubbles = 25; const explode = (x, y) => { let particles = []; let ratio = window.devicePixelRatio; let c = document.createElement('canvas'); let ctx = c.getContext('2d'); c.style.position = 'absolute'; c.style.left = (x - 100) + 'px'; c.style.top = (y - 100) + 'px'; c.style.pointerEvents = 'none'; c.style.width = 200 + 'px'; c.style.height = 200 + 'px'; c.style.zIndex = 1000000; c.width = 200 * ratio; c.height = 200 * ratio; document.body.appendChild(c); for(var i = 0; i document.body.removeChild(c), 1000); } const render = (particles, ctx, width, height) => { requestAnimationFrame(() => render(particles, ctx, width, height)); ctx.clearRect(0, 0, width, height); particles.forEach((p, i) => { p.x += p.speed * Math.cos(p.rotation * Math.PI / 180); p.y += p.speed * Math.sin(p.rotation * Math.PI / 180); p.opacity -= 0.01; p.speed *= p.friction; p.radius *= p.friction; p.yVel += p.gravity; p.y += p.yVel; if(p.opacity parseFloat((Math.random() * ((a ? a : 1) - (b ? b : 0)) + (b ? b : 0)).toFixed(c ? c : 0)); $(document).on('focus click', '.js-explosion', function(e){ var position = $(this).offset(); explode(position.left.toFixed(), position.top.toFixed()); });