[ Поиск ] - [ Пользователи ] - [ Календарь ]
Полная Версия: Помогите разобраться с формой
Green
Помогите пожалуйста разобраться, не могу установить колонки в ряд по горизонтали получается все колонны по вертикали. не могу понять в чем причина...


вот сам код:




<?php

$size_global=100;
function foto($foto)
{
global $size_global;
$size_img=array();
//Размер
$size_img=getimagesize("$foto");

$w_f=$size_img[0];
$h_f=$size_img[1];
if($size_img[0]>$size_global)
{
$balans=$size_img[0]/$size_global;
if(round($balans)>=1)
{
$size_img[0]=$size_img[0]/$balans;
$size_img[1]=$size_img[1]/$balans;
}

}
if($size_img[1]>$size_global)
{
$balans=$size_img[1]/$size_global;
if(round($balans)>=1)
{
$size_img[0]=$size_img[0]/$balans;
$size_img[1]=$size_img[1]/$balans;
}
}

echo "<img src=$foto width=$size_img[0] height=$size_img[1] border=0 align=middle>";
}


$info="";

$file=array();
$file1=array();

$cat_id=array();
$cat=file("db/cat.txt");
foreach($cat as $line)

{
$line=trim($line);
$expl=explode("*",$line);
$cat_id[$expl[0]]=$expl[1];
}

if(!isset($_GET['nav']) || !array_key_exists($_GET['nav'],$cat_id))$_GET['nav']=1;


if(isset($_POST['search']))
{
$_POST['text']=trim($_POST['text']);
if($_POST['text']!="")
{
$s=urlencode($_POST['text']);
echo "<meta http-equiv=refresh content='0; url=index.php?s=$s'>";
exit();
}

}

if(!isset($_GET['s']))$file=file("db/price.txt");
else
{
$s=urldecode($_GET['s']);
$search=file("db/price.txt");
foreach($search as $line)
{
$line=trim($line);
$expl=explode("*",$line);
if(stristr($expl[0],$s))$file[]=$line;
}
}

for($n=0;$n<count($file);$n++)$file[$n]=trim($file[$n]);
$id_price=array();
foreach($file as $line)
{
$line=trim($line);
$expl=explode("*",$line);
if($_GET['nav']!=1)
{

if($expl[3]==$_GET['nav']) $file1[$expl[1]."*".$expl[2]."*".$expl[3]."*".$expl[4]."*".$expl[5]."*".$expl[6]."*".$expl[7]."*".$expl[8]]=$expl[0];
}
else $file1[$expl[1]."*".$expl[2]."*".$expl[3]."*".$expl[4]."*".$expl[5]."*".$expl[6]."*".$expl[7]."*".$expl[8]]=$expl[0];
$id_price[$expl[2]]=$expl[0]."*".$expl[1]."*".$expl[2]."*".$expl[3]."*".$expl[4]."*".$expl[5]."*".$expl[6]."*".$expl[7]."*".$expl[8];

}

asort($file1,SORT_STRING);
$file=array();
foreach($file1 as $k=>$v) $file[]="$v*$k";

//Постраничная навигация
$topic_count_page=100;
if(!isset($_GET['page']) || !is_numeric(@$_GET['page']) || @$_GET['page']<1 )$page=1;
else $page=$_GET['page'];
if($page > ceil(count($file)/ $topic_count_page))$page=1;
$start=$page * $topic_count_page-$topic_count_page;
$pages=ceil(count($file)/ $topic_count_page);
if(empty($_GET['ind']) || !is_numeric(@$_GET['ind']) || @$_GET['ind']>ceil($pages/10) || @$_GET['ind']<1)$index=1;
else $index= $_GET['ind'];

if(isset($_GET['red']) && array_key_exists($_GET['red'],$id_price) && isset($_GET['del_foto']))
{
$foto=array();
$foto=file("db/id_foto/$_GET[red]");
if(count($foto))
{
unlink("db/foto/$foto[0]");
$f=fopen("db/id_foto/$_GET[red]","w");
fclose($f);
}
echo "<meta http-equiv=refresh content='0; url=index.php?page=$page&ind=$index&nav=$_GET[nav]&red=$_GET[red]'>";
exit();
}
?>


<?php
for($x=$start,$y=0; $x<count($file); $x++,$y++)
{
if($y==$topic_count_page)break;
$file[$x]=trim($file[$x]);
$expl=explode("*",$file[$x]);
$pref=$expl[2];
if($expl[3]=='none')$name_cat='Не в категории';
else $name_cat=$cat_id[$expl[3]];

if(!isset($_GET['s']))
{
$link1="page=$page&ind=$index&red=$expl[2]&nav=$_GET[nav]";
$link2="page=$page&ind=$index&del=$expl[2]&nav=$_GET[nav]";
$link3="page=$page&ind=$index&cod=$expl[2]&nav=$_GET[nav]";
}
else
{
$s=urlencode($_GET['s']);
$link1="page=$page&ind=$index&red=$expl[2]&s=$s&nav=$_GET[nav]";
$link2="page=$page&ind=$index&del=$expl[2]&s=$s&nav=$_GET[nav]";
$link3="page=$page&ind=$index&cod=$expl[2]&s=$s&nav=$_GET[nav]";
}

echo"<tr><td align=center>
<table border=1 borde=red background-color:red; background-color: red; color:green; width=410 height=200 cellpadding=6 cellspacing=0>
</div> </td><tr><td align=center>";

$foto=array(4);
$foto=file("db/id_foto/$expl[2]");
if(count($foto))foto("db/foto/$foto[0] onclick=changeSizeImage(this) border=0 width=220px align=middle ");
else echo "<img src=foto/no_foto.png alt='нет фото' border=0>";
echo"<tr><td align=center>

<font color=#990000 fontsize=18px> $expl[0] <br><a>
<br><a align=left><font color=black background=white>Описание; $expl[4]<br><br>
<a align=left><font color=green background=white> $expl[5]<br>
<a align=left><font color=black background=white>г. $expl[6]<br>

<br><a align=left><font color=red background=white> tel: $expl[7]<br><a href=tel:$expl[7]>Позвонить</b><br>
<img src='db/foto/tel.png'><br><br></a>

<br> <a align=center>
<font color=red> цена: $expl[1] руб.
<a href=\"javascript:c('$expl[2]')\">
<br><img src=db/foto/cart.png alt='Купить' border=0 ><a href=\"addToBasket(1);return false;\"></a>

</tr> <table width=20%><br>";


}


?>
Быстрый ответ:

 Графические смайлики |  Показывать подпись
Здесь расположена полная версия этой страницы.
Invision Power Board © 2001-2024 Invision Power Services, Inc.