Sie sind auf Seite 1von 5

username and password must not be null at the time of login or registration.

all field must contain value at the time of registration for user, stall, license,
digital marketing and adding recipe, worker, rent items etc.
mobile number must be unique and should contain 10 characters at the time of
registration and login.
email must have validation as given below.
During password change, user must enter correct old password and also new password
will be confirmed by entering it twice.
when user forgets a password he/she can change the password by verifyinh otp send
to his/her phone number.
Password must have 8 digit and it must contain atleast one lowercase ,one uppercase
,one special character and one digit.
For registering stall ,user ,worker ,rent items etc an image or multiple images are
required
For registering worker valid proof image is required.

$(document).ready(function () {

var limit = 7;
var start = 0;
var flag = 0;
var action = 'inactive';
var search = "";
function load_country_data(limit, start, msearch) {

$.ajax({
url: "../vendor/code/recipe/fetch_recipe.php",
method: "POST",
data: { limit: limit, start: start, msearch: msearch },
cache: false,
success: function (data) {
result = data.split('~');
if (flag == 0) {
$('#recipecontent').append(result[0]);
} else {
$("#recipecontent").html(result[0]);
flag = 0;
}

if (result[0] == '') {
// $('#loading').html("<button type='button' class='btn btn-info'>No
Data Found</button>");
$('#wave').html("Data not found");
action = 'active';
}
else {
// $('#loading').html("<button type='button' class='btn btn-
warning'>Please Wait....</button>");
$('#wave').html('<span class="dot"></span><span
class="dot"></span><span class="dot"></span>');
action = "inactive";
}
}
});
}
$('#searchitems').keyup(function () {
var search = $(this).val();
flag = 1;
load_country_data(7, 0, search);
});

if (action == 'inactive') {
action = 'active';
load_country_data(limit, start);
}
$(window).scroll(function () {
if ($(window).scrollTop() + $(window).height() > $("#recipecontent").height()
&& action == 'inactive') {
action = 'active';
if(flag == 1){
start = 0;
start = start + limit;
}else{
start = start + limit;
}
setTimeout(function () {
load_country_data(limit, start, search);
}, 1000);
}
});

});

$("#recipe_request_add_btn").click(function () {

var userid = $("#userid").val();


var image = $('#file-input').prop('files')[0];
var title = $("#title").val();
var story = $("#story").val();
var serving = $("#serving").val();
var ingr = $("#ingr").val();
var cooktime = $("#cooktime").val();
var steps = $("#steps").val();
var tags = $("#tags").val();
var category = $('input[name=category]:checked').val();

var form_data = new FormData();


form_data.append('userid', userid);
form_data.append('image', image);
form_data.append('title', title);
form_data.append('story', story);
form_data.append('serving', serving);
form_data.append('ingr', ingr);
form_data.append('cooktime', cooktime);
form_data.append('steps', steps);
form_data.append('tags', tags);
form_data.append('category', category);
if (image != undefined) {
$("#recipe_request_image").html("");
if (userid != '') {
$("#recipe_request_userid").html("").css("margin-top", "20px");
if (title != '') {
$("#recipe_request_title").html("").css("margin-top", "20px");
if (story != '') {
$("#recipe_request_story").html("").css("margin-top", "20px");
if (serving != '') {
$("#recipe_request_serving").html("").css("margin-top", "20px");
if (ingr != '') {
$("#recipe_request_ingr").html("").css("margin-top", "20px");
if (cooktime != '') {
$("#recipe_request_cooktime").html("").css("margin-top",
"20px");
if (steps != '') {
$("#recipe_request_steps").html("").css("margin-top",
"20px");
if (tags != '') {
$("#recipe_request_tags").html("").css("margin-top",
"20px");
if (category != undefined) {
$
("#recipe_request_category").html("").css("margin-top", "20px");

$.ajax({
type: "POST",
dataType: 'text',
cache: false,
contentType: false,
processData: false,
data: form_data,
url: "code/recipe/add_recipe.php",
success: function (mess) {

$('#recipe_request_error').html(mess);

}
});
} else {
$("#recipe_request_category").html("Please Enter
Title of Recipe").css("margin-top", "-20px");
}
} else {
$("#recipe_request_tags").html("Please Enter Title of
Recipe").css("margin-top", "-20px");
}
} else {
$("#recipe_request_steps").html("Please Enter Title of
Recipe").css("margin-top", "-20px");
}
} else {
$("#recipe_request_cooktime").html("Please Enter Title of
Recipe").css("margin-top", "-20px");
}
} else {
$("#recipe_request_ingr").html("Please Enter Title of
Recipe").css("margin-top", "-20px");
}
} else {
$("#recipe_request_serving").html("Please Enter Title of
Recipe").css("margin-top", "-20px");
}
} else {
$("#recipe_request_story").html("Please Enter Title of
Recipe").css("margin-top", "-20px");
}
} else {
$("#recipe_request_title").html("Please Enter Title of
Recipe").css("margin-top", "-20px");
}
} else {
$("#recipe_request_userid").html("Please Enter userid of Existing
User").css("margin-top", "-20px");
}
} else {
$("#recipe_request_image").html("Please Upload Image");
}

});

////////////////////////////////////

function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();

reader.onload = function (e) {


$('#blah')
.attr('src', e.target.result)
};

reader.readAsDataURL(input.files[0]);
}
document.getElementById("hideimage").style.display = "none";
document.getElementById("blah").style.display = "block";
}

///////////////////////////////////
function autoResize(thi) {
thi.style.height = 'auto';
thi.style.height = thi.scrollHeight + 'px';
}
///////////////////////////////

function readURLunique(input) {
// alert("adsfasdf");
if (input.files && input.files[0]) {
var reader = new FileReader();

reader.onload = function (e) {


$('#blah')
.attr('src', e.target.result)
};

reader.readAsDataURL(input.files[0]);
}
document.getElementById("hideimage").style.display = "none";
document.getElementById("blah").style.display = "block";
}

Das könnte Ihnen auch gefallen