ok
Direktori : /home2/selectio/www/wedding-info-new/admin/ |
Current File : /home2/selectio/www/wedding-info-new/admin/order-create.php |
<?php include 'header.php'; /*Client DropDown Details Start*/ $conditions = ''; if($_SESSION['speed_connect']['id'] && $_SESSION['sc_user_type']==2){ $id = $_SESSION['speed_connect']['id']; $conditions.='and id='.$id; }else if($_SESSION['speed_connect']['id'] && $_SESSION['sc_user_type']==1){ $id = $_SESSION['speed_connect']['id']; $conditions.=''; } $statement = $pdo->prepare("SELECT * FROM `client` WHERE status='Active' $conditions"); $statement->execute(); $client_dropdown = $statement->fetchAll(PDO::FETCH_ASSOC); /*Client DropDown End*/ ?> <div class="page-wrapper"> <div class="page-content"> <!--start stepper one--> <div id="stepper1" class="bs-stepper"></div><div id="stepper2" class="bs-stepper"></div> <!--end stepper two--> <!--start stepper three--> <div class="card"> <div class="card-body"> <div id="stepper3" class="bs-stepper gap-4 vertical"> <div class="bs-stepper-header" role="tablist" style="padding: 0px;"> <div class="step" data-target="#test-vl-1"> <div class="step-trigger" role="tab" id="stepper3trigger1" aria-controls="test-vl-1"> <div class="bs-stepper-circle"><i class='bx bx-user fs-4'></i></div> <div class=""> <h6 class="mb-0 steper-title">Buyer Details</h6> <p class="mb-0 steper-sub-title">Buyer & Biling Address</p> </div> </div> </div> <div class="step" data-target="#test-vl-2"> <div class="step-trigger" role="tab" id="stepper3trigger2" aria-controls="test-vl-2"> <div class="bs-stepper-circle"><i class='bx bx-file fs-4'></i></div> <div class=""> <h6 class="mb-0 steper-title">Pickup Details</h6> <p class="mb-0 steper-sub-title">Pickup Address Details</p> </div> </div> </div> <div class="step" data-target="#test-vl-3"> <div class="step-trigger" role="tab" id="stepper3trigger3" aria-controls="test-vl-3"> <div class="bs-stepper-circle"><i class='bx bxs-graduation fs-4'></i></div> <div class=""> <h6 class="mb-0 steper-title">Order Details</h6> <p class="mb-0 steper-sub-title">Product & Payment Details</p> </div> </div> </div> <div class="step" data-target="#test-vl-4"> <div class="step-trigger" role="tab" id="stepper3trigger4" aria-controls="test-vl-4"> <div class="bs-stepper-circle"><i class='bx bx-briefcase fs-4'></i></div> <div class=""> <h6 class="mb-0 steper-title">Package Details</h6> <p class="mb-0 steper-sub-title">Volumetric Weight Details</p> </div> </div> </div> </div> <div class="bs-stepper-content"> <form id="form_buyer_details"> <div id="test-vl-1" role="tabpane3" class="bs-stepper-pane content fade" aria-labelledby="stepper3trigger1"> <div class="row g-3 mr-bottom-10" <?php if($_SESSION['speed_connect']['id'] && $_SESSION['sc_user_type']==2){ echo "hidden"; }?>> <h6 class="mb-1 " >Select Client Information Details</h6> <div class="col-12 col-lg-4"> <label for="FisrtName" class="form-label required">Select Client Name</label> <select name="client_id" id="client_id" class="form-select valid font-size12" aria-invalid="false" required> <?php foreach($client_dropdown as $client){ echo "<option value='".$client['id']."'>".$client['company_name']."</option>"; } ?> </select> </div> </div> <h6 class="mb-1 " >Add Buyer's Details</h6> <div class="row g-3"> <div class="col-12 col-lg-12"> <b class="mr-top-20">To whom is the order being delivered?</b> <span class="color-liht-gray">(Buyer's Info)</span> </div> <div class="col-12 col-lg-4"> <label for="FisrtName" class="form-label required">Mobile Number</label> <input type="text" class="form-control" oninput="this.value=this.value.replace(/[^0-9]/g,'')" name="buyer_mobile_no" placeholder="Enter buyer's phone number"> </div> <div class="col-12 col-lg-4"> <label for="LastName" class="form-label required">Full Name</label> <input type="text" class="form-control" name="buyer_full_name" id="LastName" placeholder="Enter full Name"> </div> <div class="col-12 col-lg-4"> <label for="PhoneNumber" class="form-label ">Email Id <span class="color-liht-gray">(Optional)</span></label> <input type="text" class="form-control" name="buyer_email_id" id="PhoneNumber" placeholder="Phone Number"> </div> <div class="color-blue"> <button class="color-blue mr-top-20 font-size12 accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne" >+ Add Alternate Mobile Number, Buyer's Company Name, Buyer's GSTIN <span class="color-liht-gray">(Optional)</span></button> </div> <input type="hidden" name="type" value="create_shipment"/> <!--Optional div Start--> <div class="row accordion-collapse collapse" id="collapseOne" aria-labelledby="headingOne" data-bs-parent="#accordionExample"> <div class="col-12 col-lg-4"> <label for="FisrtName" class="form-label">Alternate Mobile Number</label> <input type="text" class="form-control" oninput="this.value=this.value.replace(/[^0-9]/g,'')" name="buyer_alter_mobile_no" placeholder="Enter buyer's phone number"> </div> <div class="col-12 col-lg-4"> <label for="FisrtName" class="form-label">Buyer's Company Name</label> <input type="text" class="form-control" name="buyer_company_name" placeholder="Enter Buyer's Company Name"> <span class="font-size10 color-liht-gray">Note: If you're Shipping B2B, Please Enter the Company's name</span> </div> <div class="col-12 col-lg-4"> <label for="FisrtName" class="form-label">Buyer's GSTIN</label> <input type="text" class="form-control " name="buyer_gstin" placeholder="Enter Buyer's GSTIN"> </div> </div> <!--Optional div end--> <div class="col-12 col-lg-12 mr-top-20"> <b> Where is the order being delivered to?</b> <span class="color-liht-gray">(Buyer's Address)</span> </div> <div class="row"> <div class="col-12 col-lg-6"> <label for="FisrtName" class="form-label required">Complete Address</label> <textarea class="form-control" placeholder="Describe yourself here..." rows="2" cols="3" name="buyer_address_line1"></textarea> </div> <div class="col-12 col-lg-6"> <label for="FisrtName" class="form-label">Landmark <span class="color-liht-gray">(Optional)</span></label> <textarea class="form-control" placeholder="Describe yourself here..." rows="2" cols="3" name="buyer_address_line2"></textarea> <span class="font-size10 color-liht-gray">Note: If you're Shipping B2B, Please Enter the Company's name</span> </div> <div class="col-6 col-lg-3"> <label for="FisrtName" class="form-label required">Pincode</label> <input type="text" class="form-control " name="buyer_pincode" placeholder="Enter Buyer's Pincode"> </div> <div class="col-6 col-lg-3"> <label for="FisrtName" class="form-label required">City</label> <input type="text" class="form-control " name="buyer_city" placeholder="Enter Buyer's City"> </div> <div class="col-6 col-lg-3"> <label for="FisrtName" class="form-label required">State</label> <input type="text" class="form-control " name="buyer_state" placeholder="Enter Buyer's State"> </div> <div class="col-6 col-lg-3"> <label for="FisrtName" class="form-label required">Country</label> <input type="text" class="form-control " name="buyer_country" placeholder="Enter Buyer's Country"> </div> </div> <div class="col-12 col-lg-12 form-check form-check-success"> <input class="form-check-input same_shipping_address" type="checkbox" name="billing_address_is_same" id="flexCheckCheckedSuccess" checked> <label class="form-check-label" for="flexCheckCheckedSuccess"><b>Billing address is same as the shipping address</b></label> </div> <div class="row" id="shipping_address_div" style="display: none;"> <div class="col-12 col-lg-12"> <h6 class="mb-1">Billing Address</h6> <span class="font-size14">Buyer's Details</span> </div> <div class="col-12 col-lg-4"> <label for="FisrtName" class="form-label required">Mobile Number</label> <input type="text" class="form-control" oninput="this.value=this.value.replace(/[^0-9]/g,'')" name="buyer_billing_address_mobile_no" placeholder="Enter buyer's phone number" required> </div> <div class="col-12 col-lg-4"> <label for="LastName" class="form-label required">Full Name</label> <input type="text" class="form-control" name="buyer_billing_address_name" placeholder="Enter full Name" required> </div> <div class="col-12 col-lg-4"> <label for="PhoneNumber" class="form-label">Email Id <span class="color-liht-gray">(Optional)</span></label> <input type="text" class="form-control" name="buyer_billing_email_id" placeholder="Phone Number"> </div> <div class="col-12 col-lg-12"><hr></div> <div class="row"> <div class="col-12 col-lg-6"> <label for="FisrtName" class="form-label required">Complete Address</label> <textarea class="form-control" placeholder="Describe yourself here..." rows="2" cols="3" name="buyer_billing_address_line1" required></textarea> </div> <div class="col-12 col-lg-6"> <label for="FisrtName" class="form-label">Landmark <span class="color-liht-gray">(Optional)</span></label> <textarea class="form-control" placeholder="Describe yourself here..." rows="2" cols="3" name="buyer_billing_address_line2"></textarea> <span class="font-size10 color-liht-gray">Note: If you're Shipping B2B, Please Enter the Company's name</span> </div> <div class="col-6 col-lg-3"> <label for="FisrtName" class="form-label required">Pincode</label> <input type="text" class="form-control " name="buyer_billing_address_pincode" placeholder="Enter Buyer's Pincode" required> </div> <div class="col-6 col-lg-3"> <label for="FisrtName" class="form-label required">City</label> <input type="text" class="form-control " name="buyer_billing_address_city" placeholder="Enter Buyer's City" required> </div> <div class="col-6 col-lg-3"> <label for="FisrtName" class="form-label required">State</label> <input type="text" class="form-control " name="buyer_billing_address_state" placeholder="Enter Buyer's State" required> </div> <div class="col-6 col-lg-3"> <label for="FisrtName" class="form-label required">Country</label> <input type="text" class="form-control " name="buyer_billing_address_country" placeholder="Enter Buyer's Country" required> </div> </div> </div> <div class="col-12 col-lg-6"> <button class="btn btn-sm btn-success" type="submit" name="buyer_submit" >Next<i class='bx bx-right-arrow-alt ms-2'></i></button> </div> </div><!---end row--> </div> </form> <form id="form_pickup_details"> <div id="test-vl-2" role="tabpane3" class="bs-stepper-pane content fade" aria-labelledby="stepper3trigger2"> <h6 class="mb-1">Pickup Address</h6> <div class="row g-3"> <div class="col-12 col-lg-6"> <b>Where is the order being sent from? </b><span class="color-liht-gray">(Your Address)</span> </div> <div class="col-12 col-lg-8"> <div class="input-group mb-3"> <span class="input-group-text" id="basic-addon1"><i class="lni lni-search-alt"></i></span> <input type="text" class="form-control" id="search-address" autocomplete="off" placeholder="Search your pick up address here by nickname or phone number"> </div> </div> <!--address details start--> <div class="row" id="pickup_address_list"> </div> <!--address details end--> <div class="col-12"> <div class="d-flex align-items-center gap-3"> <span class="btn btn-outline-secondary btn-sm" onclick="stepper3.previous()"><i class='bx bx-left-arrow-alt me-2'></i>Previous</span> <button class="btn btn-success btn-sm" name="pickup_address_select">Next<i class='bx bx-right-arrow-alt ms-2'></i></button> </div> </div> </div><!---end row--> </div> </form> <form id="form_order_details"> <div id="test-vl-3" role="tabpane3" class="bs-stepper-pane content fade" aria-labelledby="stepper3trigger3"> <h6 class="mb-1">Order Details</h6> <div class="row g-3"> <div class="row mr-top-20"> <div class="col-12 col-lg-3"> <label for="SchoolName" class="form-label">Order ID <span class="color-liht-gray">(Auto Generated)</span></label> <input type="text" class="form-control order_id" name="order_id" value="<?php echo $fn->get_order_id($pdo); ?>" placeholder="Order Id" > </div> <div class="col-12 col-lg-3"> <label for="BoardName" class="form-label required">Order Date</label> <input type="date" class="form-control" name="order_date" value="<?=date("Y-m-d")?>" placeholder="Order Date" required> </div> <div class="col-12 col-lg-3"> <label for="UniversityName" class="form-label required">Order Channel <i class="lni lni-question-circle fill-color" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="Tooltip on top"></i> </label> <select name="order_channel" class="form-control" required> <option value="1">Default</option> </select> </div> </div> <div class="col-12 col-lg-12 mr-top-20 color-blue"> <b class="color-blue accordion-button font-size12 collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#orderTag" aria-expanded="false" aria-controls="orderTag" >+ Add Order Tag, Reseller's Name <span class="color-liht-gray">(Optional)</span></b> </div> <div class="row accordion-collapse collapse" id="orderTag"> <div class="col-12 col-lg-9"> <label for="BoardName" class="form-label">Order Tag</label> <select multiple data-role="tagsinput" name="order_tag"> </select> </div> <div class="col-12 col-lg-3"> <label for="BoardName" class="form-label">Reseller's Name <span class="color-liht-gray">(Optional)</span></label> <input type="text" class="form-control" name="reseller_name" placeholder="Reseller Name"> </div> </div> <div class="col-12 col-lg-12 mr-top-20"> <b>Product Details</b> </div> <div class="row mr-top-20" id="product_details"> <div class="row product_rows light-border"> <div class="col-12 col-lg-4"> <label for="BoardName" class="form-label required">Product 1 Name</label> <input type="text" class="form-control" name="product_name[]" value="Product 1 Name" placeholder="Product Name" required> </div> <div class="col-12 col-lg-2"> <label for="BoardName" class="form-label required">Unit Price</label> <input type="text" class="form-control" name="unit_price[]" value="1" placeholder="Unit Price" required> </div> <div class="col-12 col-lg-2"> <label for="BoardName" class="form-label required">Quantity</label> <input type="text" class="form-control" name="quantity[]" value="1" placeholder="Quantity" required> </div> <div class="col-12 col-lg-3"> <label for="BoardName" class="form-label required">Product Category</label> <input type="text" class="form-control" name="product_category[]" value="Default Categoty" placeholder="Product Category" required> </div> <div class="col-12 col-lg-12 mr-top-20 mr-bottom-10 color-blue"> <b class="color-blue accordion-button font-size12 collapsed" data-bs-toggle="collapse" data-bs-target="#firstTag" aria-expanded="false" aria-controls="firstTag">+ Add HSN Code, SKU, Tax Rate and Discount <span class="color-liht-gray">(Optional)</span></b> </div> <div class="row accordion-collapse collapse" id="firstTag"> <div class="col-12 col-lg-4"> <label for="UniversityName" class="form-label">HSN Code <i class="lni lni-question-circle fill-color" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="HSN Code is the 6 digit Unigue code that idendify 5000+ products & accept wordwide"></i> </label> <input type="text" class="form-control" name="hsn_code[]" placeholder="HSN Code"> </div> <div class="col-12 col-lg-3"> <label for="UniversityName" class="form-label">SKU <i class="lni lni-question-circle fill-color" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="stock keeping unit,used for Inventory management"></i> </label> <input type="text" class="form-control" name="sku[]" placeholder="SKU"> </div> <div class="col-12 col-lg-2"> <label for="BoardName" class="form-label">Tax Rate</label> <input type="text" class="form-control" name="tax_rate[]" placeholder="Tax Rate"> </div> <div class="col-12 col-lg-3"> <label for="UniversityName" class="form-label">Product Discount <i class="lni lni-question-circle fill-color" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="Discount given by buyer on this product"></i> </label> <input type="text" class="form-control" name="product_discount" placeholder="Product Discount"> </div> </div> </div> </div> <div class="col-12 col-lg-12 mr-top-20"> <span class="btn btn-gray btn-sm" id="add_another_product"><i class="lni lni-plus font-size12"></i> Add Another Product</span> </div> <hr> <div class="col-12 col-lg-12 mr-top-20 mr-bottom-10"> <b>Payment Details</b><br> <span class="color-liht-gray">Select mode of payment that your buyer has chosen for the order</span> </div> <div class="col-12 col-lg-12 mr-top-20 mr-bottom-10"> <div class="form-check"> <input class="form-check-input" type="radio" name="order_payment_type" id="prepaid" value="Prepaid" required checked> <label class="form-check-label" for="prepaid"> Prepaid <i class="lni lni-question-circle fill-color" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="Payment already received from buyer"></i> </label> </div> <div class="form-check form-check-warning"> <input class="form-check-input" type="radio" name="order_payment_type" id="cod" value="Cash On Delivery" required> <label class="form-check-label" for="cod"> Cash on Delivery <i class="lni lni-question-circle fill-color" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="COD will be remitted in your account as per your selected payment circle"></i> </label> </div> </div> <div class="col-12 col-lg-12 mr-top-20 mr-bottom-10"> <b class="color-blue">+ Add Shipping Charges, Giftwrap, Transaction fee <span class="color-liht-gray">(Optional)</span></b> </div> <div class="row"> <div class="col-12 col-lg-3"> <label for="UniversityName" class="form-label">Shipping Charges </label> <input type="text" class="form-control" name="shipping_charges" placeholder="Shipping Charges" value="0" oninput="this.value=this.value.replace(/[^0-9]/g,'')" required> </div> <div class="col-12 col-lg-3"> <label for="UniversityName" class="form-label">Gift Wrap </label> <input type="text" class="form-control" name="gift_wrap" placeholder="Gift Wrap" value="0.00" oninput="this.value=this.value.replace(/[^0-9]/g,'')" required> </div> <div class="col-12 col-lg-3"> <label for="BoardName" class="form-label">Transaction Fee </label> <input type="text" class="form-control" name="transaction_fee" placeholder="Transaction Fee" value="0.00" oninput="this.value=this.value.replace(/[^0-9]/g,'')" required> </div> <div class="col-12 col-lg-3"> <label for="UniversityName" class="form-label">Discounts </label> <input type="text" class="form-control" name="discounts" placeholder="Discounts" value="0" oninput="this.value=this.value.replace(/[^0-9]/g,'')" required> </div> </div> <div class="row" style="background: #ede6de;padding: 10px;border-radius: 10px;margin: 8px 0px;"> <div class="col-6 col-lg-6 pd-10"> Sub-total for Products </div> <div class="col-6 col-lg-6 pd-10 text-right"> <span class="product_subtotal">78</span> </div> <div class="col-6 col-lg-6 pd-10"> Other Charges </div> <div class="col-6 col-lg-6 pd-10 text-right"> <span class="order_charges">78</span> </div> <div class="col-6 col-lg-6 pd-10"> <b>Total Order Value</b> </div> <div class="col-6 col-lg-6 pd-10 text-right"> <span class="total_order_value">78</span> </div> </div> <div class="col-12"> <div class="d-flex align-items-center gap-3"> <span class="btn btn-outline-secondary btn-sm" onclick="stepper3.previous()"><i class='bx bx-left-arrow-alt me-2'></i>Previous</span> <button class="btn btn-success btn-sm" >Next<i class='bx bx-right-arrow-alt ms-2'></i></button> </div> </div> </div><!---end row--> </div> </form> <form id="form_package_details"> <div id="test-vl-4" role="tabpane3" class="bs-stepper-pane content fade" aria-labelledby="stepper3trigger4"> <h6 class="mb-1">Package Details</h6> <div class="row g-3"> <div class="col-12 col-lg-4"> <label for="Experience1" class="form-label">Dead Weight <i class="lni lni-question-circle fill-color" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="Dead Weight is the physical weight"></i> </label> <div class="input-group"> <input type="text" class="form-control" name="dead_weight" value="10" maxlength="6" onkeypress="if(this.value.length==6) return false;" aria-label="Amount (to the nearest dollar)" required> <span class="input-group-text color-liht-gray">Kg</span> </div> <span class="font-size10 color-liht-gray">(Max. 3 digits after decimal place)<br> Note: The minimum chargeable weight is 0.50 Kg</span> </div> <div class="col-12 col-lg-12 mr-top-20 mr-bottom-10"> <b>Volumetric Weight</b> <i class="lni lni-question-circle fill-color" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="It is weight calculation based on the dimensions (L,B,H) entered for the shipment.This weight is calculated using the formula (LxBxH)/5000 (for most og our courier partners) which measures the amount of space that the shipment will take in the carrier."></i> </div> <div class="row"> <div class="col-12 col-lg-5"> Enter packages dimensions to calculate Volumetric Weight <div class="row"> <div class="col-12 col-lg-4"> <div class="input-group"> <input type="text" value="10" name="vol_length" maxlength="6" onkeypress="if(this.value.length==6) return false;" class="form-control" aria-label="Amount (to the nearest dollar)" required> <span class="input-group-text color-liht-gray">CM</span> </div> </div> <div class="col-12 col-lg-4"> <div class="input-group"> <input type="text" value="10" name="vol_breadth" maxlength="6" onkeypress="if(this.value.length==6) return false;" class="form-control" aria-label="Amount (to the nearest dollar)" required> <span class="input-group-text color-liht-gray">CM</span> </div> </div> <div class="col-12 col-lg-4"> <div class="input-group"> <input type="text" value="10" name="vol_height" maxlength="6" onkeypress="if(this.value.length==6) return false;" class="form-control" aria-label="Amount (to the nearest dollar)" required> <span class="input-group-text color-liht-gray">CM</span> </div> </div> </div> <span class="font-size10 color-liht-gray"> Note: Dimensions should be in centimeters only & values should be greater than 0.50 cm. </span> </div> <div class="col-12 col-lg-1 vertical-center"> <div class="input-group"> OR </div> </div> <div class="col-12 col-lg-5"> Select from your saved packages to autofill package dimensions <div class="row"> <div class="col-12 col-lg-12"> <div class="input-group"> <select class="form-control" > <option>Select Package</option> </select> </div> </div> </div> </div> <div class="col-12 col-lg-12 mr-top-20 mr-bottom-10" style="background: #ede6de;padding: 10px;border-radius: 10px;margin: 8px 0px;"> Volumetric Weight <span id="vol_weight">0.66 </span>Kg </div> <hr> <div class="col-12 col-lg-12 mr-bottom-10" style="background: #ede6de;padding: 10px;border-radius: 10px;margin: 8px 0px;"> Applicable Weight <span id="app_weight">0.66 </span>Kg <br> <span class="color-liht-gray"> *Applicable weight is the heavier among the two weights that is Dead Weight V/s the Volumetric Weight, basis on which freight charges are calculated. <br>*Final chargeable weight will be based on the weight slab of the courier selected before shipping </span> </div> </div> <div class="col-12"> <div class="d-flex align-items-center gap-3"> <span class="btn btn-primary btn-sm" onclick="stepper3.previous()"><i class='bx bx-left-arrow-alt me-2'></i>Previous</span> <button class="btn btn-success btn-sm" type="submit">Add Order</button> </div> </div> </div><!---end row--> </div> </form> </div> </div> </div> </div> <!--end stepper three--> <div class="modal fade" id="pickup_address_add_model" tabindex="-1" aria-hidden="true"> <div class="modal-dialog modal-fullscreen" id="pickup_add"> </div> </div> <div class="modal fade" id="pickup_address_edit_model" tabindex="-1" aria-hidden="true"> <div class="modal-dialog modal-fullscreen" id="pickup_edit"> </div> </div> </div> </div> <style> .bootstrap-tagsinput .badge { padding:0px; } </style> <script> $(document).on('click', '.product_remove', function() { $(this).closest('.product_rows').remove(); pro_count_arrenge(); }); $(document).ready(function(){ pickup_address_list(); $('#add_another_product').on('click', function() { $.ajax({ url: 'ui-pages/order-create/products.php', type: 'get', success: function (response) { $('#product_details').append(response); pro_count_arrenge(); } }); }); $('.same_shipping_address').change(function () { if ($(this).is(':checked')) { $("div#shipping_address_div").hide(); }else{ $("div#shipping_address_div").show(); } }); $('#search-address').on("keyup", function(){ pickup_address_list(); }); //buyer info form validation start $( "#form_buyer_details" ).validate( { rules: { buyer_mobile_no:{ required: true, minlength: 10, maxlength: 12 }, buyer_full_name: { required: true, minlength: 3 }, buyer_email_id: { email: true }, buyer_alter_mobile_no:{ minlength: 10, maxlength: 12 }, buyer_address_line1: "required", buyer_pincode:{ required: true, minlength: 6 }, buyer_city: "required", buyer_state: "required", buyer_country: "required", client_id :"required", }, messages: { buyer_mobile_no: { required: "please enter the contact mobile number", minlength: "your contact mobile number must consist of at least 10 digit number", maxlength: "your contact mobile number max 12 digit only allowed" }, buyer_full_name: { required: "please enter the full name", minlength: "your contact person name must consist of at least 6 characters" }, buyer_email_id: { required: "please enter the valid email id", }, buyer_alter_mobile_no: { minlength: "your contact alter mobile number must consist of at least 10 digit number", maxlength: "your contact alter mobile number max 12 digit only allowed" }, buyer_address_line1: "buyer address is required", buyer_city: "buyer city is required", buyer_pincode:{ required: "please enter valid pincode", minlength: "pincode min 6 digits required", }, buyer_state: "buyer state is required", buyer_country: "buyer country is required", /*--------------------------------------*/ buyer_billing_address_mobile_no:{ required: true, minlength: 10, maxlength: 12 }, buyer_billing_address_name: { required: true, minlength: 3 }, buyer_billing_email_id: { required: true, email: true }, buyer_billing_address_line1: "required", buyer_billing_address_pincode:{ required: true, minlength: 6 }, buyer_billing_address_city: "required", buyer_billing_address_state: "required", buyer_billing_address_country: "required", buyer_billing_address_mobile_no: { required: "please enter the mobile number", minlength: "your mobile number must consist of at least 10 digit number", maxlength: "your mobile number max 12 digit only allowed" }, buyer_billing_address_name: { required: "please enter the full name", minlength: "your contact person name must consist of at least 6 characters" }, buyer_billing_email_id: { required: "please enter the email id", }, buyer_billing_address_line1: "buyer address is required", buyer_billing_address_pincode: { required: "please enter valid pincode", minlength: "pincode min 6 digits required", }, buyer_billing_address_city: "buyer city is required", buyer_billing_address_state: "buyer state is required", buyer_billing_address_country: "buyer country is required", /*--------------------*/ client_id: "select anyone client name is required", }, submitHandler: function(form) { gotopickup_address(); } } ); //buyer info form validation start $( "#form_pickup_details" ).validate( { rules: { address_id:{ required: true, } }, messages: { address_id: { required: "please enter the contact mobile number", }, /*--------------------*/ }, submitHandler: function(form) { if($('.address_id_check').length){ gotopickup_address(); }else{ warning('Address not found...'); } } } ); //buyer info form validation start $( "#form_order_details" ).validate( { rules: { address_id:{ required: true, } }, messages: { address_id: { required: "please enter the contact mobile number", }, }, submitHandler: function(form) { gotopickup_address(); } } ); //buyer package details form validation start $( "#form_package_details" ).validate( { rules: { dead_weight: "required", vol_length: "required", vol_breadth: "required", vol_height: "required", }, messages: { dead_weight: {required: "Dead Weight is required"}, vol_length: {required: "length is required"}, vol_breadth: {required: "breadth is required"}, vol_height: {required: "height is required"}, }, submitHandler: function(form) { create_new_order(); } } ); }); function gotopickup_address(){ stepper3.next(); } function create_new_order(){ $('#loader').show(); $.ajax({ url : 'api/shipment-create.php', type : 'post', data : $('#form_buyer_details, #form_pickup_details,#form_order_details,#form_package_details').serialize(), dataType: 'json', success : function(response) { console.log(response); if(response['error']==false){ $('#form_buyer_details').trigger("reset"); $('#form_pickup_details').trigger("reset"); $('#form_order_details').trigger("reset"); $('#form_package_details').trigger("reset"); $('#loader').hide(); success(response['message']); }else{ $('#loader').hide(); warning(response['message']); }; } }); } function pickup_address_list(){ $('#pickup_address_list').empty(); var search= $('#search-address').val(); var client_id=$('#client_id').val(); $.ajax({ url: 'ui-pages/pickup-address/pickup-address-list.php', type: 'post', data:{search:search,id:client_id}, success: function (response) { $('#pickup_address_list').append(response); } }); } function pro_count_arrenge(){ var counts=2; $('.pro_count').each(function(){ $(this).text(counts) ; counts++; }); } //pickup entry edit function pickup_address_update(id){ $('#loader').show(); $('#pickup_edit').empty(); var client_id=$('#client_id').val(); $.ajax({ url: 'ui-pages/pickup-address/pickup-address-edit.php', type: 'post', data:{id:id,client_id:client_id}, success: function (response) { $('#pickup_edit').append(response); $('#pickup_address_edit_model').modal('show'); $('#loader').hide(); } }); } //pickup entry add function pickup_address_add(){ $('#loader').show(); $('#pickup_add').empty(); var client_id=$('#client_id').val(); $.ajax({ url: 'ui-pages/pickup-address/pickup-address-add.php', type: 'post', data : {client_id:client_id}, success: function (response) { $('#pickup_add').append(response); $('#pickup_address_add_model').modal('show'); $('#loader').hide(); } }); } function pickup_address_add_close(){ $('#pickup_add').empty();$('#pickup_address_add_model').modal('hide');pickup_address_list(); } function pickup_address_edit_close(){ $('#pickup_edit').empty();$('#pickup_address_edit_model').modal('hide');pickup_address_list(); } function pickup_address_delete(id){ $.ajax({ url: 'api/pickup-address.php', type: 'post', dataType: 'json', data:{id:id,type:'delete_pickup_address'}, success: function (response) { if(response['error']==false){ pickup_address_list(); success(response['message']); }else{ pickup_address_list(); warning(response['message']); }; } }); } function pickup_address_set_primary(id,client_id){ $.ajax({ url: 'api/pickup-address.php', type: 'post', dataType: 'json', data:{id:id,client_id:client_id,type:'primary_pickup_address'}, success: function (response) { if(response['error']==false){ pickup_address_list(); success(response['message']); }else{ pickup_address_list(); warning(response['message']); }; } }); } </script> <?php include 'footer.php'; ?>