<commit_before>/**
 * 
 */
$(document).ready(function(){
$(".edit_payer").live("click",function(){
	my_id = this.id.split("_");
	form_data ={
	payer_id: my_id[1],
	tour_id: my_id[2],
	ajax: 1
	};
	$.ajax({
		type:"get",
		data: form_data,
		url: base_url + "payer/edit",
		success: function(data){
			show_popup("Edit Tour for Payer",data, "auto");
		}
	});
	
	
});


/*
 * change the hidden value of the payment type based on changes to a dropdown
 * in the payer editor. 
 */
$(".change_payment_type").live("change",function(){
	my_id = $("#tour_id").val();
	my_type = $(this).val();
	
	form_data = {
			tour_id: my_id,
			field: my_type,
			ajax: 1
	};
	$.ajax({
		type: "get",
		url: base_url + "tour/get_value",
		data: form_data,
		success: function(data){
			$("#tour_price").val(data);
			$("#tour_price_display").html(data);
			total_cost = calculate_cost(1);
		}
	});
	
});

$(".change_room_size").live("change",function(){
	my_id = $("#tour_id").val();
	amt_paid = $("#amt_paid").val().valueOf();
	my_type = $(this).val();
	my_format = "int";
	
	form_data = {
			tour_id: my_id,
			field: my_type,
			ajax: 1
	};
	$.ajax({
		type: "get",
		url: base_url + "tour/get_value",
		data: form_data,
		success: function(data){
			$("#room_rate").val(data);
			$("#room_rate_display").html(data);
			total_cost = calculate_cost(1);
		}
	});
	
});



$("input.edit_payer_amounts").live("blur",function(){
calculate_cost(1);	
});



$('#tourist-dropdown').live('keyup', function(event) {
	var person_search = this.value;
	if (person_search.length > 2 && person_search != "find person") {
		search_words = person_search.split(' ');
		my_name = search_words.join('%') + "%";
		 my_payer = "";
		  my_tour = "";
		if($("#tour_id") && $("#payer_id")){
			my_tour = $("#tour_id").val();
		my_payer = $("#payer_id").val();
		}
		var form_data = {
			ajax: 1,
			name: my_name,
			tour_id : my_tour,
			payer_id: my_payer
		};
		$.ajax({
			url: base_url + "tourist/find_by_name",
			type: 'GET',
			data: form_data,
			success: function(data){
				//remove the search_list because we don't want to have a ton of them. 

				$("#search_list").css({"z-index": 10000}).html(data).position({
					my: "left top",
					at: "left bottom",
					of: $("#tourist-dropdown"), 
					collision: "fit"
				}).show();
		}
		});
	}else{
		$("#search_list").hide();
    	$("#search_list").css({"left": 0, "top": 0});


	}
});// end person_search.keyup

/*
 * "target" in this scriptlet identifies the format of the output from tourist/insert
 * in this case payer returns a list of tourists for a given payer. 
 */

$(".select_for_tour").live("click", function(){
	my_id = this.id.split("_");
	my_person = my_id[1];
	my_payer = my_id[2];
	my_tour = my_id[3];
	$("#search_list").hide();
<commit_msg>Minor adjustments to manage payer information. <commit_after>/**
 * 
 */
$(document).ready(function(){
$(".edit-payer").live("click",function(){
	my_id = this.id.split("_");
	form_data ={
	payer_id: my_id[1],
	tour_id: my_id[2],
	ajax: 1
	};
	$.ajax({
		type:"get",
		data: form_data,
		url: base_url + "payer/edit",
		success: function(data){
			show_popup("Edit Tour for Payer",data, "auto");
		}
	});
	
	
});


/*
 * change the hidden value of the payment type based on changes to a dropdown
 * in the payer editor. 
 */
$(".change_payment_type").live("change",function(){
	my_id = $("#tour_id").val();
	my_type = $(this).val();
	
	form_data = {
			tour_id: my_id,
			field: my_type,
			ajax: 1
	};
	$.ajax({
		type: "get",
		url: base_url + "tour/get_value",
		data: form_data,
		success: function(data){
			$("#tour_price").val(data);
			$("#tour_price_display").html(data);
			total_cost = calculate_cost(1);
		}
	});
	
});

$(".change_room_size").live("change",function(){
	my_id = $("#tour_id").val();
	amt_paid = $("#amt_paid").val().valueOf();
	my_type = $(this).val();
	my_format = "int";
	
	form_data = {
			tour_id: my_id,
			field: my_type,
			ajax: 1
	};
	$.ajax({
		type: "get",
		url: base_url + "tour/get_value",
		data: form_data,
		success: function(data){
			$("#room_rate").val(data);
			$("#room_rate_display").html(data);
			total_cost = calculate_cost(1);
		}
	});
	
});



$("input.edit-payer-amounts").live("blur",function(){
calculate_cost(1);	
});



$('#tourist-dropdown').live('keyup', function(event) {
	var person_search = this.value;
	if (person_search.length > 2 && person_search != "find person") {
		search_words = person_search.split(' ');
		my_name = search_words.join('%') + "%";
		 my_payer = "";
		  my_tour = "";
		if($("#tour_id") && $("#payer_id")){
			my_tour = $("#tour_id").val();
		my_payer = $("#payer_id").val();
		}
		var form_data = {
			ajax: 1,
			name: my_name,
			tour_id : my_tour,
			payer_id: my_payer
		};
		$.ajax({
			url: base_url + "tourist/find_by_name",
			type: 'GET',
			data: form_data,
			success: function(data){
				//remove the search_list because we don't want to have a ton of them. 
if(data.length > 0){
				$("#search_list").css({"z-index": 10000}).html(data).position({
					my: "left top",
					at: "left bottom",
					of: $("#tourist-dropdown"), 
					collision: "fit"
				}).show();
			}
		}
		});
	}else{
		$("#search_list").hide();
    	$("#search_list").css({"left": 0, "top": 0});


	}
});// end person_search.keyup




$('#tourist-dropdown').live('blur', function(event) {
	$("#search_list").fadeOut();
});



/*
 * "target" in this scriptlet identifies the format of the output from tourist/insert
 * in this case payer returns a list of tourists for a given payer. 
 */

$(".select_for_tour").live("click", function(){
	my_id = this.id.split("_");
	my_person = my_id[1];
	my_payer = my_id[2];
	my_tour = my_id[3];
	$("#search_list").hide();

{'fraction_non_alphanumeric': 0.21447345365340809, 'fraction_numerical': 0.007184159803749781, 'mean_word_length': 3.744804655029094, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1814289', 'n_tokens_mistral': 2473, 'n_tokens_neox': 2177, 'n_words': 441}