mb_http_input("utf-8");
mb_http_output("utf-8");
?>
<?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_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO add_conta_receber (campo_fim) VALUES (%s)",
GetSQLValueString($_POST['campo_fim'], "text"));
mysql_select_db($database_data, $data);
$Result1 = mysql_query($insertSQL, $data) or die(mysql_error());
$insertGoTo = "visualiza_receber.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
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;
}
}
$maxRows_DetailRS1 = 10;
$pageNum_DetailRS1 = 0;
if (isset($_GET['pageNum_DetailRS1'])) {
$pageNum_DetailRS1 = $_GET['pageNum_DetailRS1'];
}
$startRow_DetailRS1 = $pageNum_DetailRS1 * $maxRows_DetailRS1;
$colname_DetailRS1 = "-1";
if (isset($_GET['recordID'])) {
$colname_DetailRS1 = $_GET['recordID'];
}
mysql_select_db($database_data, $data);
$query_DetailRS1 = sprintf("SELECT * FROM anunciante WHERE codigo = %s", GetSQLValueString($colname_DetailRS1, "int"));
$query_limit_DetailRS1 = sprintf("%s LIMIT %d, %d", $query_DetailRS1, $startRow_DetailRS1, $maxRows_DetailRS1);
$DetailRS1 = mysql_query($query_limit_DetailRS1, $data) or die(mysql_error());
$row_DetailRS1 = mysql_fetch_assoc($DetailRS1);
if (isset($_GET['totalRows_DetailRS1'])) {
$totalRows_DetailRS1 = $_GET['totalRows_DetailRS1'];
} else {
$all_DetailRS1 = mysql_query($query_DetailRS1);
$totalRows_DetailRS1 = mysql_num_rows($all_DetailRS1);
}
$totalPages_DetailRS1 = ceil($totalRows_DetailRS1/$maxRows_DetailRS1)-1;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...nsitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Lançamentos de contas a receber</title>
<script src="SpryAssets/SpryEffects.js" type="text/javascript"></script>
<script type=text/javascript>
function copia(nome,campo_fim) {
if(nome.checked)
{
campo_fim.value += nome.value + '\r\n';
}
else
{
campo_fim.value = campo_fim.value.toString().replace(nome.value,"");
campo_fim.value = campo_fim.value.toString().replace("\r\n","");
}
}
</script></script>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="84%" border="0" cellpadding="0" cellspacing=" 0">
<tr>
<td width="48"><div align="center"><img src="Imagens/1551_128x128.png" alt="" width="48" height="48" /></div></td>
<td width="640"><strong>ADICIONE OS PREDIOS </strong></td>
<td width="450"><b><b><b> <img src="Imagens/4435_128x128.png" width="48" height="48" /><a href="fechar.php" target="_self">Fechar Janela</a></b></b></b></td>
</tr>
<tr>
<td> </td>
<td colspan="2"><table border="0" cellspacing="3" cellpadding="0" class="verdana" width="1218" >
<form action="<?php echo $editFormAction; ?>" method="POST" name="form1" id="form1">
<tr align="right">
<td width="233" height="5"><div align="center">Usuário que está cadastrando:<br />
<input name="Funcionario" type="text" id="Funcionario" value="<?php echo $_SESSION['MM_Username']; ?>" />
</div>
<div align="left"></div></td>
<td width="234"><div align="center">Anunciante:</b><br />
<input name="Cliente" type="text" id="Cliente" value="<?php echo $row_DetailRS1['Cliente']; ?>" onkeyup="muda(this)"/>
</div></td>
<td width="736" height="6">
<div align="left"><?php
//Conectando com o banco de dados MysQL e selecionando a base de dados.
$con=mysql_connect('xxxxxxxxx','xxxxxxx','xxxxxxxxxxxx')or die('Erro na conexção, verifique os dados'.mysql_error($con));
mysql_select_db('ubccriative1',$con)or die('Erro ao selecionar a tabela'.mysql_error($con));
//Varrendo a tabela dados, para pegar todos os dados.
$selecao=mysql_query("SELECT codigo,nome FROM cliente")or die('Erro na consulta SQL'.mysql_error($con));
if (mysql_num_rows($selecao) != 0)
{
echo "<form name='nome'>";
while($ver = mysql_fetch_array($selecao))
{
echo "$ver[1]<input type=\"checkbox\" value=\"$ver[1]\" onClick=\"copia(this,campo_fim);\">";
}
echo "<textarea name='campo_fim' rows='3' cols='20'></textarea></form>";
//Libramos a memória ocupada pela consulta com o free_result.
mysql_free_result($selecao);
//Fechamos a conexão com a base de dados após as operações.
mysql_close($con);
}
?>
</div></td>
</tr>
<tr align="right">
<td width="470" height="18" colspan="2"> </td>
<td height="18"> </td>
</tr>
<tr align="right">
<td height="3" colspan="2"><input type="submit" name="button" id="button" value=" Efetuar Cadastror") />
<input type="reset" name="button2" id="button2" value="Limpar Cadastro" /></td>
<td height="3"><?
setlocale(LC_TIME,"portuguese");
echo strftime("Hoje é %A, %d de %B de %Y");
?></td>
</tr>
<input type="hidden" name="MM_insert" value="form1" />
</form>
</table></td>
</tr>
</table>
<p> </p>
<p> </p>
<p> </p>
<table width="1362" border="0">
<tr>
<td><div align="center">
</body>
</html>
<?php
mysql_free_result($DetailRS1);
?>
[/codebox]
e o seguinte depois que adc esse código aqui
[codebox]<?php
//Conectando com o banco de dados MysQL e selecionando a base de dados.
$con=mysql_connect('xxxxxxxxxx','xxxxxxxxx','cxxxxxxxxxx')or die('Erro na conexção, verifique os dados'.mysql_error($con));
mysql_select_db('ubccriative1',$con)or die('Erro ao selecionar a tabela'.mysql_error($con));
//Varrendo a tabela dados, para pegar todos os dados.
$selecao=mysql_query("SELECT codigo,nome FROM cliente")or die('Erro na consulta SQL'.mysql_error($con));
if (mysql_num_rows($selecao) != 0)
{
echo "<form name='nome'>";
while($ver = mysql_fetch_array($selecao))
{
echo "$ver[1]<input type=\"checkbox\" value=\"$ver[1]\" onClick=\"copia(this,campo_fim);\">";
}
echo "<textarea name='campo_fim' rows='3' cols='20'></textarea></form>";
//Libramos a memória ocupada pela consulta com o free_result.
mysql_free_result($selecao);
//Fechamos a conexão com a base de dados após as operações.
mysql_close($con);
}
?>[/codebox]
juntamente com esse
[codebox]<script type=text/javascript>
function copia(nome,campo_fim) {
if(nome.checked)
{
campo_fim.value += nome.value + '\r\n';
}
else
{
campo_fim.value = campo_fim.value.toString().replace(nome.value,"");
campo_fim.value = campo_fim.value.toString().replace("\r\n","");
}
}
</script>[/codebox]
o meu botão não efetua o cadastro o código do botão e esse
[codebox]<input type="submit" name="button" id="button" value=" Efetuar Cadastror") />
<input type="reset" name="button2" id="button2" value="Limpar Cadastro" />[/codebox]
alguém sabe o que está acontecendo por favor?????





