hello sir...
plz check the coding....jsp functions are not working...
Sir plz check the following code and point out me errror
[PHP]
<?
include('../include/site_config.php');
####################################
/* @PAGGING */
####################################
//Variable Declaration
$array_user = array();
$i=0;
//Pagging Variable
$display_per_page = 10;
$row_count = 0;
$total_page = 0;
$page_no = 0;
if(isset($_REQUEST['page']))
$selected_page_no = $_REQUEST['page'];
else
$selected_page_no = 1;
//End Pagging Variable
#############################################
$i = 0;
$login_user = array();
$sqlQuery = "SELECT id, fname, mname, lname, email,
countries.countries_name, status
FROM customer, countries
WHERE customer.country = countries.countries_code_2
ORDER BY fname";
$rsQuery = mysql_query( $sqlQuery );
while($row = mysql_fetch_object( $rsQuery )) {
$login_user[$i]['id'] = $row->id;
$login_user[$i]['name'] = stripslashes($row->fname)."
".stripslashes($row->mname)." ".stripslashes($row->lname);
$login_user[$i]['email'] = stripslashes($row->email);
$login_user[$i]['country'] = $row->countries_name;
$login_user[$i]['status'] = $row->status;
$i++;
}
?>
<!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>
<link rel = 'stylesheet' href = '..\admin.css'>
<script language="JavaScript">
function send_form( id, page ) {
window.location.href = "add_category.php&page="+page;
}
function send_form_edit( cust_id, page ) {
window.location.href = "customer.php
?cust_id="+cust_id+"&page="+page;
}
function pagging( page ) {
window.location.href = "index.php?page="+page;
}
function delcom(id, page) {
var ans = window.confirm("Are you sure you want to delete?");
if(ans)
window.location.href =
'del_user.php?cust_id='+id+'&page='+page;
}
function status_check( mode, cust_id, page_no ){
window.location.href = "index.php
?mode="+mode+"&cust_id="+cust_id+"&page="+page_no;
}
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth='0' marginheight='0'>
<table cellpadding="0" cellspacing="0" border="0" width="600"
align="center">
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="center" valign="top">
<table width="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td colspan = '3' class = 'mainHeader'>Customer
Manager</td>
</tr>
<tr>
<td width="45%" height="22"
class="tableCell_banner_V"><a href="customer.php?page=<?=$selected_page_no
?>">Add Customer</a></td>
<td width="55%" height="22" colspan = '2'
class="tableCell_banner_V"> </td>
</tr>
</table>
<table width="100%" cellspacing="1" cellpadding="2"
border="0">
<tr class="searchResult" height="18">
<td width="7%" align="center"><b>SNo.</b></td>
<td width="18%"
align="center"><b>Name</b></td>
<td width="20%"
align="center"><b>Email</b></td>
<td width="18%"
align="center"><b>Country</b></td>
<td width="16%"
align="center"><b>Edit</b></td>
<td width="21%"
align="center"><b>Delete</b></td>
</tr>
<? //paging
//total record
if(count($login_user) > 0)
$row_count =
count($login_user);
$from = $display_per_page * (
$selected_page_no-1 );
$to = $display_per_page *
$selected_page_no;
$row_no = $from + 1;
$total_page =
ceil(count($login_user)/$display_per_page);
if($total_page == 0)
$total_page = 1;
//end
$show_rows_on_screen = 0;
for( $i=$from; $i<$to; $i++ ) {
if($show_rows_on_screen ==
$display_per_page || !isset($login_user[$i]['id']) )
break;
$show_rows_on_screen++;
?>
<tr class="tableCell">
<td align="center"
valign="top"> <?=$i+1 ?></td>
<td align="center"
valign="top"> <?=$login_user[$i]['name'] ?></td>
<td align="center"
valign="top"> <?=$login_user[$i]['email'] ?></td>
<td align="center"
valign="top"> <?=$login_user[$i]['country'] ?></td>
<td align="center"
valign="top"> <a
href="javascript:send_form_edit(<?=$login_user[$i]['id']
?>,<?=$selected_page_no ?>);"><img border='0' src='../images/edit_icon.gif'
alt='Edit'></a></td>
<td align="center"
valign="top"> <a href="javascript:delcom(<?=$login_user[$i]['id'] ?>,
<?=$selected_page_no ?>)" ><img border='0' src='../images/b_drop.gif'
alt='Delete'></a></td>
</tr>
<? } ?>
<tr height="22">
<td colspan="6"> </td>
</tr>
<tr class="tableCell" height="22">
<td colspan="6" align="right">
<?
//echo "page :";
for($i=1; $i<=$total_page; $i++) {
if( ($page_no+$i)==$selected_page_no
) {
echo " ";
echo "[".($page_no+$i)."]";
} else {
?>
<a
href="javascript:pagging(<?=($page_no+$i) ?>)"><? echo "[".($page_no+$i)."]"
?></a>
<? }//End If
}//For
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
[/PHP]
sanjay