$(document).ready(function(){
var adim=0;
// Toolbar extra buttons
var btnFinish = $('').text('Finish')
.addClass('btn btn-info')
.on('click', function(){ alert('Finish Clicked'); });
var btnCancel = $('').text('Cancel')
.addClass('btn btn-danger')
.on('click', function(){ $('#smartwizard').smartWizard("reset"); });
// Step show event
$("#smartwizard").on("showStep", function(e, anchorObject, stepNumber, stepDirection, stepPosition) {
if (stepNumber===1)
{
if (document.getElementById("hastaliklar").value==="")
{
alert('Please tell some information about your needs');
$('#smartwizard').smartWizard("goToStep", stepNumber-1);
}
}
if (stepNumber===2)
{
if (document.getElementById("nickname").value==="")
{
alert('Please use any nickname');
$('#smartwizard').smartWizard("goToStep", stepNumber-1);
}
else
if (document.getElementById("eposta").value==="")
{
alert('Please give valid e-mail address');
$('#smartwizard').smartWizard("goToStep", stepNumber-1);
}
else
if (document.getElementById("adi").value==="")
{
alert('Please provide your name');
$('#smartwizard').smartWizard("goToStep", stepNumber-1);
}
else
if (document.getElementById("soyadi").value==="")
{
alert('Please provide your surname');
$('#smartwizard').smartWizard("goToStep", stepNumber-1);
}
}
if (stepNumber===3)
{
if (document.getElementById("ulkesecim").value==="")
{
alert('Please select your country');
$('#smartwizard').smartWizard("goToStep", stepNumber-1);
}
else
if (document.getElementById("dil").value==="")
{
alert('Please select your language');
$('#smartwizard').smartWizard("goToStep", stepNumber-1);
}
else
if (document.getElementById("cinsiyet").value==="")
{
alert('Please select your gender');
$('#smartwizard').smartWizard("goToStep", stepNumber-1);
}
else
if (document.getElementById("yas_MP_cBdLN29i2").value==="")
{
alert('Please enter your age');
$('#smartwizard').smartWizard("goToStep", stepNumber-1);
}
else
if (document.getElementById("sehir").value==="")
{
alert('Please enter your city');
$('#smartwizard').smartWizard("goToStep", stepNumber-1);
}
else
if (document.getElementById("parabirimi").value==="")
{
alert('Please select your request currency');
$('#smartwizard').smartWizard("goToStep", stepNumber-1);
}
}
if (stepNumber===4)
{
if (document.getElementById("fromDate").value==="")
{
alert('Please enter your arrival date');
}
else
if (document.getElementById("toDate").value==="")
{
alert('Please enter your return date');
}
}
$("#sonuclarigetir").hide();
$("#prev-btn").removeClass('disabled');
$("#next-btn").removeClass('disabled');
document.getElementsByClassName('sw-btn-next')[0].style.visibility = 'unset';
document.getElementsByClassName('sw-btn-next')[0].style.width = 'auto';
if(stepPosition === 'first') {
$("#prev-btn").addClass('disabled');
} else if(stepPosition === 'last') {
document.getElementsByClassName('sw-btn-next')[0].style.visibility = 'hidden';
document.getElementsByClassName('sw-btn-next')[0].style.width = '0px';
$("#sonuclarigetir").show();
} else {
document.getElementsByClassName('sw-btn-next')[0].style.visibility = 'unset';
document.getElementsByClassName('sw-btn-next')[0].style.width = 'auto';
$("#prev-btn").removeClass('disabled');
$("#next-btn").removeClass('disabled');
$("#sonuclarigetir").hide();
}
});
// Smart Wizard
$('#smartwizard').smartWizard({
selected: 0,
theme: 'default', // theme for the wizard, related css need to include for other than default theme
justified: true, // Nav menu justification. true/false
darkMode:false, // Enable/disable Dark Mode if the theme supports. true/false
autoAdjustHeight: true, // Automatically adjust content height
cycleSteps: false, // Allows to cycle the navigation of steps
backButtonSupport: true, // Enable the back button support
enableURLhash: false, // Enable selection of the step based on url hash
transition: {
animation: 'slide-horizontal', // Effect on navigation, none/fade/slide-horizontal/slide-vertical/slide-swing
},
toolbarSettings: {
toolbarPosition: 'bottom', // none, top, bottom, both
toolbarButtonPosition: 'right', // left, right, center
showNextButton: true, // show/hide a Next button
showPreviousButton: true, // show/hide a Previous button
toolbarExtraButtons: [
$('').text('Get Offer')
.addClass('btn btn-info')
] // Extra buttons to show on toolbar, array of jQuery input/buttons elements
},
anchorSettings: {
anchorClickable: true, // Enable/Disable anchor navigation
enableAllAnchors: false, // Activates all anchors clickable all times
markDoneStep: true, // Add done state on navigation
markAllPreviousStepsAsDone: true, // When a step selected by url hash, all previous steps are marked done
removeDoneStepOnNavigateBack: false, // While navigate back done step after active step will be cleared
enableAnchorOnDoneStep: true // Enable/Disable the done steps navigation
},
keyboardSettings: {
keyNavigation: true, // Enable/Disable keyboard navigation(left and right keys are used if enabled)
keyLeft: [37], // Left key code
keyRight: [39] // Right key code
},
lang: { // Language variables for button
next: 'Next',
previous: 'Back'
},
disabledSteps: [], // Array Steps disabled
errorSteps: [], // Highlight step with errors
//hiddenSteps: [] // Hidden steps
});
$(".sw-theme-default > .tab-content > .tab-pane").css({'width':'100%'});
// Modal başlığı yaz
function modalIslem(){
var bolumAdi = $("#departmentid2").val();
$("#modalRandevuAlLabel").html(bolumAdi + " İçin Klinik Arama");
}
modalIslem();
// External Button Events
$("#reset-btn").on("click", function() {
// Reset wizard
$('#smartwizard').smartWizard("reset");
return true;
});
$("#prev-btn").on("click", function() {
// Navigate previous
$('#smartwizard').smartWizard("prev");
adim=adim-1;
return true;
});
$("#next-btn").on("click", function() {
// Navigate next
$('#smartwizard').smartWizard("next");
return true;
});
// Demo Button Events
$("#got_to_step").on("change", function() {
// Go to step
var step_index = $(this).val() - 1;
$('#smartwizard').smartWizard("goToStep", step_index);
return true;
});
$("#dark_mode").on("click", function() {
// Change dark mode
var options = {
darkMode: $(this).prop("checked")
};
$('#smartwizard').smartWizard("setOptions", options);
return true;
});
$("#is_justified").on("click", function() {
// Change Justify
var options = {
justified: $(this).prop("checked")
};
$('#smartwizard').smartWizard("setOptions", options);
return true;
});
$("#animation").on("change", function() {
// Change theme
var options = {
transition: {
animation: $(this).val()
},
};
$('#smartwizard').smartWizard("setOptions", options);
return true;
});
$("#theme_selector").on("change", function() {
// Change theme
var options = {
theme: $(this).val()
};
$('#smartwizard').smartWizard("setOptions", options);
return true;
});
});