sysUPLOAD($_FILES['inputfile']['tmp_name'], $link); /*$sql = 'INSERT INTO '.$ST['dbpf'].'_syllabus (`id_areas`, `file`, `year`, `forma`) VALUES ("'.$area.'", "'.$link.'", "'.$year.'", "'.$forma.'")'; $rez = $DB->QUR($sql); $id_last = mysql_insert_id(); $kaf = explode(",", $kafedra); for ($i = 0; $i < count($kaf); $i++){ $sql = 'INSERT INTO '.$ST['dbpf'].'_involved_kaf (`id_syllabus`, `id_kafedra`, `message`, `status`) VALUES ("'.$id_last.'", "'.$kaf[$i].'", "", "0")'; $rez = $DB->QUR($sql); }*/ $msg['msg'] .= 'Успешно загружен!'; } } //ВЫБЕРЕМ ДАННЫЕ УЧИТЕЛЯ $sql = 'SELECT * FROM '.$ST['dbpf'].'_teachers WHERE id_user='.$_SESSION['user']['id'].' LIMIT 1'; $rez=$DB->QUR_SEL($sql); if($rez){ $teacher['zvanie']=out_data_fu($rez[1]['zvanie']); $teacher['dolgnost']=out_data_fu($rez[1]['dolgnost']); $teacher['stepen']=out_data_fu($rez[1]['stepen']); $teacher['fakultet']=out_data_fu($rez[1]['fakultet']); $teacher['kafedra']=out_data_fu($rez[1]['kafedra']); $teacher['data_u']=date('H:i:s d.m.Y',$rez[1]['data_u']); if ($rez[1]['status']==0) $teacher['status'] = 'не подтвержден'; if ($rez[1]['status']==1) $teacher['status'] = 'подтвержден'; } //выбираем направления подготовки, которые привязаны к кафедре $areas = array(); $kafedra = $teacher['kafedra']; $sql = 'SELECT ar.*, ar.name as naprav, ar.id as ident, ar.code as napr, kaf.* FROM '.$ST['dbpf'].'_areas as ar, '.$ST['dbpf'].'_kafedres as kaf WHERE kaf.name = "'.$kafedra.'" AND ar.id_kafedra = kaf.id'; $rez = $DB->QUR_SEL($sql); foreach ($rez as $key => $val) if ($key){ //$areas['area'] = $val['area'] $areas[] = $val; } //выводим список кафедр, для того, чтобы кафедра, которая загружает план, могла отправить его другим на проверку $kafedres = array(); $sql = 'SELECT * FROM '.$ST['dbpf'].'_kafedres WHERE NOT (name = "'.$kafedra.'") ORDER BY code'; $rez = $DB->QUR_SEL($sql); foreach ($rez as $key => $val) if ($key){ $kafedres[] = $val; } $smarty->assign('page',$page); $smarty->assign('teacher',$teacher); $smarty->assign('areas',$areas); $smarty->assign('kafedres',$kafedres); $smarty->assign('msg',$msg); //контейнер для сообщений $maincontent = $smarty->fetch('tpl_design.html'); } ?>