Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
galera preciso tirar desse código aqui o páginador
Esse código e do sql
<?php require_once('Connections/data.php'); ?>
<?php require_once('Connections/data.php'); ?><?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "index.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE cliente SET nome_sindico=%s, nome_predio=%s, cidade=%s, bairro=%s, e_mail=%s, endereco=%s, telefone_sindico=%s, valor_a_ser_pago_anunc=%s, p_indicacao_anunc=%s, pagar_vendedor=%s, inscricao_estadual=%s, cnpj=%s, telefone=%s, banco=%s, agencia=%s, conta_corrente=%s, vendedor=%s, pessoas_por_dia=%s, monitores_15=%s, monitores_20=%s, prazo_para_instalacao=%s, posicao_de_instalacao=%s, pessoas_por_mes=%s, cep=%s, data_do_contrato=%s, situacao=%s, dados2=%s, dados=%s WHERE codigo=%s",
GetSQLValueString($_POST['nome_sindico'], "text"),
GetSQLValueString($_POST['nome_predio'], "text"),
GetSQLValueString($_POST['cidade'], "text"),
GetSQLValueString($_POST['bairro'], "text"),
GetSQLValueString($_POST['e_mail'], "text"),
GetSQLValueString($_POST['endereco'], "text"),
GetSQLValueString($_POST['telefone_sindico'], "text"),
GetSQLValueString($_POST['valor_a_ser_pago_anunc'], "text"),
GetSQLValueString($_POST['p_indicacao_anunc'], "text"),
GetSQLValueString($_POST['pagar_vendedor'], "text"),
GetSQLValueString($_POST['inscricao_estadual'], "text"),
GetSQLValueString($_POST['cnpj'], "text"),
GetSQLValueString($_POST['telefone'], "text"),
GetSQLValueString($_POST['banco'], "text"),
GetSQLValueString($_POST['agencia'], "text"),
GetSQLValueString($_POST['conta_corrente'], "text"),
GetSQLValueString($_POST['vendedor'], "text"),
GetSQLValueString($_POST['pessoas_por_dia'], "text"),
GetSQLValueString($_POST['monitores_15'], "text"),
GetSQLValueString($_POST['monitores_20'], "text"),
GetSQLValueString($_POST['prazo_para_instalacao'], "text"),
GetSQLValueString($_POST['posicao_de_instalacao'], "text"),
GetSQLValueString($_POST['pessoas_por_mes'], "text"),
GetSQLValueString($_POST['cep'], "text"),
GetSQLValueString($_POST['data_do_contrato'], "text"),
GetSQLValueString($_POST['situacao'], "text"),
GetSQLValueString($_POST['dados2'], "text"),
GetSQLValueString($_POST['dados'], "text"),
GetSQLValueString($_POST['codigo'], "int"));
mysql_select_db($database_data, $data);
$Result1 = mysql_query($updateSQL, $data) or die(mysql_error());
$updateGoTo = "edd_clientes.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}
$currentPage = $_SERVER["PHP_SELF"];
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_Recordset1 = 1;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_data, $data);
$query_Recordset1 = "SELECT * FROM cliente";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $data) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1']; $all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);
$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);
?><table border="0" align="center">
<tr>
<td width="19"><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>"><img src="Imagens/First.gif" border="0" /></a>
<?php } // Show if not first page ?> </td>
<td width="24"><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>"><img src="Imagens/voltar.gif" border="0" /></a>
<?php } // Show if not first page ?> </td>
<td width="25"><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>"><img src="Imagens/Next.gif" border="0" /></a>
<?php } // Show if not last page ?> </td>
<td width="26"><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>"><img src="Imagens/Last.gif" border="0" /></a>
<?php } // Show if not last page ?> </td>
</tr>
</table>Carregando comentários...