<?php  
// Set flag that this is a parent file
	defined('_FEXEC') or die();
$manual_option=$HTTP_SESSION_VARS['manual_option'];

//print_r ($cart);
  if ($cart->count_contents() < 1) {
 	echo "redirect_page||show_shopping";
	tep_session_close();
	exit;
  }
// if no shipping method has been selected, redirect the customer to the shipping method selection page
  if (!tep_session_is_registered('shipping')) {
 	echo "redirect_page||checkout_shipping_details";
	tep_session_close();
	exit;
  }
// avoid hack attempts during the checkout procedure by checking the internal cartID
  if (isset($cart->cartID) && tep_session_is_registered('cartID')) {
    if ($cart->cartID != $cartID) {
    	echo "redirect_page||checkout_shipping_details";
	    exit;
    }
  }
// Stock Check
  if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
    $products = $cart->get_products();
    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
     if ($products[$i]['elementType']=='P'){
      if (tep_check_stock($products[$i]['id'], $products[$i]['quantity'])) {
		  echo "redirect_page||show_shopping";
		  exit;
	      break;
      }
     }
    }
  }
	// modified for wallet payment -start
	if (!tep_session_is_registered("payment_page")){
		tep_session_register("payment_page");
	}
	$payment_page="default";
	// modified for wallet payment -end
// if no billing destination address was selected, use the customers own address as default
  if (!tep_session_is_registered('billto')) {
    tep_session_register('billto');
    $billto = $customer_default_address_id;
  } else {
// verify the selected billing address
    $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$billto . "'");
    $check_address = tep_db_fetch_array($check_address_query);
    if ($check_address['total'] != '1') {
      $billto = $customer_default_address_id;
      if (tep_session_is_registered('payment')) tep_session_unregister('payment');
    }
  }
if ($shipping==false){
	$sendto=$billto;
}
 require(DIR_WS_CLASSES . 'order.php');
 $order = new order;
  
 if(tep_session_is_registered('comments'))
  	tep_session_unregister('comments');

if(tep_not_null($HTTP_POST_VARS['comments']))
	tep_session_register('comments');

 $order_timestamp=time();
 $referenceID= substr(strtolower($order->customer['firstname']),0,3) . substr(strtolower($order->customer['lastname']),0,3) . $order_timestamp ;
 if (!tep_session_is_registered('referenceID')) tep_session_register('referenceID');	
 $total_weight = $cart->show_weight();
 $total_count = $cart->count_contents();
 $total_count = $cart->count_contents_virtual(); //ICW ADDED FOR CREDIT CLASS SYSTEM
// load all enabled payment modules
  require(DIR_WS_CLASSES . 'payment.php');
  $payment_modules = new payment;

	$error_text="";
	if (isset($HTTP_GET_VARS['payment_error']) && is_object(${tep_db_prepare_input($HTTP_GET_VARS['payment_error'])}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) {
		$error_text=$error["error"];
	}
/*  require(DIR_WS_CLASSES . 'order_total.php');//ICW ADDED FOR CREDIT CLASS SYSTEM
  $order_total_modules = new order_total;//ICW ADDED FOR CREDIT CLASS SYSTEM */
  if(tep_session_is_registered('order_id') && $order_id!="" && $order_status==2)
  {
  	$previous_total=get_order_total("ot_total",$order_id);
  	if($previous_total > $order->info['overall_total'])
	{?>
	<table border="0" width="80%" cellspacing="2" cellpadding="1">
		<tr>
       	 <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '50'); ?></td>
     	 </tr>
		<tr>
        <td>
			<table border="0" width="100%" cellspacing="0" cellpadding="1">
          		<tr>
				<td class="infoBoxHeading" valign="middle"><font color="#003366"><b><?php echo TEXT_NAME;?></b></font>
           		 <?php echo tep_customers_name($customer_id); ?>&nbsp;<span  id="img_process5"></span>></td>
         	 	</tr>
       		 </table>
		</td>
     	</tr>
      	<tr>
       		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     	</tr>
		<tr class="attributes-odd">
			<td colspan="5">
				<?php //tep_content_title_top(TABLE_HEADING_PAYMENT_METHOD)?>
				<table border="1" width="100%" cellspacing="0" cellpadding="2">
					<tr><td class="main"><?php echo sprintf(TEXT_REFUND_ALERT,$currencies->format($previous_total),$currencies->format($order->info['overall_total']));?></td></tr>
					<!--<tr> <?php //javascript:do_page_fetch(\'process_order\'); ?>
						<td class="main" align="right" nowrap><?php echo '<a href="javascript:show_step_number(2);">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>&nbsp;&nbsp;<a href="javascript: refund_amount();">' . tep_image_button('button_continue.gif', IMAGE_CONTINUE,'') . '</a>&nbsp;'; ?></td>
					</tr> -->
				</table>
				<?php //tep_content_title_bottom();?>
		  	</td>
		 </tr>
		</table>
	<?php  tep_session_register("payment_refund");
		$payment_refund=true;
		//exit;
	  }
  }
?>
	<table border="0" width="100%" cellspacing="2" cellpadding="1" align="center">
		<tr>
			<td valign="top" width="100%">
			<?php echo tep_draw_form('edit_order', FILENAME_CHECKOUT_CONFIRM_NEW,'', 'post'); ?>
			<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>">
			<?php $serverDate = date('Y-m-d H:i:s',getServerDate(false)); ?>
				<tr id="show_payment_error" <?php if($error_text=="") echo 'style="display:none"';?>>
				<td>
					<table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBoxNotice">
					<tr class="infoBoxNoticeContents">
					<td>
						<table border="0" width="100%" cellspacing="0" cellpadding="2">
							<tr>
							<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
							<td class="main" width="100%" valign="top" id="payment_error_text"><?php echo $error_text; ?></td>
							<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
							</tr>
						</table>
					</td>
					</tr>
					</table>
				</td>
				</tr>
				<tr>
        		<td>
					<table border="0" width="100%" cellspacing="0" cellpadding="5">
          			<tr>
					<td class="infoBoxHeading" valign="middle"><font color="#003366"><b><?php echo TEXT_NAME;?></b></font><?php echo tep_customers_name($customer_id); ?>&nbsp;<span  id="img_process5"></span></td>
        		  	</tr>
      		  		</table>
				</td>
     			</tr>
     			<tr>
       			<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
        		</tr>
	    		<tr>
				<td>
	  				<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTablerowover">
	  				<tr >
					<td class="contentTitle" onclick="javascript:toggle_panel('Shopping_Cart','false','','0');"><?php echo 'Shopping Cart'; ?></td>
					</tr>
					<?php 
					$dis_time_format="";
					if(defined('TIME_FORMAT'))
						$dis_time_format=TIME_FORMAT;
						for ($i=0, $n=count($order->products); $i<$n; $i++) {
							switch($order->products[$i]['element_type'])
							{
								case 'P':
									$index=0;
									break;
								case 'S':
									$index=2;
									break;
								case 'E':
									$index=1;
									break;
								case 'V':
									$index=3;
									break;
							}
							if (STOCK_CHECK == 'true' && $order->products[$i]['element_type']=="P") {
     						 $out= tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty']);
  							  }
							$items[$index].='<tr >' . "\n" .
							'            <td class="main_item" width="70%"  valign="top"><b>' . $order->products[$i]['name'] .$out . '</b>';
				
							if ($order->products[$i]['element_type']=="V"){
								if($order->products[$i]['others']['end_date'] && $order->products[$i]['others']['end_time']){	
									$str_time=strtotime($order->products[$i]['others']['end_date'] .' '.$order->products[$i]['others']['end_time'])+60;
									$order->products[$i]['others']['end_date']=date('Y-m-d',$str_time);
									$order->products[$i]['others']['end_time']=date('H:i:s',$str_time); 
								}
								$stime="";
								$etime="";
								if($order->products[$i]['others']['start_time']) {
									$stime=date("h:i A",strtotime($order->products[$i]['others']['start_time']));
									if($dis_time_format!="") {
										if($dis_time_format=='24') 							
											$stime=date("H:i",strtotime($order->products[$i]['others']['start_time']));						
									}
								}
								if($order->products[$i]['others']['end_time']) {
									$etime=date("h:i A",strtotime($order->products[$i]['others']['end_time']));
									if($dis_time_format!="") {
										if($dis_time_format=='24') 
										$etime=date("H:i",strtotime($order->products[$i]['others']['end_time']));
									}
								}
								if($order->products[$i]['others']['resource_id']!='') $resource_costs=tep_add_tax(tep_get_resource('resource_costs',$order->products[$i]['others']['resource_id'],$languages_id),$order->products[$i]['tax']);
								$items[$index].='<br><small><i>&nbsp;	- '.TEXT_START_DATE.' : '. format_date($order->products[$i]['others']['start_date']) . '&nbsp;' . $stime . ' <br>&nbsp; - ' . TEXT_END_DATE .' : ' . format_date($order->products[$i]['others']['end_date']). '&nbsp;' . $etime . ' '.(($order->products[$i]['others']['resource_id'])? '<br>&nbsp; - '.tep_get_resource_name($order->products[$i]['others']['resource_id'],'resource_name').'('.$currencies->format($resource_costs).')':'').'</i></small>';																			
							} 
							
							if (isset($order->products[$i]['attributes']) && is_array($order->products[$i]['attributes'])) {
								reset($order->products[$i]['attributes']);
								$attribute_id="";
								for($k=0,$att_max=sizeof($order->products[$i]['attributes']);$k<$att_max;$k++) {
									$att_row=$order->products[$i]['attributes'][$k];
									if($attribute_id!="")
										$attribute_id.="-";
									$attribute_id.=$att_row['option_id'] . "{" . $att_row['value_id'] . "}";
								}
								for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
									if($order->products[$i]['attributes'][$j]['option'] && $order->products[$i]['attributes'][$j]['value'])  $items[$index].= '<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '('.$currencies->format(tep_add_tax($order->products[$i]['attributes'][$j]['price'],$order->products[$i]['tax'])).')</i></small></nobr>';
								}
								if (STOCK_CHECK == 'true' && $order->products[$i]['element_type']=="P") {
			 echo tep_check_attribute_stock($order->products[$i]['id'],$attribute_id,$order->products[$i]['quantity']);
		  }
							}
							$disp_total+=$order->products[$i]['final_price'];
				
							if ($order->products[$i]['element_type']=="P"){
								if ($order->products[$i]['discount_whole_text']!=''){
									$items[$index].='<br>' . $order->products[$i]['discount_whole_text'];
								}
							}
				
							$items[$index].='</td>' . "\n" . '<td class="main_item" align="center" valign="top" width="10%">' . $order->products[$i]['qty'] .' </td>' . "\n" ;
							$items[$index].= '<td class="main_item" align="right" valign="top">' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . '</td>' . "\n" .
							'          </tr>' . "\n";
						}
						
					//	print_r($order->products);
					//manual price adjustment
						$val=$currencies->format($cart->show_total());
						
						if($HTTP_SESSION_VARS['sign']=='-')
						$rest_mp = substr($HTTP_SESSION_VARS['modify_price_prefix'], 1); 
						else   
						$rest_mp = $HTTP_SESSION_VARS['modify_price_prefix'];
						
						$items[4]='<tr><td colspan=3 ></td></tr><tr><td></td><td align=right class="main_item"><b>' . "Ordered Total" . '</b>&nbsp;' . $currencies->format($cart->show_net_total(true)) . '</td></tr>';
						
						if($manual_option=='Y')
						$mp='<tr><td colspan=3 ></td></tr><tr><td></td><td align=right class="main_item"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$HTTP_SESSION_VARS['purpose'].'('.$HTTP_SESSION_VARS['sign'].')</b>&nbsp;'.$currencies->format($rest_mp).'</td></tr>';
						$items[5]=$mp.'<tr><td colspan=3 ></td></tr><tr><td></td><td align=right class="main_item"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'. TEXT_TOTAL . '</b>&nbsp;' . $currencies->format($cart->show_net_total()) . '</td></tr>';
						//$items[5]='<tr><td colspan=3 ></td></tr><tr><td></td><td align=right class="main_item"><b>' . "Updated Total" . '</b>&nbsp;' . $currencies->format($cart->show_total()) . '</td></tr>';
						for($j=0;$j<=5;$j++)
						{
							if(isset($items[$j]))
							{?>
							<tr class="attributes-odd">
								<td class="main" colspan="3"><?php echo '<b>' . tep_get_title($j) . '</b>'; ?></td>
							</tr>
							<tr class="attributes-odd">
								<td>
									<table width="95%" align=right cellpadding="5">
									 <tr>
									  <td><?php echo $items[$j];?></td>
									  </tr>
									</table>
								</td>
							</tr>
							<?php
							}
						}
						
					?>
		</table>
	 	</td>
		</tr>
		<tr>
		 <td>
			<table border="0" width="100%" cellspacing="1" cellpadding="2" >
				<?php tep_content_title_top(TABLE_HEADING_PAYMENT_METHOD)?>
				<tr class="attributes-odd">
				<td>
					<table border="0" width="100%" cellspacing="0" cellpadding="2">
						<?php
						$selection = $payment_modules->selection();
					 	$flag='B';
						$radio_buttons = 0;
					  	$m = count($selection[0]['fields']);
					  	$cnt = 0;
					  	for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
						//westpac  securepay realex pm2checkout commbank authorizenet netregistry anz
					  	//if ($selection[$i]['id']=='cybersource' || $selection[$i]['id']=='virtualpay' || $selection[$i]['id']=='westpac' || $selection[$i]['id']=='securepay' || $selection[$i]['id']=='realex' || $selection[$i]['id']=='pm2checkout' || $selection[$i]['id']=='commbank' || $selection[$i]['id']=='authorizenet' || $selection[$i]['id']=='westpac' || $selection[$i]['id']=='netregistry' || $selection[$i]['id']=='anz' ) {
					   	//if( $order_id>0 && $order_status==1)
						//	$show=false;
						//}
					 	//else  {
						//	$show=true;
						//}
						
						?>
					  <tr>
						<td colspan="2">
							<table border="0" width="100%" cellspacing="0" cellpadding="2">
							<?php 
							//if($show==true){   echo $selection[$i]['id'];
							if (($selection[$i]['id'] == $payment) || ($n == 1)) 
							  echo '<tr id="defaultSelected"  onmouseover="rowOverEffect2(this)" onmouseout="rowOutEffect2(this)" onclick="selectRowEffect2(this, ' . $radio_buttons . ',\'', $selection[$i]['id'] . '\')">' . "\n";
						  else
							  echo '<tr id="defaultunSelected" class="moduleRow" onmouseover="rowOverEffect2(this)" onmouseout="rowOutEffect2(this)" onclick="selectRowEffect2(this, ' . $radio_buttons . ',\'', $selection[$i]['id'] . '\')">' . "\n";
							?> 
							
								<td width="10" nowrap="nowrap"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
							
								<td class="main" colspan="3" width="400" nowrap="nowrap"><b><?php echo $selection[$i]['module']; ?></b></td>
								<td class="main" align="left" width="250">
								<?php $single_payment=false;
									if (sizeof($selection) > 1) 
									  echo tep_draw_radio_field('payment', $selection[$i]['id'],(($i==0)?true:''));						  
									else {
									  $single_payment=true;
									  echo tep_draw_hidden_field('payment', $selection[$i]['id']);
									}
								?></td>
								
								<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
							
							<?php if (isset($selection[$i]['error'])) {	?>
								  <tr>
									<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
									<td class="main" colspan="4"><?php echo $selection[$i]['error']; ?></td>
									<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
								  </tr>
							<?php
								} elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) {
									 ?>
						   	 <tr <?php if(!$single_payment){ echo " id='" . $selection[$i]['id'] . "'"; echo (($payment!=$selection[$i]['id'])?'style="display:none"':'');}?>>
								<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
								<td colspan="4"><table border="0" cellspacing="0" cellpadding="2" align="left" width="60%">
							<?php for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {?>
								<tr>
									<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
									<td class="main" nowrap><?php echo $selection[$i]['fields'][$j]['title']; ?></td>
									<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
									<td class="main" nowrap><?php echo $selection[$i]['fields'][$j]['field']; ?></td>
									<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
								  </tr>
							<?php   } ?>
							</table>
							</td>
							</tr>
							<?php }?>
				</table>
				</td>
				</tr>
				<?php 
					$radio_buttons++;
				 // }
				  
				  }
				?>
            </table>
			</td>
          </tr>
		  <?php tep_content_title_bottom();?>
		   </table>
		</td>
      </tr>
		<tr>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
		</tr>
		
<?php  
$serverDate=getserverDate();
$coupon_check_qry = tep_db_query("select * from " . TABLE_COUPONS . " where '". $serverDate ."' <= coupon_expire_date and '". $serverDate ."' >= coupon_start_date and coupon_active='Y' ");
	if(tep_db_num_rows($coupon_check_qry)){
	require(DIR_WS_CLASSES . 'order_total.php');//ICW ADDED FOR CREDIT CLASS SYSTEM
  	$order_total_modules = new order_total;//ICW ADDED FOR CREDIT CLASS SYSTEM
?>
	<tr>
		<td>
		<table cellspacing="0" cellpadding="0" width="100%" border="0" class="attributes-odd">
			<?php tep_content_title_top('Gift Vouchers')?>
			<tr>
				<td><?php echo tep_draw_separator('pixel_trans.gif','100%','5')?></td>
			</tr>	
			<tr>
				<td class="main" >
					<table border="0" width="100%" cellspacing="1" cellpadding="2" >
					<tr><td id="error_span"></td></tr>
					<tr id="gv_chk">
					<td class="main" height="20"><?php //echo tep_draw_separator('pixel_trans.gif',40,1); ?>&nbsp;&nbsp;&nbsp;&nbsp;<b>Redeem your Gift Voucher: </b> <?php echo tep_draw_checkbox_field('coupon','1',false,'','onclick=javascript:hide_credit()');?></td>
					</tr>
					<tr>
						<td id="credit_result" class="smalltext" align="center" style="display:none;height:100;width:100%;">	</td>
					</tr>
					<tr id="credit" style="display:none">
					<td class="main" >
						<table border="0" cellpadding="0" cellspacing="0" width="70%" >
							<tr height="8"><td></td></tr>
							<tr>
							<td class="main" nowrap>&nbsp;&nbsp;&nbsp;&nbsp;Discount Coupon/Gift Voucher Redeem</td>						</tr>
						<tr>
						<td>
						<table>
						<?php echo $order_total_modules->credit_selection(); ?>
						</table>
						</td>
						</tr>
							</tr>  
						</table>
					</td>
					</tr>	
					</table>
				</td>
			</tr>
			<tr>
				<td><?php tep_content_title_bottom()?></td>
			</tr>
      		</table>
	  	</td>
		</tr>
	 <?php }
	 
	 
	 //exit;?>
	 </table>
	</td>
	</tr>
	<table border="0" width="100%" cellspacing="0" cellpadding="0">
	 <tr>
        <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
    </tr>
	<tr>
	  	  <td  width="100%" align="center"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>		
	  <td width="100%">
	  <table width="100%">
	        <tr>
				<td  align="left" width="50%"><?php  echo '<a href="javascript:show_step_number(2);">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
        		<td class="main" align="right" width="50%"><?php echo '<a href="javascript:do_page_fetch(\'submit_payment_details\');">' . tep_image_button('button_continue.gif', IMAGE_CONTINUE,'name="button_confirm5" id="button_confirm5"') . '</a>'; ?></td>
			</tr>
		</table>
      </td>
      </tr>
	  </table>
	 <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
	<table border="0" width="100%" cellspacing="0" cellpadding="0">
	 <tr>
        <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
    </tr>
	<tr>
	<td width="25%">
	<table border="0" width="100%" cellspacing="0" cellpadding="0">
		<tr>
		<td width="50%" align="right"><?php echo tep_draw_separator('pixel_black.gif', '1', '5'); ?></td>
		<td width="50%"><?php echo tep_draw_separator('pixel_black.gif', '100%', '1'); ?></td>
		</tr>
	</table>
	</td>
	<td width="25%">
	<table border="0" width="100%" cellspacing="0" cellpadding="0">
		<tr>
		<td width="50%"><?php echo tep_draw_separator('pixel_black.gif', '100%', '1'); ?></td>
		<td><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td>
		<td width="50%"><?php echo tep_draw_separator('pixel_black.gif', '100%', '1'); ?></td>
		</tr>
	</table>
	</td>
	<td width="25%"><?php echo tep_draw_separator('pixel_black.gif', '100%', '1'); ?></td>
	<td width="25%">
	<table border="0" width="100%" cellspacing="0" cellpadding="0">
		<tr>
			<td width="50%"><?php echo tep_draw_separator('pixel_black.gif', '100%', '1'); ?></td>
			<td width="50%"><?php echo tep_draw_separator('pixel_black.gif', '1', '5'); ?></td>
		</tr>
	</table>
	</td>
	</tr>
	<tr>
	<td align="center" width="25%" class="checkoutBarFrom"><?php echo '<a href="javascript:show_step_number(4);" class="checkoutBarFrom">' . CHECKOUT_BAR_DELIVERY . '</a>'; ?></td>
	<td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>
	<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
	<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
	</tr>
	</table>
	</form></td></tr>
</table>
<?php
function tep_get_title($ind)
{
	switch($ind)
	{
		case 0:
			return TEXT_HEADING_PRODUCTS;
			break;
		case 1:
			return TEXT_HEADING_EVENTS;
			break;
		case 2:
			return TEXT_HEADING_SUBSCRIPTIONS;
			break;
		case 3:
			return TEXT_HEADING_SERVICES;
			break;
	}
}
function get_order_total($class_val,$order_id)
{
	$query=tep_db_query("select value from " . TABLE_ORDERS_TOTAL . " where orders_id=" . (int)$order_id . " and class='" . $class_val ."'");
	$row=tep_db_fetch_array($query);
	return $row['value'];
}
?>