[PHP-Budget-updates] phpbudget add.php,1.4,1.5 pbudget.php,1.1,1.2
Status: Planning
Brought to you by:
rodrigoh
|
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');
|