Glavna stranica | Popis datoteka | Članovi klasa u datoteci

func_preference.php

Dokumenacija za ovu datoteku.
00001 <?
00002 /**************************************************************************************
00003  studentski Informacijski servis, 2004
00004  **************************************************************************************
00005  func_preference.php
00006  repozitorij funkcija za prikupljanje cesto neophodnih podataka
00007  vezanih za studenta
00008 
00009 
00010  Srdjan Segvic - srle
00011  **************************************************************************************
00012  **************************************************************************************
00013  This program is free software; you can redistribute it and/or modify
00014  it under the terms of the GNU General Public License as published by
00015  the Free Software Foundation; either version 2 of the License, or
00016  (at your option) any later version.
00017 
00018  This program is distributed in the hope that it will be useful,
00019  but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  GNU Library General Public License for more details.
00022 
00023  You should have received a copy of the GNU General Public License
00024  along with this program; if not, write to the Free Software
00025  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00026  **************************************************************************************/
00027  //
00028  // funkcija vraca podeseni semestar pocetka pracenja predmeta
00029  //
00030  function getSemestarPocetak($id){
00031                                                                         
00032                         $query = "SELECT semestar_pocetak
00033                                           FROM  preference_studenta
00034                                           WHERE student_ID = '$id'";
00035                                           
00036                                                                                                  
00037                         $result = mysql_query($query) or
00038                                                          die(mysql_error());                                            
00039                                                                  
00040                         $row = mysql_fetch_array($result);      
00041                          
00042                 return($row[0]);
00043          }
00044 
00045  //
00046  // funkcija vraca podeseni semestar kraja pracenja predmeta
00047  //
00048  function getSemestarKraj($id){                                         
00049                         
00050                         $query =
00051                                 "SELECT semestar
00052                                  FROM  status_studenta
00053                                  WHERE student_ID = '$id'
00054                                  AND     datum_kraja = '0000-00-00'";
00055 
00056 
00057                         $result = mysql_query($query) or
00058                                                          die(mysql_error());
00059 
00060                         $row = mysql_fetch_array($result);
00061 
00062                 return($row[0]);
00063          }
00064 
00065  //
00066  // funkcija vraca odabrani jezik sucelja
00067  //
00068  function getLang($id){
00069                  $query = "SELECT jezik
00070                                    FROM preference_studenta
00071                                    WHERE student_ID = '$id'";
00072                   
00073                   $result = mysql_query($query) or
00074                                         die(mysql_error());                                             
00075                                                                  
00076                   $row = mysql_fetch_array($result);    
00077                          
00078               return($row[0]);
00079           }
00080 
00081  //
00082  // funkcija vraca formatirani oblik semestra
00083  //
00084  function toRim($broj){
00085                 switch ($broj){
00086                         case 1: return "I";
00087                         break;;
00088                 
00089                         case 2: return "II";
00090                         break;;
00091                 
00092                         case 3: return "III";
00093                         break;;
00094                 
00095                         case 4: return "IV";
00096                         break;;
00097                 
00098                         case 5: return "V";
00099                         break;;
00100                 
00101                         case 6: return "VI";
00102                         break;;
00103                 
00104                         case 7: return "VII";
00105                         break;;
00106                 
00107                         case 8: return "VIII";
00108                         break;;
00109                 
00110                         case 9: return "IX";
00111                         break;;
00112                 
00113                         case 10: return "X";
00114                         break;;
00115 
00116                         case "A": return "Apsolventski";
00117                         break;;
00118         }
00119 }
00120  //
00121  // funkcija vraca direktorij u kojem su slike za odabranu temu
00122  //
00123  function getImageDir($id){
00124                  $query = "SELECT  teme.naziv_teme
00125                            FROM    teme, preference_studenta
00126                            WHERE   preference_studenta.student_ID = '$id'
00127                            AND     teme.teme_ID = preference_studenta.teme_ID";
00128                   
00129                   $result = mysql_query($query) or
00130                                         die(mysql_error());                                             
00131                                                                  
00132                   $row = mysql_fetch_array($result);    
00133                          
00134               return($row[0]);
00135           }
00136 
00137  //
00138  // funkcija vraca odabranu boju teme
00139  //
00140 function getColor($id, $nr){
00141                         
00142                         $select = "color".$nr; 
00143                         
00144                         $query_color = "SELECT teme.$select
00145                                         FROM teme, preference_studenta
00146                                         WHERE preference_studenta.student_ID = '$id'
00147                                         AND   teme.teme_ID = preference_studenta.teme_ID";
00148                                                                                                  
00149                         $result_color = mysql_query($query_color) or
00150                                                                          die(mysql_error());                                            
00151                                                                  
00152                         $row_color = mysql_fetch_array($result_color);  
00153                                                                 
00154                 return($row_color[0]);
00155          }
00156 
00157  //
00158  // funkcija vraca odabranu boju texta teme
00159  //
00160 function getTextColor($id, $nr){
00161                         
00162                         $select = "text_color".$nr; 
00163                         
00164                         $query_color = "SELECT teme.$select
00165                                         FROM teme, preference_studenta
00166                                         WHERE preference_studenta.student_ID = '$id'
00167                                         AND   teme.teme_ID = preference_studenta.teme_ID";
00168                                                                                                  
00169                         $result_color = mysql_query($query_color) or die(mysql_error());
00170 
00171                         $row_color = mysql_fetch_array($result_color);
00172                                                                 
00173                 return($row_color[0]);
00174          }
00175 
00176  //
00177  // funkcija vraca odabranu pozadinsku boju teme
00178  //
00179 function getBgColor($id, $nr){
00180                         
00181                         $select = "bg_color".$nr; 
00182                         
00183                         $query_color = "SELECT teme.$select
00184                                         FROM teme, preference_studenta
00185                                         WHERE preference_studenta.student_ID = '$id'
00186                                         AND   teme.teme_ID = preference_studenta.teme_ID";
00187                                                                                                  
00188                         $result_color = mysql_query($query_color) or
00189                                                                          die(mysql_error());                                            
00190                                                                  
00191                         $row_color = mysql_fetch_array($result_color);  
00192                                                                 
00193                 return($row_color[0]);
00194          }
00195 
00196  //
00197  // funkcija vraca podeseni broj obavjestenja po stranici
00198  //
00199 function getObavPerPage($id){
00200                         
00201                         $query_ppage = "SELECT obav_postranici
00202                                         FROM   preference_studenta
00203                                         WHERE  student_ID = '$id'";
00204          
00205                         $result_ppage = mysql_query($query_ppage) or die(mysql_error());
00206 
00207                         $row_ppage = mysql_fetch_array($result_ppage);  
00208 
00209                 return($row_ppage[0]);
00210          }
00211 
00212 ?>       

Generirano Thu Sep 16 17:16:00 2004 projekt: SiS.Student generator: doxygen 1.3.2