is |
Subversion Repositories: |
Compare with Previous - Blame - Download
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<style type="text/css" media="screen"> @import "style.css"; </style>
<title>db.jablonka.cz finance uživatele</title>
</head>
<link rel="stylesheet" type="text/css" href="style.css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
</head>
<body topmargin=0 leftmargin=10>
<?
require('grab_globals.lib.php');
include ("header.htm");
include ("fce.php");
$spojeni = MySQL_Connect($db_host, $db_user, $db_pass);
MySQL_Select_DB($db_name);
if($year=="") $year=date("Y");
$table="finance";
if($order=="" || $order=="datum") $dotaz=MySQL_Query("SELECT * FROM $table WHERE clen='$user_id' ORDER BY datum");
if($order=="castka") $dotaz=MySQL_Query("SELECT * FROM $table WHERE user_id='$user_id' ORDER BY money,month,day");
if($order=="typ") $dotaz=MySQL_Query("SELECT * FROM $table WHERE user_id='$user_id' ORDER BY type,month,day");
?>
<br>
<br>
<form action="viewfinance_user.php" method=POST>
<b>Finance uživatele <font color=red><? echo id_to_name($user_id)?></font> pro rok
<select class=field name="year">
<?
for ($i=2004;$i<2010;$i++)
{
echo '<option '; if($year==$i){ echo 'selected';} echo'>'.$i.'</option>';
}
echo'
</select><br>
<input class=field type="submit" name="OK" value="zobrazit">
<input name="user_id" type="hidden" value="'.$user_id.'">
</form>';
?>
<center>
<table width=80% cellspacing=1>
<tr>
<td bgcolor=#C00000>
<table cellspacing=0 cellpadding=0 width=100%>
<tr>
<td bgcolor=#FFFFFF> </td>
<td bgcolor=#FFFFFF class=text>
<a title="seřadit podle data" class=odkaz href="viewfinance_user.php?user_id=<? echo $user_id;?>&order=datum&year=<? echo $year;?>">Datum</a>
</td>
<td bgcolor=#FFFFFF class=text>
<a title="seřadit podle částky" class=odkaz href="viewfinance_user.php?user_id=<? echo $user_id;?>&order=castka&year=<? echo $year;?>">Částka</a>
</td>
<td bgcolor=#FFFFFF class=text>
<a title="seřadit podle druhu platby" class=odkaz href="viewfinance_user.php?user_id=<? echo $user_id;?>&order=typ&year=<? echo $year;?>">Typ platby</a>
</td>
<td bgcolor=#FFFFFF class=text width=200>
Poznámka
</td>
<td bgcolor=#FFFFFF><br><br>
</td>
</tr><?
while($string=MySQL_Fetch_Array($dotaz))
{
$comment=str_split($string["comment"],40);
if ($string["money"]<0)
{
$barva="#FAEEEE";
}
else
{
$barva="#E7FFF1";
}
echo '
<tr>
<td bgcolor='.$barva.'> </td>
<td bgcolor='.$barva.' class=text>
'.$string["day"].'.'.$string["month"].'.'.$year.'
</td>
<td bgcolor='.$barva.' class=text>
'.$string["money"].'
</td>
<td bgcolor='.$barva.' class=text>
'.id_to_type($string["type"]).'
</td>
<td bgcolor='.$barva.' class=text>';
?>
<a class=odkaz href="javascript:;" onClick="javascript:window.open('comment.php?comment=<? echo $string["comment"];?>','poznámka','scrollbars=yes,status=no,menubar=no,resizable=no,directories=no,width=300,height=200');">
<?
echo $comment[0];
if ($string["comment"]!="") echo '...';
echo '
</a>
</td>
<td bgcolor='.$barva.' class=text>';
?>
<a class=odkaz href="javascript:;" onClick="javascript:window.open('updatefinance_user.php?year=<? echo $year;?>&id=<? echo $string["id"];?>','poznámka','scrollbars=yes,status=no,menubar=no,resizable=no,directories=no,width=300,height=300');">
<?
echo 'upravit</a>
';
?>
<a class=odkaz href="javascript:;" onClick="javascript:window.open('delfinance_user.php?year=<? echo $year;?>&id=<? echo $string["id"];?>','poznámka','scrollbars=yes,status=no,menubar=no,resizable=no,directories=no,width=300,height=200');">
<?
echo ' <font color="#C00000">smazat</font></a>
</td>
</tr>
<tr height=1>
<td colspan=6 bgcolor=#E6E4E4></td>
</tr>
';
Next($string);
}
?></table></tr></td></table></center><?
echo '
<hr>
<b>Bilance plateb:</b><br>';
$celkova_bilance=0;
for ($i=0;$i<type_count();$i++)
{
$bilance=0;
$dotaz=MySQL_Query("SELECT * FROM $table WHERE user_id='$user_id' AND type='$i'");
while($string=MySQL_Fetch_Array($dotaz))
{
$bilance+=$string["money"];
Next($string);
}
if ($bilance<0) { $barva="#C00000"; }else{ $barva="green"; }
echo id_to_type($i).': <font color='.$barva.'>'.$bilance.'</font><br>';
$celkova_bilance+=$bilance;
}
echo '-------------------------------------------<br>';
$bilance=$celkova_bilance;
if ($bilance<0) { $barva="#C00000"; }else{ $barva="green"; }
echo '
<b>Celková bilance:</b> <font color='.$barva.'>'.$bilance.'</font>';
echo'
<br>
<br>
<img src=images/arrow.jpg> <a href="addfinance_user.php?user_id='.$user_id.'" class=odkaz>přidat transakci uživateli '.id_to_name($user_id).'</a>
<br>
<br>';
MySQL_Close($spojeni);
?>
</body>
</html>