Projekt

Obecné

Profil

Stáhnout (1.08 KB) Statistiky
| Větev: | Tag: | Revize:
1
<?
2
define ("SLOUPCU", 4);
3
	if (! @$spojeni = Pg_Connect("user=vadmin  dbname=vseved2"))
4
	{
5
    echo ("Nepodarilo se pripojit do databaze!<br>\n");
6
    echo ("</BODY>");
7
    echo ("</HTML>");
8
    exit;
9
	}
10
	Pg_Exec ($spojeni, "UPDATE nejhesla SET sl1_obor='$nsl1', sl2_obor='$nsl2', sl3_obor='$nsl3', sl4_obor='$nsl4'");
11

    
12
	$sporadi = Array (1=>$sl1por, $sl2por, $sl3por, $sl4por);
13
	$s = Array (1=>$nsl1, $nsl2, $nsl3, $nsl4);
14
	for ($i=1; $i <= SLOUPCU; $i++)
15
	{
16
		if ($sporadi[$i] != "")
17
		{
18
			if ($s[$i] >= 0) 
19
				$pod1 = "WHERE ((obor4='$s[$i]') OR (obor5='$s[$i]') OR (obor6='$s[$i]') OR (obor7='$s[$i]'))";
20
			$list[$i] = Pg_Exec ($spojeni, "SELECT fk_ez_id FROM whitel $pod1 ORDER BY web DESC, wap DESC");
21
			if ($sporadi[$i] < Pg_NumRows ($list[$i]) )
22
				List ($nidhesla[$i]) = Pg_Fetch_Row ($list[$i], $sporadi[$i]);
23

    
24
			if (! @Pg_Exec ($spojeni, "UPDATE nejhesla SET sl".$i."_heslo='$nidhesla[$i]'") )
25
			{
26
				echo ("Zvolene heslo ve sloupci $i nema odpovidajici heslo v EZETDAT<br>\n");
27
				Pg_Close ($spojeni);
28
				exit;
29
			}
30
		}
31
	}
32

    
33
	Pg_Close ($spojeni);
34

    
35
  Header ("Location: ./show.php");
36
?>
(2-2/2)