<?php

// trolley.tpl
// -------------------------------------------------------------------------------------------------
// Trolley template
//
// Revision   > $Rev: 83 $
// Date		  > $Date: 2009-06-29 11:25:53 +0100 (Mon, 29 Jun 2009) $
// Author     > RAK for DML
// Copyright  > (C) Digital Mail Limited (2005-2009)
// -------------------------------------------------------------------------------------------------

?>

<!-- ***************** -->
<!-- TROLLEY COMPONENT -->
<!-- ***************** -->

<script language="javascript" type="text/javascript">

// CREATE 'PUBLIC' JS INTERFACE FOR COMPONENT
dmx.<?=$comp_name;?> = new Object();
dmx.<?=$comp_name;?>.name  = '<?=$comp_name;?>';
dmx.<?=$comp_name;?>.xclass = 'trolley';

<?php if (!$err_msg) : ?>

<?php

// Set infortext status for collapsed trolley
switch($status_icon_infotext)
{
	case 'trolley_go':
		$ct_info = 'You are logged in and<br />can proceed to ckeckout';
		break;
	case 'trolley_log':
		$ct_info = 'Log in / register to proceed to checkout';
		break;
	case 'trolley_empty':
		$ct_info = 'Your trolley is empty';
		break;
}

?>

// Ajax debugging?
dmx.<?=$comp_name;?>.ajax_debug = true;

// -------------------------------------------------------------------------------------------------
// COMPONENT METHODS

dmx.<?=$comp_name;?>.show_typinv = function(index)
{
	dmx.<?=$comp_name;?>.change_focus(index);

	// Show typical invoice
	<?php if ($div_typinv) : ?>

	var params = new Object();
	params.dmb1_SessRef		= '<?=$dmx_session;?>';
	params.family 			= 'dmshop';
	params.xclass 			= 'typicalfirstinvoice';
	params.name	  			= '<?=$div_typinv;?>';
	params.ajax   			= 1;
	params.response_type	= 'html';
	params.dmx_glib			= '<?=$dmx_glib;?>';
	params.ajax_debug   	= dmx.<?=$comp_name;?>.ajax_debug;
	params.index			= index;
	params.buttonfunc		= 'dmx.<?=$div_typinv;?>.kill(); return false;';

	<?php if ($hook_typinv) : ?>
	// This executes designer specified function in client page, and exits if return value is false, otherwise continues
	// It can modify the ajax request params if desired, otherwise should return them
	params = <?=$hook_typinv;?>(params);
	if (params == false) return;
	<?php endif; ?>

	$('<?=$div_typinv;?>').style.display = 'block';

	// Load by ajax
	var xajax = new Request.HTML( { url: '/dmx/core/php/xcom_server.php', data: params, update: '<?=$div_typinv;?>' } );
	xajax.post();
	return false;
	<?php else: ?>

	// We're not using ajax, so open typical invoice as usual
	return true;
	<?php endif; ?>
}

dmx.<?=$comp_name;?>.show_cce = function(index)
{
	// Show call cost explorer

	dmx.<?=$comp_name;?>.change_focus(index);
	
	if (dmx.<?=$div_cce;?> != 'undefined')
	{
		// Update existing CCE
		dmx.<?=$div_cce;?>.change_number(index);
		<?php if ($hook_cce_update) : ?>
		// This executes designer specified function in client page
		<?=$hook_cce_update;?>();
		<?php endif; ?>
	}
	else
	{
		// Load CCE
		var params = new Object();
		params.dmb1_SessRef		= '<?=$dmx_session;?>';
		params.family 			= 'dmshop';
		params.xclass 			= 'callcostexplorer';
		params.name	  			= '<?=$div_cce;?>';
		params.ajax   			= 1;
		params.response_type	= 'html';
		params.ajax_debug   	= dmx.<?=$comp_name;?>.ajax_debug;
		params.index			= index;

		<?php if ($hook_cce) : ?>
		// This executes designer specified function in client page, and exits if return value is false, otherwise continues
		// It can modify the ajax request params if desired, otherwise should return them
		params = <?=$hook_cce;?>(params);
		if (params == false) return;
		<?php endif; ?>

		$('<?=$div_cce;?>').style.display = 'block';

		// Load by ajax
		var xajax = new Request.HTML( { url: '/dmx/core/php/xcom_server.php', data: params, update: '<?=$div_cce;?>' } );
		xajax.post();
	}

}

dmx.<?=$comp_name;?>.change_focus = function(index)
{
	for (var i = 1; i <= <?=$num_items;?>; i++)
	{
		i == index ? $('<?=$comp_name;?>_r' + i).addClass('focuscol') : $('<?=$comp_name;?>_r' + i).removeClass('focuscol');
	}
}

<?php endif; ?>

</script>

<style type="text/css">

.trolley .pad
{
	padding: 12px;
}

#<?=$comp_name;?>_typinv, #<?=$comp_name;?>_cce
{
	position: absolute;
	z-index: 150;
	top: 0px;
	left: 0px;
	display: none;
	background-color: #FFF;
	margin: 20px;
}

</style>

<div class="dmb0" style="<?=$comp_width;?>">
<div class="dmx">
<div class="trolley">
<div class="<?=$variant;?>">
<div class="<?=$comp_name;?>">

<?php if ($variant != 'collapsed') : ?>
	<h1 class="bordered" style="background-color: red; color: yellow;">I am the customised template example.tpl</h1>
<?php endif; ?>

<?php if ($showborder) : ?>
<div class="border" style="<?=$box_size;?>">
<?php else: ?>
<div  style="<?=$box_size;?>">
<?php endif; ?>

<?php if (!$err_msg) : ?>

	<form name="confirm" action="<?=DMX_SELF;?>" method="GET" style="display: none;">
	<input type="hidden" name="dmx_action" value="confirm_order">
	<input type="hidden" name="dmx_total_plus_outst" value="<?=$total_plus_outst;?>">
	<input type="hidden" name="dmx_cust_id" value="<?=$cust_id;?>">
	<input type="hidden" name="dmx_header_url" value="<?=$headerurl;?>">
	<input type="hidden" name="dmx_ganal_accno" value="<?=$ganal_accno;?>">
	<input type="hidden" name="dmx_ganal_trans_rep" value="<?=$ganal_trans_rep;?>">
	<input type="hidden" name="dmx_rc" value="<?=$rc_forms;?>">
	<input type="hidden" name="dmx_comp_name" value="<?=$comp_name;?>">
	<input type="hidden" name="dmx_comp_class" value="trolley">
	</form>

	<?php if ($variant == 'collapsed') : ?>

	<!-- TROLLEY COLLAPSED -->
	<script language="javascript" type="text/javascript">

	function dmx_trolley_click_action() {
		sim_link = new Object();
		sim_link.href = '<?=DMX_SELF;?>?dmx_action=collapsed_clicked&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=trolley';
		tst_follow_link(sim_link);
	}

	</script>

	<div onclick="dmx_trolley_click_action();">
	<table class="vert_centered" align="center">
	<tr>
		<td><a href="<?=DMX_SELF;?>?dmx_action=trolley_clicked&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=trolley"><img src="<?=$dmx_glib;?>interface/trolley_15.gif" width="18" height="15" border="0" alt="" class="infotext" /><span class="tipcontents"><img src="<?=$dmx_glib;?>interface/trolley_15.gif" width="18" height="15" border="0" alt="" /> <b>Shopping trolley</b><br />Lists all services ordered<br />during this session. Click the<br />icon to see full order details.</span></a></td>
		<td><span class="price"><strong><?=$currency_symbol;?><?=$total_inc;?></strong></span></td>
		<td><img src="<?=$dmx_glib;?>interface/val_<?=$status_icon;?>_14.gif" width="14" height="14" border="0" alt="" class="infotext" /><span class="tipcontents"><?=$ct_info;?></span></td>
	</tr>
	</table>
	</div>
	<!-- END TROLLEY COLLAPSED -->

	<?php endif; ?>

	<?php if ($variant == 'compact') : ?>

	<!-- TROLLEY COMPACT -->
	<table class="vert_centered" style="width: 100%; border-spacing: 0px; margin-bottom: 2px;">
		<tr>
			<td><?php if ($cust_id) : ?><?=$cust_id;?><?php endif; ?></td>
			<td style="text-align: right;"><a href="<?=DMX_SELF;?>?dmx_action=trolley_clicked&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=trolley" class="nu"><img src="<?=$dmx_glib;?>interface/trolley_15.gif" width="18" height="15" border="0" alt="" class="infotext" /><span class="tipcontents"><img src="<?=$dmx_glib;?>interface/trolley_15.gif" width="18" height="15" border="0" alt="" /> <b>Shopping trolley</b><br />Lists all services ordered<br />during this session. Click the<br />icon to see full order details.</span></a></td>
		</tr>
	</table>
	<table class="vert_centered" style="width: 100%; border-spacing: 0px;" cellspacing="0">
	<tr><td class="divider" colspan="2"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="1" alt=""></td></tr>

	<?php if ($num_items > 0) : ?>

		<?php for ($i= 0; $i < $num_items; $i++) : ?>
			<tr id="<?=$comp_name;?>_r<?=($i+1);?>"<?php if ($focus == $i + 1) : ?> class="focuscol"<?php endif;?>>
				<td style="padding: 2px;">
					<?php if ($showicons) : ?>
						<!-- SERVICE GRAPHIC NUMBER, WITH ACTUAL NUMBER INSERTED -->
						<span class="icon_blocks">
							<a href="<?=DMX_SELF;?>?dmx_action=configure&dmx_index=<?=($i+1);?>&dmx_num=<?=$item[$i]['native'];?>&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=trolley" class="infotext nu">
								<img src="<?=$dmx_glib;?>/numbers/butt_32.gif" width="12" height="32" alt="" />
								<span class="fullnum"><?=$item[$i]['sg_num'];?></span>
								<img src="<?=$dmx_glib;?>numbers/<?=$item[$i]['sg_icon'];?>_cap_32.gif" alt="" width="56" height="32">
								<img src="<?=$dmx_glib;?>numbers/<?=$item[$i]['sg_plan'];?>_32.gif" alt="" width="73" height="32">
							</a>
							<span class="tipcontents">Change service<br />and call plan</span>
						</span>
						<!-- END SERVICE GRAPHIC NUMBER, WITH ACTUAL NUMBER INSERTED -->
					<?php else : ?>
						<a href="<?=DMX_SELF;?>?dmx_action=configure&dmx_index=<?=($i+1);?>&dmx_num=<?=$item[$i]['native'];?>&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=trolley" class="infotext nu"><?=$item[$i]['formatted'];?><span class="tipcontents">Change service<br />and call plan</span></a>
						<img src="<?=$dmx_glib;?>interface/sp_9.gif" width="14" height="9" alt="" style="padding-left: 10px;" class="infotext" /><span class="tipcontents"><?=$item[$i]['service'];?> <?=$item[$i]['plan'];?></span>
					<?php endif; ?>
				</td>
				<td style="text-align: right;"><a href="<?=DMX_SELF;?>?dmx_action=show_typical_invoice&dmx_index=<?=($i+1);?>&dmx_num=<?=$item[$i]['native'];?>&dmx_num_f=<?=$item[$i]['formatted'];?>&dmx_popup=<?=$usepopup;?>&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=trolley" target="<?=$usepopup;?>" onclick="this.blur(); return dmx.<?=$comp_name;?>.show_typinv(<?=($i+1);?>);" class="<?=$price_class;?> infotext nu"><?=$currency_symbol;?><?=$item[$i]['price'];?><span class="tipcontents">See a breakdown of this price<br />in a typical first invoice</span></a></td>
			</tr>
			<tr><td class="divider" colspan="2"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="1" alt=""></td></tr>
		<?php endfor; ?>

		</table>
		<table class="vert_centered" style="width: 100%;">

		<?php if ($showtotals) : ?>
			<!-- VAT & TOTAL -->
			<tr>
				<td class="cell_plain_thin" style="text-align: right; width: 70%;">VAT</td>
				<td class="cell2f_thin" style="text-align: right; width: 30%;"><?=$currency_symbol;?><?=$total_tax;?></td>
			</tr>
			<tr><td class="divider" colspan="2"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="1" alt=""></td></tr>
			<tr>
				<td class="cell_plain_thin" style="text-align: right;"><span class="price"><strong>Total</strong></span></td>
				<td class="cell2i_thin" style="text-align: right;"><span class="price"><strong><?=$currency_symbol;?><?=$total_inc;?><strong></span></td>
			</tr>
			<tr><td class="divider" colspan="2"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="1" alt=""></td></tr>
			<!-- END VAT & TOTAL -->
		<?php endif; ?>

		<?php if ($showpreamble && $showactions) : ?>
			<tr>
				<td colspan="2" class="cell_plain">
					<?php if ($logged_in && $checkout_ready) : ?><strong>All numbers are ready</strong><?php endif; ?>
					<?php if ($logged_in && !$checkout_ready) : ?><strong>Configure all numbers to proceed</strong><?php endif; ?>
					<?php if (!$logged_in) : ?><strong>Login / register to complete order</strong><?php endif; ?>
				</td>
			</tr>
		<?php endif; ?>

		<?php else: ?>
			<!-- EMPTY TROLLEY -->
			<tr><td colspan="2" class="cell2f">Your shopping trolley is empty.</td></tr>
			<!-- END EMPTY TROLLEY -->
			<tr><td class="divider" colspan="2"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="1" alt=""></td></tr>
		<?php endif; ?>

		<?php if ($showactions) : ?>
			<tr>
				<td colspan="2" class="cell_plain">
					<?php if (!$logged_in && $num_items > 0) : ?>
						<div class="grabut_left_forward"><ul><li>
					<a href="<?=DMX_SELF;?>?dmx_action=display_login&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=trolley">Login&nbsp;/&nbsp;Register</a>
					<?php endif; ?>

					<?php if ($logged_in && $num_items > 0) : ?>
						<div class="grabut_left_forward"><ul><li>
						<a href="#" onclick="dmx.<?=$comp_name;?>.confirm(event); return false;">Confirm&nbsp;Order</a>
					<?php endif; ?>

					<?php if ($logged_in && $num_items == 0 && $outst_num) : ?>
						<div class="grabut_left_forward"><ul><li>
					<a href="#" onclick="dmx.<?=$comp_name;?>.confirm(event); return false;">Go&nbsp;to&nbsp;Your&nbsp;Account</a>
					<?php endif; ?>

						</li></ul></div>
				</td>
			</tr>
		<?php endif; ?>

		<?php if ($outst_num > 0) : ?>
			<tr><td colspan="2"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="3" alt=""></td></tr>
			<tr>
				<td colspan="2">
					<a href="#" onclick="dmx.<?=$comp_name;?>.confirm(event); return false;"><img src="<?=$dmx_glib;?>interface/account_15.gif" width="16" height="15" border="0" alt=""  align="right" class="infotext" /><span class="tipcontents"><img src="<?=$dmx_glib;?>interface/account_15.gif" width="16" height="15" border="0" alt="" /> <b>Your account</b><br />Lists services ordered from this<br />shopping trolley that remain unpaid.<br />Currently <?=$currency_symbol;?><?=$outst_total;?> unpaid on <?=$outst_num;?> order<?php if ($outst_num > 1) : ?>s<?php endif;?>.<br /><br />Once you go to checkout, items<br />from your trolley ( <img src="<?=$dmx_glib;?>interface/trolley_15.gif" width="18" height="15" border="0" alt="" /> ) appear in<br />your 'clubhouse' and can be<br />paid for from your account.</span></a>
					<a href="#" onclick="dmx.<?=$comp_name;?>.confirm(event); return false;" class="infotext nu"><?=$outst_num;?> outstanding order<?php if ($outst_num > 1) :?>s<?php endif; ?> (<?=$currency_symbol;?><?=$outst_total;?>)<span class="tipcontents"><img src="<?=$dmx_glib;?>interface/account_15.gif" width="16" height="15" border="0" alt="" /> <b>Your account</b><br />Lists services ordered from this<br />shopping trolley that remain unpaid.<br />Currently <?=$currency_symbol;?><?=$outst_total;?> unpaid on <?=$outst_num;?> order<?php if ($outst_num > 1) : ?>s<?php endif;?>.<br /><br />Once you go to checkout, items<br />from your trolley ( <img src="<?=$dmx_glib;?>interface/trolley_15.gif" width="18" height="15" border="0" alt="" /> ) appear in<br />your 'clubhouse' and can be<br />paid for from your account.</span></a>
				</td>
			</tr>
			<tr><td class="divider" colspan="2"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="1" alt=""></td></tr>
		<?php endif; ?>

		</table>
	<!-- END TROLLEY COMPACT -->

	<?php endif; ?>

	<?php if ($variant == 'full') : ?>

	<!-- TROLLEY FULL -->

	<?php if ($comp_err_msg) : ?>
	<span class="error"><?=$comp_err_msg;?><br></span>
	<?php elseif ($comp_msg) : ?>
	<?=$comp_msg;?><br>
	<?php endif; ?>

	<table class="vert_centered" style="width: 100%; border-spacing: 0px;" cellspacing="0" border="0">
		<tr class="detailed">
			<td colspan="2" style="vertical-align: bottom; padding-bottom: 2px;">
				<img src="<?=$dmx_glib;?>interface/trolley_15.gif" width="18" height="15" border="0" alt=""> <?php if ($cust_id) : ?><?=$cust_id;?><?php endif; ?>
			</td>
			<?php if ($num_items > 0) : ?>
				<td style="text-align: right; vertical-align: bottom; padding-bottom: 2px; width: 70px;">{GLOS:one_off}</td>
				<td style="text-align: right; vertical-align: bottom; padding-bottom: 2px; width: 70px;">{GLOS:monthly}</td>
				<td colspan="2" style="text-align: right; vertical-align: bottom; padding-bottom: 2px; width: 100px;">UK landline<br />{GLOS:call_rate} {GLOS:ppm}</td>
				<td style="text-align: right; vertical-align: bottom; padding-bottom: 2px; width: 80px;">Initial<br />Payment</td>
			<?php else: ?>
				<td colspan="7"></td>
			<?php endif; ?>
		</tr>
		<tr><td class="divider" colspan="7"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="1" alt=""></td></tr>

		<?php if ($num_items > 0) : ?>
			<?php for ($i = 0; $i < $num_items; $i++) : ?>
				<tr id="<?=$comp_name;?>_r<?=($i+1);?>"<?php if ($focus == $i + 1) : ?> class="focuscol"<?php endif;?>>
					<td style="padding: 2px;">
						<?php if ($showicons) : ?>
							<!-- SERVICE GRAPHIC NUMBER, WITH ACTUAL NUMBER INSERTED -->
							<span class="icon_blocks">
								<a href="<?=DMX_SELF;?>?dmx_action=configure&dmx_index=<?=($i+1);?>&dmx_num=<?=$item[$i]['native'];?>&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=trolley" class="infotext nu">
									<img src="<?=$dmx_glib;?>/numbers/butt_32.gif" width="12" height="32" alt="" />
									<span class="fullnum"><?=$item[$i]['sg_num'];?></span>
									<img src="<?=$dmx_glib;?>numbers/<?=$item[$i]['sg_icon'];?>_cap_32.gif" alt="" width="56" height="32">
									<img src="<?=$dmx_glib;?>numbers/<?=$item[$i]['sg_plan'];?>_32.gif" alt="" width="73" height="32">
								</a>
								<span class="tipcontents">Change service<br />and call plan</span>
							</span>
							<!-- END SERVICE GRAPHIC NUMBER, WITH ACTUAL NUMBER INSERTED -->
						<?php else : ?>
							<a href="<?=DMX_SELF;?>?dmx_action=configure&dmx_index=<?=($i+1);?>&dmx_num=<?=$item[$i]['native'];?>&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=trolley" class="infotext nu"><?=$item[$i]['formatted'];?><span class="tipcontents">Change service<br />and call plan</span></a>
							<span style="padding-left: 10px;"><img src="<?=$dmx_glib;?>interface/sp_9.gif" width="14" height="9" alt="" class="infotext" /><span class="tipcontents"><?=$item[$i]['service'];?> <?=$item[$i]['plan'];?></span></span>
						<?php endif; ?>
					</td>
					<td style="text-align: center;">
						<?php if ($showoptions) : ?><a href="<?=DMX_SELF;?>?dmx_action=configure&dmx_index=<?=($i+1);?>&dmx_num=<?=$item[$i]['native'];?>&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=trolley" class="img"><img src="<?=$dmx_glib;?>interface/tools_15.gif" width="15" height="15" style="border: 0px; padding-left: 10px;" alt="" class="infotext" /><span class="tipcontents">Change service<br />and call plan</span></a><?php endif; ?>
						<a href="<?=DMX_SELF;?>?dmx_action=delete&dmx_index=<?=($i+1);?>&dmx_num=<?=$item[$i]['native'];?>&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=trolley" class="img"><img src="<?=$dmx_glib;?>interface/delete_15.gif" width="15" height="15" style="border: 0px; padding: 0px 10px;" alt="" class="infotext" /><span class="tipcontents">Remove number from trolley</span></a>
					</td>
					<td style="text-align: right;"><?=$currency_symbol;?><?=$item[$i]['setup'];?></td>
					<td style="text-align: right;"><?=$currency_symbol;?><?=$item[$i]['rental'];?></td>
					<td style="text-align: right;"<?php if ($item[$i]['payout']) : ?> class="payout"<?php endif;?>><?=$item[$i]['ukllppm'];?></td>
					<td style="text-align: right; width: 35px;">
						<?php if ($item[$i]['payout']) : ?><img src="<?=$dmx_glib;?>interface/payout_15.gif" width="14" height="15" alt="" class="infotext" /><span class="tipcontents"><b>Payout:</b> Calls to number can result in payout to you</span><?php endif; ?>
						<a href="#" onclick="this.blur(); dmx.<?=$comp_name;?>.show_cce(<?=($i+1);?>); return false;" class="img"><img src="<?=$dmx_glib;?>interface/globe_15.gif" width="15" height="15" alt="" style="border: 0px; padding: 0px;" class="infotext" /><span class="tipcontents">Open the 'Call Cost Explorer' to see<br />call rates for forwarding to non-UK landlines</span></a>
					</td>
					<td style="text-align: right;"><a href="<?=DMX_SELF;?>?dmx_action=show_typical_invoice&dmx_index=<?=($i+1);?>&dmx_num=<?=$item[$i]['native'];?>&dmx_num_f=<?=$item[$i]['formatted'];?>&dmx_popup=<?=$usepopup;?>&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=trolley" target="<?=$usepopup;?>" onclick="this.blur(); return dmx.<?=$comp_name;?>.show_typinv(<?=($i+1);?>);" class="<?=$price_class;?> nu infotext"><?=$currency_symbol;?><?=$item[$i]['price'];?><span class="tipcontents">See a breakdown of this price<br />in a typical first invoice</span></a></td>
				</tr>
				<tr><td class="divider" colspan="7"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="1" alt=""></td></tr>
			<?php endfor; ?>
		</table>

		<table class="vert_centered" style="width: 100%;">

			<?php if ($showtotals) : ?>
				<!-- VAT & TOTAL -->
				<tr>
					<td colspan="4" rowspan="2" class="cell_plain" style="text-align: left; vertical-align: top; line-height: 130%;">
					<?php if ($showpreamble && $showactions) : ?>
						<?php if ($logged_in && $checkout_ready) : ?><strong>You are logged in and all numbers are ready</strong><?php endif; ?>
						<?php if ($logged_in && !$checkout_ready) : ?><strong>You need to configure all numbers to proceed</strong><?php endif; ?>
						<?php if (!$logged_in) : ?><strong>Login or register to complete your order</strong><?php endif; ?>
					<?php endif; ?>
					</td>
					<td class="cell2f" style="text-align: right; white-space: nowrap;">Total ex. VAT</td>
					<td class="cell2f" style="text-align: right;"><?=$currency_symbol;?><?=$total_net;?></td>
				</tr>
				<tr>
					<td class="cell2f" style="text-align: right;">VAT</td>
					<td class="cell2f" style="text-align: right;"><?=$currency_symbol;?><?=$total_tax;?></td>
				</tr>
				<tr>
					<td colspan="4"></td>
					<td class="divider" colspan="2"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="1" alt=""></td>
				</tr>
				<tr>
					<td colspan="4">
						<?php if ($showactions) : ?>
							<?php if (!$logged_in) : ?>
							<div class="grabut_left_forward"><ul><li>
							<a href="<?=DMX_SELF;?>?dmx_action=display_login&dmx_rc=<?=$rc_links;?>&dmx_comp_name=<?=$comp_name;?>&dmx_comp_class=trolley">Login&nbsp;/&nbsp;Register</a>
							<?php endif; ?>
							<?php if ($logged_in) : ?>
							<div class="grabut_left_forward"><ul><li>
							<a href="#" onclick="dmx.<?=$comp_name;?>.confirm(event); return false;">Confirm&nbsp;Order</a>
							<?php endif; ?>
							</li></ul></div>
						<?php endif; ?>
					</td>
					<td class="cell2i" style="text-align: right; width: 68px;"><span class="price"><strong>Total</strong></span></td>
					<td class="cell2i" style="text-align: right; width: 68px;"><span class="price"><strong><?=$currency_symbol;?><?=$total_inc;?><strong></span></td>
				</tr>
				<tr>
					<td colspan="4"></td>
					<td class="divider" colspan="2"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="1" alt=""></td>
				</tr>
				<!-- END VAT & TOTAL -->
			<?php endif; ?>
		<?php else: ?>
			<!-- EMPTY TROLLEY -->
			<tr>
				<td colspan="6" class="cell_plain">Your shopping trolley is empty.</td>
			</tr>
			<tr>
				<td colspan="6" class="cell_plain">
					<?php if ($logged_in && $outst_num) : ?>
					<div class="grabut_left_forward"><ul><li>
					<a href="#" onclick="dmx.<?=$comp_name;?>.confirm(event); return false;">Go&nbsp;to&nbsp;Your&nbsp;Account</a>
					<?php endif; ?>
					</li></ul></div>
				</td>
			</tr>
			<!-- END EMPTY TROLLEY -->
		<?php endif; ?>

		<?php if ($outst_num > 0) : ?>
			<tr><td class="cell_plain" colspan="6"></td></tr>
			<tr><td class="cell_plain" colspan="6"></td></tr>
			<tr>
				<td colspan="6" style="text-align: right; padding-right: 0px;"><a href="#" onclick="dmx.<?=$comp_name;?>.confirm(event); return false;"><img src="<?=$dmx_glib;?>interface/account_15.gif" width="16" height="15" border="0" alt="" align="right" class="infotext" /><span class="tipcontents"><img src="<?=$dmx_glib;?>interface/account_15.gif" width="16" height="15" border="0" alt="" /> <b>Your account</b><br />Lists services ordered from this<br />shopping trolley that remain unpaid.<br />Currently <?=$currency_symbol;?><?=$outst_total;?> unpaid on <?=$outst_num;?> order<?php if ($outst_num > 1) : ?>s<?php endif;?>.<br /><br />Once you go to checkout, items<br />from your trolley ( <img src="<?=$dmx_glib;?>interface/trolley_15.gif" width="18" height="15" border="0" alt="" /> ) appear in<br />your 'clubhouse' and can be<br />paid for from your account.</span></a></td>
			</tr>
			<tr><td class="divider" colspan="6"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="1" alt=""></td></tr>
			<tr>
				<td colspan="5" class="cell_plain">
					<a href="#" onclick="dmx.<?=$comp_name;?>.confirm(event); return false;" class="infotext"><?=$outst_num;?> outstanding order<?php if ($outst_num > 1) :?>s<?php endif; ?><span class="tipcontents"><img src="<?=$dmx_glib;?>interface/account_15.gif" width="16" height="15" border="0" alt="" /> <b>Your account</b><br />Lists services ordered from this<br />shopping trolley that remain unpaid.<br />Currently <?=$currency_symbol;?><?=$outst_total;?> unpaid on <?=$outst_num;?> order<?php if ($outst_num > 1) : ?>s<?php endif;?>.<br /><br />Once you go to checkout, items<br />from your trolley ( <img src="<?=$dmx_glib;?>interface/trolley_15.gif" width="18" height="15" border="0" alt="" /> ) appear in<br />your 'clubhouse' and can be<br />paid for from your account.</span></a>
				</td>
				<td class="cell2i" style="text-align: right;"><strong><?=$currency_symbol;?><?=$outst_total;?></strong></td>
			</tr>
			<tr><td class="divider" colspan="6"><img src="<?=$dmx_glib;?>clear.gif" width="1" height="1" alt="" /></td></tr>
		<?php endif; ?>

	</table>
	<!-- END TROLLEY FULL -->

	<?php endif; ?>

<?php else : ?>
<!-- ERROR HANDLING -->
	<?php if ($variant == 'collapsed') : ?>
	<div class="error" style="vertical-align: middle;">
		<span class="infotext">WE'RE SORRY<span class="tipcontents"><?=$err_msg;?></span></span>
	</div>
	<?php else: ?>
	<div style="vertical-align: middle;">
	<img src="<?=$dmx_glib;?>interface/error_32.gif" alt="" width="36" height="32" border="0" style="float: left; padding: 0 10px 0 0;"><span class="error">WE'RE SORRY<br><?=$err_msg;?></span>
	</div>
	<?php endif; ?>
<!-- END ERROR HANDLING -->
<?php endif; ?>

</div>

</div>
</div>
</div>
</div>
</div>

<div id="<?=$comp_name;?>_typinv"><img src="<?=$dmx_glib;?>interface/ajax_loader_col1.gif" width="16" height="16" alt="" class="loaderpad"> Loading Example Invoice</div>
<div id="<?=$comp_name;?>_cce"><img src="<?=$dmx_glib;?>interface/ajax_loader_col1.gif" width="16" height="16" alt="" class="loaderpad"> Loading Call Cost Explorer</div>

<!-- ********************* -->
<!-- END TROLLEY COMPONENT -->
<!-- ********************* -->
