Hi,
thank you for your interest...here the code:
<?php
$acum=array();
function STACK($push_values,$content)
{
array_push($push_values,$content);
}
function REPLACE($valor,$i) // replace some indexs that are stored into tables
{
switch ($i)
{
case 12: // index of position into query result
{
if ($valor==0)
{
$valor="Male";
break;
}
else
if ($valor==1)
{
$valor="Female";
break;
}
}
}
}
//**************************
// STORE PROCEDURE FOR CPF'S QUERY
//**************************
$id_voo=0;
$message="";
$tuples=0;
$conn=mssql_connect("JHSALN06","adv_user","developer");
if ($conn)
{
mssql_select_db("CRM",$conn);
$stmt=mssql_init("CPF_CHECK",$conn);
mssql_bind($stmt,"@CPF",$CPF,SQLVARCHAR);
mssql_bind($stmt,"@message",&$message,SQLVARCHAR,TRUE); // get message
mssql_bind($stmt,"@tuples",&$tuples,SQLINT4,TRUE); // get message
$result=mssql_execute($stmt);
if ($tuples==1)
{
print ("Message: ".$message."<BR>");
while ($arr=mssql_fetch_row($result))
{
foreach ($arr as $key => $value)
{
REPLACE (&$value, $key);
STACK (&$acum,$value);
}
}
}
else
print ("Message: ".$message."<BR>");
mssql_close($conn);
}
else print("ooops!");
?>
//////////////////////////////// FORM WROTE FOR PORTUGUESE LANGUAGE ////////////////////////////////////
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="Layer1" style="position:absolute; left:17px; top:81px; width:770px; height:421px; z-index:1">
<table border="1">
<tr>
<td width="37%"><font size="1" face="Georgia, Times New Roman, Times, serif"><b>DATA
DO CADASTRO</b></font></td>
</tr>
<tr>
<td width="37%" > </td>
</tr>
<tr>
<td width="37%" ><font size="1" face="Georgia, Times New Roman, Times, serif"><b>NOME</b></font></td>
</tr>
<tr>
<td colspan="5">
<input type="text" name="nome" size="95" value=<?php echo $push_values[0]; ?> >
</td>
</tr>
<tr>
<td width="37%"><font size="1" face="Georgia, Times New Roman, Times, serif"><b>ENDEREÇO</b></font></td>
</tr>
<tr>
<td colspan="5">
<input type="text" name="endereco" size="95" value=<?php echo $push_values[1]; ?> >
</td>
</tr>
<tr>
<td width="37%" ><font size="1" face="Georgia, Times New Roman, Times, serif"><b>CIDADE</b></font></td>
<td width="9%" ><font size="1" face="Georgia, Times New Roman, Times, serif"><b>UF</b></font></td>
<td width="19%"><font size="1" face="Georgia, Times New Roman, Times, serif"><b>CEP</b></font></td>
</tr>
<tr>
<td width="37%" >
<input type="text" name="cidade" size="50" value=<?php echo $push_values[2]; ?> >
</td>
<td width="9%" >
<input type="text" name="uf" size="2" value=<?php echo $push_values[3]; ?> >
</td>
<td width="19%">
<input type="text" name="cep" value=<?php echo $push_values[4]; ?> >
</td>
</tr>
<tr>
<td width="37%" ><font size="1" face="Georgia, Times New Roman, Times, serif"><b>E-MAIL</b></font></td>
<td colspan="1" width="9%" height="15"><font size="1" face="Georgia, Times New Roman, Times, serif"><b>DDD</b></font></td>
<td width="19%" ><font size="1" face="Georgia, Times New Roman, Times, serif"><b>TEL.
RESID. </b></font></td>
<td width="13%" ><font size="1" face="Georgia, Times New Roman, Times, serif"><b>TEL.
CEL </b></font></td>
<td width="14%" ><font size="1" face="Georgia, Times New Roman, Times, serif"><b>TEL.
COM.</b></font></td>
<td colspan="1" width="8%" ><font size="1" face="Georgia, Times New Roman, Times, serif"><b>RAMAL</b></font></td>
</tr>
<tr>
<td width="37%" >
<input type="text" name="email" size="45">
</td>
<td colspan="1" width="9%">
<input type="text" name="ddd" size="3">
</td>
<td width="19%">
<input type="text" name="tres" size="10">
</td>
<td width="13%" >
<input type="text" name="tcel" size="10">
</td>
<td width="14%" >
<input type="text" name="tcom" size="10">
</td>
<td colspan="1" width="8%" >
<input type="text" name="ramal" size="5">
</td>
</tr>
<tr>
<td width="37%" ><font size="1" face="Georgia, Times New Roman, Times, serif"><b>DATA
DE NASCIMENTO</b></font></td>
<td colspan="1" width="9%"><font size="2" face="Georgia, Times New Roman, Times, serif"><b><font size="1">SEXO</font></b></font></td>
<td width="19%"><font size="1" face="Georgia, Times New Roman, Times, serif"><b>RG</b></font></td>
<td width="13%" ><font size="1" face="Georgia, Times New Roman, Times, serif"><b>CPF</b></font></td>
</tr>
<tr>
<td width="37%" > </td>
<td colspan="1" width="9%"> </td>
<td width="19%">
<input type="text" name="rg" size="14">
</td>
<td width="13%" >
<input type="text" name="cpf" size="16">
</td>
</tr>
<tr>
<td width="37%"><font size="1" face="Georgia, Times New Roman, Times, serif"><b>CARTÃO
SMILES</b></font></td>
<td colspan="1" width="9%"><font size="1" face="Georgia, Times New Roman, Times, serif"><b>CATEGORIA</b></font></td>
</tr>
<tr>
<td width="37%" > </td>
<td colspan="1" width="9%"> </td>
</tr>
</table>
</div>
</body>