/    Sign up×
Community /Pin to ProfileBookmark

Creating a simple (?) mod. for OsCommerce

Hello. First time poster, long time reader here……..

I run an online tutoring company and I’m trying to build a simple (hopefully) mod that will work with my OsCommerce site where I can update/display tutoring time that a customer has left and also comments left by the tutor.

I’m thinking that all I need is a tutoring_time column in the customers database, then a separate database for the comments (so that they can be time stamped and listed as separate entries in a table). I would like to create a page that…..

1.) Lists all customers
2.) Allows me to select via radio button a customer’s account to edit.

Below is the VERY EARLY stages of what I have. Basically it’s the page that has the form and the page that processes the form. BTW, nevermind some of the field names. I’ll be changing those at some point.

Can anyone help me with the radio button selecting the customer part?

Thanks!

The form page….

[code=php]
<?php
include(“dbinfo.inc_current.php”);

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( “Unable to select database”);

$query=”SELECT * FROM tutoringunits”;
$result=mysql_query($query);
$num=mysql_numrows($result);

mysql_close();

$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,”id”);
$first=mysql_result($result,$i,”first”);
$units=mysql_result($result,$i,”units”);
$web=mysql_result($result,$i,”web”);
$date_time=mysql_result($result,$i,”date_added”);

?>

<html>
<form action=”updated.php”>
<input type=”hidden” name=”ud_id” value=”<? echo “$id”; ?>”>
ID Number: <input type=”text” name=”ud_id” value=”<? echo “$id”?>”><br>
First Name: <input type=”text” name=”ud_first” value=”<? echo “$first”?>”><br>
Units: <input type=”text” name=”ud_units” value=”<? echo “$units”?>”><br>
Web Address: <input type=”text” name=”ud_web” value=”<? echo “$web”?>”><br>
Date/Time Stamp (all times PST): <input type=”text” name=”ud_web” value=”<? echo “$date_time”?>”><br>
Update ID: <input type=”text” name=”ud_update_id” value=””><br>
ID2: <input type=”text” name=”ud_id2″ value=””><br>
Comments: <input type=”text” name=”ud_comments” value=””><br>
<input type=”Submit” value=”Update”>
</form>
</html>

<?php
++$i;
}
?>
[/code]

Processing the info. from the form….

[code=php]
<?
include(“dbinfo.inc.php”);
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( “Unable to select database”);

$query=”UPDATE tutoringunits SET first=’$ud_first’, units=’$ud_units’, web=’$ud_web’ WHERE id=’$ud_id'”;
@mysql_select_db($database) or die( “Unable to select database”);
mysql_query($query);

$query2 = “INSERT INTO comments VALUES (”,’$ud_id2′,Now(),’$ud_comments’)”;
@mysql_select_db($database) or die( “Unable to select database”);
mysql_query($query2);

echo “Record Updated”;
mysql_close();

?>
[/code]

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @gtilflm spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...