...

View Full Version : How to separate pages using php?



chleng
06-12-2005, 05:06 AM
Hi, I tasked to generate a bill using php.

The sample bill looks like this

billing name :abc
account no:12345

summary

9111 1111
9222 2222

Details

mobile number 9111 1111

number of outgoing calls 29
number of sms 30
mobile number 9111 1111

mobile number 9222 2222

number of outgoing calls 29
number of sms 30

but since the details portion is variable how to I separate the pages? thks
Reply

delinear
06-12-2005, 01:15 PM
I'm not 100% sure what you're asking, but if you just want a way to store and retrieve each separate billing account's details then the easiest way is by using a database. That way to pull up the details for a certain account you just tailor your query to select that account, eg:

$result = mysql_query("SELECT * FROM $tablename WHERE $account='12345' AND name='abc' LIMIT 1");

chleng
06-13-2005, 04:45 AM
billing name :abc
account no:12345

summary

9111 1111 $123
9222 2222 $456
9333333 $789

Details

mobile number 9111 1111

number of outgoing calls 29
number of sms 30

mobile number 9222 2222

number of outgoing calls 29
number of sms 30
coolroam $87
pdid $80

-----------------------------------Page 1
<comment if it is already one page, then should insert line break and indicate page 1---->

mobile 9333 3333

number of outgoing calls 29
number of sms 30

details in each mobile is variable hence insertion of line break is also variable.

So my question is how to insert line breaks when we don't know how long is the detail of each mobile going to be? Not only that the the summary is also varying initially.

thks.

Serex
06-13-2005, 04:53 AM
you could create 2 seperate pages. 1 for the top page and 1 for the bottom. and then create an include on the first page below were you retrieve all the information.

i.e

page1:


echo " <-- place detailed information for the top here --> ";
// include second page
include('path/to/page.php');


page2:


echo "All other information";


i have no idea if thats what you mean... but thats what it sounds like to me



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum