<?php
if (empty($_GET['u'])){$_GET['u'] = 1;}
$query = "select * from obd_0 where jobid = " . $_GET['u'];
$result = mysql_query($query);
$row = mysql_fetch_array($result);
?>
<div id="div_12">
<table><tr><td class="ssm wnw rgt btm" style="width:300px;">Автор: 
<?php
$result2 = mysql_query("select * from ojobsuser where jobid=".$row['jobid']);
$num_result2 = mysql_num_rows($result2);
for ($j=0; $j<$num_result2; $j++){
	$row2 = mysql_fetch_array($result2);
?>
<a title="Открыть страницу пользователя" href="user.php?u=<?php echo $row2['userid']; ?>"><?php echo $ousers[$row2['userid']][0]; ?></a>
<?php } ?><br />Просмотров: <?php
mysql_select_db('onestyle_w');
$result4 = mysql_query("select * from ocView_3 where c_word_id= " . $_GET['u']);
if (mysql_num_rows($result4)){
	$row4 = mysql_fetch_array($result4);
	echo $row4['c_count'];
}else{echo "0";}
mysql_select_db('onestyle_testmy');
?><br />Теги: <?php
	$result4 = mysql_query("select p_tag, word_id from tblTag_0 where word_id=".$_GET['u']);
	$num_result4 = mysql_num_rows($result4);

	$tmp1 = "";
	$tmp1_1 = "";
	
	$tmp2 = 1;
	for ($k=0; $k<$num_result4; $k++){
		$row4 = mysql_fetch_array($result4);
		for ($i=1; $i<=count($obase); $i++){
			if ($row4['p_tag'] == $obase[$i][5]){ $tmp1 .= "<span class='ssm'>" . $tmp2++ . "</span> <a href='/online.php?p=" . (99 + $i*2) . "'>" . $obase[$i][0] . "</a> "; }
		}

		//проекты в тему
		if (empty($tmp2_2)){$tmp2_2 = 1;}
		$result_tmp = mysql_query("select obd_0.name, obd_0.jobid, tblTag_0.p_tag from obd_0, tblTag_0 where tblTag_0.p_tag = " . $row4['p_tag'] . " and tblTag_0.word_id = obd_0.jobid ORDER BY jobid desc limit 0, 3");
		$num_result_tmp = mysql_num_rows($result_tmp);
		if ($num_result_tmp){
			for ($i=0; $i<$num_result_tmp; $i++){
				if ($tmp2_2 > 7){break;}
				$row_tmp = mysql_fetch_array($result_tmp);
				if ($row_tmp['jobid'] <> $_GET['u']){$tmp1_1 .= "<span class='ssm'>" . $tmp2_2++ . "</span> <a href='/project.php?u=" . $row_tmp['jobid'] . "'>" . stripslashes($row_tmp['name']) . "</a> ";}
			}
		}


		echo "<a title='Отобразить все записи, удовлетворяющие данному тегу' href='javascript:document.location =\"http://www.onestyle.com.ua/index.php?tag=" . $row4['p_tag'] . "\"'>";
		echo $tags[0][$row4['p_tag']] . "</a> ";
	}
	unset($tmp2);
	
?>
</td><td class="pg10 sm btm">
<?php 
if ($tmp1 <> ""){echo "<div><span class='bld'>Базы онлайн в тему: </span>" . $tmp1 . "</div>";}
if ($tmp1_1 <> ""){echo "<div><span class='bld'>Проекты в тему: </span>" . $tmp1_1 . "</div>";}

?>
</td></tr></table>
<table><tr><td class="sm" style="width:200px;padding:0px 3px;">
<?php echo textterm(file_get_contents("../tail/project/nmbr/" . $_GET['u'] . ".php")); ?>
</td><td>
<?php
include "../add_view.php";
include "../is_rating.php";
 ?>
<div class="p_block sm div_bbig2"><?php echo stripslashes($row['name']); ?></div>
<div class="pg10">
<table><tr>
<?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/galary/small/_project/' . $row['jobid'] . '.jpg')){ ?>
<td class="mdl"><a target="_blank" href="galary/big/_project/<?php echo $row['jobid'] . '.jpg'; ?>"><img style="border:7px solid white;" src="galary/small/_project/<?php echo $row['jobid'] . '.jpg'; ?>" /></a></td>
<?php } ?>
<td id="test_1" class="sm"><?php echo stripslashes($row['desk']); ?></td></tr></table>
</div>
</index></td></tr></table>

</div>