<div id="main_borders">
  <div id="main_inner_borders">
    <h2><strong>
      <?=$title?>
      </strong></h2>
       <? if ($this-> session-> flashdata('message')): ?>
    <div class='warning'>
      <?=$this-> session-> flashdata('message');?>
    </div>
    <? endif; ?>

<? if ($this->cart->contents()) { ?>
<div id="orderForm">
  <? $attributes = array('class' => 'yform','AUTOCOMPLETE'=>'off'); ?>
  <?=form_open('page/payment_method',$attributes); ?>
          <fieldset>
            <legend><?=$this->lang->line('select_payment_method')?></legend>
        <div class="type-check">
               <?=form_radio('select', 'Cash', FALSE); ?>
               <?=form_label($this->lang->line('cash_on_delivery'))?>
		</div>
        <div class="type-check">
               <?=form_radio('select', 'Bank', FALSE); ?>
               <?=form_label($this->lang->line('bank_deposit'))?>
		</div>
        <div class="type-check">
               <?=form_radio('select', 'Credit', FALSE); ?>
               <?=form_label($this->lang->line('credit_card'))?>
		</div>
        <div class="type-check">
               <?=form_radio('select', 'PayPal', FALSE); ?>
               <?=form_label($this->lang->line('pay_pal'))?>
		</div>
</fieldset>
<fieldset>
<legend><?=$this->lang->line('select_delivery_address')?></legend>
<? if ($orderdata['same_address']=='Yes') { ?>
   <? $countries = $this->MFuncs->getCountries();?>
   <? foreach ($countries as $countries => $country){
	$options_country[0] = 'Select Country';
	$options_country[$country['id']]=$country['name'] ;
	} ?>
			<div class="type-select"><? echo "<label for='country'>".$this->lang->line('country')."</label>";
	echo form_dropdown('country',$options_country, $userdata['country_id']) .""; ?>
			</div>      
        <div class="type-text"> 
        <?=form_label(lang('address'), 'address')?> 
        <? $data = array('name'=>'address','id'=>'address','size'=>25, 'value'=>$userdata['address'])?> 
        <?=form_input($data); ?> 
        </div>
        <div class="type-text"> 
        <?=form_label(lang('city'), 'city')?>
        <? $data = array('name'=>'city','id'=>'city','size'=>25, 'value'=>$userdata['city'])?> 
        <?=form_input($data); ?> 
        </div>
        <div class="type-text"> 
        <?=form_label(lang('postal'), 'postal')?>
        <? $data = array('name'=>'postal','id'=>'postal','size'=>25, 'value'=>$userdata['postal'])?> 
        <?=form_input($data); ?> 
        </div>
        <div class="type-text"> 
        <?=form_label(lang('floor'), 'floor')?>
        <? $data = array('name'=>'floor','id'=>'floor','size'=>25, 'value'=>$userdata['floor'])?> 
        <?=form_input($data); ?> 
        </div>
        <div class="type-text"> 
        <?=form_label(lang('name_bell'), 'name_bell')?>
        <? $data = array('name'=>'name_bell','id'=>'name_bell','size'=>25, 'value'=>$userdata['name_bell'])?> 
        <?=form_input($data); ?> 
        </div>
        <? }else {?>
   <? $countries = $this->MFuncs->getCountries();?>
   <? foreach ($countries as $countries => $country){
	$options_country[0] = 'Select Country';
	$options_country[$country['id']]=$country['name'] ;
	} ?>
		<div class="type-select"><? echo "<label for='country'>".$this->lang->line('country')."</label>";
			echo form_dropdown('country',$options_country, $orderdata['country_id']) .""; ?>
		</div>      
        <div class="type-text"> 
        <?=form_label(lang('address'), 'address')?>
        <? $data = array('name'=>'address','id'=>'address','size'=>25, 'value'=>$orderdata['address'])?> 
        <?=form_input($data); ?> 
        </div>
        <div class="type-text"> 
        <?=form_label(lang('city'), 'city')?>
        <? $data = array('name'=>'city','id'=>'city','size'=>25, 'value'=>$orderdata['city'])?> 
        <?=form_input($data); ?> 
        </div>
        <div class="type-text"> 
        <?=form_label(lang('postal'), 'postal')?>
        <? $data = array('name'=>'postal','id'=>'postal','size'=>25, 'value'=>$orderdata['postal'])?> 
        <?=form_input($data); ?> 
        </div>
        <div class="type-text"> 
        <?=form_label(lang('floor'), 'floor')?>
        <? $data = array('name'=>'floor','id'=>'floor','size'=>25, 'value'=>$orderdata['floor'])?> 
        <?=form_input($data); ?> 
        </div>
        <div class="type-text"> 
        <?=form_label(lang('name_bell'), 'name_bell')?>
        <? $data = array('name'=>'name_bell','id'=>'name_bell','size'=>25, 'value'=>$orderdata['name_bell'])?> 
        <?=form_input($data); ?> 
        </div>
        <? } ?>
        </fieldset>
          <fieldset>
            <legend><?=$this->lang->line('select_receipt_method')?></legend>
        <div class="type-check">
               <?=form_radio('select2', 'receipt', FALSE); ?>
               <?=form_label($this->lang->line('type_receipt'))?>
		</div>
        <div class="type-check">
               <?=form_radio('select2', 'invoice', FALSE); ?>
               <?=form_label($this->lang->line('type_invoice'))?>
		</div>
</fieldset>
           <fieldset>
            <legend><?=$this->lang->line('insert_offer_code')?></legend>
        <div class="type-text"> 
        <?=form_label(lang('offer_code'), 'offer_code')?>
        <? $data = array('name'=>'offer_code','id'=>'offer_code','size'=>25)?> 
        <?=form_input($data); ?> 
        </div>
</fieldset>
       <div class="buttons"><?=anchor("view_cart", $this->lang->line('shopping_cart'),array('id'=>'back_btn','class'=>'positive'))?>
<button type="submit" class="positive"> <?=$this->lang->line('continue')?> </button></div>
 <?=form_close();?>

</div><div style="clear:both"></div>
</div>
<? } else { 
redirect('home','location');
} ?>

</div>