<?php



// checkout.php

// common fragment for pages displaying the 'dmShop.Trolley' XComponent

// - 'Full' variant, seen before completing a purchase

//

// USES (Page Environment variables)

// None

//

// EXPECTS

// No additional variables



?>



		<div class="main_column">

		<!-- ----------------- -->

		<!-- BEGIN MAIN COLUMN -->

		<!-- ----------------- -->



<?php



if (isset($dmx_resultcode['result']) && $dmx_resultcode['result'] == 'numberpick')

{

	// The user has just added a numberr to the trolley

	abs_inc_fragment('checkout_numberpick');

}

else if (isset($dmx_init_response['QntItems']) && $dmx_init_response['QntItems'] && $dmx_session_status != '')

{

	// Shopping trolley is not empty, and the customer is logged in

	abs_inc_fragment('checkout_notempty_logged');

}

else if (isset($dmx_init_response['QntItems']) && $dmx_init_response['QntItems'])

{

	// Shopping trolley is not empty, and the customer is not logged in

	abs_inc_fragment('checkout_notempty_notlogged');

}

else

{

	// Shopping trolley is empty

	abs_inc_fragment('checkout_empty');

}



?>



<?php



// Display autoshop messages

if (isset($_SESSION['AUTOSHOP']['messages']) && $_SESSION['AUTOSHOP']['messages'])

{

	?>

	<h3>Latest activity</h3>

	<p class="dmb0">

	<b><?=(str_replace("\n", '<br />', $_SESSION['AUTOSHOP']['messages']));?></b>

	</p>

	<?php

}

$_SESSION['AUTOSHOP']['messages'] = '';



?>



<!-- fred is a full trolley, with header, border and options turned off -->

<?php

$xparams['variant'] = 'full';

$xparams['showheader'] = 0;

$xparams['showborder'] = 0;

$xparams['showpreamble'] = 0;

$xparams['showoptions'] = 0;

$xparams['showactions'] = 0;

$xparams['result_loginregister'] = 'register.php';

$xparams['usepopup'] = 0;

$xparams['result_typinv'] = $abs_root . '/numbers/typical_invoice.php';

$xparams['result_configure'] = $abs_root . '/numbers/' . $abs_subject['range'] . '/svc_plan.php';

$xparams['headerurl'] = 'http://' . $_SERVER['SERVER_NAME'] . $abs_root . '/common/header_export\.php';

$xparams['div_typinv'] 	= 'typinv_ajax_target'; // ID of DIV to load typical invoice in, if using ajax

$xparams['hook_typinv'] = 'abs_show_typinv'; // The name of the function to execute before loading the typical invoice

$xparams['div_cce'] = 'carlos'; // ID of DIV in which to load CallCostExplorer, if using ajax

$xparams['hook_cce'] = 'abs_show_cce'; // The name of the function to execute before loading the CallCostExplorer

$xparams['hook_cce_update'] = 'abs_show_cce_sp'; // The name of the function to execute before updating CCE price grid

dmx_render('dmshop.trolley', 'fred', $xparams);

?>



<?php

if (isset($dmx_init_response['QntItems']) && $dmx_init_response['QntItems']) abs_inc_fragment('checkout_key');

?>



		<!-- --------------- -->

		<!-- END MAIN COLUMN -->

		<!-- --------------- -->

		</div>



		<div class="sidebar">

		<!-- ------- -->

		<!-- SIDEBAR -->

		<!-- ------- -->



<!-- PAGE FLOW BOX -->

<div id="flowbox">

<?php if (isset($dmx_init_response['QntItems']) && $dmx_init_response['QntItems'] && $dmx_session_status == 'A') : ?>

	<a href="#" onclick="dmx.fred.confirm(event); return false;" class="flowbox_main_trolley infotext" style="line-height: 35px;">Checkout<span class="tipcontents">Click here to confirm your order</span></a>

<?php elseif (isset($dmx_init_response['QntItems']) && $dmx_init_response['QntItems'] && $dmx_session_status == 'I') : ?>

	<a href="<?=$abs_root;?>/numbers/<?=$abs_subject['range'];?>/login.php" class="flowbox_main_forward infotext">Continue to<br />checkout<span class="tipcontents">Log in to continue with your order</span></a>

<?php elseif (isset($dmx_init_response['QntOSOrders']) && $dmx_init_response['QntOSOrders']) : ?>

	<a  href="#" onclick="dmx.fred.confirm(event); return false;" class="flowbox_main_trolley infotext" style="line-height: 35px;">Go to your account<span class="tipcontents">Proceed to your clubhouse</span></a>

<?php elseif (!$dmx_session_status): ?>

	<a href="<?=$abs_root;?>/numbers/<?=$abs_subject['range'];?>/register.php" class="flowbox_main_forward infotext">Continue to<br />checkout<span class="tipcontents">Log in or register to confirm your order</span></a>

<?php endif; ?>

 	<a href="<?=$abs_root;?>/numbers/index.php" class="flowbox_sub_trolley infotext">Add some more numbers<span class="tipcontents">Go back and choose some more numbers<br />to add to your trolley</span></a>

</div>

<!-- END PAGE FLOW BOX -->



<div class="ie6_7_is_buggy"><!-- Empty Div to get rid of IE6/7 CSS 'quirk' --></div>



<!-- SIDEBAR BOX -->

<?php abs_inc_fragment('sb_guarantee'); ?>

<!-- END SIDEBAR BOX -->



		<!-- ----------- -->

		<!-- END SIDEBAR -->

		<!-- ----------- -->

		</div>



