Разработка информационной системы управления учебным процессом (на примере филиала РГТУ г. Всеволожска)
Дипломная работа - Компьютеры, программирование
Другие дипломы по предмету Компьютеры, программирование
USER, DB_PASS, DB_NAME);
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
}
$mysqli->query('SET NAMES utf8');
$result = $mysqli->query($sql);
foreach( $result->fetch_assoc() as $key => $value){
if($key=="Stepen_id")$value=get_stepen_name ($value);
if($key=="Departmen_id")$value=get_kaf_name ($value);
if($key=="items_id")$value=get_items_name ($value);
echo ""; }
$result->close();
$mysqli->close();
echo "
";
};
}get_all_info_spec(){
$count= getinfo("SELECT count(`id`) from `spec");
$count=$count[0];
$sql="SELECT `id`, `Name` from `spec`";
$mysqli = new mysqli(HOST_DB, DB_USER, DB_PASS, DB_NAME);
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
}
$mysqli->query('SET NAMES utf8');
$result = $mysqli->query($sql);
for($k=1; $k $value){
if($key=="id")$id=$value;
if($key=="Name")$Name=$value;(($id)&&($Name)) {
echo "
" ;
$id=""; $Name="";
};
};
};
$result->close();
$mysqli->close();
}get_all_info_predm(){
$count= getinfo("SELECT count(`id`) from `predm");
$count=$count[0];
$sql="SELECT `id`, `Name` from `predm`";
$mysqli = new mysqli(HOST_DB, DB_USER, DB_PASS, DB_NAME);
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
}
$mysqli->query('SET NAMES utf8');
$result = $mysqli->query($sql);
for($k=1; $k<=$count; $k++){
foreach( $result->fetch_assoc() as $key => $value){
if($key=="id")$id=$value;
if($key=="Name")$Name=$value;
if(($id)&&($Name)) {
echo "
" ;
$id=""; $Name="";
};
};
};
$result->close();
$mysqli->close();
}
function id_info_lectures($kaf){
$ids=getinfo("SELECT `id` FROM `lectures` where `Departmen_id`=$kaf");
foreach($ids as $id){ echo ""; ($kaf) $sql="SELECT `id`, `Surname`,`Name`,`Patronymic`,`Stepen_id`,`Departmen_id`,`items_id` FROM `lectures` where `Departmen_id`=$kaf and id=$id";
$mysqli = new mysqli(HOST_DB, DB_USER, DB_PASS, DB_NAME);
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
}
$mysqli->query('SET NAMES utf8');
$result = $mysqli->query($sql);
foreach( $result->fetch_assoc() as $key => $value){
if($key=="Stepen_id")$value=get_stepen_name ($value);
if($key=="Departmen_id")$value=get_kaf_name ($value);($key=="items_id")$value=get_items_name ($value);
echo "";
$value="";
}
$result->close();
$mysqli->close();
if(!$kaf)echo "
";
};
}get_all_kaf_li(){
$ids=get_all_kaf_id();
foreach($ids as $id){
echo "" ;
}
}get_all_predm_li(){
$ids=get_all_predm_id();
foreach($ids as $id){
echo "" ;
}
}get_all_predm_li_ved(){
$ids=get_all_predm_id();
foreach($ids as $id){
echo "" ;
}
}get_all_group_li_a(){
$ids=get_group_id();
foreach($ids as $id){
echo "\n" ;
}
}get_all_kaf_dep(){
$count=getinfo("SELECT count(`id`) from `Departments`");
$count=$count[0];
$sql="SELECT `id`, `Name`, `ZavDepartment` from `Departments`";
$mysqli = new mysqli(HOST_DB, DB_USER, DB_PASS, DB_NAME);
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
}
$mysqli->query('SET NAMES utf8');
$result = $mysqli->query($sql);
for($k=1; $k<=$count; $k++){
foreach( $result->fetch_assoc() as $key => $value){
if($key=="id")$id=$value;
if($key=="Name")$Name=$value;
if($key=="ZavDepartment")$zav=$value;
if(($id)&&($Name)&&($zav)) {
echo "
" ; $id=""; $Name=""; $zav="";
};
};
};
$result->close();
$mysqli->close();
return $data;
}del_student($id){
$sql="DELETE FROM `students` where `id`=$id";
execute($sql);
return 1;
}del_group($id){
$sql="DELETE FROM `group` where `id`=$id";
execute($sql);
return 1;
}del_lectures($id){
$sql="DELETE FROM `lectures` where `id`=$id";
execute($sql);
return 1;
}del_kaf($id){
$sql="DELETE FROM `Departments` where `id`=$id";
execute($sql);
return 1;
}
function del_spec($id){
$sql="DELETE FROM `spec` where `id`=$id";
execute($sql);
return 1;
}del_predm($id){
$sql="DELETE FROM `predm` where `id`=$id";
execute($sql);
return 1;
}
get_all_kaf_id(){
$sql='SELECT `id` FROM `Departments`';
return (getinfo($sql));
}get_all_predm_id(){
$sql='SELECT `id` FROM `predm`';
return (getinfo($sql));
}get_all_spec_id(){
$sql='SELECT `id` FROM `spec`';
return (getinfo($sql));
}get_all_group_id(){
$sql='SELECT `id` FROM `group`';
return (getinfo($sql));
}get_all_stud_id(){
$sql='SELECT `id` FROM `students`';
return (getinfo($sql));
}get_all_stepen_id(){
$sql='SELECT `id` FROM `stepeni`';
return (getinfo($sql));
}get_predm_ved($predm){
echo "";
$sql="SELECT `id`, `id_stud`,`id_pred`,`ocenka` FROM `vedomosti` where `id_pred`=$predm";
$mysqli = new mysqli(HOST_DB, DB_USER, DB_PASS, DB_NAME);
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
}
$mysqli->query('SET NAMES utf8');
$result = $mysqli->query($sql);
foreach( $result->fetch_assoc() as $key => $value){
if($key=="id_stud")$value=get_fio_student ($value);
if($key=="id_pred")$value= get_predm_name ($value);
echo "<div align=\"center\&quo