[PHP-Budget-updates] phpbudget index.php,1.4,1.5 pbudget.php,1.3,1.4
Status: Planning
Brought to you by:
rodrigoh
|
From: <rod...@us...> - 2002-11-03 21:16:59
|
Update of /cvsroot/php-budget/phpbudget
In directory usw-pr-cvs1:/tmp/cvs-serv26786
Modified Files:
index.php pbudget.php
Log Message:
Almost a working prealpha... :)
Index: index.php
===================================================================
RCS file: /cvsroot/php-budget/phpbudget/index.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** index.php 20 Oct 2002 21:45:34 -0000 1.4
--- index.php 3 Nov 2002 21:16:54 -0000 1.5
***************
*** 8,14 ****
include_once('./includes/header-inc.php');
- echo "<BIG>PHPB</BIG><SMALL>udget</SMALL>";
- echo "<hr><br>\n";
-
//start login code
--- 8,11 ----
Index: pbudget.php
===================================================================
RCS file: /cvsroot/php-budget/phpbudget/pbudget.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** pbudget.php 25 Oct 2002 13:01:11 -0000 1.3
--- pbudget.php 3 Nov 2002 21:16:54 -0000 1.4
***************
*** 10,19 ****
include_once("./includes/functions.inc.php");
! /* static user for testing */
! $B_Owner="rodde";
! if ($_GET["G_budget"])
{
! $C_budget=$_GET["G_budget"];
if(empty($B_Owner) OR empty($C_budget))
--- 10,57 ----
include_once("./includes/functions.inc.php");
! /* static user and budget for testing */
! $B_Owner = "rodde";
! $U_Table=T_user; //User-Owner table
! $B_Table=T_main; //Budget Table
! $D_Table=T_data; //Data Table
!
!
! if ($_POST['add_values'])
! {
! if(empty($_POST['nName']) OR empty($_POST['nDate']) OR empty($_POST['nValue']) OR empty($_POST['B_Owner']) OR empty($_POST['B_name']))
! {
! echo "Var vänlig och fyll i a dem fält med en stjärna brevid * !!";
! echo "<a href=\"$PHP_SELF\">Tillbaks</a>\n";
! }
!
! else
! {
! //set userinput vars from POST_vars to local_vars, there might be an easier or alt. way to do this
! $nName = $_POST['nName'];
! $nDate = $_POST['nDate'];
! $nValue = $_POST['nValue'];
! $nMonth = $_POST['nMonth'];
! $nVincome1 = $_POST['nVincome1'];
! $nVincome2 = $_POST['nVincome2'];
! $nQurter = $_POST['nQuarter'];
! $nYear = $_POST['nYear'];
!
! //add values to selected budget
! mysql_query("INSERT INTO $D_Table(F_d_name, F_d_date, F_b_name, F_d_value, F_d_month, F_d_vIncome1, F_d_vIncome2, F_d_quarter, F_b_year, F_b_owner) VALUES('$nName', '$nDate', '$B_name', '$nValue', '$nMonth', '$mVincome1', '$nVincome2', '$Quarter', '$nYear', '$B_Owner')") OR DIE("Kunde inte lägga till datar!, mysql_error()");
!
! echo "<HTML><HEAD>\n";
! //send the user back to the add page, soon this will be redirected to the add_edit_change page
! echo "<meta http-equiv=\"refresh\" content=\"1;URL=$PHP_SELF\">\n";
! echo "<META HTTP-EQUIV=PRAGMA CONTENT=\"NO-CACHE\">\n";
! echo "</HEAD>\n";
! echo "<body>Done!!! now Wait!</body></html>\n";
! }
! }
!
! if ($_GET['G_budget'])
{
! $C_budget=$_GET['G_budget'];
!
if(empty($B_Owner) OR empty($C_budget))
***************
*** 53,61 ****
}
echo "</table><br>\n";
!
//get the budget values
$B_values=mysql_query("SELECT * FROM T_data where F_b_name='$C_budget' AND F_b_owner='$B_Owner'") OR die ("Could not get budget data");
! }
echo "<table cellspacing=\"3\" border=\"1\">\n";
echo "<tr valign=\"top\">\n";
--- 91,99 ----
}
echo "</table><br>\n";
! }
//get the budget values
$B_values=mysql_query("SELECT * FROM T_data where F_b_name='$C_budget' AND F_b_owner='$B_Owner'") OR die ("Could not get budget data");
!
echo "<table cellspacing=\"3\" border=\"1\">\n";
echo "<tr valign=\"top\">\n";
***************
*** 79,82 ****
--- 117,149 ----
}
echo "</table><br>\n";
+
+ //New value entries
+ $tid = mktime();
+ $tid = date("Y-m-d H:i:s", $tid);
+ echo "<form method=\"post\" action=\"$PHP_SELF\">\n";
+ echo "<table>\n";
+ echo "<caption>Add new budget values</caption>\n";
+ echo "<tr>\n";
+ echo "<td>Date: </td><td>\n";
+ echo "<input type=\"text\" NAME=\"nDate\" SIZE=\"30\" value=\"$tid\"> * Som - 2002-01-01</td></tr><tr>\n";
+ echo "<td>Value name: </td><td>\n";
+ echo "<input type=\"text\" NAME=\"nName\" SIZE=\"30\"> * Som - köp av kläder</td></tr><tr>\n";
+ echo "<td>Value: </td><td>\n";
+ echo "<input type=\"text\" NAME=\"nValue\" SIZE=\"30\" value=\"\">kr * Som - 200</td></tr><tr>\n";
+ echo "<td>Month: </td><td>\n";
+ echo "<input type=\"text\" NAME=\"nMonth\" SIZE=\"30\" value=\"\"> * Som Januari</td></tr><tr>\n";
+ echo "<td>Variable Income1: </td><td>\n";
+ echo "<input type=\"text\" NAME=\"nVincome1\" SIZE=\"30\" value=\"\">kr Som 2500 OBS! inte ett måste</td></tr><tr>\n";
+ echo "<td>Variable Income2: </td><td>\n";
+ echo "<input type=\"text\" NAME=\"nVincome2\" SIZE=\"30\" value=\"\">kr Som 3000 OBS! inte ett måste</td></tr><tr>\n";
+ echo "<td>Quarter: </td><td>\n";
+ echo "<input type=\"text\" NAME=\"nQuarter\" SIZE=\"30\" value=\"\"> * Som K1</td></tr><tr>\n";
+ echo "<input type=\"hidden\" NAME=\"B_Owner\" value=\"$B_Owner\">\n";
+ echo "<input type=\"hidden\" NAME=\"B_name\" value=\"$C_budget\">\n";
+ echo "<td><input type=\"submit\" name=\"add_values\" value=\"Add value\"></td>\n";
+ echo "</tr></table>";
+ echo "</form>";
+ echo "<hr>";
+
include_once('./includes/footer-inc.php');
|