-
Notifications
You must be signed in to change notification settings - Fork 3
/
indexprijavljen.php
59 lines (51 loc) · 2.83 KB
/
indexprijavljen.php
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
<?php
include_once('aplikacijskiOkvir.php');
#$greske="";
session_start();
$korisnik = provjeraKorisnika();
$baza=new Baza();
dnevnik_zapis("Početna stranica");
//$upit="SELECT ambulanta.ambulantaID,ambulanta.ambulantaNaziv,ambulanta.ambulantaAdresa,ambulanta.ambulantaGrad,ambulanta.ambulantaTelefon,ambulanta.ambulantaRadnoVrijeme,korisnik.korisnikIme,korisnik.korisnikaPrezime from ambulanta left outer join korisnik on ambulanta.ambulantaID=korisnik.ambulanta_ambulantaID";
$upit="SELECT * from ambulanta";
$podaci=$baza->selectUpiti($upit);
$slikeAmbulante=array("Koprivnica"=>"img/kc.jpg","Varaždin"=>"img/vz.jpg","Križevci"=>"img/kž.jpg","Ludbreg"=>"img/ludbreg.jpg","Osijek"=>"img/os.jpg","Rijeka"=>"img/ri.jpg","Zadar"=>"img/zd.jpg","Zagreb"=>"img/zg.jpg","Čakovec"=>"img/čk4.jpg", "Split"=>"img/split.jpg");
$gradovi=array();
if ($podaci){
while($red=$podaci->fetch_array()){
$ispis.="<div id='info{$red[ambulantaID]}' class='reveal-modal small' data-reveal>";
$ispis.="<div class='row'>";
$ispis.="<div class='small-12 medium-12 large-12 xlarge-12 columns'>";
$ispis.="<form>";
$ispis.="<label>Naziv ambulante</label><input type='text' value='$red[ambulantaNaziv]' readonly>";
$ispis.="<label>Adresa</label><input type='text' value='$red[ambulantaAdresa] , $red[ambulantaGrad]' readonly>";
$ispis.="<label>Telefon</label><input type='text' value='$red[ambulantaTelefon]' readonly>";
$ispis.="<label>Radno vrijeme</label><input type='text' value='$red[ambulantaRadnoVrijeme]' readonly>";
$ispis.="<label>Veterinari</label><input type='text' readonly value='"; #greska ako postoji ambulanta bez veterinara
$upit="SELECT korisnikIme,korisnikaPrezime from korisnik where ambulanta_ambulantaID={$red[ambulantaID]} and tipKorisnika_tipKorisnikaID=2";
$rez=$baza->selectUpiti($upit);
if($rez){
while($red2=$rez->fetch_array()){
$ispis.=" {$red2[korisnikIme]} {$red2[korisnikaPrezime]} ";
}
}
$ispis.="'";
$ispis.="</form>";
$ispis.="</div></div>";
$ispis.="<a class='close-reveal-modal' href='#'>x</a>";
$ispis.="</div>";
$ispisGrid.="<li><img src={$slikeAmbulante["{$red[ambulantaGrad]}"]} alt='slika{$red[ambulantaID]}' /><a href='#' class='button expand' data-reveal-id='info{$red[ambulantaID]}'>{$red[ambulantaNaziv]}</a></li>";
}
$ispisGrid.="</ul>";
}else{
$greske.="Greska pri radu s bazom podataka. <br>";
}
if (!empty($greske)){
header('Location: greske.php?kod='.$greske);
exit();
}
include 'headerLogIn.php';
$smarty->assign('ispis', $ispis);
$smarty->assign('ispisGrid', $ispisGrid);
$smarty->display('predlosci/index.tpl');
include 'footer.php'
?>