Subversion Repositories SmartDukaan

Rev

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

<script>
$(document).ready(function(){
   $('.radGroup2').click(function(){
        var pin = $(this).data('pin');
         var add_id = $(this).data('id');
        $('#loadingModal').modal('show');
        $.ajax({
        method: "GET",
        url: "<?php echo $base_url;?>shippings/isServicable/"+pin,
      })
        .done(function( msg ) {
            $('#loadingModal').modal('hide');
            if(msg== 'true'){
                $('.myaddress').removeClass('addressselect');
                $('#address'+add_id).addClass('addressselect');
                // $('#message_success').empty();
                // $('#message_success').append();
                // $('#message_success').removeClass('hidden');

                // setTimeout(function() {
                //     $('#message_success ').addClass('hidden');
                // }, 2000);
            }
            if(msg== 'false'){
                $('#message').empty();
                $('#message').append("Location is not serviceable...");
                $('#message').removeClass('hidden');
                $("input:radio").removeAttr("checked");
                $('.myaddress').removeClass('addressselect');
                setTimeout(function() {
                    $('#message').addClass('hidden');
                }, 2000);
            }
            
            // alert(msg);
        });
   }); 

   $("#showmore").click(function(){
        $("#showmoreaddressdropdown").toggle();
        if($('#showmore').html() == 'Show More')
        {
            $("#showmore").html('Show Less');
        }
        else if($("#showmore").html() == 'Show Less')
        {
            // $("#showmore").empty();
            $("#showmore").html('Show More');    
        }
    });
});
</script>

<style>
#footer{
    position:fixed;
    /*height:50px;*/
    /*background-color:red;*/
    bottom:0px;
    left:0px;
    right:0px;
    margin-bottom:0px;
}

#message,#message_success{
    position:fixed;
    /*height:50px;*/
    /*background-color:red;*/
    /*background-color: white;*/
    top:0px;
    left:0px;
    right:0px;
    margin-top:0px; 
    z-index: 10;  
}

.addressselect{
    background-color: #D9FACF;
}
input[type=radio].css-checkbox {
                                                        position:absolute; z-index:-1000; left:-1000px; overflow: hidden; clip: rect(0 0 0 0); height:1px; width:1px; margin:-1px; padding:0; border:0;
                                                }

                                                input[type=radio].css-checkbox + label.css-label {
                                                        padding-left:21px;
                                                        height:16px; 
                                                        display:inline-block;
                                                        line-height:16px;
                                                        background-repeat:no-repeat;
                                                        background-position: 0 0;
                                                        /*font-size:16px;*/
                                                        vertical-align:middle;
                                                        cursor:pointer;

                                                }

                                                input[type=radio].css-checkbox:checked + label.css-label {
                                                        background-position: 0 -16px;
                                                }
                                                label.css-label {
                                background-image:url(../img/radio.png);
                                -webkit-touch-callout: none;
                                -webkit-user-select: none;
                                -khtml-user-select: none;
                                -moz-user-select: none;
                                -ms-user-select: none;
                                user-select: none;
                        }
/*background: url(../img/radio.png) 0 -16px repeat-x;*/
/*label {
    display: inline-block;
    cursor: pointer;
    position: relative;
    padding-left: 25px;
    margin-right: 15px;
    font-size: 13px;
}
input[type=radio] {
    display: none;
}
label:before {
    content: "";
    display: inline-block;
 
    width: 16px;
    height: 16px;
 
    margin-right: 10px;
    position: absolute;
    left: 0;
    bottom: 1px;
    background-color: #aaa;
    box-shadow: inset 0px 2px 3px 0px rgba(0, 0, 0, .3), 0px 1px 0px 0px rgba(255, 255, 255, .8);
}
.radio label:before {
    border-radius: 8px;
}
input[type=radio]:checked + label:before {
    content: "\2022";
    color: #f3f3f3;
    font-size: 30px;
    text-align: center;
    line-height: 18px;
}*/
</style>
<?php debug($firstshowaddress);?>

<div class="alert alert-danger hidden" id="message"></div>
<div class="alert alert-success hidden" id="message_success"></div>
<div class='container' style='margin-bottom:50px;'>

        


    <div class='row' style="padding-bottom:40px;">


        <div class= 'row'>
            <div class='col-xs-12' style="background-color:white;margin-top:5px;">
              <h4>Shipping Address: <a href= "<?php echo $base_url;?>shippings/add" class='btn btn-success btn-xs' style='float:right;'>Add New Address</a></h4>
              <br>

          </div>
      </div>
        <div class='col-xs-12' style='background-color:white;padding:40px;padding:3px 20px;'>
        <div style='background-color:#f8f8f8;padding:5px;'>
            <?php
                for($i=0;$i<count($firstshowaddress);$i++){?>

                    <?php if($i==3):?>
                        <div id='showmoreaddressdropdown' style='display:none;'>
                    <?php endif;?>
                    <?php //if(count($firstshowaddress)>$i):?>
                        <div  style = 'height:60px;padding:4px;' id = "address<?php echo $address['addresses'][$firstshowaddress[$i]]['id'];?>" class='myaddress <?php if(intval($address['defaultAddress']) == $address['addresses'][$firstshowaddress[$i]]['id']){echo "addressselect";}?>'>

                           <input type="radio" class="css-checkbox" id='<?php echo $address['addresses'][$firstshowaddress[$i]]['id'];?>' name="selectedaddress" <?php if(intval($address['defaultAddress']) == $address['addresses'][$firstshowaddress[$i]]['id']){echo "checked";}?>>

                           <label for="<?php echo $address['addresses'][$firstshowaddress[$i]]['id'];?>" class="css-label radGroup2" data-pin="<?php echo $address['addresses'][$firstshowaddress[$i]]['pin'];?>" data-id="<?php echo $address['addresses'][$firstshowaddress[$i]]['id'];?>">
                                <?php
                                if(isset($address['addresses'][$firstshowaddress[$i]]['line1']) && !empty($address['addresses'][$firstshowaddress[$i]]['line1']))
                                    {echo "Address: ",$address['addresses'][$firstshowaddress[$i]]['line1'];}
                                if(isset($address['addresses'][$firstshowaddress[$i]]['line2']) && !empty($address['addresses'][$firstshowaddress[$i]]['line2']))
                                    {echo ",",$address['addresses'][$firstshowaddress[$i]]['line2'];}
                                if(isset($address['addresses'][$firstshowaddress[$i]]['city']) && !empty($address['addresses'][$firstshowaddress[$i]]['city']))
                                    {echo "<br>",$address['addresses'][$firstshowaddress[$i]]['city'];}
                                if(isset($address['addresses'][$firstshowaddress[$i]]['state']) && !empty($address['addresses'][$firstshowaddress[$i]]['state']))
                                    {echo ", ",$address['addresses'][$firstshowaddress[$i]]['state'];}
                                if(isset($address['addresses'][$firstshowaddress[$i]]['pin']) && !empty($address['addresses'][$firstshowaddress[$i]]['pin']))
                                    {echo ",",$address['addresses'][$firstshowaddress[$i]]['pin'];}
                                ?>
                            </label>

                        </div><hr style='margin:0px;padding:0px;border-color:#58d936;'>
                    <?php //endif;?>

                    <?php if($i>3 && $i==(count($firstshowaddress)-1)):?>
                        </div>
                        <!-- <center><button class='btn btn-default btn-xs' id='showmore'>Show More</button></center> -->
                    <?php endif;?>

            <?php }?> 
        </div>           
        </div>
         <?php if(count($firstshowaddress)>3):?>
                        <center><div class='btn btn-default btn-xs' id='showmore'>Show More</div></center>
                    <?php endif;?>
    </div>  
    <!-- End of address section -->

    <!-- Cart section started -->
    <div class='row' style='padding:0px;' id='footer'>
        <div class='col-xs-12' style='background-color:white;padding:5px; width:100%;'>
            <h4>Total payable Amount: Rs. 1000000/-<br>
            <button class='btn btn-success'>Confirm Order via COD</button>
            <a href="#" style='float:right;padding-right:2px;color:blue;font-size:15px;'>Other Pay Option</a>
        </div>
    </div>

    <!-- Cart section end -->
</div>