mysql_connect('localhost', 'dissert','dissertkorsh') or die( mysql_error() );
mysql_select_db( "Dissert" ) or die( mysql_error() );
mysql_query( "set CHARACTER_SET_results='cp1251'");
mysql_query( "set CHARACTER_SET_client='cp1251'");
mysql_query( "set CHARACTER_SET_connection='cp1251'");
$incl_head = "/wwwarea/wiki/templates/static_start.tpl";
$incl_tail = "/wwwarea/wiki/templates/static_end.tpl";
if ( !($mode = $_GET[ '_mode' ])) $mode = 1;
switch ( $mode )
{
case 1:
{
include $incl_head;
// print "
";
$res = mysql_query( "select * from Sovet where inreg=0 order by Code" ) or die( mysql_error() );
print "";
print "";
$res = mysql_query( "select * from Sovet where inreg=1 order by Code" ) or die( mysql_error() );
print "";
include $incl_tail;
exit;
}
case 2:
{
include $incl_head;
$idSovet = $_GET[ 'idSovet' ];
$res = mysql_query( "select * from Sovet where id=$idSovet" ) or die( mysql_error() );
$row = mysql_fetch_object( $res );
print "
$row->Code - $row->Description
Председатель совета: $row->Preds
Ученый секретарь совета: $row->Uchsecr
";
$res = mysql_query( "select Dis.id, Dis.Description, Dis.Author, Dis.FolderDis, Dis.Declam, Dis.FolderAuto, Spec.Code, Spec.Description as SpecDesc, Types.Description as TypesDesc from Spec,Dis,Types where idSovet=$row->id and idSpec=Spec.id and idType=Types.id order by Dis.Author" ) or die( mysql_error() );
print "";
include $incl_tail;
exit;
}
case 3:
{
include $incl_head;
$idDis = $_GET[ 'idDis' ];
$res = mysql_query( "select Dis.*, Types.Description as TypDis, Spec.Code, Spec.Description as SpecDis, Sovet.Code as Cd, Sovet.id as idSovet from Dis,Types,Sovet,Spec where Dis.id=$idDis and idType=Types.id and idSpec=Spec.id and idSovet=Sovet.id" ) or die( mysql_error() );
// print( "select Dis.*, Types.Description as TypDis, Spec.Code, Spec.Description as SpecDis, Sovet.Code as Cd, Sovet.id as idSovet from Dis,Types,Sovet,Spec where Dis.id=$idDis and idType=Types.id and idSpec=Spec.id and idSovet=Sovet.id" ) or die( mysql_error() );
$row = mysql_fetch_object( $res );
print "
$row->Author
$row->Description
Специальность: $row->Code $row->SpecDis
$row->TypDis
$row->Declam
";
print "
idSovet&_mode=2>Список диссертаций совета";
if ( $row->FolderDis )
print " FolderDis/dis.pdf>Диссертация";
if ( $row->FolderAuto )
print " FolderAuto/auto.pdf>Автореферат";
include $incl_tail;
exit;
}
case 4:
{
$res = mysql_query( "select Dis.*, Types.Description as TypDis, Spec.Code, Spec.Description as SpecDis, Sovet.Code, Sovet.id as idSovet from Dis,Types,Sovet,Spec where idType=Types.id and idSpec=Spec.id and idSovet=Sovet.id and Dis.Declam <>'' order by DateZa desc limit 20" ) or die( mysql_error() );
print "";
while ( $row = mysql_fetch_object( $res ) )
{
$dat = substr( $row->DateZa, 0, 10);
print "- $dat  $row->Author $row->Code
id>$row->Description ";
}
print "
";
exit;
}
case 5:
{
include $incl_head;
$res = mysql_query( "select Dis.*, Types.Description as TypDis, Spec.Code, Spec.Description as SpecDis, Sovet.Code, Sovet.id as idSovet from Dis,Types,Sovet,Spec where idType=Types.id and idSpec=Spec.id and idSovet=Sovet.id and Dis.Declam <>'' order by DateZa desc limit 15" ) or die( mysql_error() );
print "";
while ( $row = mysql_fetch_object( $res ) )
{
$dat = substr( $row->DateZa, 0, 10);
print "- $dat  $row->Author ($row->Code)
id>$row->Description
";
}
include $incl_tail;
print "
";
exit;
}
}
?>