Projekt

Allgemein

Profil

GX-Bug #41120 » GMCallbackService.js

Moritz Bunjes, 06.01.2015 12:10

 
1
/* GMCallbackService.js <?php
2
#   --------------------------------------------------------------
3
#   GMCallbackService.js 2015-01-06 gambio
4
#   Gambio GmbH
5
#   http://www.gambio.de
6
#   Copyright (c) 2015 Gambio GmbH
7
#   Released under the GNU General Public License (Version 2)
8
#   [http://www.gnu.org/licenses/gpl-2.0.html]
9
#   --------------------------------------------------------------
10
?>*/
11
/*<?php
12
if($GLOBALS['coo_debugger']->is_enabled('uncompressed_js') == false)
13
{
14
?>*/
15
var gm_callback_service=new GMCallbackService();function GMCallbackService(){this.check_callback=function(){$('#gm_callback_service_error_message').load('request_port.php?module=CallbackService&action=check&name='+escape($('#gm_callback_service_name').val())+'&telephone='+escape($('#gm_callback_service_telephone').val())+'&vvcode='+$('#vvcode').val()+'&recaptcha_response_field='+encodeURI($('#recaptcha_response_field').val())+'&recaptcha_challenge_field='+encodeURI($('#recaptcha_challenge_field').val())+'&XTCsid='+gm_session_id,function(errors){if(errors=='')gm_callback_service.send_form();else{$('#gm_callback_service_error_message').html(errors);try{Recaptcha.reload()}catch(e){$('#vvcode').val('');$('#vvcode_image').attr('src','request_port.php?rand='+Math.random()+'&module=CreateVVCode&XTCsid='+gm_session_id)}}})};this.send_form=function(){jQuery.ajax({data:$('#gm_callback_service_form').serialize(),url:'request_port.php?module=CallbackService&action=send&XTCsid='+gm_session_id,type:"POST",success:function(sent_success){$("#gm_callback_service_success").html(sent_success)}})};}$(document).ready(function(){$("#gm_callback_service_send").click(function(){gm_callback_service.check_callback();return false})});
16
/*<?php
17
}
18
else
19
{
20
?>*/
21
var gm_callback_service = new GMCallbackService();
22

    
23
function GMCallbackService(){
24

    
25
	this.check_callback = function(){
26
		$('#gm_callback_service_error_message').load('request_port.php?module=CallbackService&action=check'
27
																		+ '&name=' + escape($('#gm_callback_service_name').val())
28
																		+ '&telephone=' + escape($('#gm_callback_service_telephone').val())
29
																		+ '&vvcode=' + $('#vvcode').val()
30
																		+ '&recaptcha_response_field=' +  encodeURI($('#recaptcha_response_field').val())
31
																		+ '&recaptcha_challenge_field=' + encodeURI($('#recaptcha_challenge_field').val())
32
																		+ '&XTCsid=' + gm_session_id,
33
				function(errors){
34
					if(errors == '') gm_callback_service.send_form();
35
					else
36
					{
37
						$('#gm_callback_service_error_message').html(errors);
38
						try
39
						{
40
							Recaptcha.reload();
41
						}
42
						catch (e)
43
						{
44
							$('#vvcode').val('');
45
							$('#vvcode_image').attr('src', 'request_port.php?rand=' + Math.random() + '&module=CreateVVCode&XTCsid=' + gm_session_id);
46
						}
47
					}
48
				}
49
		);
50
	}
51

    
52
	this.send_form = function(){
53
		jQuery.ajax({
54
			data: 		$('#gm_callback_service_form').serialize(),
55
			url: 		'request_port.php?module=CallbackService&action=send&XTCsid=' + gm_session_id,
56
			type: 		"POST",
57
			success: 	function(sent_success) 
58
						{
59
							$("#gm_callback_service_success").html(sent_success);
60
						}
61
		});
62
	}
63
}
64

    
65
$(document).ready(function()
66
{
67
	$("#gm_callback_service_send").click(function()
68
	{
69
		gm_callback_service.check_callback();
70
		return false;
71
	});
72
});
73
/*<?php
74
}
75
?>*/
    (1-1/1)