0) { $name = mysql_result($res,0,'name'); $iddd = mysql_result($res,0,'id'); $namet = mysql_result($res,0,'name'); $model = getNameModel($db_conn, mysql_result($res,0,'model')); $color = mysql_result($res,0,'color'); $mater = mysql_result($res,0,'mater'); $size = mysql_result($res,0,'size'); $prise = mysql_result($res,0,'prise'); $newprice = mysql_result($res,0,'newprice'); $PACHFOTOSMALL = mysql_result($res,0,'PACHFOTOSMALL'); $PACHFOTOBIG = mysql_result($res,0,'PACHFOTOBIG'); $STRAZI = mysql_result($res,0,'STRAZI'); $PECHAT = mysql_result($res,0,'PECHAT'); $label = mysql_result($res,$i,'label'); $dbcont[$id]['idcat']= mysql_result($res,0,'idcat'); $dbcont[$id]['iddd']=$iddd; $dbcont[$id]['name']= $namet; $dbcont[$id]['model']= $model; $dbcont[$id]['color']= $color; $dbcont[$id]['mater']= $mater; $dbcont[$id]['size']= $size; $dbcont[$id]['prise']= $prise; $dbcont[$id]['newprice']= $newprice; $dbcont[$id]['PACHFOTOSMALL']= $PACHFOTOSMALL; $dbcont[$id]['PACHFOTOBIG']= $PACHFOTOBIG; $dbcont[$id]['STRAZI']= $STRAZI; $dbcont[$id]['PECHAT']= $PECHAT; $dbcont[$id]['lab']= $label; $res2 = mysql_query( 'SELECT * FROM tovar WHERE model='.mysql_result($res,0,'model').' and pokaz=1 ORDER BY id DESC' ); $countRes2 = MYSQL_NUMROWS($res2); for ($j=0; $j<$countRes2;$j++) { $dbcont[$id]['nam'][$j] = mysql_result($res2,$j,'name'); $dbcont[$id]['mod'][$j] = getNameModel($db_conn, mysql_result($res2,$j,'model')); $dbcont[$id]['col'][$j] = mysql_result($res2,$j,'color'); $dbcont[$id]['mat'][$j] = mysql_result($res2,$j,'mater'); $dbcont[$id]['siz'][$j] = mysql_result($res2,$j,'size'); $dbcont[$id]['mimg'][$j] = mysql_result($res2,$j,'PACHFOTOSMALL'); $dbcont[$id]['img'][$j] = mysql_result($res2,$j,'PACHFOTOBIG'); $dbcont[$id]['pri'][$j]= mysql_result($res2,$j,'prise'); $dbcont[$id]['newpri'][$j]= mysql_result($res2,$j,'newprice'); $dbcont[$id]['id'][$j]= mysql_result($res2,$j,'id'); $dbcont[$id]['label'][$j]= mysql_result($res2,$j,'label'); } ob_start(); include($_SERVER['DOCUMENT_ROOT'].'/templates/ttovar.html'); $resultdb = ob_get_contents(); ob_end_clean(); } //print_r($dbcont); mysql_close($db_conn); } else { $name = 'Категории не существует'; } $content = file_get_contents($_SERVER['DOCUMENT_ROOT']."/view/tovar.html"); $content = str_replace('', $name, $content); $content = str_replace('', $resultdb, $content); return include $_SERVER['DOCUMENT_ROOT']."/templates/base.html";