Professional Documents
Culture Documents
{
var mobile = $('#txtMobileNo').val();
var password = $('#txtPassword').val();
var error = 0;
var errormessage = '<h3 style="padding-left:10px;">Error!</h3><p style="pad
ding:10px">';
if(mobile.length != 10 )
{
error = 1;
errormessage = errormessage + 'Please enter a valid mobile number<br
/>';
}
if(password == '')
{
error = 1;
errormessage = errormessage + 'Please enter a password<br />';
}
if(error == 1)
{
$.prompt(errormessage+'</p>');
}
else
{
var dataString = 'txtMobileNo='+ mobile+'&password='+password;
$('#blocker').css('display','block');
$.ajax
({
type: "POST",
url: "verifylogin.php",
data: dataString,
cache: false,
success: function(html)
{
if(html=="1")
{
window.location='../dashboard.php?r=1';
}
else
{
$('#blocker').css('display','none');
$.prompt('<h3 style="padding-left:10px;">Error!</h3><p style=
"padding:10px">You have entered an incorrect mobile number / password.<br />Kind
ly try again or click on "Forgot Password" to retreive it</p>');
}
}
});
}
}
function submitForgotPassword()
{
var mobile = $('#fpMobile').val();
$.fancybox.close();
if(mobile.length == 10 )
{
var dataString = 'fpMobile='+ mobile;
$('#blocker').css('display','block');
$.ajax
({
type: "GET",
url: "requestpin.php",
data: dataString,
cache: false,
success: function(html)
{
if(html=="1")
{
$('#blocker').css('display','none');
$.prompt('<h3 style="padding-left:10px;">Success!</h3><p
style="padding:10px">Password sent successfully to you registered Email ID</p>')
;
}
else
{
$('#blocker').css('display','none');
$.prompt('<h3 style="padding-left:10px;">Error!</h3><p st
yle="padding:10px">The mobile number you have entered is not registered with us.
If you are ordering for the first time kindly use the "first time order" sectio
n');
}
}
});
}
else
{
$.prompt('<h3 style="padding-left:10px;">Error!</h3><p style="padding
:10px">Please enter a valid mobile number</p>');
}
}
function setStreetNameValue()
{
var streetName = $('#txtStreetName').val();
if(streetName == '' || streetName == 'Street / Society Name')
{
$('#txtStreetName').val('');
}
}
function removeStreetNameValue()
{
var streetName = $('#txtStreetName').val();
if(streetName == '' || streetName == 'Street / Society Name')
{
$('#txtStreetName').val('Street / Society Name');
}
}
function setHouseNoValue()
{
var flatNo = $('#txtFlatNo').val();
else
{
$('#homedeliveryform').submit();
}
}
function readCookie(name) {
var cookieName = name + "=";
var cookieArray = document.cookie.split(';');
for (var i = 0; i < cookieArray.length; i++){
var cookie = cookieArray[i];
while (cookie.charAt(0)==' '){
cookie = cookie.substring(1,cookie.length);
}
if (cookie.indexOf(cookieName) == 0){
return cookie.substring(cookieName.length,cookie.length);
}
}
return null;
}
$(function()
{
$(".modal").fancybox({'autoScale': false, 'width':510, 'height': 270, 'autoD
imensions': false, 'scrolling': 'no'});
$('#captcha-submit').click(function()
{
var captcha=$('#captcha-form').val();
var dataString = 'cap='+ captcha;
$.ajax({
type: "POST",
url: "captcha-action.php",
data: dataString,
success: function(html)
{
if(html==1)
{
$.prompt('<h3 style="padding-left:10px;"></h3><p style="padding:10px
">Invalid Captcha!<br/>Please enter another word from the image!');
$('#captcha').attr('src','captcha.php?'+Math.random());
}
if(html==0)
{
//$.prompt('<h3 style="padding-left:10px;"></h3><p style="padding:10
px">Valid captcha!');
$('.captcha-wrap').fadeOut(500,function(){$('.fade-in').fadeIn();})
}
if(html==2)
{
$.prompt('<h3 style="padding-left:10px;"></h3><p style="padding:10px
">Please enter the captcha from the image');
$('#captcha').attr('src','captcha.php?'+Math.random());
}
}}); return false;
});
case '2D':
slot_result_desc = "Wooho! That's two do
ubles for you!";
window.lastAttempt = 1;
break;
case '3':
slot_result_desc = "Congrats! You have l
anded a double!";
window.lastAttempt = 1;
break;
case '3A':
slot_result_desc = "Whoopee! You have la
nded a triple!";
window.lastAttempt = 1;
break;
case '4':
slot_result_desc = "Sorry! Try again..."
;
window.lastAttempt = 1;
break;
default:
slot_result_desc = "You've tried your lu
ck twice already! You may only use the last coupon you won.";
}
}
$('#result').html(slot_result_desc+'<br />');
if(json['coupon_description']){
$('#result').append(json['coupon_description']);
}
if(json['unique_coupon'])
$('#slot-result-coupon').html('Your coupon code
is: <strong>'+json['unique_coupon']+'</strong>');
else{
$('#slot-result-coupon').html('');
}
//console.log($('#control').val());
var buttonState = $('#control').val();
if(buttonState == 'Start' || buttonState == 'Please
wait...'){
$('#control').val('Try Again').attr('disabled',f
alse);
}
else{
$('#control').attr('disabled',false);
}
} // limit == 4
}}); // slot animate
} // for loop
}); // post
}); // click
}); // doc.ready