mikebyrne Posted December 1, 2007 Share Posted December 1, 2007 I've just started my Admin page and have seen an example I like http://www.btrax.com/includes/sample_admin/eng/order/new.php Now, i've done my template but was wondering how would I produce a table in the middle of my page like the example?? Here's my template <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <!-- TemplateBeginEditable name="doctitle" --> <title>Untitled Document</title> <!-- TemplateEndEditable --> <style type="text/css"> <!-- #Layer1 { position:absolute; width:1105px; height:817px; z-index:1; left: 5px; top: -158px; } #Layer2 { position:absolute; width:916px; height:534px; z-index:1; top: 260px; left: 177px; background-color: #CCCCCC; } #Layer3 { position:absolute; width:895px; height:511px; z-index:2; left: 185px; top: 275px; background-color: #FFFFFF; } #Layer4 { position:absolute; width:942px; height:128px; z-index:2; left: 182px; top: 105px; } --> </style> <!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable --> </head> <body bgcolor="#FFFFFF"> <div id="Layer1"> <div id="Layer2"></div> <img src="/grey.jpg" width="130" height="805" /> <div id="Layer4"> <p> </p> <p> </p> <p>------Oders-------Sales-------Items-------Shipping-------</p> <p> </p> </div> <hr /> <div id="Layer3"> <label></label> </div> </div> </body> </html> Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted December 1, 2007 Share Posted December 1, 2007 This has nothing to do with PHP, try the CSS forum. Quote Link to comment Share on other sites More sharing options...
mikebyrne Posted December 1, 2007 Author Share Posted December 1, 2007 I thought I'd need php code to run SQL queries and palce the results in tables. Just not sure how to code this and display the output in a table located in the middle of my page like the link I posted Quote Link to comment Share on other sites More sharing options...
wsantos Posted December 1, 2007 Share Posted December 1, 2007 step 1: Establish a connection to your database...for this we need your database...is it mysql,text,etc... step 2: Select your db...we need the structure step 3: Execute your query..it really depends on your db step 4: Close your connection step 5: Display ... This is always the easiest part It really depends...sometimes step 4 and 5 are interchanged. Please provide us sufficient information so we can help you out. Quote Link to comment Share on other sites More sharing options...
mikebyrne Posted December 1, 2007 Author Share Posted December 1, 2007 Its really the display part I have the problem with: How can I get my dispaly to look like this table http://www.btrax.com/includes/sample_admin/eng/order/new.php Quote Link to comment Share on other sites More sharing options...
Fehnris Posted December 1, 2007 Share Posted December 1, 2007 PHP isn't going to be concerned with the table layout. Sure you will need PHP to connect and retrieve your database records but for the actual formatting of the table as in the link you provided, you will need to use HTML. For there table layout they have used DIV tags but you could do something similar using HTML Table, TR and TD tags. If you are using a MYSQL database and you decide on HTML tables, you could do something like:- echo "<table>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>"; echo $row['field1']; echo "</td>"; echo "<td>"; echo $row['field2']; echo "</td>"; . etc. . echo "</tr>"; } echo "</table>"; This would only give you the basic layout and you would also have to consider styling your tables using different TABLE tag attributes straight in each tag or by adding extra values to your CSS documents. Quote Link to comment Share on other sites More sharing options...
dezkit Posted December 1, 2007 Share Posted December 1, 2007 awesome ideas Quote Link to comment Share on other sites More sharing options...
mikebyrne Posted December 1, 2007 Author Share Posted December 1, 2007 Thanks that makes sense!! Would I manually have to insert Check boxes or can you inset them using PHP? Quote Link to comment Share on other sites More sharing options...
Fehnris Posted December 1, 2007 Share Posted December 1, 2007 Your welcome You would incorporate them in with your while loop for each record for example:- echo "<table>"; while($row=mysql_fetch_array($result)) { echo "<tr>"; echo "<td>"; echo "<input type='checkbox' name='maybe the id of this record to allow you to identify if a certain row is checked'>"; echo "</td>"; echo "<td>"; echo $row['field1']; echo "</td>"; . etc . echo "</tr>"; } echo "</table>"; Quote Link to comment Share on other sites More sharing options...
mikebyrne Posted December 1, 2007 Author Share Posted December 1, 2007 Thats great. I'll put together some dummt order etc to test it out. No doubt I'll be back soon looking for help! THANKS Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.