Location: PHPKode > projects > Your online shop > includes/sites/singranos/languages/lituano/check_out_1.php
<?php

 #--> Conexión con la base de datos
 if (!$server->db) {
   $server->db=new database;
   $server->db->my_connect() or die("Could not connect");
 }
#<-- Conexión con la base de datos

 #Actualizamos los datos del usuario. Primero lo reseteamos por si es otro usuario
	$mylanguage=$user->language;
	$myreferer=$user->referer;
	$user=new user();
	$user->phone=$_POST['phone'];
	$user->language=$mylanguage;
	$user->referer=$myreferer;
	$user->address=new address();	//Algunas operaciones requerirán de la dirección
	#Cargamos los datos de usuario si existe un usuario con ese teléfono
	if ( $user->check_phone() ) {
	  $user->db_login_phone();
	}

	#Guardamos el usuario en la sesión
	$_SESSION["ser_user"]=serialize($user);
?>
<div class="basket_overview">
          <table width="100%" border="0" cellspacing="0" cellpadding="0" id="order">
            <tr> 
              <th width="65%">Produktas</th> 
              <th width="12%">Kiekis</th> 
              <th width="12%">Kaina</th> 
              <th width="11%">Viso</th>
	    </tr>
            <tr>
              <td colspan="4" class="hr"></td>
            </tr>
            <tr class="total">
              <td colspan="3" class="total"><label>Kaina be pristatymo:</label></td>
              <td id="subTotal"></td>
            </tr>
            <tr id="discount" class="total">
              <td colspan="3"><label>Nuolaida: <span id="discountPc"></span></label></td>
              <td id="discountValue"></td>
            </tr>
            <tr class="total">
              <td colspan="3"><label>Pristatymas:</label></td>
              <td id="shippingCost" ></td>
            </tr>
            <tr class="total">
              <td colspan="3"><label>Viso:</label></td>
              <td id="total"></td>
            </tr>
          </table>
<table id="infoShipping"></table>
</div>
<FORM ACTION="?seccion=check_out_2" METHOD="POST" ENCTYPE="application/x-www-form-urlencoded" id="checkOutForm" rel="rightContentBox">
<!-- Imprimimos el formulario-->
<div class="formMarco">
      <TABLE width="100%" class="form">
        <TR> 
          <TH COLSPAN="2">Pristatymo adresas:</TH>
        </TR>
        <TR> 
          <TD COLSPAN="2" align="center">Pristatymai dažniausiai yra darbo laiku, todėl jeigu žinote jei nebusite namie, geriau pateikti darbo adresą.</TD>
        </TR>
        <TR> 
          <TD WIDTH="33%" HEIGHT="33" align="right">Vardas:</TD>
          <TD WIDTH="67%" HEIGHT="33"> <INPUT class="reqd" TYPE="TEXT" NAME="entry_firstname" SIZE="20" value="<?php print $user->address->firstname;?>"> 
          </TD>
        </TR>
        <TR> 
          <TD WIDTH="33%" HEIGHT="33" align="right">Pavardė:</TD>
          <TD WIDTH="67%" HEIGHT="33"> <INPUT TYPE="TEXT" NAME="entry_lastname" SIZE="30" value="<?php print $user->address->lastname;?>"> 
          </TD>
        </TR>
        <TR> 
          <TD WIDTH="33%" HEIGHT="33" align="right">Įmonė (Neprivaloma) &nbsp;&nbsp; 
          </TD>
          <TD WIDTH="67%" HEIGHT="33"> <INPUT TYPE="TEXT" NAME="delivery_company" SIZE="30" value="<?php print $user->address->company;?>"> 
          </TD>
        </TR>
        <TR> 
          <TD WIDTH="33%" HEIGHT="33" align="right">Pilnas adresas:</TD>
          <TD WIDTH="67%" HEIGHT="33"> <INPUT class="reqd" TYPE="TEXT" NAME="delivery_street_address" SIZE="40" value="<?php print $user->address->street_address;?>"> 
          </TD>
        </TR>
<TR> 
          <TD WIDTH="33%" HEIGHT="33" align="right">Å alis:</TD>
          <TD WIDTH="67%" HEIGHT="33"> 
            <?php
#Ponemos los posibles paises

if (!isset($user->address->country_id)) $user->address->country_id=DEFAULT_COUNTRY_ID;
print '<select id="country" name="country" rel="alertConfirm" href="?seccion=provinces" class="getText">';

$consulta="SELECT countries_id, countries_country_name FROM " .
			'AloePaises' . " p" .
			" WHERE 1".
			" order by p.countries_country_name asc";

$result = mysql_query($consulta);
$numResultados=mysql_affected_rows();

for($i=0;$i<$numResultados;$i++)
{
	list($idP, $nomPais)=mysql_fetch_row($result);
	if ($idP==$user->address->country_id) {
	  print '<option selected value="'.$idP.'">'.$nomPais.'</option>';
	  $country=$nomPais;
	}
	else print '<option value="'.$idP.'">'.$nomPais.'</option>';
}

print "</select>";
?>
          </TD>
        </TR>
        <TR> 
          <TD WIDTH="33%" HEIGHT="33" align="right">Miestas:</TD>
          <TD WIDTH="67%" HEIGHT="33"> <INPUT TYPE="TEXT" NAME="delivery_city" SIZE="25" value="<?php print $user->address->city;?>"> 
          </TD>
        </TR>
        <TR> 
          <TD WIDTH="33%" HEIGHT="33" align="right"><FONT CLASS="comprimida">Savivaldybė:</FONT></TD>
          <TD WIDTH="67%" HEIGHT="33"> 
            <?php
#La provincia y el estado son lo mismo. Recogemos las provincias por zonas y luego las ponemos en el state que es lo que importa
print '<select id="state" name="state" rel="alert" href="?seccion=shipping"  class="getText">';
$consulta="SELECT zone_id, zone_name FROM " .
			TABLE_ZONES . " z" .
			" WHERE z.zone_country_id=" . $user->address->country_id .
			" order by z.zone_name asc";

$result = mysql_query($consulta);
$numResultados=mysql_affected_rows();

for($i=0;$i<$numResultados;$i++)
{
	list($idProv, $nomProv)=mysql_fetch_row($result);
	if ($idProv==$user->address->zone_id) print '<option selected value="'.$idProv.'">'.$nomProv.'</option>';
	else print '<option value="'.$idProv.'">'.$nomProv.'</option>';
}

print "</select>";
?>
<input type="hidden" id="delivery_state" NAME="delivery_state" value=""/>
          </TD>
        </TR>
        <TR> 
          <TD WIDTH="33%" HEIGHT="33" align="right">Pašto kodas:</TD>
          <TD WIDTH="67%" HEIGHT="33"> <INPUT TYPE="TEXT" NAME="delivery_postcode" SIZE="25" value="<?php print $user->address->postcode;?>"> 
          </TD>
        </TR>
        <TR> 
          
        <TD WIDTH="33%" align="right">Telefonas:</TD>
          <TD WIDTH="67%"> <INPUT class="reqd" TYPE="TEXT" NAME="customers_telephone" SIZE="20" VALUE="<?php if ($user->phone) print $user->phone; else print $_POST['phone'];?>">
         </TD>
        </TR>
          <TD WIDTH="33%" align="right">E-Mail:</TD>
          <TD WIDTH="67%"> <INPUT TYPE="TEXT" NAME="customers_email_address" SIZE="25" value="<?php print $user->email;?>"> 
          </TD>
        </TR>
      </TABLE>
	</div>
	<div class="formMarco">
	<TABLE width="100%" class="form">
      <TR> 
        <TH COLSPAN="2">Apmokėjimo forma:</TH>
      </TR>
      <TR> 
        <TD COLSPAN="2" align="center">Pasirinkite mokėjimo būdą, kuris Jums tinka:</TD>
      </TR>
      <?php
$payment_methods=$user->db_load_payment_methods();
	#Guardamos el usuario en la sesión
	$_SESSION["ser_user"]=serialize($user);
$mycount=0;
foreach ($payment_methods as $payment_method) { $mycount++;
?>
       <TR> 
        <TD WIDTH="38%" HEIGHT="33" align="right">
            <INPUT TYPE="radio" NAME="payment_method" value="<?php echo $payment_method->id; ?>" SIZE="20"<?php if ($mycount==1) echo 'checked'; ?> <?php if ($payment_method->pay_by_cash) echo ' class="pay_by_cash"';?>/>
          </TD>
        <TD WIDTH="62%" HEIGHT="33" align="left"><a href="#" onclick="javascript:alert('<?php echo $payment_method->description; ?>')" title="<?php echo $payment_method->description; ?>"><?php echo $payment_method->name; if ($payment_method->price) echo ' (+ '. $payment_method->price . '€)';?></a></TD>
      </TR>
<?php
}
?>
    </TABLE>
	</div>
	<div align="center">
<INPUT TYPE="submit"  VALUE="Toliau" id="formSubmitButton"/>
    </div>
</FORM>
<input type="hidden" id="textInfoShipping" value="$shippingName en $delay horas. Envío gratis a partir de $freeShippingMinimum €. Para menos: $shippingPrice €. "/>
<input type="hidden" id="textUnderMinimum" value="¡ATENCIÓN! Su pedido no supera los $minimum € que es el precio mínimo para ser enviado a su localización."/>
<input type="hidden" id="textFreeShipping" value="¡ATENCIÓN! Le quedan tan sólo $toFreeShipping € para conseguir los gastos de envío gratis."/>

<script language="JavaScript">
initForms();
SetParam("<?php $str=rawurlencode( 'discountRange='.$user->discount_range.'&serShippingType='.$user->encode_shipping_types() ); echo $str;?>");
RecargarCesta('order');
RecargarMiniCesta('mini_order');
SetReloadShippingPrice();
SetReloadProvinces();
ReloadShippingPrice();
RecargarPago();
</script>
Return current item: Your online shop