<div class="span5">
	<fieldset>
		<legend>Service Details</legend>

		<div class="dl-horizontal">
			<dt>DN</dt>
			<dd><?php echo $o->dn(); ?></dd>

			<dt>Serial Number</dt>
			<dd><?php echo $o->serial(); ?></dd>

			<dt>Subject Key Id</dt>
			<dd><?php echo $o->ski(); ?></dd>

			<dt>Issuer</dt>
			<dd>
				<?php if ($o->validCA() AND $o->authorised($o->ca)) : ?>
				<?php echo HTML::anchor(URL::link('reseller','ssl/edit/').$o->ca->id,$o->issuer()); ?>
				<?php else : ?>
				<?php echo $o->issuer(); ?>
				<?php endif ?>
			</dd>

			<dt>Issuer Serial</dt>
			<dd><?php printf('%s (%s)',$o->aki_keyid(), $o->aki_serial()); ?></dd>

			<dt>Valid From</dt>
			<dd><?php echo $o->valid_from(TRUE); ?></dd>

			<dt>Valid To</dt>
			<dd><?php echo $o->valid_to(TRUE); ?></dd>

			<dt>Hash</dt>
			<dd><?php echo $o->hash(); ?></dd>

			<dt>Version</dt>
			<dd><?php echo $o->version(); ?></dd>

			<dt>Algorithm</dt>
			<dd><?php echo $o->algorithm(); ?></dd>

		</div> <!-- dl-horizontal -->
	</fieldset>
</div> <!-- /span -->

<div class="span6">
	<fieldset>
		<legend>Certificate</legend>

		<pre><?php echo $o->cert; ?></pre>

		<?php
			echo $o->download_button(); 
			if ($ao=Auth::instance()->get_user() AND ($ao->isAdmin() OR $ao->isReseller()) AND $o->service->status AND ($o->valid_to()-(Kohana::$config->load('ssl.min_renew_days')*86400) <= time()) AND $o->service->paid_to() > time()) :
				echo Form::open(URL::link('reseller','ssl/renew/'.$o->service->id));
				echo Form::button('submit','Renew',array('class'=>'btn btn-primary'));
			endif
		?>
	</fieldset>
</div> <!-- /span -->
