jablonka.czprosek.czf

is

Subversion Repositories:
[/] [trunk/] [html/] [updatefinance_user.php] - Rev 4 Go to most recent revision

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">
</head>
<body topmargin=10 leftmargin=10>
<?
require('grab_globals.lib.php');
include ("fce.php");
$spojeni = MySQL_Connect($db_host, $db_user, $db_pass);
MySQL_Select_DB($db_name);
$dotaz=MySQL_Query("SELECT * FROM finance WHERE clen='$id'");
$dotaz=MySQL_Fetch_Array($dotaz);

if(!$action)
{
echo '
<form action="updatefinance_user.php?action=save" method=POST>
<table>
        <tr>
                <td class=text>Rok:</td>
                <td class=text>
                '.$year.'
                </td>
        </tr>
        <tr>    
                <td class=text>Měsíc:</td>
                <td>
                
                <select class=field name="month">';
                for ($i=1;$i<13;$i++)
                {               
                        echo '<option '; if($dotaz["month"]==$i){ echo 'selected';} echo'>'.$i.'</option>';
                }
                echo'
                </select>
                </td>
        </tr>
        <tr>    
                <td class=text>Den:</td>
                <td>            
                
                <select class=field name="day">';
                for ($i=1;$i<32;$i++)
                {
                         echo '<option '; if($dotaz["day"]==$i){ echo 'selected';} echo'>'.$i.'</option>';
                }
                echo'
                </select>
                </td>
        </tr>
        <tr>
           <td class=text>typ transakce:</td>
           <td>
                <select class=field name="type">';
                $typdotaz=MySQL_Query("SELECT * from poplatky ORDER BY id ASC");
                $count=MySQL_Num_Rows($typdotaz);
                
                for ($i=0;$i<$count;$i++)
                {
                         $string=MySQL_Fetch_Array($typdotaz);
                         echo '<option '; if($dotaz["type"]==$i){ echo 'selected';} echo' value='.$i.'>'.$string["type"].'</option>';
                         Next($string);
                }               
                echo '</select>
           </td>
        </tr>
        <tr>
           <td class=text>částka:</td><td><input class=field name="money" type="text" value="'.$dotaz["money"].'" size=25></td>
        </tr>
        <tr>
           <td class=text valign=top>Poznámka:</td><td><textarea class=fieldthin name="comment" rows=8 cols=25>'.$dotaz["comment"].'</textarea></td>
        </tr>
</table>
<br>
<center><input class=field type="submit" name="OK" value="&nbsp;uložit&nbsp;"></center>
<input name="year" type="hidden" value="'.$year.'"><input name="id" type="hidden" value="'.$id.'"><input name="table" type="hidden" value="'.$table.'">
';
}
else
{
MySQL_Query("UPDATE $table SET month='$month', day='$day', type='$type', comment='$comment', money='$money' WHERE id='$id'");
echo 'Změny uloženy. Prosím vyberte rok a klikněte na "zobrazit".';
}
?>
</body>
</html>

Powered by WebSVN 2.2.1