include ("forixinc.php");
include ("co_util.php");
include ("util.php");
$Cod_engine=40000;
$Cod_notes=70000;
function CA_Edi()
{
extract($GLOBALS);
$SQLQuery="SELECT ca.nome as ca_model, can.nome as co_nome FROM can inner join ca on can.rco=ca.rco where ca.rca=".$rca." and can.lin=".$linx;
if (($result = mysql_query($SQLQuery)) and ($RSList = mysql_fetch_array($result)))
{
fxhead("Forix: ".$RSList["co_nome"]." ".$RSList["ca_model"]);
tab_ini();
tab_bar(2);
?>
tab_ini();
tab_bar(2);
?> |
echo $RSList["co_nome"]; ?> echo $RSList["nome"]; ?>
if ($super_modo>=$Modo_privado)
{
?>
}
?> |
tab_bar(4);
// Car photos
$SQLQuery="SELECT count(*) as total FROM fotos inner join contactos on fotos.sig=contactos.sig where fotos.ref=".$rca." and fotos.cref=".$REF_CA;
$result = mysql_query($SQLQuery);
$RSfoto= mysql_fetch_array($result);
$n=$RSfoto["total"];
if ($n>0)
{
$SQLQuery="SELECT fotos.*, contactos.copynote FROM fotos inner join contactos on fotos.sig=contactos.sig where fotos.ref=".$rca." and fotos.cref=".$REF_CA." Limit ". rand(0,$n-1) .", 1";
$result = mysql_query($SQLQuery);
$RSfoto= mysql_fetch_array($result);
tab_bor();
if ($n>1)
{
tab_bar2(4);
?> echo $titulo[$N_PGAL]; ?> |
}
else
{
tab_bar1(6);
}
?>
if ($RSfoto["zoom"]==0)
{
?>" ALT="Photo">
}
else
{
?>">" ALT="Zoom" BORDER="0">
}
?> echo $RSfoto["copynote"]; ?> |
tab_bar1(4);
}
// Comments
$SQLQuery="SELECT notes.*, contactos.copynote FROM notes inner join contactos on contactos.sig=notes.autor Where (notes.lin=".$lin;
if ($lin==$linBra)
{
$SQLQuery=$SQLQuery." or notes.lin=".$linPor;
}
$SQLQuery=$SQLQuery.") ";
if ($super_modo==$Modo_publico)
{
$SQLQuery=$SQLQuery." and notes.dat<=".$hiso;
}
$SQLQuery=$SQLQuery." and notes.cref=".$REF_CA." and notes.ref=".$rca." and notes.tipo=".$No_tipo_C." and notes.modo<=".$super_modo." Order by notes.lin desc";
$result = mysql_query($SQLQuery);
while ($RScomm= mysql_fetch_array($result))
{
com_texto($RScomm,400,$titulo[$N_COMM],false);
}
// Technical Specifications
$SQLQuery="SELECT * FROM cas where rca=".$rca." and (lin=".$lin." or lin=".$linEng.") order by cod, lin desc";
if (($result = mysql_query($SQLQuery)) and ($RSList = mysql_fetch_array($result)))
{
$SQLQuery="SELECT * FROM casn Where lin=".$lin." or lin=".$linEng." Order by lin desc, cod";
$result2 = mysql_query($SQLQuery);
tab_bor();
?> echo $titulo[$N_TSPEC]; ?> |
|
|
|
|
|
|
|
while ($RSnom= mysql_fetch_array($result2))
{
$cod=$RSnom["cod"];
$niv=$cod-10*intval($cod/10);
$seq=intval($cod/10)-100*intval($cod/1000);
if ($RSList)
{
$codc=$RSList["cod"];
if ($cod==$codc and ($cod!=$Cod_notes or $super_modo==$Modo_total))
{
if ($seq==0 and $niv==0)
{
?> |
}
if ($niv==0)
{
?> |
}
else
if ($niv==1)
{
?> | | |
}
else
if ($niv==2)
{
?> | | | |
}
if ($seq==0)
{
?> echo $RSnom["nome"]; ?>
}
else
{
?> echo $RSnom["nome"]; ?>
}
?> | |
$val=$RSList["val"];
if ($cod==$Cod_engine)
{
ca_motores($rca,$val);
}
else
{
?> echo $val; ?>
}
?> | |
$RSList= mysql_fetch_array($result);
// Bypass other languages
if ($RSList)
{
$codc=$RSList["cod"];
while($RSList and $cod==$codc)
{
$codc=$RSList["cod"];
if ($cod==$codc)
{
$RSList= mysql_fetch_array($result);
}
}
}
}
else
if ($cod<$codc)
{
if ($seq==0 and (($niv==0 and intval($cod/10000)==intval($codc/10000)) or ($niv==1 and intval($cod/1000)==intval($codc/1000))))
{
?> |
if ($niv==0)
{
?> |
}
else
if ($niv==1)
{
?> | | |
}
?> echo $RSnom["nome"]; ?> | |
}
}
}
}
tab_bar1(4);
?>
|
if ($super_modo==$Modo_total)
{
?>[Edit] |
}
}
// Other models selection
if ($super_modo>$Modo_publico)
{
$SQLQuery="SELECT ca.rca, ca.nome as ca_model, can.nome as ca_nome FROM ca inner join can on ca.rco=can.rco where ca.rco=".$rco." and can.lin=".$linx;
if (($result = mysql_query($SQLQuery)) and ($RSList = mysql_fetch_array($result)))
{
tab_bor();
tab_bar(4);
?>
tab_bar(4);
}
}
tab_fim();
?>
// Racing history
if ($npar>0)
{
?> |
tab_ini();
tab_bar(4);
?> | echo $titulo[$N_RHIS]; ?> |
tab_bar(4);
tab_bor();
?>
echo $titulo[$N_PARS]; ?>
echo $titulo[$N_WINS]; ?>
echo $titulo[$N_POLES]; ?>
echo $titulo[$N_FLAPS]; ?>
echo $titulo[$N_PONS]; ?>
| |
echo $npar; ?>
if ($nvit>0)
{
?> echo $nvit; ?>
}
else
{
?>-
}
if ($npol>0)
{
?> echo $npol; ?>
}
else
{
?>-
}
if ($nvmr>0)
{
?> echo $nvmr; ?>
}
else
{
?>-
}
?> echo $npon/100; ?>
|
|
tab_bar1(10);
// Foto galeria
$SQLQuery="Select count(*) as num from fotos, contactos, papi where fotos.sig=contactos.sig and papi.rpa=fotos.ref and fotos.dat<=".$hiso." and fotos.camp=1 and fotos.cref=".$REF_PA." and papi.rca=$rca and (fotos.gal='img' or fotos.gal is NULL)";
if (($result = mysql_query($SQLQuery)) and ($RSList = mysql_fetch_array($result))) {
$nf = $RSList["num"];
if ($nf > 0) {
if ($nf > 1)
echo("$titulo[$N_PGAL] | ");
$SQLQuery="Select fotos.foto, fotos.zoom, contactos.copynote from fotos, contactos, papi where fotos.sig=contactos.sig and papi.rpa=fotos.ref and fotos.dat<=".$hiso." and fotos.camp=1 and fotos.cref=".$REF_PA." and papi.rca=$rca and (fotos.gal='img' or fotos.gal is NULL) order by fotos.ref limit ".rand(0,$nf-1).", 1";
if (($result = mysql_query($SQLQuery)) and ($RSList = mysql_fetch_array($result))) {
echo("");
if ($RSList["zoom"] == 0)
echo(" ");
else
echo(" ");
echo("".$RSList["copynote"]." | ");
tab_bar1(10);
}
}
}
// Pilotos e respectivas participações
$SQLQuery="SELECT count(papi.rpi) as total, papi.rpi, pin.nome as pi_nome FROM papi, pin Where papi.rpi=pin.rpi and papi.rca=".$rca." and papi.rpi>0 GROUP BY papi.rpi, papi.rca order by total desc, pin.apel";
if (($result = mysql_query($SQLQuery)) and mysql_num_rows($result) > 0)
{
?> echo $titulo[$N_DRIVS]; ?>: echo $titulo[$N_PARS]; ?> |
tab_bar1(4);
?>
|
tab_bar1(6);
}
tab_fim();
?>
|
}
?>
}
else
{
fxhead("Forix: ".$titulo[$N_UNKC]);
}
fxtail();
return $function_ret;
}
$cmdFic=0;
$cmdEdi=10;
$cmdIns=11;
$rca=intval(get_arg("r"));
$cmd=intval(get_arg("c"));
log_page($REF_CA,$rca,$cmd);
if ($super_modo!=$Modo_total)
{
CAfic();
}
else
{
switch ($cmd)
{
case $cmdEdi:
CA_Edi();
break;
case $cmdIns:
CA_Ins();
break;
default:
CAfic();
break;
}
}
?>