<div class="span6">
	<fieldset>
		<legend>ADSL Plan Details</legend>

		<div class="row">
			<div class="tabbable span5">
				<ul class="nav nav-tabs">
					<li class="active"><a href="#tab1" data-toggle="tab">Peak</a></li>
					<li><a href="#tab2" data-toggle="tab">Offpeak</a></li>
				</ul>

				<div class="tab-content">
					<div class="tab-pane active" id="tab1">

						<div class="row">
							<div class="span2">
								<?php echo Form::input('base_down_peak',$o->base_down_peak,array('label'=>'Base Down','class'=>'span1')); ?>
							</div>
							<div class="span2">
								<?php echo Form::input('extra_down_peak',$o->extra_down_peak,array('label'=>'Extra','class'=>'span1')); ?>
							</div>
						</div>

						<div class="row">
							<div class="span2">
								<?php echo Form::input('base_up_peak',$o->base_up_peak,array('label'=>'Base Up','class'=>'span1')); ?>
							</div>
							<div class="span2">
								<?php echo Form::input('extra_up_peak',$o->extra_up_peak,array('label'=>'Extra','class'=>'span1')); ?>
							</div>
						</div>

					</div> <!-- /tab-pane -->

					<div class="tab-pane" id="tab2">

						<div class="row">
							<div class="span2">
								<?php echo Form::input('base_down_offpeak',$o->base_down_offpeak,array('label'=>'Base Down','class'=>'span1')); ?>
							</div>
							<div class="span2">
								<?php echo Form::input('extra_down_offpeak',$o->extra_down_offpeak,array('label'=>'Extra','class'=>'span1')); ?>
							</div>
						</div>

						<div class="row">
							<div class="span2">
								<?php echo Form::input('base_up_offpeak',$o->base_up_offpeak,array('label'=>'Base Up','class'=>'span1')); ?>
							</div>
							<div class="span2">
								<?php echo Form::input('extra_up_offpeak',$o->extra_up_offpeak,array('label'=>'Extra','class'=>'span1')); ?>
							</div>
						</div>

					</div> <!-- /tab-pane -->
				</div> <!-- /tab-content -->
			</div> <!-- /tabbable -->
		</div> <!-- /row -->

		<div class="row">
			<?php echo Form::input('contract_term',$o->contract_term,array('label'=>'Contract Term','class'=>'span1')); ?>
		</div>

		<div class="row">
			<?php echo StaticList_YesNo::form('extra_charged',$o->extra_charged,FALSE,array('label'=>'Extra Charged','class'=>'span1')); ?>
		</div>

		<div class="row">
			<?php echo Form::select('adsl_supplier_plan_id',ORM::factory('ADSL_Supplier_Plan')->list_select(),$o->adsl_supplier_plan_id,array('label'=>'Supplier Plan','class'=>'span4')); ?>
		</div>
	</fieldset>

	<div class="row">
		<div class="offset2">
			<button type="submit" class="btn btn-primary">Save changes</button>
			<button type="button" class="btn">Cancel</button>
		</div>
	</div>
</div> <!-- /span -->

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

		<div class="dl-horizontal">
			<dt>Supplier</dt>
			<dd><?php echo $o->supplier_plan->supplier->name; ?></dd>

			<dt>Allowance</dt>
			<dd><?php echo $o->allowance($o->supplier_plan->traffic_data(),TRUE); ?></dd>

			<dt>Cost</dt>
			<dd><?php echo $o->supplier_plan->display('base_cost'); ?></dd>

			<dt>Excess</dt>
			<dd><?php echo $o->supplier_plan->cost_extra($o->allowance($o->supplier_plan->traffic_data()),TRUE); ?></dd>

			<dt>Speed</dt>
			<dd><?php echo $o->supplier_plan->speed; ?></dd>
		</div>
	</fieldset>
</div> <!-- /span -->

<div class="span5">
	<fieldset>
		<legend>Test Traffic</legend>

		<div class="row">
			<div class="span2">
				<?php echo Form::input('test[base_down_peak]',10000,array('label'=>'Down Peak','class'=>'span1')); ?>
			</div>
			<div class="span2">
				<?php echo Form::input('test[base_down_offpeak]',30000,array('label'=>'Offpeak','class'=>'span1')); ?>
			</div>
		</div>
		<div class="row">
			<div class="span2">
				<?php echo Form::input('test[base_up_peak]',20000,array('label'=>'Up Peak','class'=>'span1')); ?>
			</div>
			<div class="span2">
				<?php echo Form::input('test[base_up_offpeak]',40000,array('label'=>'Offpeak','class'=>'span1')); ?>
			</div>
		</div>
		<div class="row">
			<div class="span2">
				<?php echo Form::checkbox('test[charge]',1,FALSE,array('label'=>'Charges','class'=>'span1')); ?>
			</div>
		</div>
	</fieldset>

	<?php if ($test_result) : ?>
		<fieldset>
			<legend>Test Traffic Result</legend>

			<div class="dl-horizontal">
				<?php foreach ($test_result as $k=>$v) : ?>
					<dt><?php echo $k; ?></dt>
					<dd><?php echo $v; ?></dd>
				<?php endforeach ?>

				<dt>Has Offpeak?</dt>
				<dd><?php echo $o->hasOffpeak(); ?></dd>
			</div>
		</fieldset>
	<?php endif ?>
</div> <!-- /span -->
