php-budget-updates Mailing List for PHPBudget - Home Budget Application
Status: Planning
Brought to you by:
rodrigoh
You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(11) |
Nov
(4) |
Dec
|
|---|
|
From: <rod...@us...> - 2002-11-05 22:50:42
|
Update of /cvsroot/php-budget/phpbudget/includes In directory usw-pr-cvs1:/tmp/cvs-serv4250/includes Added Files: auth.inc.php Log Message: ... --- NEW FILE: auth.inc.php --- <? ######################### #Name:PHPBudget # #Version: 0.1 # #File: auth.inc.php # ######################### //Main authentication file unset($AUTH); |
|
From: <rod...@us...> - 2002-11-05 22:49:07
|
Update of /cvsroot/php-budget/phpbudget/includes
In directory usw-pr-cvs1:/tmp/cvs-serv3347/includes
Modified Files:
functions.inc.php
Log Message:
working on auth code.
Index: functions.inc.php
===================================================================
RCS file: /cvsroot/php-budget/phpbudget/includes/functions.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** functions.inc.php 23 Oct 2002 21:32:55 -0000 1.1
--- functions.inc.php 5 Nov 2002 22:49:02 -0000 1.2
***************
*** 10,24 ****
function check_input()
{
! foreach($_GET as $key=>$value)
! {
! addslashes($value);
! echo "$key: Value: $value<br\n";
! }
! foreach($_POST as $key=>$value)
! {
! addslashes($value);
! //debug _POST vars
! echo "$key: Value: $value<br>\n";
! }
?>
--- 10,24 ----
function check_input()
{
! foreach($_GET as $key=>$value)
! {
! addslashes($value);
! echo "$key: Value: $value<br\n";
! }
! foreach($_POST as $key=>$value)
! {
! addslashes($value);
! //debug _POST vars
! echo "$key: Value: $value<br>\n";
! }
?>
|
|
From: <rod...@us...> - 2002-11-05 22:49:07
|
Update of /cvsroot/php-budget/phpbudget
In directory usw-pr-cvs1:/tmp/cvs-serv3347
Modified Files:
pbudget.php
Added Files:
add_budget.php add_user.php
Log Message:
working on auth code.
--- NEW FILE: add_budget.php ---
<?
#########################
#Name:PHPBudget #
#Version: 0.1 #
#File: add.php #
#########################
//Add new budget.
include_once("./includes/db_setup.inc.php");
include_once("./includes/header-inc.php");
include_once("./includes/functions.inc.php");
//Set some VARS
$B_Owner=rodde; //temp user for dev.
$U_Table=T_user; //User-Owner table
$B_Table=T_main; //Budget Table
$D_Table=T_data; //Data Table
//Check if submit is set, if it is go into add_budget code
//add_budget code needs more and better check for income values
if ($_POST['Abudget'])
{
if (empty($_POST['nBname']) OR empty($_POST['nByear']) OR empty($_POST['nMvalue']) OR empty($B_Owner))
{
echo "Please fill all the required fields these are marked with an *";
echo "<a href=\"$PHP_SELF\">Go back</a>\n";
}
else
{
//set userinput vars from POST vars to local VARS, there might be an easier or alt. way to do this
$nBname = $_POST['nBname'];
$nByear = $_POST['nByear'];
$nBdescr = $_POST['nBdescr'];
$nMvalue = $_POST['nMvalue'];
$nIncome1 = $_POST['nIncome1'];
$nIncome2 = $_POST['nIncome2'];
$nIncome3 = $_POST['nIncome3'];
$nIncome4 = $_POST['nIncome4'];
//add new budget
mysql_query("INSERT INTO $B_Table(F_b_name, F_b_year, F_b_descr, F_b_month, F_b_income1, F_b_income2, F_b_income3, F_b_income4, F_b_owner) VALUES('$nBname', '$nByear', '$nBdescr', '$nMvalue', '$nIncome1', '$nIncome2', '$nIncome3', '$nIncome4', '$B_Owner' )") OR die(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";
}
}
echo "Goto:<a href=\"./pbudget.php\" alt=\"Main\">main</a><br>\n";
//ADD_form START
echo "<pre>\n";
echo "<form method=\"post\" action=\"$PHP_SELF\">\n";
echo "<table border=\"1\">\n";
echo "<caption>Add Budget</caption>\n";
echo "<tr><td>*Budget name:</td><td>\n";
echo "<input type=\"text\" name=\"nBname\" size=\"15\" value=\"Budget2002\"><b> ex. Budget2002</b></td></tr>\n";
echo "<tr><td>*Budget Year:</td><td>\n";
echo "<input type=\"text\" name=\"nByear\" size=\"4\" value=\"2002\"><b> ex. 2002</b></td></tr>\n";
echo "<tr><td>Budget descr:</td><td>\n";
echo "<input type=\"text\" name=\"nBdescr\" size=\"50\"></td></tr>\n";
echo "<tr><td>*Budget month value:</td><td>\n";
echo "<input type=\"text\" name=\"nMvalue\" size=\"2\" value=\"25\"></td></tr>\n";
echo "<tr><td>Income 1:</td><td>\n";
echo "<input type=\"text\" name=\"nIncome1\" size=\"11\"></td></tr>\n";
echo "<tr><td>Income 2:</td><td>\n";
echo "<input type=\"text\" name=\"nIncome2\" size=\"11\"></td></tr>\n";
echo "<tr><td>Income 3:</td><td>\n";
echo "<input type=\"text\" name=\"nIncome3\" size=\"11\"></td></tr>\n";
echo "<tr><td>Income 4:</td><td>\n";
echo "<input type=\"text\" name=\"nIncome4\" size=\"11\"></td></tr>\n";
echo "</table>\n";
echo "<input type=\"submit\" name=\"Abudget\" value=\"Add Budget\">\n";
echo "</form>\n";
//ADD_forum END
echo "</pre>\n";
include_once("./includes/footer-inc.php");
?>
--- NEW FILE: add_user.php ---
<?
#########################
#Name:PHPBudget #
#Version: 0.1 #
#File: add_user.php #
#########################
//add users to system
include_once("./includes/db_setup.inc.php");
include_once("./includes/header-inc.php");
include_once("./includes/functions.inc.php");
/* This code will add an user with an md5 hashed password to the database,
* this code is not optimal and will be updated in the future. My recomendation is
* to use both this authentication + .htaccess file + https if you have this data on a public web server
*/
check_input();
//Check if we have been called from the form
if ($_POST['SUBMIT'])
{
if (empty($_POST['nUser']) OR empty($_POST['nPass']))
{
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
{
$P_HASH=md5($_POST['nPass']);
echo $nUser;
echo $P_HASH;
}
}
//ADD_USER form
echo "<h2>Lägg till ny användare:</h2>\n";
echo "<form method=\"post\" action=\"$PHP_SELF\">\n";
echo "<table border=\"1\">\n";
echo "<tr><td><pre>Användarnamn:\t<input type=\"text\" name=\"nUser\"></pre></td><td> tex. nisse</td></tr>\n";
echo "<tr><td><pre>Lösenord:\t<input type=\"text\" name=\"nPass\"></pre></td><td> tex. 12_mitt-p4ss OBS! använd inte denna!! :)</td><tr>\n";
echo "</table>\n";
echo "<input type=\"submit\" name=\"SUBMIT\" value=\"Add user\">\n";
echo "</form>\n";
include_once('./includes/footer-inc.php');
?>
Index: pbudget.php
===================================================================
RCS file: /cvsroot/php-budget/phpbudget/pbudget.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** pbudget.php 3 Nov 2002 21:16:54 -0000 1.4
--- pbudget.php 5 Nov 2002 22:49:02 -0000 1.5
***************
*** 13,20 ****
$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'])
--- 13,16 ----
|
|
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');
|
|
From: <rod...@us...> - 2002-10-25 17:23:58
|
Update of /cvsroot/php-budget/phpbudget/includes In directory usw-pr-cvs1:/tmp/cvs-serv17952/includes Modified Files: header-inc.php Log Message: fixing some here some there :) Index: header-inc.php =================================================================== RCS file: /cvsroot/php-budget/phpbudget/includes/header-inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** header-inc.php 21 Oct 2002 20:33:10 -0000 1.2 --- header-inc.php 25 Oct 2002 13:01:12 -0000 1.3 *************** *** 14,22 **** echo "<META NAME=\"description\" CONTENT=\"PHPBudget site\">\n"; echo "<META NAME=\"generator\" CONTENT=\"VIM\">\n"; ! echo "<BASE HREF=\"http://php-budget.sourceforge.net/\">\n"; echo "<title>PHPBudget</title>\n"; echo "</head>\n"; echo "<body bgcolor=\"#9999CC\" text=\"#000000\" link=\"#000066\" vlink=\"#80008 0\" alink=\"#00FFFF\">\n"; //End header --- 14,24 ---- echo "<META NAME=\"description\" CONTENT=\"PHPBudget site\">\n"; echo "<META NAME=\"generator\" CONTENT=\"VIM\">\n"; ! echo "<BASE HREF=\"http://php-budget.sourceforge.net/phpbudget/\">\n"; echo "<title>PHPBudget</title>\n"; echo "</head>\n"; echo "<body bgcolor=\"#9999CC\" text=\"#000000\" link=\"#000066\" vlink=\"#80008 0\" alink=\"#00FFFF\">\n"; + echo "<BIG>PHPB</BIG><SMALL>udget</SMALL>"; + echo "<hr><br>\n"; //End header |
|
From: <rod...@us...> - 2002-10-25 16:22:08
|
Update of /cvsroot/php-budget/phpbudget
In directory usw-pr-cvs1:/tmp/cvs-serv17952
Modified Files:
add.php pbudget.php
Log Message:
fixing some here some there :)
Index: add.php
===================================================================
RCS file: /cvsroot/php-budget/phpbudget/add.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** add.php 23 Oct 2002 21:32:54 -0000 1.5
--- add.php 25 Oct 2002 13:01:10 -0000 1.6
***************
*** 52,58 ****
}
!
! echo "<BIG>PHPB</BIG><SMALL>udget</SMALL>";
! echo "<hr><br>\n";
//ADD_form START
--- 52,56 ----
}
! echo "Goto:<a href=\"./pbudget.php\" alt=\"Main\">main</a><br>\n";
//ADD_form START
Index: pbudget.php
===================================================================
RCS file: /cvsroot/php-budget/phpbudget/pbudget.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pbudget.php 23 Oct 2002 21:32:55 -0000 1.2
--- pbudget.php 25 Oct 2002 13:01:11 -0000 1.3
***************
*** 15,19 ****
if ($_GET["G_budget"])
{
! if(empty($B_Owner) OR empty($_GET["C_budget"]))
{
echo "Please fill all the required fields!!";
--- 15,21 ----
if ($_GET["G_budget"])
{
! $C_budget=$_GET["G_budget"];
!
! if(empty($B_Owner) OR empty($C_budget))
{
echo "Please fill all the required fields!!";
***************
*** 23,57 ****
else
{
! $C_budget=$_GET['C_budget'];
!
! $B_data=mysql_query("SELECT * FROM T_main where F_b_name='$C_budget' AND F_b_owner='rodde'") OR die ("Could not get budget data");
! echo "<table cellspacing=\"2\">\n";
echo "<tr valign=\"top\">\n";
! echo "<td bgcolor=\"#000083\"><font color=\"#FFFFFF\">Name<b></td>\n";
! echo "<td bgcolor=\"#000083\"><font color=\"#FFFFFF\">Year<b></td>\n";
! echo "<td bgcolor=\"#000083\"><font color=\"#FFFFFF\">Description<b></td>\n";
! echo "<td bgcolor=\"#000083\"><font color=\"#FFFFFF\">Month_de<b></td>\n";
! echo "<td bgcolor=\"#000083\"><font color=\"#FFFFFF\">Income1<b></td>\n";
! echo "<td bgcolor=\"#000083\"><font color=\"#FFFFFF\">Income2<b></td>\n";
! echo "<td bgcolor=\"#000083\"><font color=\"#FFFFFF\">Income3<b></td>\n";
! echo "<td bgcolor=\"#000083\"><font color=\"#FFFFFF\">Income4<b></td>\n";
echo "</tr>\n";
while ($data=mysql_fetch_array($B_data))
{
echo "<tr>\n";
! echo "<td>$data[F_b_name]</td>\n";
! echo "<td>$data[F_b_year]</td>\n";
! echo "<td>$data[F_b_descr]</td>\n";
! echo "<td>$data[F_b_income1]</td>\n";
! echo "<td>$data[F_b_income2]</td>\n";
! echo "<td>$data[F_b_income3]</td>\n";
! echo "<td>$data[F_b_income4]</td>\n";
echo "</tr>\n";
}
! echo "</table>\n";
! }
}
!
else
{
--- 25,86 ----
else
{
! //get det choosen Budget and its info
! $B_data=mysql_query("SELECT * FROM T_main 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";
! echo "<td bgcolor=\"#000083\" align=\"center\"><font color=\"#FFFFFF\">Name<b></td>\n";
! echo "<td bgcolor=\"#000083\" align=\"center\"><font color=\"#FFFFFF\">Year<b></td>\n";
! echo "<td bgcolor=\"#000083\" align=\"center\"><font color=\"#FFFFFF\">Description<b></td>\n";
! echo "<td bgcolor=\"#000083\" align=\"center\"><font color=\"#FFFFFF\">Month_de<b></td>\n";
! echo "<td bgcolor=\"#000083\" align=\"center\"><font color=\"#FFFFFF\">Income1<b></td>\n";
! echo "<td bgcolor=\"#000083\" align=\"center\"><font color=\"#FFFFFF\">Income2<b></td>\n";
! echo "<td bgcolor=\"#000083\" align=\"center\"><font color=\"#FFFFFF\">Income3<b></td>\n";
! echo "<td bgcolor=\"#000083\" align=\"center\"><font color=\"#FFFFFF\">Income4<b></td>\n";
echo "</tr>\n";
while ($data=mysql_fetch_array($B_data))
{
echo "<tr>\n";
! echo "<td align=\"center\">$data[F_b_name]</td>\n";
! echo "<td align=\"center\">$data[F_b_year]</td>\n";
! echo "<td align=\"center\">$data[F_b_descr]</td>\n";
! echo "<td align=\"center\">$data[F_b_month]</td>\n";
! echo "<td align=\"center\">$data[F_b_income1]</td>\n";
! echo "<td align=\"center\">$data[F_b_income2]</td>\n";
! echo "<td align=\"center\">$data[F_b_income3]</td>\n";
! echo "<td align=\"center\">$data[F_b_income4]</td>\n";
echo "</tr>\n";
}
! 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";
! echo "<td bgcolor=\"#000083\" align=\"center\"><font color=\"#FFFFFF\">Name<b></td>\n";
! echo "<td bgcolor=\"#000083\" align=\"center\"><font color=\"#FFFFFF\">Date<b></td>\n";
! echo "<td bgcolor=\"#000083\" align=\"center\"><font color=\"#FFFFFF\">Value<b></td>\n";
! echo "<td bgcolor=\"#000083\" align=\"center\"><font color=\"#FFFFFF\">vIncome1<b></td>\n";
! echo "<td bgcolor=\"#000083\" align=\"center\"><font color=\"#FFFFFF\">vIncome2<b></td>\n";
! echo "<td bgcolor=\"#000083\" align=\"center\"><font color=\"#FFFFFF\">Quarter<b></td>\n";
! echo "</tr>\n";
! while ($d_values=mysql_fetch_array($B_values))
! {
! echo "<tr>\n";
! echo "<td>$d_values[F_d_name]</td>\n";
! echo "<td>$d_values[F_d_date]</td>\n";
! echo "<td>$d_values[F_d_value]</td>\n";
! echo "<td>$d_values[F_d_vIncome1]</td>\n";
! echo "<td>$d_values[F_d_vIncome2]</td>\n";
! echo "<td>$d_values[F_d_quarter]</td>\n";
! echo "</tr>\n";
! }
! echo "</table><br>\n";
!
! include_once('./includes/footer-inc.php');
! }
!
else
{
***************
*** 61,66 ****
/* Print out the logged in user budgets */
- echo "<BIG>PHPB</BIG><SMALL>udget</SMALL>";
- echo "<hr><br>\n";
echo "<BIG>$B_Owner please choose an budget to work on.</BIG><br><br>\n";
echo "<table cellspacing=\"2\">\n";
--- 90,93 ----
***************
*** 70,74 ****
{
echo "<tr><td>\n";
! echo "<a href=\"$PHP_SELF?budget=$data[F_b_name]\" alt=\"$data[F_b_name]\">$data[F_b_name]</a>\n";
echo "</td></tr>\n";
}
--- 97,101 ----
{
echo "<tr><td>\n";
! echo "<a href=\"$PHP_SELF?G_budget=$data[F_b_name]\" alt=\"$data[F_b_name]\">$data[F_b_name]</a>\n";
echo "</td></tr>\n";
}
|
|
From: <rod...@us...> - 2002-10-23 21:32:59
|
Update of /cvsroot/php-budget/phpbudget
In directory usw-pr-cvs1:/tmp/cvs-serv1994
Modified Files:
add.php pbudget.php
Log Message:
more db code :).. alot of bad code also... just temporarily though
Index: add.php
===================================================================
RCS file: /cvsroot/php-budget/phpbudget/add.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** add.php 21 Oct 2002 21:10:14 -0000 1.4
--- add.php 23 Oct 2002 21:32:54 -0000 1.5
***************
*** 8,25 ****
include_once("./includes/db_setup.inc.php");
include_once("./includes/header-inc.php");
- //pre_alpha clean_user_input code, this will become much better
- foreach($_GET as $key=>$value)
- {
- addslashes($value);
- echo "$key: Value: $value<br\n";
- }
- foreach($_POST as $key=>$value)
- {
- addslashes($value);
- //debug _POST vars
- echo "$key: Value: $value<br>\n";
- }
- //END
//Set some VARS
--- 8,13 ----
include_once("./includes/db_setup.inc.php");
include_once("./includes/header-inc.php");
+ include_once("./includes/functions.inc.php");
//Set some VARS
***************
*** 54,58 ****
$nIncome4 = $_POST['nIncome4'];
//add new budget
! mysql_query("INSERT INTO $B_Table(F_b_name, F_b_year, F_b_descr, F_b_month, F_b_income1, F_b_income2, F_b_income3, F_b_income4, F_b_owner) VALUES('$nBname', '$nByear', '$nBdescr', '$nMvalue', '$nIncome1', '$nIncome2', '$nIncome3', '$nIncome4', '$B_owner' )") OR die(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
--- 42,46 ----
$nIncome4 = $_POST['nIncome4'];
//add new budget
! mysql_query("INSERT INTO $B_Table(F_b_name, F_b_year, F_b_descr, F_b_month, F_b_income1, F_b_income2, F_b_income3, F_b_income4, F_b_owner) VALUES('$nBname', '$nByear', '$nBdescr', '$nMvalue', '$nIncome1', '$nIncome2', '$nIncome3', '$nIncome4', '$B_Owner' )") OR die(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
Index: pbudget.php
===================================================================
RCS file: /cvsroot/php-budget/phpbudget/pbudget.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** pbudget.php 20 Oct 2002 21:03:02 -0000 1.1
--- pbudget.php 23 Oct 2002 21:32:55 -0000 1.2
***************
*** 5,15 ****
#File: pbudget.php #
#########################
! //Edit, add new búdget entrys
! include_once('./includes/header-inc.php');
echo "<BIG>PHPB</BIG><SMALL>udget</SMALL>";
echo "<hr><br>\n";
- echo "<h5>Edit budget</h5>\n";
include_once('./includes/footer-inc.php');
--- 5,81 ----
#File: pbudget.php #
#########################
! //View, Edit, add new budget entrys
! include_once("./includes/db_setup.inc.php");
! include_once("./includes/header-inc.php");
! include_once("./includes/functions.inc.php");
!
! /* static user for testing */
! $B_Owner="rodde";
!
! if ($_GET["G_budget"])
! {
! if(empty($B_Owner) OR empty($_GET["C_budget"]))
! {
! echo "Please fill all the required fields!!";
! echo "<a href=\"$PHP_SELF\">Go back</a>\n";
! }
!
! else
! {
! $C_budget=$_GET['C_budget'];
!
! $B_data=mysql_query("SELECT * FROM T_main where F_b_name='$C_budget' AND F_b_owner='rodde'") OR die ("Could not get budget data");
!
! echo "<table cellspacing=\"2\">\n";
! echo "<tr valign=\"top\">\n";
! echo "<td bgcolor=\"#000083\"><font color=\"#FFFFFF\">Name<b></td>\n";
! echo "<td bgcolor=\"#000083\"><font color=\"#FFFFFF\">Year<b></td>\n";
! echo "<td bgcolor=\"#000083\"><font color=\"#FFFFFF\">Description<b></td>\n";
! echo "<td bgcolor=\"#000083\"><font color=\"#FFFFFF\">Month_de<b></td>\n";
! echo "<td bgcolor=\"#000083\"><font color=\"#FFFFFF\">Income1<b></td>\n";
! echo "<td bgcolor=\"#000083\"><font color=\"#FFFFFF\">Income2<b></td>\n";
! echo "<td bgcolor=\"#000083\"><font color=\"#FFFFFF\">Income3<b></td>\n";
! echo "<td bgcolor=\"#000083\"><font color=\"#FFFFFF\">Income4<b></td>\n";
! echo "</tr>\n";
! while ($data=mysql_fetch_array($B_data))
! {
! echo "<tr>\n";
! echo "<td>$data[F_b_name]</td>\n";
! echo "<td>$data[F_b_year]</td>\n";
! echo "<td>$data[F_b_descr]</td>\n";
! echo "<td>$data[F_b_income1]</td>\n";
! echo "<td>$data[F_b_income2]</td>\n";
! echo "<td>$data[F_b_income3]</td>\n";
! echo "<td>$data[F_b_income4]</td>\n";
! echo "</tr>\n";
! }
! echo "</table>\n";
! }
! }
!
! else
! {
!
! /*Get current users budget names */
! $b_name=mysql_query("SELECT F_b_name from T_main") OR die("Could not get budget names");
+ /* Print out the logged in user budgets */
echo "<BIG>PHPB</BIG><SMALL>udget</SMALL>";
echo "<hr><br>\n";
+ echo "<BIG>$B_Owner please choose an budget to work on.</BIG><br><br>\n";
+ echo "<table cellspacing=\"2\">\n";
+ echo "<tr valign=\"top\">\n";
+ echo "<td bgcolor=\"#000083\"><font color=\"#FFFFFF\">Budget name<b></td><tr>\n";
+ while ($data = mysql_fetch_array($b_name))
+ {
+ echo "<tr><td>\n";
+ echo "<a href=\"$PHP_SELF?budget=$data[F_b_name]\" alt=\"$data[F_b_name]\">$data[F_b_name]</a>\n";
+ echo "</td></tr>\n";
+ }
+ echo "</table>\n";
+ }
+
+
include_once('./includes/footer-inc.php');
|
|
From: <rod...@us...> - 2002-10-23 21:32:59
|
Update of /cvsroot/php-budget/phpbudget/includes
In directory usw-pr-cvs1:/tmp/cvs-serv1994/includes
Modified Files:
db_setup.inc.php
Added Files:
functions.inc.php
Log Message:
more db code :).. alot of bad code also... just temporarily though
--- NEW FILE: functions.inc.php ---
<?
#########################
#Name:PHPBudget #
#Version: 0.1 #
#File: functions.inc.php#
#########################
//Functions file
//check POST GET VARS, this is to be modified
function check_input()
{
foreach($_GET as $key=>$value)
{
addslashes($value);
echo "$key: Value: $value<br\n";
}
foreach($_POST as $key=>$value)
{
addslashes($value);
//debug _POST vars
echo "$key: Value: $value<br>\n";
}
?>
Index: db_setup.inc.php
===================================================================
RCS file: /cvsroot/php-budget/phpbudget/includes/db_setup.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** db_setup.inc.php 16 Oct 2002 10:54:55 -0000 1.1
--- db_setup.inc.php 23 Oct 2002 21:32:55 -0000 1.2
***************
*** 4,16 ****
//Vars. section, Enter the correct database info,
//##########################
! $user="root";
! $pass="";
! $host="localhost";
! $db="phpb";
//##########END##############
//Connection attempt
$link=mysql_pconnect($host, $user, $pass) OR DIE("Houston the shit went down");
- #echo "whoooooooo";
mysql_select_db($db, $link) OR DIE("this DB sucks!");
?>
--- 4,18 ----
//Vars. section, Enter the correct database info,
//##########################
! $user="root"; // You´re mysql user
! $pass=""; // Mysql user pass
! $host="localhost"; // Mysql db host
! $db="phpb"; // The database created for this project
! $U_table="T_user"; // User table
! $B_table="T_main"; // Budget table
! $D_table="T_data"; // Data table
//##########END##############
//Connection attempt
$link=mysql_pconnect($host, $user, $pass) OR DIE("Houston the shit went down");
mysql_select_db($db, $link) OR DIE("this DB sucks!");
?>
|
|
From: <rod...@us...> - 2002-10-21 21:10:17
|
Update of /cvsroot/php-budget/phpbudget In directory usw-pr-cvs1:/tmp/cvs-serv3656 Modified Files: add.php Log Message: little add Index: add.php =================================================================== RCS file: /cvsroot/php-budget/phpbudget/add.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** add.php 21 Oct 2002 21:06:30 -0000 1.3 --- add.php 21 Oct 2002 21:10:14 -0000 1.4 *************** *** 73,83 **** echo "<table border=\"1\">\n"; echo "<caption>Add Budget</caption>\n"; ! echo "<tr><td>Budget name:</td><td>\n"; echo "<input type=\"text\" name=\"nBname\" size=\"15\" value=\"Budget2002\"><b> ex. Budget2002</b></td></tr>\n"; ! echo "<tr><td>Budget Year:</td><td>\n"; echo "<input type=\"text\" name=\"nByear\" size=\"4\" value=\"2002\"><b> ex. 2002</b></td></tr>\n"; echo "<tr><td>Budget descr:</td><td>\n"; echo "<input type=\"text\" name=\"nBdescr\" size=\"50\"></td></tr>\n"; ! echo "<tr><td>Budget month value:</td><td>\n"; echo "<input type=\"text\" name=\"nMvalue\" size=\"2\" value=\"25\"></td></tr>\n"; echo "<tr><td>Income 1:</td><td>\n"; --- 73,83 ---- echo "<table border=\"1\">\n"; echo "<caption>Add Budget</caption>\n"; ! echo "<tr><td>*Budget name:</td><td>\n"; echo "<input type=\"text\" name=\"nBname\" size=\"15\" value=\"Budget2002\"><b> ex. Budget2002</b></td></tr>\n"; ! echo "<tr><td>*Budget Year:</td><td>\n"; echo "<input type=\"text\" name=\"nByear\" size=\"4\" value=\"2002\"><b> ex. 2002</b></td></tr>\n"; echo "<tr><td>Budget descr:</td><td>\n"; echo "<input type=\"text\" name=\"nBdescr\" size=\"50\"></td></tr>\n"; ! echo "<tr><td>*Budget month value:</td><td>\n"; echo "<input type=\"text\" name=\"nMvalue\" size=\"2\" value=\"25\"></td></tr>\n"; echo "<tr><td>Income 1:</td><td>\n"; |
|
From: <rod...@us...> - 2002-10-21 21:06:33
|
Update of /cvsroot/php-budget/phpbudget
In directory usw-pr-cvs1:/tmp/cvs-serv31629
Modified Files:
add.php
Log Message:
add.php can now add budgets to the db :)
Index: add.php
===================================================================
RCS file: /cvsroot/php-budget/phpbudget/add.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** add.php 21 Oct 2002 20:27:05 -0000 1.2
--- add.php 21 Oct 2002 21:06:30 -0000 1.3
***************
*** 18,22 ****
{
addslashes($value);
! echo "$key: Value: $value<br\n";
}
//END
--- 18,23 ----
{
addslashes($value);
! //debug _POST vars
! echo "$key: Value: $value<br>\n";
}
//END
***************
*** 53,59 ****
$nIncome4 = $_POST['nIncome4'];
//add new budget
! mysql_query("INSERT INTO B_table(F_b_name, F_b_year, F_b_descr, F_b_month, F_b_income1, F_b_income2, F_b_income3, F_b_income4, F_b_owner) VALUES('$nBname', '$nByear', '$nBdescr', '$nMvalue', '$nIncome1', '$nIncome2', '$nIncome3', '$nIncome3, '$nIncome4', '$B_owner')") OR die("Wops could not add budget");
echo "<HTML><HEAD>\n";
! echo "<meta http-equiv=\"refresh\" content=\"0;URL=$PHP_SELF\">\n";
echo "<META HTTP-EQUIV=PRAGMA CONTENT=\"NO-CACHE\">\n";
echo "</HEAD>\n";
--- 54,61 ----
$nIncome4 = $_POST['nIncome4'];
//add new budget
! mysql_query("INSERT INTO $B_Table(F_b_name, F_b_year, F_b_descr, F_b_month, F_b_income1, F_b_income2, F_b_income3, F_b_income4, F_b_owner) VALUES('$nBname', '$nByear', '$nBdescr', '$nMvalue', '$nIncome1', '$nIncome2', '$nIncome3', '$nIncome4', '$B_owner' )") OR die(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";
|
|
From: <rod...@us...> - 2002-10-21 20:33:13
|
Update of /cvsroot/php-budget/phpbudget/includes In directory usw-pr-cvs1:/tmp/cvs-serv29702/includes Modified Files: header-inc.php Log Message: changed the base_href Index: header-inc.php =================================================================== RCS file: /cvsroot/php-budget/phpbudget/includes/header-inc.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** header-inc.php 16 Oct 2002 10:54:55 -0000 1.1 --- header-inc.php 21 Oct 2002 20:33:10 -0000 1.2 *************** *** 14,19 **** echo "<META NAME=\"description\" CONTENT=\"PHPBudget site\">\n"; echo "<META NAME=\"generator\" CONTENT=\"VIM\">\n"; ! echo "<BASE HREF=\"http://www.myw0rld.org/\">\n"; ! echo "<title>MyW0rld</title>\n"; echo "</head>\n"; echo "<body bgcolor=\"#9999CC\" text=\"#000000\" link=\"#000066\" vlink=\"#80008 --- 14,19 ---- echo "<META NAME=\"description\" CONTENT=\"PHPBudget site\">\n"; echo "<META NAME=\"generator\" CONTENT=\"VIM\">\n"; ! echo "<BASE HREF=\"http://php-budget.sourceforge.net/\">\n"; ! echo "<title>PHPBudget</title>\n"; echo "</head>\n"; echo "<body bgcolor=\"#9999CC\" text=\"#000000\" link=\"#000066\" vlink=\"#80008 |
|
From: <rod...@us...> - 2002-10-21 20:27:09
|
Update of /cvsroot/php-budget/phpbudget
In directory usw-pr-cvs1:/tmp/cvs-serv24031
Modified Files:
add.php
Log Message:
add.php code
Index: add.php
===================================================================
RCS file: /cvsroot/php-budget/phpbudget/add.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** add.php 20 Oct 2002 21:03:02 -0000 1.1
--- add.php 21 Oct 2002 20:27:05 -0000 1.2
***************
*** 6,10 ****
#########################
//Add new budget.
! include_once('./includes/header-inc.php');
echo "<BIG>PHPB</BIG><SMALL>udget</SMALL>";
--- 6,65 ----
#########################
//Add new budget.
! include_once("./includes/db_setup.inc.php");
! include_once("./includes/header-inc.php");
!
! //pre_alpha clean_user_input code, this will become much better
! foreach($_GET as $key=>$value)
! {
! addslashes($value);
! echo "$key: Value: $value<br\n";
! }
! foreach($_POST as $key=>$value)
! {
! addslashes($value);
! echo "$key: Value: $value<br\n";
! }
! //END
!
! //Set some VARS
! $B_Owner=rodde; //temp user for dev.
!
! $U_Table=T_user; //User-Owner table
! $B_Table=T_main; //Budget Table
! $D_Table=T_data; //Data Table
!
!
! //Check if submit is set, if it is go into add_budget code
! //add_budget code needs more and better check for income values
!
! if ($_POST['Abudget'])
! {
! if (empty($_POST['nBname']) OR empty($_POST['nByear']) OR empty($_POST['nMvalue']) OR empty($B_Owner))
! {
! echo "Please fill all the required fields these are marked with an *";
! echo "<a href=\"$PHP_SELF\">Go back</a>\n";
! }
!
! else
! {
! //set userinput vars from POST vars to local VARS, there might be an easier or alt. way to do this
! $nBname = $_POST['nBname'];
! $nByear = $_POST['nByear'];
! $nBdescr = $_POST['nBdescr'];
! $nMvalue = $_POST['nMvalue'];
! $nIncome1 = $_POST['nIncome1'];
! $nIncome2 = $_POST['nIncome2'];
! $nIncome3 = $_POST['nIncome3'];
! $nIncome4 = $_POST['nIncome4'];
! //add new budget
! mysql_query("INSERT INTO B_table(F_b_name, F_b_year, F_b_descr, F_b_month, F_b_income1, F_b_income2, F_b_income3, F_b_income4, F_b_owner) VALUES('$nBname', '$nByear', '$nBdescr', '$nMvalue', '$nIncome1', '$nIncome2', '$nIncome3', '$nIncome3, '$nIncome4', '$B_owner')") OR die("Wops could not add budget");
! echo "<HTML><HEAD>\n";
! echo "<meta http-equiv=\"refresh\" content=\"0;URL=$PHP_SELF\">\n";
! echo "<META HTTP-EQUIV=PRAGMA CONTENT=\"NO-CACHE\">\n";
! echo "</HEAD>\n";
! echo "<body>Done!!! now Wait!</body></html>\n";
! }
! }
!
echo "<BIG>PHPB</BIG><SMALL>udget</SMALL>";
***************
*** 13,17 ****
//ADD_form START
echo "<pre>\n";
! echo "<form name=\"nBudget\" action=\"post\">\n";
echo "<table border=\"1\">\n";
echo "<caption>Add Budget</caption>\n";
--- 68,72 ----
//ADD_form START
echo "<pre>\n";
! echo "<form method=\"post\" action=\"$PHP_SELF\">\n";
echo "<table border=\"1\">\n";
echo "<caption>Add Budget</caption>\n";
***************
*** 39,43 ****
! include_once('./includes/footer-inc.php');
?>
--- 94,98 ----
! include_once("./includes/footer-inc.php");
?>
|
|
From: <rod...@us...> - 2002-10-21 18:45:21
|
Update of /cvsroot/php-budget/phpbudget/db
In directory usw-pr-cvs1:/tmp/cvs-serv32456/db
Modified Files:
db.sql
Log Message:
forgot to add budget owner to T_data
Index: db.sql
===================================================================
RCS file: /cvsroot/php-budget/phpbudget/db/db.sql,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** db.sql 21 Oct 2002 18:39:50 -0000 1.3
--- db.sql 21 Oct 2002 18:45:18 -0000 1.4
***************
*** 28,31 ****
--- 28,32 ----
F_d_quarter char(2) NOT NULL default '',
F_year year(4) NOT NULL default '0000',
+ F_b_owner varchar(15) NOT NULL default '',
PRIMARY KEY (F_d_id)
) TYPE=MyISAM;
|
|
From: <rod...@us...> - 2002-10-21 18:39:55
|
Update of /cvsroot/php-budget/phpbudget/db
In directory usw-pr-cvs1:/tmp/cvs-serv28093/db
Modified Files:
db.sql
Log Message:
added owner table
Index: db.sql
===================================================================
RCS file: /cvsroot/php-budget/phpbudget/db/db.sql,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** db.sql 20 Oct 2002 20:19:41 -0000 1.2
--- db.sql 21 Oct 2002 18:39:50 -0000 1.3
***************
*** 51,54 ****
--- 51,55 ----
F_b_income3 int(11) unsigned default NULL,
F_b_income4 int(11) unsigned default NULL,
+ F_b_owner varchar(15) NOT NULL default '',
PRIMARY KEY (F_id)
) TYPE=MyISAM;
|
|
From: <rod...@us...> - 2002-10-20 21:45:39
|
Update of /cvsroot/php-budget/phpbudget
In directory usw-pr-cvs1:/tmp/cvs-serv17145/phpbudget
Modified Files:
index.php
Log Message:
Testing syncmail
Index: index.php
===================================================================
RCS file: /cvsroot/php-budget/phpbudget/index.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** index.php 20 Oct 2002 21:03:02 -0000 1.3
--- index.php 20 Oct 2002 21:45:34 -0000 1.4
***************
*** 5,9 ****
#File: index.php #
#########################
! //Index file, here starts everything
include_once('./includes/header-inc.php');
--- 5,9 ----
#File: index.php #
#########################
! //Index file
include_once('./includes/header-inc.php');
|