sysUPLOAD($_FILES['file_pasport']['tmp_name'], $file_pasport)) { $file_pasport=''; } } //диплом $file_edu=''; if(isset($_FILES['file_edu'])){ if(!file_exists($dir_dest)) mkdir($dir_dest); $fil = $date_create.$_FILES['file_edu']['name']; $t = explode('.',$fil); $ext = $t[count($t)-1]; unset($t[count($t)-1]); $fn = implode('.',$t); $file_edu = $dir_dest . basename(translit($fn).'.'.$ext); //if (!move_uploaded_file($_FILES['file_edu']['tmp_name'], $file_edu)) { if (!$SYSTEMclass->sysUPLOAD($_FILES['file_edu']['tmp_name'], $file_edu)) { $file_edu=''; } } //военный билет $file_vb=''; if(isset($_FILES['file_vb'])){ if(!file_exists($dir_dest)) mkdir($dir_dest); $fil = $date_create.$_FILES['file_vb']['name']; $t = explode('.',$fil); $ext = $t[count($t)-1]; unset($t[count($t)-1]); $fn = implode('.',$t); $file_vb = $dir_dest . basename(translit($fn).'.'.$ext); //if (!move_uploaded_file($_FILES['file_vb']['tmp_name'], $file_vb)) { if (!$SYSTEMclass->sysUPLOAD($_FILES['file_vb']['tmp_name'], $file_vb)) { $file_vb=''; } } //СНИЛС $file_snils=''; if(isset($_FILES['file_snils'])){ if(!file_exists($dir_dest)) mkdir($dir_dest); $fil = $date_create.$_FILES['file_snils']['name']; $t = explode('.',$fil); $ext = $t[count($t)-1]; unset($t[count($t)-1]); $fn = implode('.',$t); $file_snils = $dir_dest . basename(translit($fn).'.'.$ext); //if (!move_uploaded_file($_FILES['file_snils']['tmp_name'], $file_snils)) { if (!$SYSTEMclass->sysUPLOAD($_FILES['file_snils']['tmp_name'], $file_snils)) { $file_snils=''; } } //заявление $file_zayv=''; if(isset($_FILES['file_zayv'])){ if(!file_exists($dir_dest)) mkdir($dir_dest); $fil = $date_create.$_FILES['file_zayv']['name']; $t = explode('.',$fil); $ext = $t[count($t)-1]; unset($t[count($t)-1]); $fn = implode('.',$t); $file_zayv = $dir_dest . basename(translit($fn).'.'.$ext); //if (!move_uploaded_file($_FILES['file_zayv']['tmp_name'], $file_zayv)) { if (!$SYSTEMclass->sysUPLOAD($_FILES['file_zayv']['tmp_name'], $file_zayv)) { $file_zayv=''; } } //ДОБАВЛЕНИЕ В БАЗУ $sql = 'INSERT INTO '.$ST['dbpf'].'_accredit (`id_user`, `surname`, `name`, `patronymic`, `sex`, `type`, `citizenship`, `fellow`, `attidude`, `snils`, `phone_number`, `date_born`, `index_reg`, `address`, `vid_doc`, `seria_doc`, `num_doc`, `date_doc`, `kem_doc`, `type_edu`, `level_edu`, `spec_edu`, `seria_edu`, `num_edu`, `date_edu`, `kem_edu`, `file_pasport`, `file_edu`, `file_vb`, `file_snils`, `file_zayv`, `date_create`, `status`, `accredit`) VALUES ("'.$id_user.'", "'.$surname.'", "'.$name.'", "'.$patronymic.'", "'.$sex.'", "'.$type.'", "'.$citizenship.'", "'.$fellow.'", "'.$attidude.'", "'.$snils.'", "'.$phone_number.'", "'.$date_born.'", "'.$index_reg.'", "'.$address.'", "'.$vid_doc.'", "'.$seria_doc.'", "'.$num_doc.'", "'.$date_doc.'", "'.$kem_doc.'", "'.$type_edu.'", "'.$level_edu.'", "'.$spec_edu.'", "'.$seria_edu.'", "'.$num_edu.'", "'.$date_edu.'", "'.$kem_edu.'", "'.$file_pasport.'", "'.$file_edu.'", "'.$file_vb.'", "'.$file_snils.'", "'.$file_zayv.'", "'.$date_create.'", "0", "'.$accredit.'") '; //echo $sql; $rez = $DB->QUR($sql); $id = mysql_insert_id(); //НУЖНО ЕЩЕ ЗАГРУЗИТЬ ФАЙЛЫ И УКАЗАТЬ ССЫЛКИ В БАЗЕ $msg = 1; save_logs('Заявление на аккредитацию оформлено №'.$id); } //мои заявления $zayavks = array(); $sql = 'SELECT * FROM '.$ST['dbpf'].'_accredit WHERE id_user = "'.$id_user.'" '; $rez = $DB->QUR_SEL($sql); if ($rez){ foreach ($rez as $key => $val) if ($key){ /*$val['date_born'] = date('d.m.Y', $val['date_born']); $val['date_doc'] = date('d.m.Y', $val['date_doc']); $val['date_edu'] = date('d.m.Y', $val['date_edu']);*/ $val['date_create'] = date('d.m.Y', $val['date_create']); $zayavks[] = $val; } } $fio = $_SESSION['user']['fio']; $smarty->assign('fio', $fio); $smarty->assign('msg', $msg); $smarty->assign('zayavks', $zayavks); $maincontent = $smarty->fetch('tpl_accredit_order.html'); } //ПРЕДСЕДАТЕЛЬ АККРЕДИТАЦИОННОЙ КОМИССИИ if ($_GET['page'] == 'chairman'){ //заявления на рассмотрении $zayavks = array(); $sql = 'SELECT ac.*, us.* FROM '.$ST['dbpf'].'_accredit as ac, '.$ST['dbpf'].'_users as us WHERE ac.status = "0" AND ac.id_user = us.id AND ac.date_create >= "'.(date("U")-3600*24*90).'"'; $rez = $DB->QUR_SEL($sql); if ($rez){ foreach ($rez as $key => $val) if ($key){ $val['date_create'] = date('d.m.Y', $val['date_create']); $zayavks[] = $val; } } $smarty->assign('zayavks', $zayavks); $maincontent = $smarty->fetch('tpl_accredit_chairman.html'); } //ПРОСМОТР ОБЩЕЙ ТАБЛИЦЫ if (($_GET['page'] == 'print0')||($_GET['page'] == 'print')){ //0 в конце - СПО //заявления $zayavks = array(); //$sql = 'SELECT * FROM '.$ST['dbpf'].'_accredit '; if ($_GET['page'] == 'print0') $sql = 'SELECT ac.*, us.* FROM '.$ST['dbpf'].'_accredit as ac, '.$ST['dbpf'].'_users as us WHERE ac.status = "0" AND ac.id_user = us.id AND ac.date_create >= "'.(date("U")-3600*24*90).'" AND ac.level_edu = "Среднее профессиональное образование"'; else $sql = 'SELECT ac.*, us.* FROM '.$ST['dbpf'].'_accredit as ac, '.$ST['dbpf'].'_users as us WHERE ac.status = "0" AND ac.id_user = us.id AND ac.date_create >= "'.(date("U")-3600*24*90).'" AND ac.level_edu = "Высшее образование"'; $rez = $DB->QUR_SEL($sql); if ($rez){ foreach ($rez as $key => $val) if ($key){ $val['date_create'] = date('d.m.Y', $val['date_create']); $zayavks[] = $val; } } $smarty->assign('zayavks', $zayavks); $smarty->display('tpl_accredit_print.html'); exit; } ?>