<div id="div_21">
<table style="width:100%;position:relative;top:+3px;"><tr><td class="jst">
<div style="padding:0px 0px 7px 0px;"><table style="width:100%;"><tr>
<td class="p_block_center" style="width:20%;"><span class="bld">Windows</span></td>
<td class="p_block_center" style="width:19%;"><span class="bld">Клиент/Сервер</span></td>
<td class="p_block_center" style="width:19%;"><span class="bld">ПК и другое</span></td>
<td class="p_block_center" style="width:19%;"><span class="bld">Программист</span></td>
<td class="p_block_center" style="width:20%;"><span class="bld">Программы</span></td>
</tr><tr>
<?php for($j=1;$j<=7;$j++){ ?>
<td><?php
for($k=1;$k<=count($obase);$k++){
	if ($obase[$k][2] == $j){
	?>
<a class="a_block" href="online.php?p=<?php echo 99 + 2*$k; ?>" onmouseover="javascript:showUser('divg_<?php echo (300 + $k); ?>');" onmouseout="javascript:showUser('divg_<?php echo (300 + $k); ?>');"><?php echo $obase[$k][0]; ?></a>
<?php } } ?></td><?php } ?></tr></table></div>
<FORM class="black_block sm" style="color:#FCCE92;font-size: smaller;" METHOD="POST" id="fchangedirect">
<select class="cinline" name="direct_job" onchange="javascript:document.getElementById('fchangedirect').submit();">
<option>ПРОЕКТЫ: Выберите направление</option>
<?php 
for($k=1;$k<=count($odirection);$k++){
?>
<option value="<?php echo $k; ?>" <?php if ($_POST['direct_job'] == $k) {echo "selected";} ?>><?php echo $odirection[$k][0]; ?></option>
<?php 
}
?>
</select>
<?php genfndf("in_orderby"); ?>
<input class="cinline" size="33" maxlength="70" type="text" id="id_user_name" name="user_name" value="<?php if (isset($_POST['user_name'])) {echo $_POST['user_name'];}else{echo 'Введите часть названия';} ?>" onkeydown="if(event.keyCode == 13){document.getElementById('fchangedirect').submit();}" onmousedown="fInputOver(this, 'Введите часть названия')" /></FORM>
<?php
if (isset($_GET['tag'])){
	$query = "select obd_0.name, obd_0.desk, obd_0.jobid, obd_0.directionid, tblTag_0.p_tag from obd_0, tblTag_0 where tblTag_0.p_tag = " . $_GET['tag'] . " and tblTag_0.word_id = obd_0.jobid";
	if (isset($_POST['direct_job']) && ($_POST['direct_job'] <> "ПРОЕКТЫ: Выберите направление")){
		$_POST['direct_job'] = intval($_POST['direct_job']);
		$query .= " and obd_0.directionid = " . $_POST['direct_job'];
	}
	if ($_POST['user_name'] <> "" and $_POST['user_name'] <> "Введите часть названия"){
		finds5last_set($_GET['p'], $_POST['user_name']);
		$query = $query . " and (obd_0.desk like '%" . addslashes($_POST['user_name']) . "%')";
	}
}else{
	$query = "select name, desk, jobid, directionid from obd_0 where 1=1";
	if (isset($_POST['direct_job']) && ($_POST['direct_job'] <> "ПРОЕКТЫ: Выберите направление")){
		$_POST['direct_job'] = intval($_POST['direct_job']);
		$query .= " and directionid = " . $_POST['direct_job'];
	}
	if ($_POST['user_name'] <> "" and $_POST['user_name'] <> "Введите часть названия"){
		finds5last_set($_GET['p'], $_POST['user_name']);
		$query = $query . " and (desk like '%" . addslashes($_POST['user_name']) . "%')";
	}
}
$query .= " ORDER BY ";
switch($_POST['in_orderby']){
case "2": $query .= "jobid asc";break;
case "3": $query .= "name desc";break;
case "4": $query .= "name asc";break;
default: $query .= "jobid desc";break;
}


	//проверка лимита
	$result = mysql_query($query);
	$z = mysql_num_rows($result);
	if (isset($_GET['l'])){$query .= " limit " .$_GET['l'] . "," . $cur_list_numb;}else{$query = $query . " limit 0," . $cur_list_numb;}
	$result = mysql_query($query);
	$num_result = mysql_num_rows($result);

?>
<div class="black_block_c">
<?php
	if ($num_result){
	for ($i=0; $i<$num_result; $i++){
		$row = mysql_fetch_array($result);

require "../find_project.php";
	}
	}else{
		if ($_POST['direct_job'] == 1){
			echo '<div class="p_block">&nbsp;</div><center>Все проекты, связанные с дизайном интерьеров, представлены в <a class="sm" href="galary.php?u=0">галерее</a>.<br /><br /></center>';
		}else{none_project();}
	}
?>
</div>
<?php
require "../find_project_res.php";
?>
<?php finds5last_get($_GET['p']); ?>
</td><td class="sm hlpcol" style="padding:0px 5px;">
<?php allblock("newsall", 5);allblock("newsit", 4); ?>
</td></tr></table></div>