listar.php <?php require_once('Connections/conexao.php'); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "master,simples,basico";
$MM_donotCheckaccess = "false";
// *** 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 == "") && false) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "index_guia.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 = "")
{
if (PHP_VERSION < 6) {
$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;
}
}
mysql_select_db($database_Hcontrol, $Hcontrol);
$query_info = "SELECT * FROM hcontrol_info";
$info = mysql_query($query_info, $Hcontrol) or die(mysql_error());
$row_info = mysql_fetch_assoc($info);
$totalRows_info = mysql_num_rows($info);
$colname_dados = "-1";
if (isset($_GET['disponivel'])) {
$colname_dados = $_GET['disponivel'];
}
mysql_select_db($database_Hcontrol, $Hcontrol);
$query_dados = sprintf("SELECT * FROM dados WHERE disponivel = %s AND `pi` = 'sim' ORDER BY local ASC", GetSQLValueString($colname_dados, "text"));
$dados = mysql_query($query_dados, $Hcontrol) or die(mysql_error());
$row_dados = mysql_fetch_assoc($dados);
$totalRows_dados = mysql_num_rows($dados);
?>
<!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">
>
<title></title>
</head>
<body>
<table border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td><font color="#000000" class="tex">
<span style="font-size: 16px"></span></font><span class="titulo"><font color="#000000"><?php echo $_SESSION['MM_Username']; ?></font></span></td>
</tr>
</table>
<br />
<form action="enviar.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
<table border="0" align="center" cellpadding="4" cellspacing="4" class="tabela">
<tr bgcolor="#000000">
<td class="titulobranco">Codigo:</td>
<td class="titulobranco">Endereco:</td>
<td class="titulobranco">Referenciaa:</td>
<td class="titulobranco">Localizao:</td>
<td class="titulobranco">Produto:</td>
<td class="titulobranco">Selecione:</td>
<td><img src="f.png" width="20" height="20" /></td>
</tr>
<?php do { ?>
<tr bgcolor="<?php echo $row_dados['cor1']; ?>">
<td><?php echo $row_dados['codponto']; ?></td>
<td><?php echo $row_dados['end']; ?></td>
<td><?php echo $row_dados['ref']; ?></td>
<td><?php echo $row_dados['local']; ?></td>
<td bgcolor="<?php echo $row_dados['cor2']; ?>"><?php echo $row_dados['produto']; ?></td>
<td bgcolor="<?php echo $row_dados['cor2']; ?>"><input name="checkbox" type="checkbox" id="checkbox" value="confirmado" /></td>
<td><a href="<?php echo $row_dados['imagem']; ?>" target="_blank"><img src="f.png" width="20" height="20" /></a></td>
</tr>
<?php } while ($row_dados = mysql_fetch_assoc($dados)); ?>
<?php $codponto = $_POST["codponto"]?>
</table>
<br />
<table width="0" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><input type="submit" name="button" id="button" value="Enviar" /></td>
</tr>
</table>
</form>
<br />
<p><br />
</p>
</body>
</html>
<?php
mysql_free_result($info);
mysql_free_result($dados);
?>
enviar.php
<?php
$para = "meuemail@meumail.com.br";
$meu = "meuemail@meumail.com.br";
$assunto = "Resultados";
mail ($para,"$assunto",$resultados,"from: $meu");
echo "Mensagem enviada com sucesso!";
?> dede já agradeço, abraço!