Location: PHPKode > scripts > ezStats for PlayStation Network > ezStats2_psn/admin/templates/updateplayer.html
<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
		(function($) {
			$.extend({
				update_player: function() {
					var node = $('#updatenotes > div');
					
					// AJAX starten
					$.ajax({
						type:     "POST",
						url:      "update.php",
						dataType: "json",
						data: {
							request: "admin",
						},
						beforeSend: function () {
							node.eq("0").hide();
							node.eq("1").show();
							node.eq("2").hide();
						},
						error: function(data) {
							if (data && data.responseText)
								$('aside').text("").html(data.responseText).fadeIn();
						},
						success: function(data) {
							// Ergebnis ausgeben
							if (data && data.message) {
								node.eq("1").hide();
								node.eq("2").html(data.message).fadeIn();
							}
							if (data && data.time) {
								$('#updateplayer span').text(data.time).fadeIn();
							}
							
							// Spieleruebersicht aktualisieren, falls Funktion geladen wurde
							if (typeof $.load_player() == "function") $.load_player();
						}
					});
				}, 
				
				save_settings: function(elem) {
					// AJAX starten
					$.ajax({
						type:     "POST",
						url:      "action.php",
						dataType: "json",
						data: {
							action: "settings",
							sid:    "$sid",
							input:  {
								name: elem.attr("name"),
								value:  elem.val()
							}
						},
						beforeSend: function() {
							$('aside').stop(true, true).hide().text('%saving% ...').fadeIn();
						},
						error: function(data) {
							if (data && data.responseText)
								$('aside').text("").html(data.responseText).fadeIn();
						},
						success:    function(data) {
							if (data && data.message) 
								 $('aside').text(data.message);
							else $('aside').fadeOut();
							
							// Weiterleiten, falls Parameter uebergeben wurde
							if (data && data.href) document.location.href = data.href;
						}
					});
				}
			});
		})(jQuery);
		
		$('#updateplayer .button').click(function(e) {
			e.preventDefault();
			$.update_player();
		});
		
		$('#updatecount').bind("keyup change", function(e) {
			$.save_settings($(this));
		});
	});
</script>

<article id="updateplayer">
	<h1>%update_player%</h1>
	<ul>
		<li>
			<a href="update_player" class="button">%update_now%</a>
			<legend style="margin: 0">%lastupdate%: <span>$lastcheckall</span></legend>
		</li>
		<li>&nbsp;</li>
		<li>
			<input class="fleft" type="text" size="3" name="updatecount" id="updatecount" value="$var->updatecount" /> 
			<legend style="margin: 0">&nbsp;&nbsp;&nbsp;%updatecount%</legend>
		</li>
	</ul>
</article>


<article id="updatenotes">
	<h2>&nbsp;</h2>
	<div>
		<p>%update_help_1% <a href="http://www.setcronjob.com">setcronjob.com</a>.</p>
		<p>%update_help_2% [<a href="update.php">%update_help_3%</a>]</p>
	</div>
	</div>
	<div class="hidden">
		<div class="bigloader"></div>
		<p>&nbsp;</p><p>$message</p>
	</div>
	<div></div>
</article>

<div class="clear"></div>
Return current item: ezStats for PlayStation Network