how can i integrate that into this code?
<?php
require('includes/application_top.php');
// if the customer is not logged on, redirect them to the login page
if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
/// action write here
$sess_id=session_id();
if(isset($HTTP_SESSION_VARS['customer_id']))
$customer_id=$HTTP_SESSION_VARS['customer_id'];
else $customer_id=0;
// the following cPath references come from application_top.php
$category_depth = 'top';
if (isset($cPath) && tep_not_null($cPath)) {
$categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
$cateqories_products = tep_db_fetch_array($categories_products_query);
if ($cateqories_products['total'] > 0) {
$category_depth = 'products'; // display products
} else {
$category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
$category_parent = tep_db_fetch_array($category_parent_query);
if ($category_parent['total'] > 0) {
$category_depth = 'nested'; // navigate through the categories
} else {
$category_depth = 'products'; // category has no products, but display the 'no products' message
}
}
}
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CARD_SCHEDULE_SETUP);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<!--<link rel="stylesheet" type="text/css" href="stylesheet.css">-->
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<tr>
<td width="182" align="left" valign="top">
<table width="182" cellpadding="0" cellspacing="0" border="0">
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
</table>
</td>
<td width="509" valign="top" style="padding-left:2px;">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%" height="100%" valign="top" bgcolor="#FFFFFF">
<table border="0" width="100%" cellpadding="0" cellspacing="0" >
<tr>
<td width="100%" height="25" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0" height="24">
<tr>
<td><img src="images/left_header.gif" width="4" height="24" alt="" /></td>
<td width="100%" style="background-image:url(images/header_bg.gif); text-align:left; color:#FFF; padding-left:5px; font-size:110%; font-weight:bold "><?php
echo HEADING_TITLE; ?>
</td>
<td><img src="images/right_header.gif" width="4" height="24" alt="" /></td>
</tr>
</table>
<br>
<!-- buttons -->
<div align="center">
</div>
</td>
</tr>
<tr>
<div align="center">
<table border="1" width="370" height="105">
<tr>
<td height="23" width="79" align="center" bgcolor="#258BE0"><b>First Name</b></td>
<td height="23" width="80" align="center" bgcolor="#258BE0"><b>Last Name</b></td>
<td height="23" width="54" align="center" bgcolor="#258BE0"><b>City</b></td>
<td height="23" width="66" align="center" bgcolor="#258BE0">
<td height="23" width="60" align="center" bgcolor="#258BE0">
</tr>
<tr>
<td height="23" width="79" align="center" bgcolor="#258BE0"><b>Relation</b></td>
<td height="23" width="80" align="center" bgcolor="#258BE0"> </td>
<td height="23" width="54" align="center" bgcolor="#258BE0"> </td>
<td height="23" width="66" align="center" bgcolor="#258BE0">
<img border="0" src="images/editicon.gif" width="17" height="14"></td>
<td height="23" width="60" align="center" bgcolor="#258BE0">
<img border="0" src="images/deleteicon.gif" width="12" height="14"></td>
</tr>
<?
if(isset($_GET['id']) && ($_GET['action'] == 'delete'))
{
$id = $_GET['id'];
$delete = $_GET['delete'];
$dsql1 = mysql_query("DELETE from card_schedule where id = '$id'");
if($dsql1)
echo"<b>Customer $first_name . $last_name deleted!</b>";
else
echo"Error!";
}
?>
<?php
$query="SELECT customer_relation, birthday, first_name,last_name, city, id FROM card_schedule where customer_id = '" . (int)$customer_id . "'";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>
<?
$i=0;
while($i<$num){
$first=mysql_result($result,$i,"first_name");
$last=mysql_result($result,$i,"last_name");
$city=mysql_result($result,$i,"city");
$id=mysql_result($result,$i,"id");
$customer_relation=mysql_result($result,$i,"customer_relation");
$birthday=mysql_result($result,$i,"birthday");
?>
<tr>
<td height="23" width="79"><? echo $first ?></td>
<td height="23" width="80"><? echo $last ?></td>
<td height="23" width="54"><? echo $city ?></td>
<td height="23" width="66"><? echo $birthday ?></td>
<td height="23" width="60"> </t
></tr>
<tr>
<td height="24" width="79" style="border-bottom-style: solid; border-bottom-width: 2px"><? echo $customer_relation ?></td>
<td height="24" width="80" style="border-bottom-style: solid; border-bottom-width: 2px"> </td>
<td height="24" width="54" style="border-bottom-style: solid; border-bottom-width: 2px"> </td>
<td height="24" width="66" style="border-bottom-style: solid; border-bottom-width: 2px" align="center"><a href="edit_contact.php?id=<?php echo $id; ?>">Edit</a></td>
<td height="24" width="60" style="border-bottom-style: solid; border-bottom-width: 2px" align="center"><a href="card_schedule.php?action=delete&id=<?php echo $id; ?>">Delete</a></td>
</tr>
<?
$i++;
}
echo "</table>";
?>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>