<?php

	require("db.inc.php");
	require("functions.php");
	$mydb = new db();

	$title="list creator";

	include('header.inc.php');


if ($round == 1) {

    $stmt = "SELECT szuro FROM kk_szuro WHERE id='" . $id ."'";
	$result=$mydb->query($stmt);
    $row = mysql_fetch_object($result);

    $stmt = $row->szuro;
	$result=$mydb->query($stmt);


    printf("
    <B>Új lista</B>
    <TABLE border='1' style='border-collapse: collapse' bordercolor='#CCCCCC' CELLPADDING='5' STYLE='background: #FFFFFF;'>
    <TR>");
	printf("<TH style='font-size: 11px'>Az.</TH>\n");
	printf("<TH style='font-size: 11px'>Adatok</TH>\n");
	printf("<TH style='font-size: 11px'>Admin</TH>\n");

    while($row = mysql_fetch_row($result)){

        $s_data = "";
        for ($i=1;$i<sizeof($row);$i++) {
            $s_data .= $row[$i] . " | ";
            }

        $a_ids[] = $row[0];

        $s_data = substr($s_data, 0, strlen($s_data)-3);

        printf("<tr><td>%s</td><td>%s</td><td>Töröl</td></tr>", $row[0], $s_data);
        }

    printf("</TABLE>");

    $s_ids = serialize($a_ids);
    printf(base64_encode($s_ids));

} else {
	printf("<B>Új lista gyártása</B>");

	printf("<FORM METHOD=post ACTION=\"%s\">\n", $PHP_SELF);
    printf("<table cellspacing=\"1\" style='background: #BBBBBB;'>");

    PrintSelect('kk_szuro', 'id', 'Szűrő', 1, 'id', 'nev');

    printf("<tr><td>&nbsp;</td><td><input type=\"submit\" name=\"Submit\" value=\"Mehet\"></td></tr>");
    printf("</table>");
    printf("<input type=\"hidden\" name=\"round\" value=\"1\">");
	printf("</FORM>");
}
	include('footer.inc.php');




?>