\n"; echo "state\n"; echo "public\n"; echo "count\n"; while( $row ) { $state = $row["ff_state"]; $public = $row["ff_public"]; $cnt = $row["cnt"]; switch( $state ) { case FFS_INCOMING: $state = "incoming"; break; case FFS_ACTIVE: $state = "active"; break; case FFS_REJECTED: $state = "rejected"; break; } switch( $public ) { case 0: $public = "false"; break; case 1: $public = "true"; break; } echo "\n"; echo "$state\n"; echo "$public\n"; echo "$cnt\n"; $row = pg_fetch_array( $ress, NULL, PGSQL_ASSOC ); } echo "\n"; echo "

 

\n"; $sql = "select " . "f.ff_camera, " . "min(ff_orig_name) as minname, " . "max(ff_orig_name) as maxname, " . "count(*) as cnt " . "from " . "fotolib_foto f " . "group by " . "f.ff_camera " . "order by " . "f.ff_camera " . ""; $ress = pg_query( $conn, $sql ); $row = pg_fetch_array( $ress, NULL, PGSQL_ASSOC ); if( !$row ) { return; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; while( $row ) { $camera = $row["ff_camera"]; $minname = $row["minname"]; $maxname = $row["maxname"]; $cnt = $row["cnt"]; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $row = pg_fetch_array( $ress, NULL, PGSQL_ASSOC ); } echo "
cameracountfirstlast
$camera$cnt$minname$maxname
\n"; echo "

 

\n"; $sql = "select " . "t.ft_id, " . "t.ft_kind, " . "t.ft_name, " . "t.ft_descr, " . "count(ft.ff_id) as cnt " . "from " . "fotolib_tag t " . "left join fotolib_foto_tag ft on " . "ft.ft_id = t.ft_id " . "where " . "t.ft_id = ft.ft_id " . "group by " . "t.ft_id, " . "t.ft_kind, " . "t.ft_name, " . "t.ft_descr " . "order by " . "t.ft_kind, " . "t.ft_name, " . "t.ft_descr " . ""; $ress = pg_query( $conn, $sql ); $row = pg_fetch_array( $ress, NULL, PGSQL_ASSOC ); if( !$row ) { return; } echo "\n"; echo "\n"; echo "\n"; $prevkind = -1; while( $row ) { $kind = $row["ft_kind"]; $name = $row["ft_name"]; $descr = $row["ft_descr"]; $cnt = $row["cnt"]; if( $kind != $prevkind ) { echo "\n"; echo "\n"; $prevkind = $kind; } if( $descr != "" ) { $name .= ": " . $descr; } echo "\n"; echo "\n"; echo "\n"; $row = pg_fetch_array( $ress, NULL, PGSQL_ASSOC ); } echo "
tagcount
" . htmlentities($FTK_NAMES[$kind]) . "
   $name$cnt
\n"; } ?>