Instantly share code, notes, and snippets.
Created
March 12, 2020 13:12
-
Star
(0)
0
You must be signed in to star a gist -
Fork
(0)
0
You must be signed in to fork a gist
-
Save yellowstonebum/5b935d149ffd5db84f990d6ea83045f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $mk_settings; | |
$template = ''; | |
if (global_get_post_id()) { | |
$template = get_post_meta(global_get_post_id(), '_template', true); | |
} | |
if ($template != 'no-footer' && $template != 'no-header-footer' && $template != 'no-header-title-footer' && $template != 'no-sub-footer-title' && $template != 'no-title-footer-sub-footer') : | |
if ($mk_settings['footer'] == true && $template != 'no-footer-only' && $template != 'no-footer-title' && $template != 'no-header-title-only-footer' && $template != 'no-title-footer') : ?> | |
<section id="mk-footer" <?php echo get_schema_markup('footer'); ?>> | |
<div class="footer-wrapper mk-grid"> | |
<div class="mk-padding-wrapper"> | |
<?php | |
$footer_column = $mk_settings['footer-layout']; | |
if (is_numeric($footer_column)): | |
switch ($footer_column): | |
case 1: | |
$class = ''; | |
break; | |
case 2: | |
$class = 'mk-col-1-2'; | |
break; | |
case 3: | |
$class = 'mk-col-1-3'; | |
break; | |
case 4: | |
$class = 'mk-col-1-4'; | |
break; | |
case 5: | |
$class = 'mk-col-1-5'; | |
break; | |
case 6: | |
$class = 'mk-col-1-6'; | |
break; | |
endswitch; | |
for ($i = 1; $i <= $footer_column; $i++): | |
?> | |
<?php if ($i == $footer_column): ?> | |
<div class="<?php echo $class; ?>"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<?php else: ?> | |
<div class="<?php echo $class; ?>"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<?php endif; | |
endfor; | |
else : | |
switch ($footer_column): | |
case 'third_sub_third': | |
?> | |
<div class="mk-col-1-3"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<div class="mk-col-2-3"> | |
<div class="mk-col-1-3"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<div class="mk-col-1-3"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<div class="mk-col-1-3"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
</div> | |
<?php | |
break; | |
case 'sub_third_third': | |
?> | |
<div class="mk-col-2-3"> | |
<div class="mk-col-1-3"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<div class="mk-col-1-3"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<div class="mk-col-1-3"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
</div> | |
<div class="mk-col-1-3"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<?php | |
break; | |
case 'third_sub_fourth': | |
?> | |
<div class="mk-col-1-3"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<div class="mk-col-2-3 last"> | |
<div class="mk-col-1-4"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<div class="mk-col-1-4"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<div class="mk-col-1-4"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<div class="mk-col-1-4"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
</div> | |
<?php | |
break; | |
case 'sub_fourth_third': | |
?> | |
<div class="mk-col-2-3"> | |
<div class="mk-col-1-4"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<div class="mk-col-1-4"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<div class="mk-col-1-4"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<div class="mk-col-1-4"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
</div> | |
<div class="mk-col-1-3"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<?php | |
break; | |
case 'half_sub_half': | |
?> | |
<div class="mk-col-1-2"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<div class="mk-col-1-2"> | |
<div class="mk-col-1-2"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<div class="mk-col-1-2"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
</div> | |
<?php | |
break; | |
case 'half_sub_third': | |
?> | |
<div class="mk-col-1-2"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<div class="mk-col-1-2"> | |
<div class="mk-col-1-3"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<div class="mk-col-1-3"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<div class="mk-col-1-3"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
</div> | |
<?php | |
break; | |
case 'sub_half_half': | |
?> | |
<div class="mk-col-1-2"> | |
<div class="mk-col-1-2"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<div class="mk-col-1-2"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
</div> | |
<div class="mk-col-1-2"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<?php | |
break; | |
case 'sub_third_half': | |
?> | |
<div class="mk-col-1-2"> | |
<div class="mk-col-1-3"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<div class="mk-col-1-3"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<div class="mk-col-1-3"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
</div> | |
<div class="mk-col-1-2"><?php mk_sidebar_generator('get_footer_sidebar'); ?></div> | |
<?php | |
break; | |
endswitch; | |
endif; ?> | |
<div class="clearboth"></div> | |
</div> | |
</div> | |
<div class="clearboth"></div> | |
<?php endif; ?> | |
<?php if ($mk_settings['sub-footer'] == true && $template != 'no-sub-footer' && $template != 'no-title-sub-footer') { ?> | |
<div id="sub-footer"> | |
<div class="mk-grid"> | |
<div class="item-holder"> | |
<span class="mk-footer-copyright"><?php echo stripslashes($mk_settings['footer-copyright']); ?></span> | |
<?php do_action('subfooter_social'); ?> | |
<?php do_action('subfooter_logos'); ?> | |
</div> | |
</div> | |
<div class="clearboth"></div> | |
</div> | |
<?php } ?> | |
</section> | |
<?php endif; ?> | |
</div><!-- End boxed layout --> | |
<a href="#" class="mk-go-top"><i class="mk-icon-angle-up"></i></a> | |
</div><!-- End Theme main Wrapper --> | |
<?php | |
do_action('side_dashboard'); | |
do_action('quick_contact'); | |
?> | |
<?php wp_footer(); ?> | |
<style> | |
._bulk_upload_frm input[type=submit] { | |
background-color: #1e73be !important; | |
border-color: #1e73be !important; | |
} | |
._bulk_upload_frm input[type=submit]:hover{ | |
opacity: 0.7; | |
} | |
</style> | |
<?php if ($mk_settings['custom-js']) : ?> | |
<script type="text/javascript"> | |
<?php echo stripslashes($mk_settings['custom-js']); ?> | |
</script> | |
<?php endif; | |
if ($mk_settings['google-analytics']) { | |
?> | |
<script type="text/javascript"> | |
var _gaq = _gaq || []; | |
_gaq.push(['_setAccount', '<?php echo stripslashes($mk_settings['google-analytics']); ?>']); | |
_gaq.push(['_trackPageview']); | |
(function () { | |
var ga = document.createElement('script'); | |
ga.type = 'text/javascript'; | |
ga.async = true; | |
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | |
var s = document.getElementsByTagName('script')[0]; | |
s.parentNode.insertBefore(ga, s); | |
})(); | |
</script> | |
<?php } ?> | |
<?php | |
if ($mk_settings['header-location'] == 'bottom') { | |
$header_padding_type = $mk_settings['sticky-header'] ? 'sticky-header' : 'none-sticky-header'; ?> | |
<div class="bottom-header-padding <?php echo $header_padding_type ?>"></div> | |
<?php | |
} | |
?> | |
</body> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css"> | |
<!-- <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script> --> | |
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script> | |
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script> | |
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script> | |
<!--<link rel="stylesheet" type="text/css" href="https://npmcdn.com/flatpickr/dist/themes/dark.css">--> | |
<script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"></script> | |
<script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/additional-methods.min.js"></script> | |
<script src="https://www.google.com/recaptcha/api.js" async defer></script> | |
<!--<script src="--><?php //echo get_stylesheet_directory_uri()?><!--/tbl-fixed-header.js"></script>--> | |
<div class="modal fade bulk-upload_modal" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> | |
<div class="modal-dialog modal-lg" role="document"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<h5 class="modal-title" id="exampleModalLabel">Bulk Upload</h5> | |
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | |
<span aria-hidden="true">×</span> | |
</button> | |
</div> | |
<div class="modal-body"> | |
<div class="_request_loader"><i class="fas fa-spinner fa-spin"></i></div> | |
<form id="fileUploadForm" action="<?php echo admin_url('admin-ajax.php'); ?>" method="post" enctype="multipart/form-data"> | |
<input type="hidden" value="ambi_upload_bulk_file" name="action"> | |
<input type="hidden" value="Submit" name="submit"> | |
<p class="text-center">Save time by bulk uploading multiple 360 participants in a single instance <a href="#" data-toggle="tooltip" data-placement="auto" title="Important: All CSV files should be comma delimited and double quote encased. If you are using special characters (including language characters foreign to English), please make sure that you use UTF-8 encoding before saving the file."><i class="fas fa-info-circle" style="color: #151515;"></i></a></p> | |
<div class="form-group"> | |
<div class="custom-file mb-3"> | |
<input type="file" name="csvFile" class="custom-file-input" id="customFile" aria-describedby="customFile"> | |
<label class="custom-file-label" for="customFile">Choose file</label> | |
</div> | |
<small class="form-text text-muted"><b>Sample file:</b> <a target="_blank" href="https://www.ambivista.com/wp-content/uploads/2020/01/bulk_upload_sample_file.csv" download="bulk_upload_sample_file.csv">Download</a></small> | |
<small class="form-text text-muted"><b>Template file:</b> <a target="_blank" href="https://www.ambivista.com/wp-content/uploads/2020/01/template_csv_file-5.csv" download="template_csv_file-5.csv">Download</a></small> | |
</div> | |
<input class="btn btn-success btn-block" id="_file_upload" type="submit" name="submit-btn" value="Submit"> | |
</form> | |
<div id="_response_table" style="display: none;"> | |
<div class="table-responsive"> | |
<table id="bulkDataTable" class="table table-bordered"> | |
</table> | |
</div> | |
<div class="row mt-3 justify-content-center"> | |
<div class="col-6 mb-2 width-49"> | |
<a id="bulkModalStep2Back" href="#" class="btn btn-secondary btn-block">Back</a> | |
</div> | |
<div class="col-6 mb-2 width-49"> | |
<a id="bulkModalStep2Next" href="#" class="btn btn-success ml-auto btn-block">Next</a> | |
</div> | |
</div> | |
</div> | |
<div id="_second_form" class="row justify-content-center" style="display: none;"> | |
<div class="col-md-12"> | |
<h4>Survey Campaign Customization</h4> | |
<form id="bulkUploadFourthForm" action="<?php echo admin_url('admin-ajax.php'); ?>" method="post" enctype="multipart/form-data" class="_bulk_upload_frm"> | |
<input type="hidden" name="csvFileURL"> | |
<input type="hidden" value="Save" name="submit"> | |
<input type="hidden" name="action" value="ambi_save_bulk_data"> | |
<h5>Time Frame</h5> | |
<div class="form-row"> | |
<div class="form-group col-md-6"> | |
<label for="requestedLaunchDate">Requested Launch Date <span class="text-danger">*</span></label> | |
<input id="requestedLaunchDate" type="date" class="form-control" name="requestedLaunchDate" required> | |
</div> | |
</div> | |
<div class="form-row align-items-end"> | |
<div class="form-group col-md-6"> | |
<label>Requested Close Date <span class="text-danger">*</span></label> | |
<input id="reminderDate" type="date" class="form-control" name="reminderDate" style="display: none"> | |
<input id="finalReminderDate" type="date" class="form-control" name="finalReminderDate" style="display: none"> | |
<input id="requestedCloseDate" type="date" class="form-control" name="requestedCloseDate" required> | |
<input id="reportDueDate" type="date" class="form-control" name="reportDueDate" style="display: none"> | |
<input id="summaryReportDueDate" type="date" class="form-control" name="summaryReportDueDate" style="display: none"> | |
</div> | |
<div class="col-md-6"> | |
<div class="form-group"> | |
<div class=" pb-2"> | |
<input type="checkbox" class="" id="customCloseDateCheckbox" name="customCloseDateCheckbox"> | |
<label class="-label" for="customCloseDateCheckbox">Custom Close Date</label> | |
</div> | |
</div> | |
</div> | |
</div> | |
<h5>Branding Options</h5> | |
<div class="form-group"> | |
<label>Add Survey Logo</label> | |
<p> | |
<small>Upload a logo to be used as the header of your survey</small> | |
</p> | |
<input type="file" name="surveyLogo"> | |
<p class="form-text text-muted mb-0"> | |
<small>Recommended size: 2 MB (max)</small> | |
</p> | |
<p class="form-text text-muted"> | |
<small>Download sample image (1366 x 300)</small> | |
<a href="https://www.ambivista.com/wp-content/uploads/2019/12/Sample-Logo-Header.jpeg">Sample Image</a></p> | |
</div> | |
<div class="form-group"> | |
<label>Add Report Logo</label> | |
<p> | |
<small>Upload a logo to be used as the header of your report</small> | |
</p> | |
<input type="file" name="reportLogo"> | |
<p class="form-text text-muted mb-0"> | |
<small>Recommended size: 2 MB (max)</small> | |
</p> | |
<p class="form-text text-muted"> | |
<small>Download sample image (1366 x 300)</small> | |
<a href="https://www.ambivista.com/wp-content/uploads/2019/12/Sample-Logo-Header.jpeg">Sample Image</a></p> | |
</div> | |
<div class="form-group"> | |
<label>Normative Data</label> | |
<div> | |
<div class=" -inline"> | |
<input type="radio" id="standardNormativeData" name="normativeData" class="" value="Standard"> | |
<label class="-label" for="standardNormativeData">Standard</label> | |
</div> | |
<div class=" -inline"> | |
<input type="radio" id="customNormativeData" name="normativeData" class="" value="Custom"> | |
<label class="-label" for="customNormativeData">Custom</label> | |
</div> | |
</div> | |
</div> | |
<div class="normativeDataToggle form-group" style="display: none"> | |
<label class="d-block">Some Information</label> | |
<input type="file" name="normativeDataFile"> | |
</div> | |
<div class="form-group"> | |
<label>Data Redaction</label> | |
<div> | |
<div class=" -inline"> | |
<input type="radio" id="standardDataRedaction" name="dataRedaction" class="" value="Standard redaction"> | |
<label class="-label" for="standardDataRedaction">Standard redaction</label> | |
</div> | |
<div class=" -inline"> | |
<input type="radio" id="limitedDataRedaction" name="dataRedaction" class="" value="Limited redaction"> | |
<label class="-label" for="limitedDataRedaction">Limited redaction</label> | |
</div> | |
<div class=" -inline"> | |
<input type="radio" id="noDataRedaction" name="dataRedaction" class="" value="No redaction"> | |
<label class="-label" for="noDataRedaction">No redaction</label> | |
</div> | |
</div> | |
</div> | |
<div class="form-group"> | |
<label>Correspondence</label> | |
<div> | |
<div class=" -inline"> | |
<input type="radio" id="standardCorrespondence" name="correspondence" class="" value="Standard"> | |
<label class="-label" for="standardCorrespondence">Standard</label> | |
</div> | |
<div class=" -inline"> | |
<input type="radio" id="customCorrespondence" name="correspondence" class="" value="Custom"> | |
<label class="-label" for="customCorrespondence">Custom</label> | |
</div> | |
</div> | |
</div> | |
<div class="correspondenceToggle form-group" style="display: none;"> | |
<label>Add Custom Correspondence</label> | |
<p> | |
<small>Upload a custom correspondence document to be used to communicate with your raters.</small> | |
</p> | |
<input type="file" name="correspondenceFile"> | |
<p class="form-text text-muted mb-0"> | |
<small>Recommended size: 2 MB (max)</small> | |
</p> | |
</div> | |
<div class="form-group"> | |
<label>Report Options</label> | |
<div class=" "> | |
<input type="checkbox" class="" id="reportOptions" name="reportOptions" value="Request summary report"> | |
<label class="-label" for="reportOptions">Request summary report</label> | |
</div> | |
</div> | |
<div class="form-group"> | |
<label>Additional Options</label> | |
<div class=" "> | |
<input type="checkbox" class="" id="additionalInformationCheck" name="additionalInformationCheck" value="additional information"> | |
<label class="-label" for="additionalInformationCheck">Add additional information (optional)</label> | |
</div> | |
</div> | |
<div class="additionalInstructionsToggle form-group" style="display: none"> | |
<label>Additional Instructions</label> | |
<textarea rows="5" class="form-control" name="additionalInstructions"></textarea> | |
</div> | |
<div class="row"> | |
<div class="col-md-12"> | |
<div class="g-recaptcha mb-2" data-sitekey="6LeSqsgUAAAAAKMOh4h4zGa_n3hL7OIW6kQuKyIX" data-callback="recaptchaCallback"></div> | |
<!-- <input type="hidden" class="hiddenRecaptcha required" name="hiddenRecaptcha" id="hiddenRecaptcha">--> | |
</div> | |
</div> | |
<div class="row justify-content-center"> | |
<div class="col-6 width-49"> | |
<a id="bulkModalStep3Back" href="#" class="btn btn-secondary btn-block">Cancel</a> | |
</div> | |
<div class="col-6 width-49"> | |
<input type="hidden" value="false" id="_buck_upload_confirmation"> | |
<input type="hidden" value="New Bulk 360 Confirmation for" name="emailSubject"> | |
<input class="btn btn-success ml-auto btn-block" id="_bulk_form_f_submit" type="submit" name="submit-btn" value="Submit" disabled> | |
</div> | |
</div> | |
</form> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
<!--Confermation modal--> | |
<div class="modal fade" id="_confirm_modal_box" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> | |
<div class="modal-dialog" role="document"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<h5 class="modal-title" id="exampleModalLabel">Confirmation</h5> | |
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | |
<span aria-hidden="true">×</span> | |
</button> | |
</div> | |
<div class="modal-body"> | |
<p style="font-size: 16px;">I confirm that the submitted information is accurate and any changes post-submission may be subject to an additional fee.</p> | |
</div> | |
<div class="modal-footer"> | |
<button type="button" class="btn btn-secondary" id="_cancel_confirm">Cancel</button> | |
<button type="button" class="btn btn-primary" id="confirm_submition">Confirm</button> | |
</div> | |
</div> | |
</div> | |
</div> | |
<script type="text/javascript"> | |
function messageAlert(type, msg) { | |
jQuery('.bulk-upload_modal .modal-body').prepend('<div class="alert alert-' + type + '">' + msg + '</div>'); | |
setTimeout(function () { | |
jQuery('.bulk-upload_modal .modal-body').find('.alert').remove(); | |
}, 3000) | |
} | |
jQuery(document).ready(function ($) { | |
$(document).on('click', '#bulk-upload-entry', function (e) { | |
e.preventDefault(); | |
}) | |
}); | |
jQuery(document).ready(function ($) { | |
$(document).on('submit', '#fileUploadForm', function (e) { | |
e.preventDefault(); | |
var formData = new FormData($(this)[0]); | |
var ajaxurl = $(this).attr('action'); | |
//console.log(); | |
$('._request_loader').addClass('active'); | |
jQuery.ajax({ | |
url: ajaxurl, | |
data: formData, | |
contentType: false, | |
processData: false, | |
method: 'POST', | |
cache: false, | |
dataType: "JSON", | |
success: function (res) { | |
if (res['type'] === "success") { | |
$('#fileUploadForm').hide(); | |
$('#_response_table').show(); | |
var rows = res.data; | |
var blk_form = ''; | |
rows.forEach(function (item, index) { | |
if(index == 0){ | |
// blk_form += '<thead>'; | |
blk_form += '<tr>'; | |
blk_form += '<td>'; | |
blk_form += '<a href="#" class="_scroll_up">'; | |
blk_form += '</td>'; | |
} | |
if((index > 0) && (index < rows.length)){ | |
blk_form += '<td>'; | |
blk_form += index; | |
blk_form += '</td>'; | |
} | |
item.forEach(function (item, index) { | |
blk_form += '<td>'; | |
blk_form += item; | |
blk_form += '</td>'; | |
}); | |
blk_form += '</tr>'; | |
if(index == 0){ | |
// blk_form += '</thead>'; | |
} | |
}); | |
// blk_form += '<tr><td><a href="#" class="_scroll_up"></td><td colspan="100"></td ></tr>'; | |
$('#bulkDataTable').append(blk_form); | |
console.log(res.scanMessage); | |
// $("#bulkDataTable").fixedtableheader(); | |
$(document).find('[name="csvFileURL"]').val(res['fileURL']) | |
} else { | |
messageAlert(res.type, res.message); | |
} | |
$('._request_loader').removeClass('active'); | |
}, | |
error: function (e) { | |
console.log("ERROR : ", e); | |
$('._request_loader').removeClass('active'); | |
} | |
}); | |
}); | |
$(document).on('submit', '#bulkUploadFourthForm', function (e) { | |
e.preventDefault(); | |
var formData = new FormData($(this)[0]); | |
var ajaxurl = $(this).attr('action'); | |
if($('#_buck_upload_confirmation').val() == 'false'){ | |
$('#_confirm_modal_box').modal('show'); | |
$('#_confirm_modal_box').show(); | |
}else { | |
$('._request_loader').addClass('active'); | |
jQuery.ajax({ | |
url: ajaxurl, | |
data: formData, | |
contentType: false, | |
processData: false, | |
method: 'POST', | |
cache: false, | |
dataType: "JSON", | |
success: function (res) { | |
console.log("SUCCESS : ", res); | |
console.log("data.type : ", res.type); | |
if (res['type'] === "success") { | |
messageAlert(res.type, 'CSV Data Successfully Submitted.'); | |
$('#exampleModal').modal('hide'); | |
// window.location.replace("https://www.ambivista.com/bulk-upload-thank-you-page/"); | |
}else{ | |
messageAlert(res.type, res.message); | |
} | |
$('._request_loader').removeClass('active'); | |
}, | |
error: function (e) { | |
console.log("ERROR : ", e); | |
$('._request_loader').removeClass('active'); | |
} | |
}); | |
} | |
}); | |
$('#bulkModalStep2Back').on('click', function () { | |
$('#fileUploadForm').show(); | |
$('#_response_table').hide(); | |
$('#_second_form').hide(); | |
$('#customFile').val(''); | |
$('.custom-file-label').text(''); | |
$("#_response_table table").empty(); | |
}); | |
$('#bulkModalStep2Next').on('click', function () { | |
$('#fileUploadForm').hide(); | |
$('#_response_table').hide(); | |
$('#_second_form').show(); | |
}); | |
$('#bulkModalStep3Back').on('click', function () { | |
$('#fileUploadForm').hide(); | |
$('#_response_table').show(); | |
$('#_second_form').hide(); | |
}); | |
$('#exampleModal').on('hidden.bs.modal', function () { | |
$("#_response_table table").empty(); | |
}); | |
}); | |
</script> | |
<script> | |
jQuery(document).ready(function ($) { | |
var reminder_date = flatpickr("#reminderDate", { | |
altFormat: "F j, Y", | |
dateFormat: "Y-m-d" | |
}); | |
var final_reminder_date = flatpickr("#finalReminderDate", { | |
altFormat: "F j, Y", | |
dateFormat: "Y-m-d" | |
}); | |
var reportDueDate = flatpickr("#reportDueDate", { | |
altFormat: "F j, Y", | |
dateFormat: "Y-m-d" | |
}); | |
var summaryReportDueDate = flatpickr("#summaryReportDueDate", { | |
altFormat: "F j, Y", | |
dateFormat: "Y-m-d" | |
}); | |
// $('#requestedCloseDate').on("change paste keyup", function() { | |
// $('#requestedCloseDate').trigger("change"); | |
// }); | |
var close_date = flatpickr("#requestedCloseDate", { | |
altFormat: "F j, Y", | |
dateFormat: "Y-m-d", | |
"disable": [ | |
function(date) { | |
// return true to disable | |
return (date.getDay() === 0 || date.getDay() === 6); | |
} | |
], | |
"locale": { | |
"firstDayOfWeek": 1 // start week on Monday | |
}, | |
onChange: function (selectedDates, dateStr, instance) { | |
close_date.set("minDate", selectedDates); | |
var date_arr = dateStr.split("-"); | |
var y = parseInt(date_arr[0]); | |
var m = parseInt(date_arr[1]); | |
var d = parseInt(date_arr[2]); | |
var new_date = new Date(y, m - 1, d + 1); | |
reportDueDate.setDate(new_date); | |
summaryReportDueDate.setDate(new Date(y, m - 1, d + 1)); | |
final_reminder_date.setDate(new Date(y, m - 1, d - 3)); | |
} | |
}); | |
var lanch_date = flatpickr("#requestedLaunchDate", { | |
"disable": [ | |
function(date) { | |
// return true to disable | |
return (date.getDay() === 0 || date.getDay() === 6); | |
} | |
], | |
"locale": { | |
"firstDayOfWeek": 1 // start week on Monday | |
}, | |
onChange: function (selectedDates, dateStr, instance) { | |
close_date.set("minDate", selectedDates); | |
var date_arr = dateStr.split("-"); | |
var y = parseInt(date_arr[0]); | |
var m = parseInt(date_arr[1]); | |
var d = parseInt(date_arr[2]); | |
var new_date = new Date(y, m - 1, d +20); | |
do { | |
new_date.setDate(new_date.getDate() + 1) | |
} while(new_date.getDay() == 0 ); | |
close_date.setDate(new_date); | |
summaryReportDueDate.setDate(new Date(y, m - 1, d +21)); | |
final_reminder_date.setDate(new Date(y, m - 1, d +17)); | |
reminder_date.setDate(new Date(y, m - 1, d + 5)); | |
// $('#requestedCloseDate').trigger("change"); | |
} | |
}); | |
$('#additionalInformationCheck').on('change', function () { | |
if ($(this).is(':checked')) { | |
$('.additionalInstructionsToggle').fadeIn() | |
} else { | |
$('.additionalInstructionsToggle').hide() | |
} | |
}); | |
$('[name="correspondence"]').on('change', function () { | |
if ($(this).val() === 'Custom') { | |
$('.correspondenceToggle').fadeIn() | |
} else { | |
$('.correspondenceToggle').hide() | |
} | |
}); | |
$('[name="normativeData"]').on('change', function () { | |
if ($(this).val() === 'Custom') { | |
$('.normativeDataToggle').fadeIn() | |
} else { | |
$('.normativeDataToggle').hide() | |
} | |
}); | |
// $('input#requestedCloseDate').attr('disabled', 'disabled'); | |
$('input#requestedCloseDate').addClass('disable'); | |
$('input#customCloseDateCheckbox').change(function () { | |
// if ($(this).prop("checked") == true) { | |
// $('input#requestedCloseDate').attr('disabled', false); | |
// } else { | |
// $('input#requestedCloseDate').attr('disabled', 'disabled'); | |
// } | |
$('input#requestedCloseDate').toggleClass('disable'); | |
}); | |
$.validator.addMethod('filesize', function (value, element, param) { | |
return this.optional(element) || (element.files[0].size <= param) | |
}, 'File size must be less than 2MB'); | |
$(document).find('._bulk_upload_frm').validate({ | |
rules: { | |
surveyLogo: { | |
required: false, | |
extension: "jpeg|png|jpg", | |
filesize: 2000000 | |
}, | |
reportLogo: { | |
required: false, | |
extension: "jpeg|png|jpg", | |
filesize: 2000000 | |
}, | |
normativeDataFile: { | |
required: false, | |
extension: "csv|xls" | |
}, | |
correspondenceFile: { | |
required: false, | |
extension: "csv|xls|doc|docx" | |
} | |
} | |
}); | |
$("#fileUploadForm").validate({ | |
rules: { | |
csvFile: { | |
required: true, | |
extension: "csv", | |
filesize: 2000000 | |
} | |
}, | |
messages: { | |
csvFile: { | |
extension: "Please upload a valid import file.", | |
}, | |
} | |
}); | |
$('#exampleModal').on('hidden.bs.modal', function (e) { | |
e.preventDefault(); | |
$('#_response_table,#_second_form').hide(); | |
$('#fileUploadForm').show(); | |
}); | |
$('#customFile').on('change', function (e) { | |
var fileName = e.target.files[0].name; | |
$(this).siblings('.custom-file-label').text(fileName); | |
}); | |
$('[data-toggle="tooltip"]').tooltip(); | |
$(document).on('click', '#gform_2 #gform_submit_button_2', function (e) { | |
if($('#input_2_65').val() == 'false'){ | |
$('#_confirm_modal_box').modal('show'); | |
e.preventDefault(); | |
} | |
}); | |
$(document).on('click','#confirm_submition', function () { | |
$('#input_2_65').val('true'); | |
$('#_buck_upload_confirmation').val('true'); | |
if($('#exampleModal').hasClass('show')){ | |
$('#bulkUploadFourthForm').submit(); | |
$('#_confirm_modal_box').modal('hide'); | |
}else{ | |
$('#gform_2').submit(); | |
} | |
}); | |
$(document).on('click', '#_cancel_confirm',function () { | |
if($('#exampleModal').hasClass('show')) { | |
$('#_confirm_modal_box').hide(); | |
// alert('test'); | |
// $('body').addClass('modal-open'); | |
} | |
}) | |
}); | |
function recaptchaCallback() { | |
// alert('welcome'); | |
jQuery('#_bulk_form_f_submit').attr("disabled", false); | |
}; | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment