Разработка информационной системы управления учебным процессом (на примере филиала РГТУ г. Всеволожска)
Дипломная работа - Компьютеры, программирование
Другие дипломы по предмету Компьютеры, программирование
>
}
$result->close();
$mysqli->close();
};
return 1;
}add_student($surname, $name, $patronymic, $spec, $N_zach, $year, $number_group){
$sql="INSERT INTO `students`
( `id`,
`Surname`,
`Name`,
`Patronymic`,
`Specialty`,
`Entered`,
`group_id`,
`N_zach`)
VALUES ('',
'$surname',
'$name',
'$patronymic',
'$spec',
'$year',
'$number_group',
'$N_zach'
)";($sql);
return 1;
}add_lectures($kaf,$surname, $name, $patronymic, $stepen, $items ){
$sql="INSERT INTO `lectures`
( `id`,
`Surname`,
`Name`,
`Patronymic`,
`Stepen_id`,
`Departmen_id`,
`items_id` )
VALUES ('',
'$surname',
'$name',
'$patronymic',
'$stepen',
'$kaf',
'$items'
)";
execute($sql);
$_POST="";
return 1;
}add_department($name,$ZavDepartment){
$sql="INSERT INTO `Departments`
( `id`,
`Name`,
`ZavDepartment`)
VALUES ('',
'$name',
'$ZavDepartment'
)";
execute($sql);
$_POST="";
return 1;
}add_groups($name,$year, $group_number){
$sql="INSERT INTO `group`
( `id`,
`name`,
`year`,
`group_number`)
VALUES ('',
'$name',
'$year',
'$group_number'
)";
execute($sql);
$_POST="";
return 1;
}add_vedomosti($predm,$stud_id,$ocenka){
$sql="INSERT INTO `vedomosti`
( `id`,
`id_stud`,
`id_pred`,
`ocenka`)
VALUES ('',
'$stud_id',
'$predm',
'$ocenka'
)";
execute($sql);
$_POST="";
return 1;
}add_spec($name){
$sql="INSERT INTO `spec`
( `id`,
`Name` )
VALUES ('',
'$name'
)";
execute($sql);
$_POST="";
return 1;
}add_predm($name){
$sql="INSERT INTO `predm`
( `id`,
`Name` )
VALUES ('',
'$name'
)";
execute($sql);
$_POST="";
return 1;
}edit_department($id, $name,$group_number){
$sql= "UPDATE `rggu`.`group` SET `Name` = '$name', `year` = '$year', `group_number`='$group_number' WHERE `group`.`id` =$id";($sql);1;
};edit_group($id, $name,$year, $group_number){
$sql= "UPDATE `rggu`.`group` SET `name` = '$name', `year` = '$year', `group_number`='$group_number' WHERE `group`.`id` =$id";($sql);1;
};edit_lectures($id, $kaf,$surname, $name, $patronymic, $stepen, $items )
{
$sql="UPDATE `rggu`.`lectures` SET
`Surname` = '$surname',
`Name` = '$name',
`Patronymic`='$patronymic',
`Stepen_id` ='$stepen',
`Departmen_id` ='$kaf',
`items_id`='$items'
WHERE `lectures`.`id`=$id";
execute($sql);
return 1;
}edit_student($id,$surname, $name, $patronymic, $spec, $N_zach, $year, $number_group)
{
$sql="UPDATE `rggu`.`students` SET
`Surname`='$surname',
`Name`='$name',
`Patronymic`='$patronymic',
`Specialty`='$spec',
`Entered`='$year',
`N_zach`='$N_zach',
`group_id`='$number_group'
WHERE `students`.`id`=$id;";($sql);
return 1;
}edit_spec($id, $name)
{
$sql= "UPDATE `rggu`.`spec` SET `Name` = '$name' WHERE `spec`.`id` =$id";($sql);
return 1;};
function edit_predm($id, $name){
$sql= "UPDATE `rggu`.`predm` SET `Name` = '$name' WHERE `predm`.`id` =$id";($sql);1;
};get_items_name($items){
$item_ar = explode ( "," , $items);
foreach($item_ar as $value){
$items_str.=", ".get_predm_name($value);
}
$items_str=substr($items_str,2,strlen($items_str)-2);
return $items_str;
}get_kaf_name($id){
$x=getinfo("SELECT `Name` from `Departments` WHERE `id`=$id");
$x=$x[0];
return $x;
}get_kurse($id){
$x=getinfo("SELECT `Course` from `students` WHERE `id`=$id");
$x=$x[0];
return $x;
}get_entered($id){
$x=getinfo("SELECT `Entered` from `students` WHERE `id`=$id");
$x=$x[0];
return $x;
}get_N_zach($id){
$x=getinfo("SELECT `N_zach` from `students` WHERE `id`=$id");
$x=$x[0];
return $x;
}get_group_name($id){
$x=getinfo("SELECT `name` from `group` WHERE `id`=$id");
$x=$x[0];
return $x;
}get_group_year($id){
$x=getinfo("SELECT `year` from `group` WHERE `id`=$id");
$x=$x[0];
return $x;
}get_group_number($id){
$x=getinfo("SELECT `group_number` from `group` WHERE `id`=$id");
$x=$x[0];
return $x;
}
function get_god_ob($id){
$x=getinfo("SELECT `god_ob` from `students` WHERE `id`=$id");
$x=$x[0];
return $x;
}get_spec_name($id){
$x=getinfo("SELECT `Name` from `spec` WHERE `id`=$id");
$x=$x[0];
return $x;
}get_group($id){
$x=getinfo("SELECT `name`, `year`, `group_number` from `group` WHERE `id`=$id");
$x=$x[0].$x[1].$x[2];
return $x;
}get_predm_name($id){
$x=getinfo("SELECT `Name` from `predm` WHERE `id`=$id");
$x=$x[0];
return $x;
}get_kaf_ZavDepartment($id){
$x=getinfo("SELECT `ZavDepartment` from `Departments` WHERE `id`=$id");
$x=$x[0];
return $x;
}get_stepen_name($id){
$x=getinfo("SELECT `Name` from `stepeni` WHERE `id`=$id");
$x=$x[0];
return $x;
}get_name_lectures($id){
$x=getinfo("SELECT `Name` from `lectures` WHERE `id`=$id");
$x=$x[0];
return $x;
}get_name_students($id){
$x=getinfo("SELECT `Name` from `students` WHERE `id`=$id");
$x=$x[0];
return $x;
}get_surname_lectures($id){
$x=getinfo("SELECT `Surname` from `lectures` WHERE `id`=$id");
$x=$x[0];
return $x;
}get_surname_students($id){
$x=getinfo("SELECT `Surname` from `students` WHERE `id`=$id");
$x=$x[0];
return $x;
}get_patronymic_students($id){
$x=getinfo("SELECT `Patronymic` from `students` WHERE `id`=$id");
$x=$x[0];
return $x;
}get_patronymic_lectures($id){
$x=getinfo("SELECT `Patronymic` from `lectures` WHERE `id`=$id");
$x=$x[0];
return $x;
}get_name_group_li(){
$sql='SELECT `id` FROM `lectures`';
return (getinfo($sql));
}get_group_id(){
$sql='SELECT `id` FROM `group`';
return (getinfo($sql));
}vedomost_add_group($date, $group, $predm){
$sql="INSERT INTO `vedomosti_list`
( `id`,
`id_predm`,
group_id`,
`date`)
VALUES ('',
'$predm',
'$group',
'$date'
)";
execute($sql);
return 1;
}find_id_vedomost_group($date, $group, $predm){
$sql="SELECT id from `vedomosti_list` WHERE `id_predm`=$predm AND `group_id`=$group AND `date`='$date'";
$x=getinfo($sql);
return $x[0];
}get_vedomost_group($ved){
$sql="SELECT group_id from vedomosti_list where id=$ved";
$group_id=getinfo($sql);
$group_id=$group_id[0];
$sql="SELECT id from students where group_id=$group_id";
$ids=getinfo($sql);
for($x=0; $x<count($ids);$x++){
$sql="SELECT Surname, Name, Patronymic from students where id=$ids[$x]";
$name=getinfo($sql);
$name=$name[0]." ".$name[1]." ".$name[2];
$sql="SELECT N_zach from students where id=$ids[$x]";
$N_zach=getinfo($sql);
$N_zach=$N_zach[0];
$sql="SELECT ocenka from vedomosti where id_stud=$ids[$x] and id_ved=$ved";
$ocenka=getinfo($sql);
$ocenka= $ocenka[0];
echo "";
}
}get_vedomost_group_list($group){
$sql="SELECT `id` from vedomosti_list WHERE group_id=$group";
$ids=getinfo($sql);
for($x=0; $x<count($ids);$x++){
$sql="SELECT `id_predm` from vedomosti_list WHERE id=$ids[$x]";
$predm=getinfo($sql);
$predm=$predm[0];
$sql="SELECT `date` from vedomosti_list WHERE id=$ids[$x]";
$date=getinfo($sql);
$date=$date[0];
echo "";
}
}
?>