Code Context <?php echo $this->Html->charset(); ?>
<title>
<?php echo $cakeDescription ?>:
$viewFile = '/home/may17iyakkam/public_html/forms/join/app/View/Layouts/default.ctp'
$dataForView = array(
'base_url' => '/forms/join',
'locations' => array(
(int) 1 => 'Tamil Nadu',
(int) 2 => 'Pondicherry',
(int) 3 => 'Other State',
(int) 4 => 'Overseas'
),
'content_for_layout' => '<style>
table {
border: none !important;
}
table tr.even, table tr.alt, table tr:nth-of-type(even) {
background: none !important;
}
table tr th, table tr td {
padding: 0 0.625rem 0.625rem 0 !important;
}
#MemberName {
width: 75% !important;
}
.select {
margin-top: -16px;
}
input[type="checkbox"]{
width: 20px;
height: 15px;
vertical-align: top;
margin-bottom: 0px;
}
.error-message {
display: none;
}
</style>
<img style="width:100%;" src="https://may17iyakkam.com/wp-content/uploads/2015/03/13310560_10209534989475138_6210745611955952395_n-660x330.jpg">
<h4>மே 17 இயக்கத்துடன் இணைந்து செயலாற்ற / போராட்ட களத்தில் நிற்க அனைவரையும் அழைக்கிறோம். </h4>
<br>
<input type="hidden" value="/forms/join" id="base_url" />
<div class="large-12 columns users form" style="padding-left: 0px; width:65%;">
<form action="/forms/join/members/register" id="MemberRegisterForm" method="post" accept-charset="utf-8"><div style="display:none;"><input type="hidden" name="_method" value="POST"/></div> <br>
<div class="input text required"><label for="MemberName">பெயர் - Name </label><input name="data[Member][name]" type="text" id="MemberName" required="required"/></div> <br>
<div class="input text required"><label for="MemberEmail">மின்னஞ்சல் - Email</label><input name="data[Member][email]" type="text" id="MemberEmail" required="required"/></div>
<br>
<div class="input text required"><label for="MemberMobile">தொடர்பு எண் - Mobile</label><input name="data[Member][mobile]" type="text" id="MemberMobile" required="required"/></div> <br>
<div class="input text">
<label for="MemberWhatsappMobile">வாட்சப் எண் - WhatsApp : <input type="checkbox" id="same_mobile" /> <font style="font-weight: normal; font-style: normal;">Same as mobile</font></label>
<input name="data[Member][whatsapp_mobile]" maxlength="20" type="text" id="MemberWhatsappMobile">
</div>
<br>
<div class="input text"><label for="MemberFacebookUrl">முகநூல் இணைய முகவரி - Facebook Profile Url</label><input name="data[Member][facebook_url]" maxlength="100" type="text" id="MemberFacebookUrl"/></div> <br>
<div class="input textarea"><label for="MemberAboutYourself">உங்களைப் பற்றி சில வரிகள் - About Yourself</label><textarea name="data[Member][about_yourself]" cols="30" rows="6" id="MemberAboutYourself"></textarea></div> <br><br>
<div class="input select required"><label for="MemberCurrentLocation">தற்போது தொழில்/படிப்பு சார்ந்து வசிக்கும் இடம் - Current Location</label><select name="data[Member][current_location]" id="MemberCurrentLocation" required="required">
<option value="">Select your current location</option>
<option value="1">Tamil Nadu</option>
<option value="2">Pondicherry</option>
<option value="3">Other State</option>
<option value="4">Overseas</option>
</select></div> <br>
<input type="hidden" id="current_districts" />
<div class="input number required"><label for="MemberCurrentDistrict">தற்போது வசிக்கும் மாவட்டம் - Current District</label><input name="data[Member][current_district]" class="autocomplete" type="number" id="MemberCurrentDistrict" required="required"/></div> <input type="hidden" name="data[Member][current_district_value]" id="MemberCurrentDistrictValue" />
<br>
<div class="input number required"><label for="MemberCurrentCityVillage">தற்போது வசிக்கும் மாவட்டத்தின் பகுதி - Current Area Ex: Saithapettai</label><input name="data[Member][current_city_village]" type="number" id="MemberCurrentCityVillage" required="required"/></div> <input type="hidden" id="current_cities" />
<input type="hidden" name="data[Member][current_city_village_value]" id="MemberCurrentCityVillageValue" />
<br>
<input type="checkbox" id="same_location" />சொந்த ஊரும், தற்போது வசிப்பதும் ஒரே ஊர் தான் - Native & Current are same location.
<br><br>
<div class="input select required"><label for="MemberNativeLocation">சொந்த இடம் - Native Location</label><select name="data[Member][native_location]" id="MemberNativeLocation" required="required">
<option value="">Select your native location</option>
<option value="1">Tamil Nadu</option>
<option value="2">Pondicherry</option>
<option value="3">Other State</option>
<option value="4">Overseas</option>
</select></div> <input type="hidden" id="native_districts" />
<br>
<div class="input number required"><label for="MemberNativeDistrict">சொந்த மாவட்டம் - Native District</label><input name="data[Member][native_district]" type="number" id="MemberNativeDistrict" required="required"/></div> <input type="hidden" name="data[Member][native_district_value]" id="MemberNativeDistrictValue" />
<br>
<div class="input number required"><label for="MemberNativeCityVillage">சொந்த ஊர் - Native City/Village Ex: Melur</label><input name="data[Member][native_city_village]" type="number" id="MemberNativeCityVillage" required="required"/></div> <input type="hidden" id="native_cities" />
<input type="hidden" name="data[Member][native_city_village_value]" id="MemberNativeCityVillageValue" />
<br>
<div class="submit"><input type="submit" value="பதிவு செய் - Register"/></div></form>
<br><br><br>
<p align="center">
மேல் உள்ள படிவத்தை பூர்த்தி செய்யவும். அல்லது தங்களின் கைபேசி எண் ., மின்னஞ்சல் முகவரி , பெயர் , ஊர் போன்ற விவரங்களை contact.may17@gmail.com எனும் முகவரிக்கு அனுப்பி வைக்கவும்.
<br>
Mobile: 98840 72010 <br>
Facebook : <a href="https://www.facebook.com/mayseventeenmovement">https://www.facebook.com/mayseventeenmovement</a>
</p>
</div>
<script type="text/javascript">
$(document).ready(function(){
var baseUrl = $('#base_url').val();
function checkAjax(field, value) {
var response = false;
$.ajax({
url: document.location.origin + baseUrl + '/Members/checkDB/' + value + '/' + field,
type: "POST",
async: false,
success: function(result){
if(parseInt(result) == 0) {
response = true;
} else if(parseInt(result) == 1)
response = false;
}
});
return response;
}
$.validator.addMethod(
"checkMobile",
function(value, element) {
return checkAjax('mobile', value);
},
"இந்த கைபேசி எண் வைத்து நீங்கள் ஏற்கனவே மே 17 இயக்கத்தில் பதிவு செய்துள்ளீர்கள். - Mobile number already exist"
);
$.validator.addMethod(
"checkWhatsappMobile",
function(value, element) {
return checkAjax('whatsapp_mobile', value);
},
"இந்த கைபேசி எண் வைத்து நீங்கள் ஏற்கனவே மே 17 இயக்கத்தில் பதிவு செய்துள்ளீர்கள். - Mobile number already exist"
);
$.validator.addMethod(
"checkEmail",
function(value, element) {
return checkAjax('email', value);
},
"இந்த மின்னஞ்சல் வைத்து நீங்கள் ஏற்கனவே மே 17 இயக்கத்தில் பதிவு செய்துள்ளீர்கள். - Email ID already exist"
);
$( "#MemberRegisterForm" ).submit(function( event ) {
var cur_dis = $('#MemberCurrentDistrict').text();
if(cur_dis != '')
$('#MemberCurrentDistrictValue').val(0);
var cur_cit = $('#MemberCurrentCityVillage').text();
if(cur_cit != '')
$('#MemberCurrentCityVillageValue').val(0);
var nat_dis = $('#MemberNativeDistrict').text();
if(nat_dis != '')
$('#MemberNativeDistrictValue').val(0);
var nat_cit = $('#MemberNativeCityVillage').text();
if(nat_cit != '')
$('#MemberNativeCityVillageValue').val(0);
});
$("#MemberRegisterForm").validate({
rules: {
'data[Member][name]': "required",
'data[Member][email]': {
required: true,
email: true,
checkEmail: true
},
'data[Member][mobile]': {
required: true,
minlength: 10,
checkMobile: true
},
'data[Member][whatsapp_mobile]': {
required: false,
minlength: 10,
checkWhatsappMobile: true
},
},
messages: {
'data[Member][name]': "Please enter your name",
'data[Member][email]': {
required: "Please enter your email ID",
minlength: "Please enter a valid email address",
checkEmail: "இந்த மின்னஞ்சல் வைத்து நீங்கள் ஏற்கனவே மே 17 இயக்கத்தில் பதிவு செய்துள்ளீர்கள். This Email ID was already submitted."
},
'data[Member][mobile]': {
required: "Please enter your mobile number",
minlength: "Please enter a valid mobile number",
checkMobile: "இந்த கைபேசி எண் வைத்து நீங்கள் ஏற்கனவே மே 17 இயக்கத்தில் பதிவு செய்துள்ளீர்கள். This mobile number was already submitted."
},
'data[Member][whatsapp_mobile]': {
minlength: "Please enter a valid mobile number",
checkWhatsappMobile: "Mobile number already exist"
}
}
});
$("#MemberRegisterForm").on('submit', function(e) {
var isvalid = $("#MemberRegisterForm").valid();
if (isvalid) { }
else { e.preventDefault(); }
});
$('input').attr('autocomplete','off');
$("#MemberCurrentDistrict, #MemberCurrentCityVillage, #MemberNativeDistrict, #MemberNativeCityVillage").prop("type", "text");
function getDistricts(val, type) {
$.ajax({
url : document.location.origin + baseUrl + '/Members/getDistricts/' + val,
type: 'GET',
success : function(response){
if(type == 'current')
$('#current_districts').val(response);
else
$('#native_districts').val(response);
}
});
}
// Current
$('#MemberCurrentLocation').change(function(){
var current_location = $('#MemberCurrentLocation').val();
getDistricts(current_location, 'current');
});
$( "#MemberCurrentDistrict" ).focus(function() {
var cur_val = $('#current_districts').val();
var districts = JSON.parse(cur_val);
$( "#MemberCurrentDistrict" ).autocomplete({
minLength: 0,
source: districts,
focus: function( event, ui ) {
$( "#MemberCurrentDistrict" ).val( ui.item.label );
return false;
},
select: function( event, ui ) {
$( "#MemberCurrentDistrict" ).val( ui.item.label );
$( "#MemberCurrentDistrictValue" ).val( ui.item.value );
var val = ui.item.value;
$.ajax({
url : document.location.origin + baseUrl + '/Members/getCities/' + val,
type: 'GET',
success : function(response){
$('#current_cities').val(response);
}
});
return false;
}
}).bind('dblclick', function(){ $(this).autocomplete("search"); } );
});
$( "#MemberCurrentCityVillage" ).focus(function() {
var cur_val = $('#current_cities').val();
var cities = JSON.parse(cur_val);
$( "#MemberCurrentCityVillage" ).autocomplete({
minLength: 0,
source: cities,
focus: function( event, ui ) {
$( "#MemberCurrentCityVillage" ).val( ui.item.label );
return false;
},
select: function( event, ui ) {
$( "#MemberCurrentCityVillage" ).val( ui.item.label );
$( "#MemberCurrentCityVillageValue" ).val( ui.item.value );
return false;
},
change: function( event, ui ) {
val = $(this).val();
exists = $.inArray(val, cities);
if (exists < 0) {
$('#MemberCurrentCityVillageValue').val(0);
return true;
}
}
}).bind('dblclick', function(){ $(this).autocomplete("search"); } );
});
// Native
$('#MemberNativeLocation').change(function(){
var native_location = $('#MemberNativeLocation').val();
getDistricts(native_location, 'native');
});
$( "#MemberNativeDistrict" ).focus(function() {
var nat_val = $('#native_districts').val();
var districts = JSON.parse(nat_val);
$( "#MemberNativeDistrict" ).autocomplete({
minLength: 0,
source: districts,
focus: function( event, ui ) {
$( "#MemberNativeDistrict" ).val( ui.item.label );
return false;
},
select: function( event, ui ) {
$( "#MemberNativeDistrict" ).val( ui.item.label );
$( "#MemberNativeDistrictValue" ).val( ui.item.value );
var val = ui.item.value;
$.ajax({
url : document.location.origin + baseUrl + '/Members/getCities/' + val,
type: 'GET',
success : function(response){
$('#native_cities').val(response);
}
});
return false;
}
}).bind('dblclick', function(){ $(this).autocomplete("search"); } );
});
$( "#MemberNativeCityVillage" ).focus(function() {
var cur_val = $('#native_cities').val();
var cities = JSON.parse(cur_val);
$( "#MemberNativeCityVillage" ).autocomplete({
minLength: 0,
source: cities,
focus: function( event, ui ) {
$( "#MemberNativeCityVillage" ).val( ui.item.label );
return false;
},
select: function( event, ui ) {
$( "#MemberNativeCityVillage" ).val( ui.item.label );
$( "#MemberNativeCityVillageValue" ).val( ui.item.value );
return false;
},
change: function( event, ui ) {
val = $(this).val();
exists = $.inArray(val, cities);
if (exists < 0) {
$('#MemberNativeCityVillageValue').val(0);
return true;
}
}
}).bind('dblclick', function(){ $(this).autocomplete("search"); } );
});
$("#same_mobile").change(function() {
if(this.checked) {
var mobile = $('#MemberMobile').val();
$('#MemberWhatsappMobile').val(mobile);
$("#MemberWhatsappMobile").attr("readonly", "readonly");
} else {
$('#MemberWhatsappMobile').val('');
$("#MemberWhatsappMobile").removeAttr("readonly");
}
});
$("#same_location").change(function() {
if(this.checked) {
var current_location = $('#MemberCurrentLocation').val();
getDistricts(current_location, 'native');
var location = $('#MemberCurrentLocation').val();
$('#MemberNativeLocation').val(location);
$("#MemberNativeLocation").prop("readOnly", true);
var district = $('#MemberCurrentDistrict').val();
$('#MemberNativeDistrict').val(district);
$("#MemberNativeDistrict").attr("readonly", "readonly");
var district_value = $('#MemberCurrentDistrictValue').val();
$('#MemberNativeDistrictValue').val(district_value);
var city_village = $('#MemberCurrentCityVillage').val();
$('#MemberNativeCityVillage').val(city_village);
$("#MemberNativeCityVillage").attr("readonly", "readonly");
var city_village_value = $('#MemberCurrentCityVillageValue').val();
$('#MemberNativeCityVillageValue').val(city_village_value);
} else {
$('#MemberNativeLocation').val('');
$("#MemberNativeLocation").removeAttr("readonly");
$('#MemberNativeDistrict').val('');
$("#MemberNativeDistrict").removeAttr("readonly");
$('#MemberNativeCityVillage').val('');
$("#MemberNativeCityVillage").removeAttr("readonly");
$('#MemberNativeDistrictValue').val('');
$('#MemberNativeCityVillageValue').val('');
}
});
});
$( "#MemberNativeDistrict, #MemberCurrentDistrict, #MemberCurrentCityVillage, #MemberNativeCityVillage" ).keypress(function() {
return onlyAlphabets(event, this);
});
function onlyAlphabets(e, t) {
try {
if (window.event) {
var charCode = window.event.keyCode;
}
else if (e) {
var charCode = e.which;
}
else { return true; }
if ((charCode > 64 && charCode < 91) || (charCode > 96 && charCode < 123))
return true;
else
return false;
}
catch (err) {
alert(err.Description);
}
}
</script>',
'scripts_for_layout' => '',
'title_for_layout' => 'Members'
)
$base_url = '/forms/join'
$locations = array(
(int) 1 => 'Tamil Nadu',
(int) 2 => 'Pondicherry',
(int) 3 => 'Other State',
(int) 4 => 'Overseas'
)
$content_for_layout = '<style>
table {
border: none !important;
}
table tr.even, table tr.alt, table tr:nth-of-type(even) {
background: none !important;
}
table tr th, table tr td {
padding: 0 0.625rem 0.625rem 0 !important;
}
#MemberName {
width: 75% !important;
}
.select {
margin-top: -16px;
}
input[type="checkbox"]{
width: 20px;
height: 15px;
vertical-align: top;
margin-bottom: 0px;
}
.error-message {
display: none;
}
</style>
<img style="width:100%;" src="https://may17iyakkam.com/wp-content/uploads/2015/03/13310560_10209534989475138_6210745611955952395_n-660x330.jpg">
<h4>மே 17 இயக்கத்துடன் இணைந்து செயலாற்ற / போராட்ட களத்தில் நிற்க அனைவரையும் அழைக்கிறோம். </h4>
<br>
<input type="hidden" value="/forms/join" id="base_url" />
<div class="large-12 columns users form" style="padding-left: 0px; width:65%;">
<form action="/forms/join/members/register" id="MemberRegisterForm" method="post" accept-charset="utf-8"><div style="display:none;"><input type="hidden" name="_method" value="POST"/></div> <br>
<div class="input text required"><label for="MemberName">பெயர் - Name </label><input name="data[Member][name]" type="text" id="MemberName" required="required"/></div> <br>
<div class="input text required"><label for="MemberEmail">மின்னஞ்சல் - Email</label><input name="data[Member][email]" type="text" id="MemberEmail" required="required"/></div>
<br>
<div class="input text required"><label for="MemberMobile">தொடர்பு எண் - Mobile</label><input name="data[Member][mobile]" type="text" id="MemberMobile" required="required"/></div> <br>
<div class="input text">
<label for="MemberWhatsappMobile">வாட்சப் எண் - WhatsApp : <input type="checkbox" id="same_mobile" /> <font style="font-weight: normal; font-style: normal;">Same as mobile</font></label>
<input name="data[Member][whatsapp_mobile]" maxlength="20" type="text" id="MemberWhatsappMobile">
</div>
<br>
<div class="input text"><label for="MemberFacebookUrl">முகநூல் இணைய முகவரி - Facebook Profile Url</label><input name="data[Member][facebook_url]" maxlength="100" type="text" id="MemberFacebookUrl"/></div> <br>
<div class="input textarea"><label for="MemberAboutYourself">உங்களைப் பற்றி சில வரிகள் - About Yourself</label><textarea name="data[Member][about_yourself]" cols="30" rows="6" id="MemberAboutYourself"></textarea></div> <br><br>
<div class="input select required"><label for="MemberCurrentLocation">தற்போது தொழில்/படிப்பு சார்ந்து வசிக்கும் இடம் - Current Location</label><select name="data[Member][current_location]" id="MemberCurrentLocation" required="required">
<option value="">Select your current location</option>
<option value="1">Tamil Nadu</option>
<option value="2">Pondicherry</option>
<option value="3">Other State</option>
<option value="4">Overseas</option>
</select></div> <br>
<input type="hidden" id="current_districts" />
<div class="input number required"><label for="MemberCurrentDistrict">தற்போது வசிக்கும் மாவட்டம் - Current District</label><input name="data[Member][current_district]" class="autocomplete" type="number" id="MemberCurrentDistrict" required="required"/></div> <input type="hidden" name="data[Member][current_district_value]" id="MemberCurrentDistrictValue" />
<br>
<div class="input number required"><label for="MemberCurrentCityVillage">தற்போது வசிக்கும் மாவட்டத்தின் பகுதி - Current Area Ex: Saithapettai</label><input name="data[Member][current_city_village]" type="number" id="MemberCurrentCityVillage" required="required"/></div> <input type="hidden" id="current_cities" />
<input type="hidden" name="data[Member][current_city_village_value]" id="MemberCurrentCityVillageValue" />
<br>
<input type="checkbox" id="same_location" />சொந்த ஊரும், தற்போது வசிப்பதும் ஒரே ஊர் தான் - Native & Current are same location.
<br><br>
<div class="input select required"><label for="MemberNativeLocation">சொந்த இடம் - Native Location</label><select name="data[Member][native_location]" id="MemberNativeLocation" required="required">
<option value="">Select your native location</option>
<option value="1">Tamil Nadu</option>
<option value="2">Pondicherry</option>
<option value="3">Other State</option>
<option value="4">Overseas</option>
</select></div> <input type="hidden" id="native_districts" />
<br>
<div class="input number required"><label for="MemberNativeDistrict">சொந்த மாவட்டம் - Native District</label><input name="data[Member][native_district]" type="number" id="MemberNativeDistrict" required="required"/></div> <input type="hidden" name="data[Member][native_district_value]" id="MemberNativeDistrictValue" />
<br>
<div class="input number required"><label for="MemberNativeCityVillage">சொந்த ஊர் - Native City/Village Ex: Melur</label><input name="data[Member][native_city_village]" type="number" id="MemberNativeCityVillage" required="required"/></div> <input type="hidden" id="native_cities" />
<input type="hidden" name="data[Member][native_city_village_value]" id="MemberNativeCityVillageValue" />
<br>
<div class="submit"><input type="submit" value="பதிவு செய் - Register"/></div></form>
<br><br><br>
<p align="center">
மேல் உள்ள படிவத்தை பூர்த்தி செய்யவும். அல்லது தங்களின் கைபேசி எண் ., மின்னஞ்சல் முகவரி , பெயர் , ஊர் போன்ற விவரங்களை contact.may17@gmail.com எனும் முகவரிக்கு அனுப்பி வைக்கவும்.
<br>
Mobile: 98840 72010 <br>
Facebook : <a href="https://www.facebook.com/mayseventeenmovement">https://www.facebook.com/mayseventeenmovement</a>
</p>
</div>
<script type="text/javascript">
$(document).ready(function(){
var baseUrl = $('#base_url').val();
function checkAjax(field, value) {
var response = false;
$.ajax({
url: document.location.origin + baseUrl + '/Members/checkDB/' + value + '/' + field,
type: "POST",
async: false,
success: function(result){
if(parseInt(result) == 0) {
response = true;
} else if(parseInt(result) == 1)
response = false;
}
});
return response;
}
$.validator.addMethod(
"checkMobile",
function(value, element) {
return checkAjax('mobile', value);
},
"இந்த கைபேசி எண் வைத்து நீங்கள் ஏற்கனவே மே 17 இயக்கத்தில் பதிவு செய்துள்ளீர்கள். - Mobile number already exist"
);
$.validator.addMethod(
"checkWhatsappMobile",
function(value, element) {
return checkAjax('whatsapp_mobile', value);
},
"இந்த கைபேசி எண் வைத்து நீங்கள் ஏற்கனவே மே 17 இயக்கத்தில் பதிவு செய்துள்ளீர்கள். - Mobile number already exist"
);
$.validator.addMethod(
"checkEmail",
function(value, element) {
return checkAjax('email', value);
},
"இந்த மின்னஞ்சல் வைத்து நீங்கள் ஏற்கனவே மே 17 இயக்கத்தில் பதிவு செய்துள்ளீர்கள். - Email ID already exist"
);
$( "#MemberRegisterForm" ).submit(function( event ) {
var cur_dis = $('#MemberCurrentDistrict').text();
if(cur_dis != '')
$('#MemberCurrentDistrictValue').val(0);
var cur_cit = $('#MemberCurrentCityVillage').text();
if(cur_cit != '')
$('#MemberCurrentCityVillageValue').val(0);
var nat_dis = $('#MemberNativeDistrict').text();
if(nat_dis != '')
$('#MemberNativeDistrictValue').val(0);
var nat_cit = $('#MemberNativeCityVillage').text();
if(nat_cit != '')
$('#MemberNativeCityVillageValue').val(0);
});
$("#MemberRegisterForm").validate({
rules: {
'data[Member][name]': "required",
'data[Member][email]': {
required: true,
email: true,
checkEmail: true
},
'data[Member][mobile]': {
required: true,
minlength: 10,
checkMobile: true
},
'data[Member][whatsapp_mobile]': {
required: false,
minlength: 10,
checkWhatsappMobile: true
},
},
messages: {
'data[Member][name]': "Please enter your name",
'data[Member][email]': {
required: "Please enter your email ID",
minlength: "Please enter a valid email address",
checkEmail: "இந்த மின்னஞ்சல் வைத்து நீங்கள் ஏற்கனவே மே 17 இயக்கத்தில் பதிவு செய்துள்ளீர்கள். This Email ID was already submitted."
},
'data[Member][mobile]': {
required: "Please enter your mobile number",
minlength: "Please enter a valid mobile number",
checkMobile: "இந்த கைபேசி எண் வைத்து நீங்கள் ஏற்கனவே மே 17 இயக்கத்தில் பதிவு செய்துள்ளீர்கள். This mobile number was already submitted."
},
'data[Member][whatsapp_mobile]': {
minlength: "Please enter a valid mobile number",
checkWhatsappMobile: "Mobile number already exist"
}
}
});
$("#MemberRegisterForm").on('submit', function(e) {
var isvalid = $("#MemberRegisterForm").valid();
if (isvalid) { }
else { e.preventDefault(); }
});
$('input').attr('autocomplete','off');
$("#MemberCurrentDistrict, #MemberCurrentCityVillage, #MemberNativeDistrict, #MemberNativeCityVillage").prop("type", "text");
function getDistricts(val, type) {
$.ajax({
url : document.location.origin + baseUrl + '/Members/getDistricts/' + val,
type: 'GET',
success : function(response){
if(type == 'current')
$('#current_districts').val(response);
else
$('#native_districts').val(response);
}
});
}
// Current
$('#MemberCurrentLocation').change(function(){
var current_location = $('#MemberCurrentLocation').val();
getDistricts(current_location, 'current');
});
$( "#MemberCurrentDistrict" ).focus(function() {
var cur_val = $('#current_districts').val();
var districts = JSON.parse(cur_val);
$( "#MemberCurrentDistrict" ).autocomplete({
minLength: 0,
source: districts,
focus: function( event, ui ) {
$( "#MemberCurrentDistrict" ).val( ui.item.label );
return false;
},
select: function( event, ui ) {
$( "#MemberCurrentDistrict" ).val( ui.item.label );
$( "#MemberCurrentDistrictValue" ).val( ui.item.value );
var val = ui.item.value;
$.ajax({
url : document.location.origin + baseUrl + '/Members/getCities/' + val,
type: 'GET',
success : function(response){
$('#current_cities').val(response);
}
});
return false;
}
}).bind('dblclick', function(){ $(this).autocomplete("search"); } );
});
$( "#MemberCurrentCityVillage" ).focus(function() {
var cur_val = $('#current_cities').val();
var cities = JSON.parse(cur_val);
$( "#MemberCurrentCityVillage" ).autocomplete({
minLength: 0,
source: cities,
focus: function( event, ui ) {
$( "#MemberCurrentCityVillage" ).val( ui.item.label );
return false;
},
select: function( event, ui ) {
$( "#MemberCurrentCityVillage" ).val( ui.item.label );
$( "#MemberCurrentCityVillageValue" ).val( ui.item.value );
return false;
},
change: function( event, ui ) {
val = $(this).val();
exists = $.inArray(val, cities);
if (exists < 0) {
$('#MemberCurrentCityVillageValue').val(0);
return true;
}
}
}).bind('dblclick', function(){ $(this).autocomplete("search"); } );
});
// Native
$('#MemberNativeLocation').change(function(){
var native_location = $('#MemberNativeLocation').val();
getDistricts(native_location, 'native');
});
$( "#MemberNativeDistrict" ).focus(function() {
var nat_val = $('#native_districts').val();
var districts = JSON.parse(nat_val);
$( "#MemberNativeDistrict" ).autocomplete({
minLength: 0,
source: districts,
focus: function( event, ui ) {
$( "#MemberNativeDistrict" ).val( ui.item.label );
return false;
},
select: function( event, ui ) {
$( "#MemberNativeDistrict" ).val( ui.item.label );
$( "#MemberNativeDistrictValue" ).val( ui.item.value );
var val = ui.item.value;
$.ajax({
url : document.location.origin + baseUrl + '/Members/getCities/' + val,
type: 'GET',
success : function(response){
$('#native_cities').val(response);
}
});
return false;
}
}).bind('dblclick', function(){ $(this).autocomplete("search"); } );
});
$( "#MemberNativeCityVillage" ).focus(function() {
var cur_val = $('#native_cities').val();
var cities = JSON.parse(cur_val);
$( "#MemberNativeCityVillage" ).autocomplete({
minLength: 0,
source: cities,
focus: function( event, ui ) {
$( "#MemberNativeCityVillage" ).val( ui.item.label );
return false;
},
select: function( event, ui ) {
$( "#MemberNativeCityVillage" ).val( ui.item.label );
$( "#MemberNativeCityVillageValue" ).val( ui.item.value );
return false;
},
change: function( event, ui ) {
val = $(this).val();
exists = $.inArray(val, cities);
if (exists < 0) {
$('#MemberNativeCityVillageValue').val(0);
return true;
}
}
}).bind('dblclick', function(){ $(this).autocomplete("search"); } );
});
$("#same_mobile").change(function() {
if(this.checked) {
var mobile = $('#MemberMobile').val();
$('#MemberWhatsappMobile').val(mobile);
$("#MemberWhatsappMobile").attr("readonly", "readonly");
} else {
$('#MemberWhatsappMobile').val('');
$("#MemberWhatsappMobile").removeAttr("readonly");
}
});
$("#same_location").change(function() {
if(this.checked) {
var current_location = $('#MemberCurrentLocation').val();
getDistricts(current_location, 'native');
var location = $('#MemberCurrentLocation').val();
$('#MemberNativeLocation').val(location);
$("#MemberNativeLocation").prop("readOnly", true);
var district = $('#MemberCurrentDistrict').val();
$('#MemberNativeDistrict').val(district);
$("#MemberNativeDistrict").attr("readonly", "readonly");
var district_value = $('#MemberCurrentDistrictValue').val();
$('#MemberNativeDistrictValue').val(district_value);
var city_village = $('#MemberCurrentCityVillage').val();
$('#MemberNativeCityVillage').val(city_village);
$("#MemberNativeCityVillage").attr("readonly", "readonly");
var city_village_value = $('#MemberCurrentCityVillageValue').val();
$('#MemberNativeCityVillageValue').val(city_village_value);
} else {
$('#MemberNativeLocation').val('');
$("#MemberNativeLocation").removeAttr("readonly");
$('#MemberNativeDistrict').val('');
$("#MemberNativeDistrict").removeAttr("readonly");
$('#MemberNativeCityVillage').val('');
$("#MemberNativeCityVillage").removeAttr("readonly");
$('#MemberNativeDistrictValue').val('');
$('#MemberNativeCityVillageValue').val('');
}
});
});
$( "#MemberNativeDistrict, #MemberCurrentDistrict, #MemberCurrentCityVillage, #MemberNativeCityVillage" ).keypress(function() {
return onlyAlphabets(event, this);
});
function onlyAlphabets(e, t) {
try {
if (window.event) {
var charCode = window.event.keyCode;
}
else if (e) {
var charCode = e.which;
}
else { return true; }
if ((charCode > 64 && charCode < 91) || (charCode > 96 && charCode < 123))
return true;
else
return false;
}
catch (err) {
alert(err.Description);
}
}
</script>'
$scripts_for_layout = ''
$title_for_layout = 'Members'
include - APP/View/Layouts/default.ctp, line 123
View::_evaluate() - CORE/Cake/View/View.php, line 948
View::_render() - CORE/Cake/View/View.php, line 910
View::renderLayout() - CORE/Cake/View/View.php, line 542
View::render() - CORE/Cake/View/View.php, line 479
Controller::render() - CORE/Cake/Controller/Controller.php, line 954
Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 198
Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 165
[main] - APP/webroot/index.php, line 99