CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 How to create Master/Detail tables with CCS?

Print topic Send  topic

Author Message
Paulo Fagiani
Posted: 08/27/2002, 4:23 PM

Hi Folks,

I would really apreciate if somebody tell me VERY DETAILED how to link-up in CCS Master/Detail tables.
My situation is:
I have basically 4 tables:
-customers
-items
-customer_orders
-customer_orderlines
So i'd need to select/create a customer, than select/create a order for that customer and add items to that order (it's not sofisticated like a shopping cart... basic abc...).
I'm really new to CCS and I'm braking my head to make probably basic stuff that may not even need any programming line :p...Examples would be useful!!! Thanks again!
Nicole
Posted: 08/28/2002, 6:58 AM

Paulo,
please refer to the following thread where scenario is described:
http://www.gotocode.com/disc_viewt.asp?mid=12644
Paulo Fagiani
Posted: 08/28/2002, 1:18 PM

Hi Nicole,

I saw that topic but I still confused because of my situation. For example, if I dont have needs for a master table grid? only the record interface? how is the Insert/Update procedures work? How can i keep the master table record screen with the detail table grid/record screen in the same page?
Trying to clarify my questions here is how i need it done:
- User choose a customer from the table;
- Application shows all Orders for that customer;
- User select one for view/edit or create a new one;
- User fills out the order record interface;
- User start selecting items (orderlines) in a simple select field and the quantity many lines as needed;
- User sends the order (it just changes a status on the order record)

I've this done by hand... but i'd never worked with classes and objects with PHP/MySQL so I really need to learn. I think it will make lots easier! Hey, thanks for your time in advance!!! You're being helpful!
Nicole
Posted: 08/29/2002, 2:09 AM

Paulo,
the first three points are related to master-detail forms.
The fourth: I suppose it is simple record one;
Do you want the 5th look like a grid form with ability to enter quantities?
Do you need to store this information into any table?
Paulo Fagiani
Posted: 08/29/2002, 10:28 AM

Hi Nicole,

The problem is that I'm not understanding how to deal with the variables that keep the order number for the detail tables... for example, when I insert a new one? I know that it's gonna be done with hidden fields and there is a function that call the number of the last id inserted... but it still dark to understand how this references work... It should be easy but i'm confused in this new way of programming (CCS). I'm not used to it and I apreciate your simplicity to explain things!
Nicole
Posted: 08/30/2002, 12:44 AM

Paulo,
As I understand you mean retrieving the value of newly inserted primary key,
Please refer to the CC related article:
http://www.gotocode.com/art.asp?art_id=80&
Here is PHP code for CCS. Put in into AfterInsert event:
$last = mysql_insert_id ();
//to pass it via url append it to $Redirect variable
global $Redirect;
$Redirect .= "&order_id=". $last;
//or store it into session
CCSetSession("pk_field", $last);

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.