<!--S:Main-->

	<style>

		.updates-holder {
			background: #e1e1e1;
		}

		.updates-holder .updates-info {
			padding: 20px;
		}

		.updates-holder .updates-info p{
			margin-bottom: 20px;
		}

		.updates-holder .updates-info h3{
			margin-bottom: 20px;
			font-size: 20px;
		}

		.updates-holder .update-status{
			white-space: pre;
			font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;
			background: #000;
			color: #fff;
			padding:10px;
			height: 400px;
			overflow-y: scroll;
  		}
	</style>

	<script>
		$(document).ready(function() {

			
			var ajaxForm;

			function UpdateStatus() {

				var skip = arguments[0];

				if (typeof skip != "undefined" ){
					var link = "ajax.php?mod=statusquo&sub=update-status&skip=true";
				} else {
					var link = "ajax.php?mod=statusquo&sub=update-status";
				}


				ajaxForm = $.ajax({
					url: link,
					type:"get"
				}).done(function(msg){
					ajaxForm = false;

					if ( msg.indexOf("[done]") != -1 ) {

						msg = msg.replace("[done]" , "");

						$("#status").html( $("#status").text() + "\n" + msg + "\n" + "Update process completed successfully.\n\nRefresh the window to reload the administration panel." );
						$("#status").animate({ scrollTop: $("#status")[0].scrollHeight}, 100);

					} else {

						if ( msg != "") {
							$("#status").html( $("#status").text() + "\n" + msg );
							$("#status").animate({ scrollTop: $("#status")[0].scrollHeight}, 100);
						}

						//run update again
						UpdateStatus();
					}
				}).fail(function(xhr , textStatus , errorThrown) {

					$("#status").html( $("#status").text() + "\n" + "Error installing/updating previous module." );
					$("#status").animate({ scrollTop: $("#status")[0].scrollHeight}, 100);
					//treat proper error messages, so we are going to skip the update of the current module
					UpdateStatus(true);
				});

			} UpdateStatus();


		});

	</script>

	<div class="updates-holder">
		<div class="row">
			<div class="col-md-8">
				<div class="update-status" id="status">[{DATE}] Starting update process...</div>
			</div>

			<div class="col-md-4">
				<div class="updates-info">
					<h3>Important</h3>

					<p>Keep this window open until the update process has completed successfully.</p>

					<p>If you encounter any errors, we recommend that you open a support ticket from your account.</p>

					<p>Don't panic, we'll fix it ASAP!</p>

					<p><a href="http://devsaver.com" target="_blank">http://devsaver.com</a></p>
				</div>
			</div>

			<div class="clear"></div>
		</div>
	</div>
<!--E:Main-->