Subversion Repositories SmartDukaan

Rev

Rev 841 | Rev 861 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#set($Integer = 0)
#if($defaultAddressId)
        #set($defaultid = $Integer.parseInt($defaultAddressId))
#else
        #set($defaultid = 0)
#end

<!-- Add Shipping Detail Start-->
<script type="text/javascript">
  $(document).ready(function(){
    $('#addAdrBtn').click(function(){
      $('#newShipAdr').show();                   
      scrollWin();
    });
    function scrollWin(){
      $('html, body').animate({
        scrollTop: $("#newShipAdr").offset().top
      }, 2000);
    }
        
  });

  function scrollWinToTop(){
      $('html, body').animate({
        scrollTop: $("body").offset().top
      }, 0);
  }

  function resetShipForm(){
    $('#shipName').val("");
    $('#shipAddress1').val("");
    $('#shipAddress2').val("");
    $('#shipState').val("");
    $('#shipCity').val("");
    $('#shipPin').val("");
    $('#shipPhone').val("");
        $('#newShipAdr').hide();
        scrollWinToTop();
  }

  function changeShipAddress(id){
    addressId = id.substring(20);
    alert("TODO AJAX request to change shipping address. " + addressId);
     jQuery.ajax({
        type: "POST",
        url: "./shipping",
        data: "action=change&addressid="+addressId,
        success: function(msg){
           alert( "Data Saved: " + msg );
           $("#addressid").val(msg);
        }
     });
    //$("#addressid").val(addressId);
    document.getElementById('shipAddressContainer').innerHTML = document.getElementById(id).innerHTML;
    //document.getElementById('newShipAdr').style.display = 'none';
    $('#newShipAdr').hide();
        scrollWinToTop();

  }

</script>

<div id="registration">
  <div class="top">
    <div class="left">
      <div class="right"> &nbsp; </div>
    </div>
  </div>
  <div class="middle">
    <div class="mid-inner">

      <!-- Block 1 -->
      <div class="padding-top17">
                                #if(!$errorMsg.isEmpty())
                <div id="messageError">
                    <span></span>
                    <p>
                        $errorMsg <br/>
                    </p>
                </div>
                    #end

        <!-- Block-1 Right-->
                                #if($items)
        <div class="shipping-block1-R" style="overflow-y:auto;">
          <table cellpadding="0" cellspacing="0" width="100%" class="estimate-table" >
            <thead>
              <tr>
                <th width="36%">Item</th>
                <th width="29%">Delivery Estimate</th>
                <th width="10%" class="quantity">Qty.</th>
                <th width="25%" class="last">Total Price</th>
              </tr>
            </thead>
            <tbody>
                                                        #foreach($item in $items)
              <tr>
                <td>$item.get("ITEM_NAME")</td>
                <td>within $item.get("SHIPPING_TIME") business days</td>
                <td class="quantity">$item.get("ITEM_QUANTITY")</td>
                <td>Rs. $item.get("TOTAL_PRICE")</td>
              </tr>
                                                        #end
              <tr align="right">
                <td colspan="4" class="total-amount">Total Amount: Rs. $totalamount</td>
              </tr>
            </tbody>
          </table>
          <div align="right" class="proceed-bttn">
            <label class="floatLeft" style="margin-top: 3px;">We accept all major credit cards and debit cards &nbsp;</label>
            <div class="bigImgButton floatLeft yellow-image">
              <form action="./order" method="post">
                <input type="hidden" id="addressid" name="addressid" value="$defaultid" >
                <input type="submit" name="btnSearch"  id="" value="Proceed to Pay" class="button" />
              </form>

              <div class="clearBoth"></div>
            </div>
            <div class="clearBoth"></div>
          </div> 
        </div><!-- Block-1 Right End-->
                                #else
        <div class="shipping-block1-R" style="height:225px; overflow-y:auto;">
          <label class="floatLeft" style="margin-top: 3px;">Your cart is empty. &nbsp;</label>
        </div>  
                                #end    
        <!-- Block-1 Left-->
        <div class="shipping-block1-L">
          <div class="ship-address-block">
                        <h2>Shipping Address</h2>
            <div class="ship-address-inner" style="height:200px; overflow-y:auto;">
              <div id="shipAddressContainer">
                                                        #foreach($address in $addresses)
                                                        #if($defaultid == $address.getId())
                                                                #if($address.getName())
                <label>$address.getName()</label><br />
                                                                #end
                                                                #if($address.getLine1())
                <label>$address.getLine1() </label><br />
                                                                #end    
                                                                #if($address.getLine2())
                <label>$address.getLine2()</label><br />
                                                                #end
                                                                #if($address.getCity()) 
                <label>$address.getCity()</label><br />
                                                                #end
                                                                #if($address.getState())
                <label>$address.getState()</label><br />
                                                                #end
                                                                #if($address.getPin())  
                <label>Pin: $address.getPin()</label><br />
                                                                #end
                                                                #if($address.getPhone())
                <label>Mob: $address.getPhone() </label><br />
                                                                #end                    
                                                        #end
                                                        #end
              </div>
              <div class="ship-address-bttn" style="margin-top: 20px;">
                <div class="bigImgButton yellow-image">
                                                                        #if($defaultid!=0)      
                  <input type="button" name="addAdrBtn"  id="addAdrBtn" value="Ship to Another Address" class="button" />
                                                                        #else
                  <input type="button" name="addAdrBtn"  id="addAdrBtn" value="Add new Address" class="button" />
                                                                        #end    
                </div>
                                
              </div>
              <div class="clearBoth"></div>     
            </div>

          </div>

        </div><!-- Block-1 Left End-->
                <div class="floatRight" style="font-size: 10px; margin-top: 10px; color: #999999;">By placing order, you agree to Saholic.com's Privacy Policy and Terms &amp; Conditions.</div>
                        
        <div class="clearBoth"></div>
      </div><!-- Block 1 End-->
      <div class="clearBoth"></div>
      <!-- Block 2 -->  
      <div class="padding-top17" style="display: none;" id="newShipAdr">
        <!-- Block 2 Right -->
        <div class="shipping-block2-L">
          <h2 class="mid-innerHeading">Other Addresses on Record</h2>
          <div class="shipping-details-scroller">

                                        #foreach($address in $addresses)
            <div class="ship-address-block-address">
              <div class="ship-address-inner">
                <div id="shipAddressContainer$address.getId()">
                                                                #if($address.getName())
                  <label>$address.getName()</label><br />
                                                                #end
                                                                #if($address.getLine1())
                  <label>$address.getLine1() </label><br />
                                                                #end    
                                                                #if($address.getLine1())
                  <label>$address.getLine2()</label><br />
                                                                #end
                                                                #if($address.getCity()) 
                  <label>$address.getCity()</label><br />
                                                                #end
                                                                #if($address.getState())
                  <label>$address.getState()</label><br />
                                                                #end
                                                                #if($address.getPin())  
                  <label>Pin: $address.getPin()</label><br />
                                                                #end
                                                                #if($address.getPhone())
                  <label>Mob: $address.getPhone() </label><br />
                                                                #end                    

                </div>  
                <div class="ship-address-bttn">
                  <div class="bigImgButton yellow-image">
                    <input type="submit" name="btnSearch" onclick="changeShipAddress('shipAddressContainer$address.getId()')"  id="" value="Ship to this Address" class="button" />
                  </div>
                </div>
                <div class="clearBoth"></div>     
              </div>
            </div>
                                        #end

          </div>        
        </div>



        <div class="" style="width:424px; float:left;">
          <div class="ship-address-block">
            <h2>Specify a New Address</h2>
            <div class="ship-address-form">
              <form name="frmShippingAddress" id="frmShippingAddress" method="post" action="shipping"> <!-- action="./shipping" -->
                <div class="register-row">
                  <label><sup>*</sup><span>Name:</span></label>
                  <div class="imgTextBox textbox-image">
                    <input type="text" id="shipName" name="name" value="" class="textbox" />
                  </div>
                  <div class="clearBoth"></div>
                </div>
                <div class="register-row">
                  <label><sup>*</sup><span>Address:</span></label>
                  <div class="imgTextBox textbox-image">
                    <input type="text" id="shipAddress1" name="line1" value="" class="textbox" />
                  </div>
                  <div class="clearBoth"></div>
                </div>
                <div class="register-row">
                  <label>&nbsp;</label>
                  <div class="imgTextBox textbox-image">
                    <input type="text" id="shipAddress2" name="line2" value="" class="textbox" />
                  </div>
                  <div class="clearBoth"></div>
                </div>
                <div class="register-row">
                  <label for="state"><sup>*</sup><span>State</span></label>
                                  <div class="select-list imgTextBox">
                  <select class="select_state" name="state" id="shipState">
                                                                                #include("templates/stateslist.vm")
                  </select>
                  </div>
                  <div class="clearBoth"></div>
                </div>
                <div class="register-row">
                  <label><sup>*</sup><span>City:</span></label>
                  <div class="imgTextBox textbox-image">
                    <input type="text" id="shipCity" name="city" value="" class="textbox"/>
                  </div>
                  <div class="clearBoth"></div>
                </div>
                <div class="register-row">
                  <label><sup>*</sup><span>Pin Code:</span></label>
                  <div class="imgTextBox textbox-image">
                    <input type="text" id="shipPin" name="pincode" value="" class="textbox textbox-pincode" style="width: 60px;" />
                  </div>
                  <div class="clearBoth"></div>
                </div>
                <div class="register-row">
                  <label><sup>*</sup><span>Phone:</span></label>
                  <div class="imgTextBox textbox-image">
                    <input type="text" id="shipPhone" name="phone" value="" class="textbox" />
                  </div>
                  <div class="clearBoth"></div>
                </div>
                <div class="ship-address-bttn">
                  <div class="form-button-outer first">
                    <div class="bigImgButton floatLeft yellow-image">
                      <input type="hidden" id="" name="action" value="add" >
                      <input type="submit" name="submitAddress"  id="submitAddress" value="Ship to this Address" class="button" />
                    </div>
                  </div>
                  <div class="form-button-outer last">
                    <div class="bigImgButton floatLeft yellow-image">
                      <input type="button" name="btnSearch" onclick="resetShipForm();" id="" value="Cancel" class="button button1" />
                    </div>
                  </div>
                  <div class="clearBoth"></div>


                </div>
                <div class="clearBoth"></div>
              </form>
            </div>
          </div>
        </div><!-- Block 2 Right End-->

        <div class="clearBoth"></div>
      </div><!-- Block 2 End--> 
      <div class="clearBoth"></div>
    </div><!-- mid inner end-->
  </div>
  <div class="bottom">
    <div class="left">
      <div class="right"> &nbsp; </div>
    </div>
  </div>
</div>
<!-- /Add Shipping Detail End-->