Jump to content

[SOLVED] Admin Page Code


mikebyrne

Recommended Posts

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>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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>";

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.