<?php
// Set flag that this is a parent file
	defined('_FEXEC') or die();
  $valid_to_checkout= true;
  $booking_type=''; 
//print_r ($_SESSION); 
 $sql_query=tep_db_query("select * from orders_total where class='ot_adjust' and orders_id='" . $order_id. "'");
 
		if(tep_db_num_rows($sql_query)>0)
		{
			$row=tep_db_fetch_array($sql_query);
			$adjust_value=$row['value'];
			$adjust_text=$row['text'];
			}
	
  if($HTTP_GET_VARS['service_id']>0){
  	$service_info=get_services_info($HTTP_GET_VARS['service_id']);
  	$booking_type=$service_info['booking_type'];	 
  }
?>
<table  border="0" width="100%" cellspacing="2" cellpadding="1">
	<tr>
	<td  valign="top" width="100%">
<?php //echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'event_action=update_cart')); ?>
<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
<?php
	$type_array=array('B'=>TEXT_SUBSCRIPTION_BASIC,
					'C'=>TEXT_SUBSCRIPTION_CASUAL,
					'S'=>TEXT_SUBSCRIPTION_SEASONAL
					);
	/*$customers_name="";
	$no_attendees=$cart->get_max_attendees()-1;
	$customers_list=$cart->attendees;
	for($icnt=0;$icnt<$no_attendees;$icnt++){
		$customer=$customers_list[$icnt];
		$customers_name.="<a href='".tep_href_link(FILENAME_CHECKOUT_ATTENDEES,'mode=edit&'.tep_get_all_get_params())."'>".$customer['first_name'].' '.$customer['last_name']."</a>,";
	} 
	$customers_name=substr($customers_name,0,-1);*/
	// BOF: Lango Added for template MOD
?>	<tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	</tr>
      <tr>
        <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="5">
          <tr>
			<td class="infoBoxHeading"><font color="#003366"><b><?php echo TEXT_NAME;?></b></font>
            <?php echo tep_customers_name($customer_id); ?>&nbsp;<span  id="img_process2"></span></td>
          </tr>
        </table></td>
      </tr>
		<tr>
		<td colspan="5"><?php echo tep_draw_separator('pixel_trans.gif', '1', '3'); ?></td> 
		</tr>
		<tr>
		<td ><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> 
		</tr>
<?php
$dis_time_format="";
if(defined('TIME_FORMAT'))
	$dis_time_format=TIME_FORMAT;
	
$show_shipping=false;
//echo tep_session_is_registered('customer_id') . 'ok';
	//if ($cart->count_contents() > 0) {?>
	<!-- Begin Hide Products -->
	<?php
	$any_out_of_stock = 0;
	$products = $cart->get_products();
	//print_r($products);
	$switch_continue_shopping = true;
	//print_r($products);
	for ($i=0, $n=sizeof($products); $i<$n; $i++) {
		// Push all attributes information in an array
		if($products[$i]['element_type']=='V'){
			$switch_continue_shopping = false;
		}
		if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
			while (list($option, $value) = each($products[$i]['attributes'])) {
				if ($products[$i]['element_type']=="V"){
					$attributes = tep_db_query("select vopt.services_options_name as products_options_name, voval.services_options_values_name as products_options_values_name, va.options_values_price as options_values_price, va.price_prefix
											  from " . TABLE_SERVICES_OPTIONS . " vopt, " . TABLE_SERVICES_OPTIONS_VALUES . " voval, " . TABLE_SERVICES_ATTRIBUTES . " va
											  where va.service_id = '" . $products[$i]['id'] . "'
											   and va.options_id = '" . $option . "'
											   and va.options_id = vopt.services_options_id
											   and va.options_values_id = '" . $value . "'
											   and va.options_values_id = voval.services_options_values_id
											   and vopt.language_id = '" . $languages_id . "'
											   and voval.language_id = '" . $languages_id . "'");
				} else { 
					$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
						from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
						where pa.products_id = '" . (int)$products[$i]['id'] . "'
						 and pa.options_id = '" . (int)$option . "'
						 and pa.options_id = popt.products_options_id
						 and pa.options_values_id = '" . (int)$value . "'
						 and pa.options_values_id = poval.products_options_values_id
						 and popt.language_id = '" . (int)$languages_id . "'
						 and poval.language_id = '" . (int)$languages_id . "'");
			  }     
			  $attributes_values = tep_db_fetch_array($attributes);
			  $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name'];
			  $products[$i][$option]['options_values_id'] = $value;
			  $products[$i][$option]['products_options_values_name'] = $attributes_values['products_options_values_name'];
			  $products[$i][$option]['options_values_price'] = $attributes_values['options_values_price'];
			  $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix']; 
			  
			}
		}
	}
	$info_content=array();
	$RowStyle = "dataTableContent";
	//print_r($products);
	 for ($i=0, $n=sizeof($products); $i<$n; $i++) {
	 		$attendee_names="";
		  if ($products[$i]['element_type']=='E'){
				/*$info_content[1].='	  <tr class="attributes-even">' . "\n" .
			   '<td class="' . $RowStyle . '" valign="top" align="center" width="10%">' . tep_draw_checkbox_field('cart_delete[]', $products[$i]['sh_id']) . tep_draw_hidden_field('products_type[]', $products[$i]['element_type']) . '</td>' ;
			   //$info_content[1].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="40%">' . tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="2" readonly="true"') . tep_draw_hidden_field('products_id[]', $products[$i]['sh_id']) . tep_draw_hidden_field('product_id[]', $products[$i]['id']) . tep_draw_hidden_field('element_type[]', $products[$i]['element_type']) . 
			  // ' x ' . "<input name='txt_name' size='40' class='inputnormal' value='" . $products[$i]['name'] . "' readonly='true'></td>";
			   $info_content[1].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="40%">' .  $products[$i]['quantity'] . tep_draw_hidden_field('cart_quantity[]', $products[$i]['quantity']) .  tep_draw_hidden_field('products_id[]', $products[$i]['sh_id']) . tep_draw_hidden_field('product_id[]', $products[$i]['id']) . tep_draw_hidden_field('element_type[]', $products[$i]['element_type']) . 
			   ' x ' . "<input name='txt_name[]' size='40' class='inputnormal' value='" . $products[$i]['name'] . "' readonly=true></td>";
			    $sessions=&$products[$i]['sessions'];
				$dates="";
				reset($sessions);
				while(list($id,$session)=each($sessions)){
					if ($dates!="") $dates.=", ";
					$dates.=date(EVENTS_DATE_FORMAT,strtotime($sessions[$id]['date']));
				}
			   $info_content[1].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="10%">' .  $dates . '</td>';
	   		   //$info_content[1].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="10%"><input type=text name="txt_tax" style="text-align:right" class="inputnormal" value=' .  $products[$i]['tax'] . ' size=4 readonly="true">%</td>';
	   		   //$info_content[1].= '	    <td class="' . $RowStyle . '" valign="top" align="right" width="10%">' .  $currencies->format($products[$i]['final_price']) . '</td>';
	   		   $info_content[1].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="10%"><input type=text name="txt_tax[]" style="text-align:right" class="inputnormal" value=' .  $products[$i]['tax'] . ' size=4 readonly=true>%</td>';
	   		   $info_content[1].= '	    <td class="' . $RowStyle . '" valign="top" align="right" width="10%"><input type=text name="txt_price[]" style="text-align:right" class="inputnormal" value=' .  $currencies->format($products[$i]['final_price']) . ' size=6 readonly=true></td>';
			   $info_content[1].= '	    <td class="' . $RowStyle . '" valign="top" align="right" width="10%">' .  $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</td></tr>';*/
			   
			   
			   $sessions=&$products[$i]['sessions'];
			  // while(list($id,$session)=each($sessions)){
				   $info_content[1].='	  <tr class="attributes-even">' . "\n" . 
				   	'<td>' . tep_draw_hidden_field('products_type[]', $products[$i]['element_type']) . '</td>';
				  // '<td class="' . $RowStyle . '" valign="top" align="center" width="10%">' . tep_draw_checkbox_field('cart_delete[]', $products[$i]['sh_id']) . tep_draw_hidden_field('products_type[]', $products[$i]['element_type']) . '</td>' ;
				   //$info_content[1].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="40%">' . tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="2" readonly="true"') . tep_draw_hidden_field('products_id[]', $products[$i]['sh_id']) . tep_draw_hidden_field('product_id[]', $products[$i]['id']) . tep_draw_hidden_field('element_type[]', $products[$i]['element_type']) . 
				  // ' x ' . "<input name='txt_name' size='40' class='inputnormal' value='" . $products[$i]['name'] . "' readonly='true'></td>";
				   $info_content[1].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="40%">' .  $products[$i]['quantity'] . tep_draw_hidden_field('cart_quantity[]', $products[$i]['quantity']) .  tep_draw_hidden_field('products_id[]', $products[$i]['sh_id']) . tep_draw_hidden_field('product_id[]', $products[$i]['id']) . tep_draw_hidden_field('element_type[]', $products[$i]['element_type']) . 
				   ' x ' . "<input name='txt_name[]' size='40' class='inputnormal' value='" . $products[$i]['name'] . "' readonly=true></td>";
				
					/*$dates="";
					reset($sessions);
					while(list($id,$session)=each($sessions)){
						if ($dates!="") $dates.=", ";
						$dates.=date(EVENTS_DATE_FORMAT,strtotime($sessions[$id]['date']));
					}*/
				   $info_content[1].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="10%"style="font-size:10px"><b>'.count($sessions).'</b></td>';
				   //$info_content[1].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="10%"><input type=text name="txt_tax" style="text-align:right" class="inputnormal" value=' .  $products[$i]['tax'] . ' size=4 readonly="true">%</td>';
				   //$info_content[1].= '	    <td class="' . $RowStyle . '" valign="top" align="right" width="10%">' .  $currencies->format($products[$i]['final_price']) . '</td>';
				   $info_content[1].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="10%"><input type=text name="txt_tax[]" style="text-align:right" class="inputnormal" value=' .  $products[$i]['tax'] . ' size=4 readonly=true>%</td>';
				   $info_content[1].= '	    <td class="' . $RowStyle . '" valign="top" align="right" width="10%"><input type=text name="txt_price[]" style="text-align:right" class="inputnormal" value=' .  $currencies->format($products[$i]['price']/count($sessions)) . ' size=6 readonly=true></td>';
				   $info_content[1].= '	    <td class="' . $RowStyle . '" valign="top" align="right" width="10%">' .  $currencies->display_price($products[$i]['price'], $products[$i]['tax'], $products[$i]['quantity']) . '</td></tr>';
				//}  
				 reset($sessions);
				if(count($sessions)>0) {
					 $info_content[1].='<tr class="attributes-even">' . "\n" .
					 						'<td></td><td></td><td class="' . $RowStyle . '" valign="top" algin="right"><table cellpadding="2" cellspacing="2" width="100%" border="0">' ;		
					while(list($id,$session)=each($sessions)){
						$info_content[1].='<tr><td width="20%"></td><td class="' . $RowStyle . '" valign="" algin="right" width="20%">' . tep_draw_checkbox_field('cart_delete[]', $id) . '</td><td class="' . $RowStyle . '" valign="center" align="left" width="60%">'  .$sessions[$id]['date'] . '</tr>';
						
				   }
				   $info_content[1].='</table></td></tr>';
				}   
			 
			   if( $products[$i]['quantity']>1) {
			   	$attendee_names .= $cart->get_attendee_names(",");
			   	$info_content[1].= '	    <tr><td valign="top" colspan="6" style="padding-left:50px;padding-bottom:10px"><b>Multiple Attendees: </b><br>' . substr($attendee_names,0,-1) . '</td></tr>';
			   }
			   
		  } else if ($products[$i]['element_type']=='S'){
				$info_content[2].='	  <tr class="attributes-even">' . "\n" .
			   '        <td class="' . $RowStyle . '" valign="top" align="center" width="10%">' . tep_draw_checkbox_field('cart_delete[]', $products[$i]['sh_id']) . tep_draw_hidden_field('products_type[]', $products[$i]['element_type']) . '</td>' ;
			   //$info_content[2].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="40%">' . tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="2" readonly="true"') . tep_draw_hidden_field('products_id[]', $products[$i]['sh_id']) . tep_draw_hidden_field('product_id[]', $products[$i]['id']) . tep_draw_hidden_field('element_type[]', $products[$i]['element_type']) . 
			   //' x ' . "<input name='txt_name' size='40' class='inputnormal' value='" . $products[$i]['name'] . "' readonly='true'>";
			   $info_content[2].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="40%">' . $products[$i]['quantity'] . tep_draw_hidden_field('cart_quantity[]', $products[$i]['quantity']) .  tep_draw_hidden_field('products_id[]', $products[$i]['sh_id']) . tep_draw_hidden_field('product_id[]', $products[$i]['id']) . tep_draw_hidden_field('element_type[]', $products[$i]['element_type']) . 
			   ' x ' . "<input name='txt_name[]' size='40' class='inputnormal' value='" . $products[$i]['name'] . "' readonly=true>";
   			   $info_content[2].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="10%" style="font-size:10px"><b>' .  $type_array[$products[$i]['subscription_type']] . '</b></td>';
	   		   //$info_content[2].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="10%"><input type=text name="txt_tax" class="inputnormal" style="text-align:right" value=' .  $products[$i]['tax'] . ' size=4 readonly="true">%</td>';
	   		   //$info_content[2].= '	    <td class="' . $RowStyle . '" valign="top" align="right" width="10%">' .  $currencies->format($products[$i]['final_price']) . '</td>';
	   		   $info_content[2].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="10%"><input type=text name="txt_tax[]" class="inputnormal" style="text-align:right" value=' .  $products[$i]['tax'] . ' size=4 readonly=true>%</td>';
	   		   $info_content[2].= '	    <td class="' . $RowStyle . '" valign="top" align="right" width="10%"><input type=text name="txt_price[]" class="inputnormal" style="text-align:right" value=' .  $currencies->format($products[$i]['final_price']) . ' size=6 readonly=true></td>';
			   $info_content[2].= '	    <td class="' . $RowStyle . '" valign="top" align="right" width="10%">' .  $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</td></tr>';
			   
		  }else if ($products[$i]['element_type']=='V'){
		  
				$info_content[3].='	  <tr class="attributes-even">' . "\n" .
			   '        <td class="' . $RowStyle . '" valign="top" align="center" width="10%">' . tep_draw_checkbox_field('cart_delete[]', $products[$i]['sh_id']) . tep_draw_hidden_field('products_type[]', $products[$i]['element_type']) . '</td>' ;
			   //$info_content[3].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="40%">' . tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="2" readonly="true"') . tep_draw_hidden_field('products_id[]', $products[$i]['sh_id']) . tep_draw_hidden_field('product_id[]', $products[$i]['id']) . tep_draw_hidden_field('element_type[]', $products[$i]['element_type']) . 
			  // ' x ' . "<input class='inputnormal' name='txt_name' size='40' value='" . $products[$i]['name'] . "' readonly='true'>";
			   $info_content[3].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="40%">' . $products[$i]['quantity'] . tep_draw_hidden_field('cart_quantity[]', $products[$i]['quantity']) . tep_draw_hidden_field('products_id[]', $products[$i]['sh_id']) . tep_draw_hidden_field('product_id[]', $products[$i]['id']) . tep_draw_hidden_field('element_type[]', $products[$i]['element_type']) . 
			   ' x ' . "<input class='inputnormal' name='txt_name[]' size='40' value='" . $products[$i]['name'] . "' readonly=true>";
			   	if($products[$i]['others']['end_date'] && $products[$i]['others']['end_time']){					 
					$str_time=strtotime($products[$i]['others']['end_date'] .' '.$products[$i]['others']['end_time'])+(($booking_type=='D')?60:0);
					$products[$i]['others']['end_date']=date('Y-m-d',$str_time);
					$products[$i]['others']['end_time']=date('H:i:s',$str_time);
				}
				$stime="";
				$etime="";
				if($products[$i]['others']['start_time']) {
					$stime=date("h:i A",strtotime($products[$i]['others']['start_time']));
					if($dis_time_format!="") {
						if($dis_time_format=='24') {
							$stime=date("H:i",strtotime($products[$i]['others']['start_time']));
						}	
					}
				}	
				if($products[$i]['others']['end_time']) {
					$etime=date("h:i A",strtotime($products[$i]['others']['end_time']));
					if($dis_time_format!="") {
						if($dis_time_format=='24') {
							$etime=date("H:i",strtotime($products[$i]['others']['end_time']));
						}	
					}
				}	
				$info_content[3].='<br> - '.TEXT_START_DATE.' : '.(($products[$i]['others']['start_date'])?format_date($products[$i]['others']['start_date']):'') . '&nbsp;' . $stime . '&nbsp;<br> - ' .TEXT_END_DATE. ' &nbsp;: ' . (($products[$i]['others']['end_date'])?format_date($products[$i]['others']['end_date']):'');
				$info_content[3].='&nbsp;&nbsp;' . $etime;
				$tax_class_id_service=$products[$i]['tax_class_id'];
				if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
					$info_content[3].="<br><table border='0' cellspacing='0' cellpadding='0'>";
					reset($products[$i]['attributes']);
					while (list($option, $value) = each($products[$i]['attributes'])) {
						$option_price=tep_add_tax($products[$i][$option]['options_values_price'],tep_get_tax_rate($tax_class_id_service));
						if($products[$i][$option]['products_options_name']) $info_content[3].= '<tr><Td class="main"><nobr><small><i> - ' . $products[$i][$option]['products_options_name'] . ' : ' . $products[$i][$option]['products_options_values_name'] .'('.(($option_price>0)?$currencies->format($option_price):'').')'. '</i></small></nobr></td></tr>';						
					}
				 $info_content[3].="</table>";	
				}				
			   $info_content[3].='</td>';
	   		   $info_content[3].= '<td class="' . $RowStyle . '" valign="top" align="center" width="20%"  style="font-size:10px"><b>';
			   if($products[$i]['others']['resource_id'])$info_content[3].=''.tep_get_resource_name($products[$i]['others']['resource_id'],'resource_name',$languages_id).'('.$currencies->format($products[$i]['others']['resource_costs']).')';				
			   $info_content[3].='</b></td>';
			   //$info_content[3].= '<td class="' . $RowStyle . '" valign="top" align="center" width="10%"><input type=text name="txt_tax" class="inputnormal" style="text-align:right" value=' .  $products[$i]['tax'] . ' size=4 readonly="true">%</td>';
			   //$info_content[3].= '<td class="' . $RowStyle . '" valign="top" align="right" width="10%">' .  $currencies->format($products[$i]['final_price']) . '</td>';
			   $info_content[3].= '<td class="' . $RowStyle . '" valign="top" align="center" width="10%"><input type=text name="txt_tax[]" class="inputnormal" style="text-align:right" value=' .  $products[$i]['tax'] . ' size=4 readonly=true>%</td>';
			   $info_content[3].= '<td class="' . $RowStyle . '" valign="top" align="right" width="10%"><input type=text name="txt_price[]" class="inputnormal" style="text-align:right" value=' .  $currencies->format($products[$i]['final_price']) . ' size=6 readonly=true></td>';
			   $info_content[3].= '<td class="' . $RowStyle . '" valign="top" align="right" width="10%">' .  $currencies->display_price($products[$i]['final_price'], $products[$i]['tax'], $products[$i]['quantity']) . '</td></tr>';
		  } else { 
		  	$info_content[0].='	  <tr class="attributes-even">' . "\n" .
		   '        <td class="' . $RowStyle . '" valign="top" align="center" width="10%">' . tep_draw_checkbox_field('cart_delete[]', $products[$i]['sh_id']) . tep_draw_hidden_field('products_type[]', $products[$i]['element_type']) . '</td>' ;

			$check_product_break_sql = "select * from " . TABLE_PRODUCTS_PRICE_BREAK . " where products_id='" . $products[$i]['id'] . "' order by quantity";
			$check_product_break_query = tep_db_query($check_product_break_sql);
			if(tep_db_num_rows($check_product_break_query) > 0){
				$break_array = array();
				$break_array[] = array('id'=>1,'text'=>1);
				while($check_product_break_result = tep_db_fetch_array($check_product_break_query)){
					$break_array[] = array('id'=>$check_product_break_result['quantity'],'text'=>$check_product_break_result['quantity']);
				}
				$info_content[0].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="40%">' . tep_draw_pull_down_menu('cart_quantity[]', $break_array,$products[$i]['quantity']) . tep_draw_hidden_field('products_id[]', $products[$i]['sh_id']) .tep_draw_hidden_field('price_breaks[]', '1') . tep_draw_hidden_field('product_id[]', $products[$i]['id']) . tep_draw_hidden_field('element_type[]', $products[$i]['element_type']) . 
				' x ' . "<input name='txt_name[]' size='40' value='" . $products[$i]['name'] . "' class=inputnormal readonly='true'>";
			}else{
			if($order_id>0) {
			   $info_content[0].= '	    <td class="' . $RowStyle . '" valign="top" align="left" width="40%">' . tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="2" ') . tep_draw_hidden_field('products_id[]', $products[$i]['sh_id']) . tep_draw_hidden_field('price_breaks[]', '0') .tep_draw_hidden_field('product_id[]', $products[$i]['id']) . tep_draw_hidden_field('element_type[]', $products[$i]['element_type']) . 
			   ' x ' . "<input name='txt_name[]' size='40' value='" . $products[$i]['name'] . "' class=inputnormal readonly='true'>";
			   } else {
			   
			   			   $info_content[0].= '	    <td class="' . $RowStyle . '" valign="top" align="left" width="40%">' . tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="2" class=inputnormal readonly=true') . tep_draw_hidden_field('products_id[]', $products[$i]['sh_id']) . tep_draw_hidden_field('price_breaks[]', '0') .tep_draw_hidden_field('product_id[]', $products[$i]['id']) . tep_draw_hidden_field('element_type[]', $products[$i]['element_type']) . 
			   ' x ' . "<input name='txt_name[]' size='40' value='" . $products[$i]['name'] . "' class=inputnormal readonly='true'>";

			   }
			   
			}
			$info_content[0].=tep_draw_hidden_field('discount_ids[]', $products[$i]['discount_id']);

		   // Has Attributes?
		   if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) { 
		     reset($products[$i]['attributes']);
			 while (list($option, $value) = each($products[$i]['attributes'])) {
			   $info_content[0].= "<br><nobr><small>&nbsp;<i> - " . "<input name='txt_option_name[]' size='6' value='" . $products[$i][$option]['products_options_name'] . "' class=inputnormal readonly='true'>" . ": " . "<input name='txt_option_value[]' size='15' value='" . $products[$i][$option]['products_options_values_name'] . '-'.  $currencies->format(tep_add_tax($products[$i][$option]['options_values_price'],$products[$i]['tax'])). "'  class=inputnormal readonly='true'>";
			   $info_content[0].= '</i></small></nobr>';
               $info_content[0].= tep_draw_hidden_field('id[' . $products[$i]['sh_id'] . '][' . $option . ']', $value);
			}
			
		  }
		  if (isset($products[$i]['discount_whole_text'])!=''){
		  		$info_content[0].='<br>' . $products[$i]['discount_whole_text'];
		  }
		  $info_content[0].="</td>";
		   $info_content[0].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="20%" style="font-size:10px"><b>' .  $products[$i]['model'] . '</b></td>';
		   //$info_content[0].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="10%"><input type=text name="txt_tax" style="text-align:right" value=' .  $products[$i]['tax'] . ' size=4 class=inputnormal>%</td>';
		   //$info_content[0].= '	    <td class="' . $RowStyle . '" valign="top" align="right" width="10%">' .  $currencies->format($products[$i]['final_price']) . '</td>';
		   
		   if(tep_db_num_rows($check_product_break_query) > 0){
			   $info_content[0].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="10%"><input type=text name="txt_tax[]" style="text-align:right" value=' .  $products[$i]['tax'] . ' size=4 class=inputnormal readonly="true">%</td>';//
			   $info_content[0].= '	    <td class="' . $RowStyle . '" valign="top" align="right" width="10%"><input type=text name="txt_price[]" style="text-align:right" value=' .  $products[$i]['final_price'] . ' size=6 class=inputnormal readonly="true"></td>';
			} else {
			  if($order_id>0){
			   $info_content[0].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="10%"><input type=text name="txt_tax[]" style="text-align:right" value=' .  $products[$i]['tax'] . ' size=4 class=inputnormal >%</td>';//
			   $info_content[0].= '	    <td class="' . $RowStyle . '" valign="top" align="right" width="10%"><input type=text name="txt_price[]" style="text-align:right" value=' .  $currencies->format($products[$i]['final_price']) . ' size=6 class=inputnormal></td>';
			   } else {
			   
			   $info_content[0].= '	    <td class="' . $RowStyle . '" valign="top" align="center" width="10%"><input type=text name="txt_tax[]" style="text-align:right" value=' .  $products[$i]['tax'] . ' size=4 class=inputnormal readonly="true">%</td>';//
			   $info_content[0].= '	    <td class="' . $RowStyle . '" valign="top" align="right" width="10%"><input type=text name="txt_price[]" style="text-align:right" value=' .  $currencies->format($products[$i]['final_price']) . ' size=6 class=inputnormal></td>';

			   
			   
			   }
			}
			
		   $info_content[0].= '	    <td class="' . $RowStyle . '" valign="top" align="right" width="10%">' .  $currencies->display_price($products[$i]['final_price'] , $products[$i]['tax'], $products[$i]['quantity']) . '</td></tr>';
	   }
	 }
//}
	?>
	 <?php if(HIDE_FROM_BACKEND_MENU_PRODUCTS=='false'){
        tep_content_title_top(TEXT_HEADING_PRODUCTS); ?>
      <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '3'); ?></td>
      </tr>
  <!-- Begin Products Listing Block -->
      <tr>
	<td>
	<?php echo tep_draw_form('cart_quantity_p',FILENAME_SHOPPING_CART,'event_action=update_cart','post');?>
	<table border="0" width="100%" cellspacing="2" cellpadding="2" >
	<?php if(isset($info_content[0])){?>
	 <tr  height=30>
	    <td class="main" align="center" width="10%"><?php echo TABLE_HEADING_ACTION; ?></td>
	    <td class="main" align="center" width="40%"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
	    <td class="main" align="center" width="20%"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
	    <td class="main" align="center" width="10%"><?php echo TABLE_HEADING_TAX; ?></td>
	    <td class="main" align="right" width="10%"><?php echo TABLE_HEADING_UNIT_PRICE; ?></td>
	    <td class="main" align="right" width="10%"><?php echo TABLE_HEADING_TOTAL_PRICE; ?></td>
	  </tr>
	 <?php }?>
	<!-- Begin Products Listings Block -->
	<?php if(isset($info_content[0]))
	{
		$show_shipping=true;
		echo  $info_content[0];
	}?>
	<!-- End Products Listings Block -->
	
	<tr >
	    <td colspan=7 valign="middle" id="product_edit">
			<?php 
				echo '<a href="javascript:do_page_fetch(\'new_product\')">' . tep_image_button('button_add.gif',IMAGE_ADD,'align=absmiddle') . '</a>&nbsp;';
				if(isset($info_content[0])){
					echo '&nbsp;<a href="javascript:do_page_fetch(\'product_delete\')">' . tep_image_button('button_delete.gif',IMAGE_DELETE,'align=absmiddle') . '</a>';
				}
			?>
	</td></tr></table></form>
	<tr><td height=10 id="new_product" style="display:none" class="opencontent1"><img src="images/24-1.gif"></td></tr>
	<?php tep_content_title_bottom(); ?>
	
    <?php } ?>
    <!-- end  for checking hide product -->		
      <tr><td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td></tr>
	  	<!-- Begin Hide Events -->
    <?php if(HIDE_FROM_BACKEND_MENU_EVENTS=='false'){ 
			 tep_content_title_top(TEXT_HEADING_EVENTS); ?>
      <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '3'); ?></td>
      </tr>
<!-- Begin Events Listing Block -->
      <tr>
	<td>
	<?php echo tep_draw_form('cart_quantity_e',FILENAME_SHOPPING_CART,'event_action=update_cart','post');?>
	<table border="0" width="100%" cellspacing="2" cellpadding="2" >
	<?php if(isset($info_content[1])){?>
	  <tr  height=30>
	    <td class="main" align="center" width="10%"><?php echo TABLE_HEADING_ACTION; ?></td>
	    <td class="main" align="center" width="40%"><?php echo TABLE_HEADING_EVENTS; ?></td>
	    <td class="main" width="20%" align="center"><?php echo TABLE_HEADING_EVENTS_SESSION; ?></td>
	    <td class="main" align="center" width="10%"><?php echo TABLE_HEADING_TAX; ?></td>
	    <td class="main" align="right" width="10%"><?php echo TABLE_HEADING_UNIT_PRICE; ?></td>
	    <td class="main" align="right" width="10%"><?php echo TABLE_HEADING_TOTAL_PRICE; ?></td>
	  </tr> 
	  <?php $attendee_names .= $cart->get_attendee_names(",");
	  }?>
	<!-- Begin events Listings Block -->
	<?php if(isset($info_content[1]))
			echo  $info_content[1];?>
	<!-- End Events Listings Block -->
	<!--<tr>
		<td colspan=7 valign="middle" class="main">
			<?php //if(isset($info_content[1]) && $attendee_names!='' ){ echo '<b>Multiple Attendees:</b><br>';
					//$start_name=strpos($attendee_names,',',1);
					//echo substr($attendee_names,$start_name+1,-1);
					// echo substr($attendee_names,0,-1); 
					// }?>
		</td>
	</tr>-->
	<tr >
	    <td colspan=7 valign="middle" id="event_edit">
			<?php 
				echo '<a href="javascript:do_page_fetch(\'new_event\')">' . tep_image_button('button_add.gif',IMAGE_ADD,'align=absmiddle') . '</a>&nbsp;';
				if(isset($info_content[1])){
					echo '&nbsp;<a href="javascript:do_page_fetch(\'event_delete\')">' . tep_image_button('button_delete.gif',IMAGE_DELETE,'align=absmiddle') . '</a>';
				}
			?>
	</td></tr></table></form>
	<tr><td height=10 id="new_event" style="display:none" class="opencontent1"><img src="images/24-1.gif"></td></tr>
	<?php tep_content_title_bottom(); ?>
	<?php } ?>
    <!-- End for Hide Events-->
      <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
	<!-- Begin Hide Subscriptions -->
   <?php if(HIDE_FROM_BACKEND_MENU_SUBSCRIPTIONS=='false'){
    tep_content_title_top(TEXT_HEADING_SUBSCRIPTIONS);
	 		if($store_member) {
	 ?>
	 	<tr>
			<td class="messageStackWarning"><?php echo 'Store Member Subscriptions  linked  are not removed Seperately';?></td>
		</tr>	
	 <?php $store_member=false; } ?>
      <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '3'); ?></td>
      </tr>
	<!-- Begin subscription Listing Block -->
      <tr>
	<td>
	<?php 	 echo tep_draw_form('cart_quantity_s',FILENAME_SHOPPING_CART,'event_action=update_cart','post');?>
	<table border="0" width="100%" cellspacing="2" cellpadding="2" >
	<?php if(isset($info_content[2])){?>
		 <tr  height=30>
	    <td class="main" align="center" width="10%"><?php echo TABLE_HEADING_ACTION; ?></td>
	    <td class="main" align="center" width="40%"><?php echo TABLE_HEADING_SUBSCRIPTIONS; ?></td>
		<td class="main" align="center" width="20%"><?php echo TABLE_HEADING_PRODUCTS_TYPE; ?></td>
	    <td class="main" align="center" width="10%"><?php echo TABLE_HEADING_TAX; ?></td>
	    <td class="main" align="right" width="10%"><?php echo TABLE_HEADING_UNIT_PRICE; ?></td>
	    <td class="main" align="right" width="10%"><?php echo TABLE_HEADING_TOTAL_PRICE; ?></td>
	  </tr>
	  <?php }?>
	<!-- Begin Subscription Listings Block -->
	<?php if(isset($info_content[2]))
			echo  $info_content[2];?>
	<!-- End subscription Listings Block -->
	<tr >
	    <td colspan=7 valign="middle" id="subscription_edit">
			<?php 
				echo '<a href="javascript:do_page_fetch(\'new_subscription\')">' . tep_image_button('button_add.gif',IMAGE_ADD,'align=absmiddle') . '</a>&nbsp;';
				if(isset($info_content[2])){
					echo '&nbsp;<a href="javascript:do_page_fetch(\'subscription_delete\')">' . tep_image_button('button_delete.gif',IMAGE_DELETE,'align=absmiddle') . '</a>';
				}
			?>
	</td></tr></table></form>
	<tr><td height=10 id="new_subscription" style="display:none" class="opencontent1"><img src="images/24-1.gif"></td></tr>
	<?php tep_content_title_bottom(); ?>
	<!-- End for Hide Products -->
  <?php }?>
	<tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '3'); ?></td>
    </tr>
   <!-- end of Subscription  Block-->
   <!-- start service entry -->
      <?php if(HIDE_FROM_BACKEND_MENU_SERVICES=='false'){
	   tep_content_title_top(TEXT_HEADING_SERVICES); ?>
      <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '3'); ?></td>
      </tr>
<!-- Begin Products Listing Block -->
      <tr>
	<td>
   <?php echo tep_draw_form('cart_quantity_v',FILENAME_SHOPPING_CART,'event_action=update_cart','post');?>
	<table border="0" width="100%" cellspacing="2" cellpadding="2" >
	<?php if(isset($info_content[3])){?>
		 <tr  height=30>
	    <td class="main" align="center" width="10%"><?php echo TABLE_HEADING_ACTION; ?></td>
	    <td class="main" align="center" width="40%"><?php echo TABLE_HEADING_SERVICES; ?></td>
	    <td class="main" align="center" width="20%"><?php echo TEXT_RESOURCE; ?></td>
	    <td class="main" align="center" width="10%"><?php echo TABLE_HEADING_TAX; ?></td>
	    <td class="main" align="right" width="10%"><?php echo TABLE_HEADING_UNIT_PRICE; ?></td>
	    <td class="main" align="right" width="10%"><?php echo TABLE_HEADING_TOTAL_PRICE; ?></td>
	  </tr>
	 <?php }?>
	<!-- Begin Products Listings Block -->
	<?php if(isset($info_content[3]))
			echo  $info_content[3];?>
<!-- End Products Listings Block -->
	<tr >
	    <td colspan=7 valign="middle" id="service_edit">
			<?php 
				echo '<a href="javascript:do_page_fetch(\'new_service\')">' . tep_image_button('button_add.gif',IMAGE_ADD,'align=absmiddle') . '</a>&nbsp;';
				if(isset($info_content[3])){
					echo '&nbsp;<a href="javascript:do_page_fetch(\'service_delete\')">' . tep_image_button('button_delete.gif',IMAGE_DELETE,'align=absmiddle') . '</a>';
				}
			?>
	</td></tr></table></form>
	<tr><td height=10 id="new_service" style="display:none" class="opencontent1"><img src="images/24-1.gif"></td></tr>
	<?php tep_content_title_bottom();
	
	} ?>
	  <!-- end service entry -->
	  
	  <tr height="30">
    	 <td align="right" class="main"><b>
			<?php echo 'Ordered Total:'; 
        		  global $customer_id;
				  $ordered_tot=$cart->show_net_total(true);
				  echo $currencies->format($ordered_tot); 
			?></b>
		</td>
	</tr>
	 
	<!-- manual Price adjustment design start-->
   	<?php
	//manual Price adjustment
	if(sizeof($products)>=1){
	?>
	 <tr>
	   <td class="main"><?php 
	   	echo tep_draw_checkbox_field('manual_priceadjust_option','Y',($_SESSION['manual_option']=='Y'?true:false),'','id="manual_priceadjust_option" onClick="javascript:show_manual_price();"').' '. 'Add Manual Price Adjustment';?>
	   </td>
	 </tr>
	 <table border="0" width="100%" cellspacing="2" cellpadding="2" >	  
 		<tr>
			<td >
 			<?php if($_SESSION['manual_option']!='Y') $style="display:none"; ?>
    			 <span id="mpa" style="<?php echo $style; ?>" >
 				  <table border="0" width="100%" cellspacing="2" cellpadding="2" >
   					<tr>
  					 <td class="main" align="center">Purpose</td><td align="right" class="main">Manual Fees</td>
					</tr>
  	 				<tr>
					 <td align="center" class="main"><?php echo TEXT_MANUAL_PRICE_ADJUSTMENT .'&nbsp;&nbsp;'.tep_draw_input_field('purpose',$purpose,"size='40' id='purpose' "); ?></td>
					 <td align="right" class="TableHeading">
				 		 <select name="sign" id="sign" style="width:40px" onchange="modify_price()">
						 <option value="+" <?php if($_SESSION['sign']=='+') echo "selected"; ?>>+</option>
					   	 <option value="-" <?php if($_SESSION['sign']=='-') echo "selected"; ?>>-</option></select>
						<?php 
						  
						
						if($order_id>0){
						$sql_query=tep_db_query("select * from orders_total where class='ot_adjust' and orders_id='" . $order_id. "'");
						if(tep_db_num_rows($sql_query)>0)
							{
								$row=tep_db_fetch_array($sql_query);
								$adjust_value=$row['value'];
								if($_SESSION['sign']=='-')
								$rest = substr($adjust_value, 1);
								else
								$rest =$adjust_value;
								}
						}
							
						?>
						<input type="text" name="modify_price_prefix" size="6" id="modify_price_prefix"  onkeyup="modify_price()" value=<?php echo $rest; ?> ></td>
					</tr>
				  </table>
				  </span>
		      </td>
		 </tr>
	  </table> 
	 <?php 
	  } 
	  ?>
	  	<!-- manual Price adjustment design end -->

   
	<tr height="30">
    	 <td align="right" class="main"><b>
			<?php /* echo "Updated Amount: "; 
				// Discount Start
        		  global $customer_id;
				  $updatetot=$cart->show_total();
				  $content="updated_amount^" . $updatetot . "#";
           		  echo '<span class="priceText" id="up_tot" >'.$currencies->format($updatetot) . '</span>'; */
          		//Discount end
			?></b>
		</td>
	</tr>
	<tr height="30">
    	 <td align="right" class="main"><b>
			<?php echo SUB_TITLE_SUB_TOTAL; 
				// Discount Start
        		  global $customer_id;
				  
				  $nettot=$cart->show_net_total();
				  //print_r ($_SESSION);
				  // this content is for manual price adjustment 
				  $content.= "net_total^" . $nettot.'#||';
				  echo '<span class="priceText" id="net_tot" >'.$currencies->format($nettot) .'</span>'; 
				
        		  //Discount end
			?></b>
		</td>
	</tr>
		
	
     <tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" >
          <tr class="main">
            <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td width="10%" class="main" nowrap="nowrap">
					<?php 
						if(sizeof($products)>=1){
						  echo '<a href="javascript:do_page_fetch(\'update_cart\');">' . tep_image_button('button_update.gif', IMAGE_UPDATE) . '</a>&nbsp;&nbsp;';
						  }
						  
						 echo '<a href="javascript:show_step_number(1);">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>&nbsp;&nbsp;';

						  
					?>
					
				</td>
                <td align="right" class="main" nowrap>
					<?php 
						if(sizeof($products)>=1)
						echo '<a href="javascript:do_page_fetch(\'show_payment_address\');">' . tep_image_button('button_continue.gif', IMAGE_CONTINUE,'name="button_confirm2" id="button_confirm2"') . '</a>&nbsp;<span  id="img_process2"></span>'; ?>
				</td>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <?php 
      if ($show_shipping==true) {?>
      <tr>
        <td><br><?php require(DIR_WS_MODULES . 'shipping_estimator.php'); ?></td>
      </tr>
      <?php } ?>
     </table></td></tr> 
	</table>
	
