1 |
<?php |
2 |
|
3 |
if (isset($submit) && check_required()) { |
4 |
$sth = $dbh->prepare("select count(login) as num from people where login = '$login'"); |
5 |
$sth->execute(); |
6 |
if ($row=$sth->fetchrow_hash()) { |
7 |
if ($row[num] == 0) { |
8 |
$sql="insert into people values ('$zanimanje','$drugo_zanimanje','$login','$geslo','$sender','$ulica','$posta','$kraj','$tel','$reply','$org','$orgtel','$orgfax','$orgemail','$specializacija','$podrocje')"; |
9 |
|
10 |
$sth = $dbh->prepare($sql); |
11 |
$sth->execute(); |
12 |
|
13 |
$smarty->assign(array( |
14 |
mailto=>$reply, |
15 |
login=>$login, |
16 |
geslo=>$geslo, |
17 |
sender=>$sender |
18 |
)); |
19 |
include_once("quoted-printable.inc"); |
20 |
iso_sendmail_t($smarty->fetch("mail.tpl")); |
21 |
$main=$smarty->fetch("novi_user.tpl"); |
22 |
} else { |
23 |
print "-- $row[num] $geslo --"; |
24 |
$smarty->assign("warning","Veè postoji uporabnièko ime! Prosimo, izaberite drugo uporabni¹ko ime."); |
25 |
$main=$smarty->fetch("obrazac.tpl"); |
26 |
$title.=" : OBRAZEC ZA PRIJAVO"; |
27 |
$smarty->assign("mtext","OBRAZEC ZA PRIJAVO"); |
28 |
} |
29 |
} |
30 |
|
31 |
} else { |
32 |
if (! check_required()) { |
33 |
$smarty->assign("warning","Prijava je nepopolno izpolnjena"); |
34 |
} |
35 |
$main=$smarty->fetch("obrazac.tpl"); |
36 |
$title.=" : OBRAZEC ZA PRIJAVO"; |
37 |
$smarty->assign("mtext","OBRAZEC ZA PRIJAVO"); |
38 |
} |
39 |
|
40 |
$smarty->assign("contact_section",1); |
41 |
|
42 |
?> |