=100 ORDER BY id DESC LIMIT 60'; $rez = $DB->QUR_SEL($sql); if ($rez){ foreach ($rez as $key => $val) if ($key){ $val['user'] = get_user($val['id_user']); $val['student'] = get_student($val['id_user']); //указываем информацию об образовании - названии специальности $rez_edu = $DB->QUR_SEL('SELECT * FROM '.$ST['dbpf'].'_areas WHERE code = "'.$val['student']['specialnost'].'" '); $val['edu'] = $rez_edu[1]['name']; $val['kurs'] = courseOfGruppa($val['student']['id_grupp']); $val['about'] = html_entity_decode($val['about']); $val['languages'] = html_entity_decode($val['languages']); if (!(isset($_POST['search']))) $portfolio[] = $val; else{ $order_is = 1; //можно публиковать if ($_POST['course'] > 0) { if ($val['kurs'] == $_POST['course']) $order_is = 1; else $order_is = 0; } if ($order_is == 1) if ($_POST['area'] > 0) { if ($rez_edu[1]['id'] == $_POST['area']) $order_is = 1; else $order_is = 0; } if ($order_is == 1) $portfolio[] = $val; } //else return; } } //специальности $areas = array(); $sql = 'SELECT * FROM '.$ST['dbpf'].'_areas '; $rez = $DB->QUR_SEL($sql); if ($rez){ foreach ($rez as $key => $val) if ($key){ $areas[] = $val; } } /*echo '
';
	print_r($_POST);
	echo '
';*/ //$smarty->assign('post', $_POST); $smarty->assign('areas', $areas); $smarty->assign('portfolio', $portfolio); $smarty->assign('control', $control); } else{ //вывод детального портфолио $id = (int) $_GET['page']; $sql = 'SELECT * FROM '.$ST['dbpf'].'_portfolio WHERE id_user = "'.$id.'" '; $rez = $DB->QUR_SEL($sql); if ($rez){ $rez[1]['user'] = get_user($rez[1]['id_user']); $rez[1]['student'] = get_student($rez[1]['id_user']); $rez[1]['about'] = html_entity_decode($rez[1]['about']); $rez[1]['languages'] = html_entity_decode($rez[1]['languages']); $rez[1]['pc'] = html_entity_decode($rez[1]['pc']); //указываем информацию об образовании - названии специальности $rez_edu = $DB->QUR_SEL('SELECT * FROM '.$ST['dbpf'].'_areas WHERE code = "'.$rez[1]['student']['specialnost'].'" '); $rez[1]['edu'] = $rez_edu[1]['name']; $rez[1]['kurs'] = courseOfGruppa($rez[1]['student']['id_grupp']); //теперь смотрим достижения $rez[1]['achievements'] = array(); $sql_ach = 'SELECT * FROM '.$ST['dbpf'].'_achievements WHERE id_user = "'.$id.'" '; //echo $sql_ach; $rez_ach = $DB->QUR_SEL($sql_ach); if ($rez_ach){ foreach ($rez_ach as $key_ach => $val) if ($key_ach){ $val['date_p'] = date('d.m.Y', $val['date_p']); $rez[1]['achievements'][$val['region']][] = $val; //$rez[1]['achievements'][] = $val; } } //смотрим успеваемость $rez[1]['marks'] = array(); $sql_mark = 'SELECT * FROM '.$ST['dbpf'].'_liquidation WHERE id_user = "'.$id.'" GROUP BY name ORDER BY semestr DESC '; $rez_mark = $DB->QUR_SEL($sql_mark); if ($rez_mark){ foreach ($rez_mark as $key_m => $val) if ($key_m){ $rez[1]['marks'][] = $val; } } //студенческие работы $rez[1]['studwork'] = array(); $sql_studwork = 'SELECT * FROM '.$ST['dbpf'].'_studwork WHERE id_user = "'.$id.'" ORDER BY semestr DESC '; $rez_studwork = $DB->QUR_SEL($sql_studwork); if ($rez_studwork){ foreach ($rez_studwork as $key_s => $val) if ($key_s){ $rez[1]['studwork'][] = $val; } } } //echo '
'; print_r($rez); echo '
'; $smarty->assign('portfolio', $rez[1]); $smarty->assign('id_portfolio', $id); } /*ВСЕ ЧТО НИЖЕ - УЖЕ НЕАКТУАЛЬНО if(isset($_POST['save_portfolio'])){ //данные в формтае bl_номер блока it_номер пункта $rez = $DB->QUR('DELETE FROM '.$ST['dbpf'].'_trudo_portfolio WHERE id_user='.$_SESSION['user']['id'].''); $id_block=0; $id_item=0; $pos=0; foreach($_POST as $key => $val)if($key!='save_portfolio'){ $t=explode('_',$key); if($id_block==$t[1] && $id_item==$t[3]) $pos++; else $pos=0; $id_block=$t[1]; $id_item=$t[3]; foreach($val as $k => $v){ $znach = addslashes(htmlspecialchars($v)); if ($znach!=''){ $sql = 'INSERT INTO '.$ST['dbpf'].'_trudo_portfolio VALUES (0,'.mktime().','.$_SESSION['user']['id'].','.$id_block.','.$id_item.',"'.$znach.'",'.$pos.');'; $rez = $DB->QUR($sql); } } } save_logs('Анкета портфолио пользователя '.$_SESSION['user']['id'].' сохранена'); } //print_r($_GET); if(isset($_GET['page'])){ if($_GET['page']=='make'){ $info['descrip'] = '

В данном разделе необходимо заполнить анкету для портфолио.

Ваше портфолио будет доступно по ссылке вида http://learn.mkgtu.ru/pf/'.$_SESSION['user']['id'].'/

'; if (isset($_GET['des'])){} $info['blocks']=array(); $info['blocks']=recursiv_show(); $info['portfo']=get_portfolio($_SESSION['user']['id']); $smarty->assign('info',$info); $maincontent = $smarty->fetch('tpl_portfolio.html'); } if($_GET['page']=='showuser'){ $id=(int)$_GET['id']; $info['blocks']=recursiv_show(); $info['portfo']=get_portfolio($id); $smarty->assign('info',$info); $maincontent = $smarty->fetch('tpl_portfolio_show.html'); } } function recursiv($par=0,$old=0,$id=0){//отображение в древовидной структуре данных блоков для ВЫБОРА global $ST,$DB; $out = ''; $sql = 'SELECT * FROM '.$ST['dbpf'].'_trudo_blocks WHERE par='.$par.' ORDER BY pos, name ASC'; $rez = $DB->QUR_SEL($sql); if($rez)foreach($rez as $key => $val)if($key){ if ($val['par'] == $old) $old--; $out .= '