Page 1 of 1

Paging

Posted: Mon Oct 31, 2005 3:54 pm
by Curtis782
feyd | This thread was split from another because code snippet threads are intended to stay within the snippet's realm, not to go on side shoots..


Would anyone know how I could use this class with my script below? I commented out a large section I'd like to use but I could probably figure out how to implement the commented once I figure out how I can use the class.

Code: Select all

<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Work Order System</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>

<?php

include ("common_vars.php");
include("pagination.php");

$wo_user=$_SERVER['PHP_AUTH_USER'];

$link = mysql_connect("$DB_HOSTNAME1", "$DB_USERNAME1", "$DB_PASSWORD1");
mysql_select_db("$DB_NAME1", $link) or die(mysql_errno() . ": " . mysql_error() . "<br>");

/*

$sql_admin = "SELECT * FROM $DB_TABLE1 ORDER BY id DESC, customer ASC";
$sql_keith = "SELECT * FROM $DB_TABLE1 WHERE salesRep='K' ORDER BY id DESC";
$sql_dottie = "SELECT * FROM $DB_TABLE1 WHERE salesRep='D1' ORDER BY id DESC";
$sql_damian = "SELECT * FROM $DB_TABLE1 WHERE salesRep='D2' ORDER BY id DESC";
$sql_mark = "SELECT * FROM $DB_TABLE1 WHERE salesRep='M' ORDER BY id DESC";
$sql_dan = "SELECT * FROM $DB_TABLE1 WHERE salesRep='D3' ORDER BY id DESC";
$sql_chuck = "SELECT * FROM $DB_TABLE1 WHERE salesRep='C' ORDER BY id DESC";
$sql_tom = "SELECT * FROM $DB_TABLE1 ORDER BY id DESC";
$sql_bill = "SELECT * FROM $DB_TABLE1 ORDER BY id DESC";

if ($wo_user == "person1") { $result = $??? -> execute($sql_person1, $link, "mysql"); }
else if ($wo_user == "person2") { $result = $??? -> execute($sql_person2, $link, "mysql"); }
else if ($wo_user == "person3") { $result = $??? -> execute($sql_person3, $link, "mysql"); }
else if ($wo_user == "person4") { $result = $??? -> execute($sql_person4, $link, "mysql"); }
else if ($wo_user == "person5") { $result = $??? -> execute($sql_person5, $link, "mysql"); }
else if ($wo_user == "person6") { $result = $??? -> execute($sql_person6, $link, "mysql"); }
else if ($wo_user == "person7") { $result = $??? -> execute($sql_person7, $link, "mysql"); }
else if ($wo_user == "person8") { $result = $??? -> execute($sql_person8, $link, "mysql"); }
else if ($wo_user == "person9") { $result = $??? -> execute($sql_person9, $link, "mysql"); }

*/

if ($query)
{



?>

<body>

<?php include 'header.php'; ?>

<div align="center">
<table border="0" cellspacing="0" cellpadding="0" width="760" align="center">
<tr>
   <td width="1" bgcolor="7e8083"><img src="http://www.domain.com/images/1x1_gray.gif" width="1"></td>
   <td width="758" style="padding-left:10px;padding-right:10px;padding-top:40px;padding-bottom:40px;">

<div align="center"><table border="1" cellpadding="2" cellspacing="0" bordercolor="#F0F0F0" width="738">
  <tr>
    <td class="style9" align="center" valign="middle">WO #</td>
    <td class="style9" align="center" valign="middle">Customer</td>
    <td class="style9" align="center" valign="middle">Customer Type</td>
    <td class="style9" align="center" valign="middle">Sales Rep</td>
    <td class="style9" align="center" valign="middle">Ship Date</td>
    <td class="style9" align="center" valign="middle">Status</td>
	<td width="50">&nbsp;</td>
	<td width="50">&nbsp;</td>
	<td width="50">&nbsp;</td>
  </tr>

<?
while ($myrow = mysql_fetch_array($query))
{
?>

  <tr>
    <td class="style10" align="center" valign="middle">&nbsp;<? print $myrow["id"]; ?>&nbsp;</td>
    <td class="style10">&nbsp;<? print $myrow["customer"]; ?>&nbsp;</td>
    <td class="style10">&nbsp;<? print $myrow["customerType"]; ?>&nbsp;</td>
    <td class="style10">&nbsp;<? print $myrow["salesRep"]; ?>&nbsp;</td>
    <td class="style10">&nbsp;<? print $myrow["shipDateMonth"]; ?>&nbsp;<? print $myrow["shipDateDay"]; ?>,&nbsp;<? print $myrow["shipDateYear"]; ?></td>
    <td class="style10">&nbsp;<? print $myrow["status"]; ?>&nbsp;</td>
	<td width="50" align="center" class="style10"><a href="./view.php?id=<? print $myrow["id"]; ?>">VIEW</a></td>
	<td width="50" align="center" class="style10"><a href="./modify.php?id=<? print $myrow["id"]; ?>">Modify</a></td>
	<td width="50" align="center" class="style10"><a href="./confirm_delete.php?id=<? print $myrow["id"]; ?>">Delete</a></td>
  </tr>

<?
	}
?>

</table></div></td>
   <td width="1" bgcolor="7e8083"><img src="http://www.domain.com/images/1x1_gray.gif" width="1"></td>
</tr>
</table>
</div>

<div align="center"><img src="http://www.domain.com/images/1x1_gray.gif" width="760" height="1"></div>

</body>

<?
}
?>

</html>