php Fisier de Administrare in aplicatia orar In functie de utilizatoru

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
//===================================================================================
// Fisier de Administrare in aplicatia orar.
// In functie de utilizatorul logat se afiseaza la ecran tebelele ce le poate edita.
// In functie de tabelul selectat este transmis sirul de interogare catre vise.php
// unde se trece in modulul de vizualizare si editare a teblului respectiv.
//===================================================================================
// Realizatori: Schipor Ovidiu, Grigoriev Sergiu, Halus Stefan
// Data ultimei actualizari: 17:39 09.03.2009
//===================================================================================
require_once ('configAdmin.inc.php');
echo '<LINK REL=StyleSheet HREF="tabel/at.inc.css" TITLE="Contemporary" TYPE="text/css">';
// modalitate simpla de a afla facultatea care s-a conectat
echo "id facultate conectata: ".$_SESSION["facultateID"];
echo "<title>Administrare</title>";
?>
<SCRIPT language="javascript">
function OK () {
var index=document.formular.tabele.selectedIndex;
var tabel=document.formular.tabele.options[index].value; // numele tabelului implicat
var back = escape (window.location.href); // adresa de intoarcere
var sirInterogare = ""; // Interogare utilizata pentru Vizualizare si Stergere
var numeCampuri = ""; // Succesiune de valori/interogari utilizate pentru inserare
switch (tabel) {
case "gradedidactice": sirInterogare = "SELECT * FROM <?php echo t('gradedidactice'); ?> ORDER BY gradDidacticID";
numeCampuri = "&numeCampuri[gradDidacticID]=1&numeCampuri[nume]=30&numeCampuri[numeScurt]=10";
break; case "situatiidoctorat": sirInterogare = "SELECT * FROM <?php echo t('situatiidoctorat'); ?> ORDER BY situatieDoctoratID;";
numeCampuri = "&numeCampuri[situatieDoctoratID]=1&numeCampuri[nume]=15&numeCampuri[numeScurt]=7";
break; case "altetitluri": sirInterogare = "SELECT * FROM <?php echo t('altetitluri'); ?> ORDER BY altTitluID;";
numeCampuri = "&numeCampuri[altTitluID]=1&numeCampuri[nume]=20&numeCampuri[numeScurt]=10";
break; case "cadre": sirInterogare = "SELECT C.cadruID,C.nume,C.prenume,C.email, G.numeScurt as grad,D.numeScurt as doctorat,A.numeScurt as alta_titulatura, L1.nume as inCaf, L2.nume as inBcaf, L3.nume as inSenat, L4.nume as inBSenat, C.catedraID ";
sirInterogare+="FROM <?php echo t('cadre'); ?> C,<?php echo t('gradedidactice'); ?> G,<?php echo t('situatiidoctorat'); ?> D,<?php echo t('altetitluri'); ?> A, <?php echo t('logic'); ?> L1, <?php echo t('logic'); ?> L2,<?php echo t('logic'); ?> L3,<?php echo t('logic'); ?> L4 ";
sirInterogare+="WHERE C.gradDidacticID=G.gradDidacticID and C.situatieDoctoratID=D.situatieDoctoratID and C.altTitluID=A.altTitluID and L1.logicID=C.inCAF and L2.logicID=C.inBCAF and L3.logicID=C.inSenat and L4.logicID=C.inBSenat ORDER BY C.nume,C.prenume;";
numeCampuri = "&numeCampuri[nume]=30&numeCampuri[prenume]=50&numeCampuri[email]=50&numeCampuri[gradDidacticID]=SELECT gradDidacticID,numeScurt FROM <?php echo t('gradedidactice'); ?>;&numeCampuri[situatieDoctoratID]=SELECT situatieDoctoratID,numeScurt FROM <?php echo t('situatiidoctorat'); ?>;&numeCampuri[altTitluID]=SELECT altTitluID,numeScurt FROM <?php echo t('altetitluri'); ?>;&numeCampuri[inCAF]=SELECT logicID,nume from <?php echo t('logic'); ?>;&numeCampuri[inBCAF]=SELECT logicID,nume from <?php echo t('logic'); ?>;&numeCampuri[inSenat]=SELECT logicID, nume from <?php echo t('logic'); ?>;&numeCampuri[inBSenat]=SELECT logicID, nume from <?php echo t('logic'); ?>;&numeCampuri[catedraID]=1";
break; case "facultati": sirInterogare = "SELECT * FROM <?php echo t('facultati'); ?> ORDER BY facultateID;";
numeCampuri = "&numeCampuri[facultateID]=1&numeCampuri[nume]=100&numeCampuri[numeScurt]=20&numeCampuri[parola]=40&numeCampuri[durataCicluLicenta]=1&numeCampuri[durataCicluMaster]=1";
break; case "specializari": sirInterogare = "SELECT S.specializareID,I.nume as specializare,an ";
sirInterogare+= "FROM Specializari S,InfoSpecializari I ";
sirInterogare+= "WHERE S.infoSpecializareID=I.infoSpecializareID ORDER BY S.an,S.specializareID;";
numeCampuri = "&numeCampuri[infoSpecializareID]=SELECT infoSpecializareID,numescurt FROM InfoSpecializari;&numeCampuri[an]=1";
break; case "serii": sirInterogare = "SELECT S.serieID,U.an,I.numescurt as uspecializare,S.indice ";
sirInterogare+= "FROM Serii S,USpecializari U,InfoUSpecializari I ";
sirInterogare+= "WHERE S.uspecializariID=U.uspecializariID and U.infoUSpecializariID=I.infoUSpecializariID ORDER BY U.an;";
numeCampuri = "&numeCampuri[uspecializariID]=SELECT U.uspecializariID,I.numescurt,U.an FROM USpecializari U,InfoUSpecializari I WHERE U.infoUSpecializariID=I.infoUSpecializariID;&numeCampuri[indice]=1";
break; case "grupe": sirInterogare = "SELECT G.grupaID,G.nume as nume,G.serieID ";
sirInterogare+= "FROM Grupe G ORDER BY substring (nume from 3 for 1),substring (nume from 2 for 1),substring (nume from 4 for 1);";
numeCampuri = "&numeCampuri[nume]=6&numeCampuri[serieID]=SELECT S.serieID,I.numescurt,U.an,S.indice FROM USpecializari U,InfoUSpecializari I, Serii S WHERE U.infoUSpecializariID=I.infoUSpecializariID and S.uspecializariID=U.uspecializariID;";
break; case "subgrupe": sirInterogare = "SELECT S.semigrupaID,G.nume as grupa,S.indice as indice_semigrupa ";
sirInterogare+= "FROM Semigrupe S,Grupe G ";
sirInterogare+= "WHERE S.grupaID=G.grupaID ORDER BY substring (G.nume from 3 for 1),substring (G.nume from 2 for 1),substring (G.nume from 4 for 1),S.indice;";
numeCampuri = "&numeCampuri[grupaID]=SELECT grupaID,nume FROM Grupe;&numeCampuri[indice]=1";
break; case "sali": sirInterogare = "SELECT * FROM <?php echo t('sali'); ?> ORDER BY numeScurt;";
numeCampuri = "&numeCampuri[nume]=30&numeCampuri[numeScurt]=10&numeCampuri[corp]=10&numeCampuri[campus]=10&numeCampuri[facultateID]=SELECT facultateID,numeScurt FROM <?php echo t('facultati'); ?>;";
break; case "zile": sirInterogare = "SELECT * FROM <?php echo t('zile'); ?> ORDER BY ziID;";
numeCampuri = "&numeCampuri[ziID]=1&numeCampuri[nume]=10&numeCampuri[numeScurt]=3";
break; case "discipline": sirInterogare = "SELECT * FROM <?php echo t('discipline'); ?> ORDER BY numeScurt;";
numeCampuri = "&numeCampuri[facultateID]=SELECT facultateID,numeScurt FROM <?php echo t('facultati'); ?>;&numeCampuri[numeScurt]=15&numeCampuri[nume]=70";
break; case "tipuriactivitati": sirInterogare = "SELECT * FROM <?php echo t('tipuriactivitati'); ?> ORDER BY tipActivitateID;";
numeCampuri = "&numeCampuri[tipActivitateID]=1&numeCampuri[nume]=20&numeCampuri[numeScurt]=20&numeCampuri[culoare]=6";
break; case "orare": sirInterogare = "SELECT * FROM <?php echo t('orare'); ?> ORDER BY orarID;";
numeCampuri = "&numeCampuri[facultateID]=SELECT facultateID,numeScurt FROM <?php echo t('facultati'); ?>;&numeCampuri[an]=1&numeCampuri[titluOrar]=100&numeCampuri[areSerii]=1&numeCampuri[areSubgrupe]=1&numeCampuri[lungime]=1";
break; case "specializariorare": sirInterogare = "SELECT * FROM <?php echo t('specializariorare'); ?> ORDER BY specializareID;";
numeCampuri = "&numeCampuri[specializareID]=SELECT specializareID,numeScurt FROM <?php echo t('specializari'); ?>;&numeCampuri[orarID]=SELECT orarID,titluOrar FROM <?php echo t('orare'); ?>;&numeCampuri[pozitieStart]=1&numeCampuri[pozitieStop]=1";
break; case "utilizatori": sirInterogare = "SELECT * FROM <?php echo t('utilizatori'); ?> ORDER BY utilizatorID;";
numeCampuri = "&numeCampuri[nume]=20&numeCampuri[parola]=32&numeCampuri[tipUtilizator]=6&numeCampuri[facultateID]=SELECT facultateID,numeScurt FROM <?php echo t('facultati'); ?>;";
break; case "logic": sirInterogare = "SELECT * FROM <?php echo t('logic'); ?> ORDER BY logicID;";
numeCampuri = "&numeCampuri[logicID]=1&numeCampuri[nume]=10";
break; case "Activitati_tabel": location.href = "VSIactivitati.php?back="+back; return;
break; case "Activitati_WYSIWYG": location.href = "activitati/index.php"; return;
break;}
location.href="tabel/vise.php?back="+back+"&sirInterogare="+escape(sirInterogare)+"&tabel="+tabel+numeCampuri;
}
</SCRIPT>
</head><body>
<H3 align='left'>Universitatea "Stefan cel Mare" Suceava</H3>
<H2 align='left'><FONT color='blue'>Facultatea de Inginerie Electrica</FONT></H2>
<HR width='50%' align='left' color='red' width='2'>
<H1 align='center'><FONT color='blue'>Orarul activitatilor didactice</FONT></H1>
<H2 align='center'><FONT color='blue'>(modulul de administrare)</FONT></H2>
<div align="center">
<B><FONT SIZE='+1'>Indica tabelul pe care vrei sa-l administrezi</FONT></B>
<FORM NAME="formular"> <!-- afiseaza tabele ce pot fi ediate -->
<SELECT NAME='tabele' SIZE='25' onChange='OK()'>
<OPTION VALUE="gradedidactice" >Grade Didactice </OPTION>
<OPTION VALUE="situatiidoctorat" >Situatii Doctorat </OPTION>
<OPTION VALUE="altetitluri" >Alte Titluri </OPTION>
<OPTION VALUE="cadre" >Cadre </OPTION>
<OPTION VALUE="facultati" >Facultati </OPTION>
<OPTION VALUE="specializari" >Specializari </OPTION>
<OPTION VALUE="serii" >Serii </OPTION>
<OPTION VALUE="grupe" >Grupe </OPTION>
<OPTION VALUE="subgrupe" >Subgrupe </OPTION>
<OPTION VALUE="sali" >Sali </OPTION>
<OPTION VALUE="zile" >Zile </OPTION>
<OPTION VALUE="discipline" >Discipline </OPTION>
<OPTION VALUE="tipuriactivitati" >TipuriActivitati </OPTION>
<OPTION VALUE="orare" >Orare </OPTION>
<OPTION VALUE="specializariorare">Specializari Orare </OPTION>
<OPTION VALUE="utilizatori" >Utilizatori </OPTION>
<OPTION VALUE="logic" >Logic </OPTION>
</SELECT>
</FORM>
<BR><B><FONT SIZE='+1'><A href="login.php">LOGOUT</A></FONT></B>
<HR width='50%' align='right' color='red' width='2'><BR>
</div>
<div align='right'><BR><B>Proiect de diploma (2003)</B> al studentului <A HREF='mailto:ovidiusc@stud.usv.ro'>Ovidiu Schipor</A><BR>
(indrumator prof. dr. ing. <FONT color='blue'><B>Stefan Gheorghe Pentiuc</B></FONT>)</div>
</body>
</html>
<?php mysql_close(CONN)?>