<?php
	session_start();
	include ('../Amfphp/Services/conexao.php');
	$con=new conexao();
	include ('funcoes.php');
	if (isset($_SESSION['acesso_idusuario'])){
		$acesso_idusuario=$_SESSION['acesso_idusuario'];
		$acesso_idempresa=$_SESSION['acesso_idempresa'];
		$acesso_admin=$_SESSION['acesso_admin'];
		$acesso_revenda=$_SESSION['acesso_revenda'];
		$diaatual=date('d/m/Y');
		$horaatual=date('h:i');
		$csp_hora=date('hi');
	} else {
		echo "<script>window.location='index.php';</script>";
	}
?>

<!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=utf-8" />
<title>Documento sem título</title>
<link href="cspadm.css" rel="stylesheet" type="text/css" />
</head>

<body>
<form id="form1" name="form1" method="post" action="csp_xml.php?comando=<?php echo $comando;?>&oqfazer=<?php echo $oqfazer;?>">
  <table width="259" border="1">
    <tr>
      <td width="372" class="txtBOX">Selecione o Profile:<br />
        <label for="sel_profile"></label>
        <select name="sel_profile" id="sel_profile">
        <?php
			$sql="select * from profile where idempresa='$acesso_idempresa' and host<>'' and conexao='Cardservproxy'";
			if ($acesso_revenda == 1){
				$sql .= " and idprofile in (select idprofile from usuario_profile where idusuario='$acesso_idusuario')";	
			}
			$resultado = $con->banco->Execute($sql);
			while ($registro = $resultado->FetchNextObject()){
				$val_idprofile=$registro->IDPROFILE;
				$val_profile=$registro->DESCRICAO;
				$val_host=$registro->HOST;
				$val_porta=$registro->PORTACSP;
			?>
	          <option value="<?php echo $val_idprofile;?>"><?php echo "$val_profile ($val_host)";?></option>            
            <?php	
			}
		?>

      </select>
        <label for="comando"></label></td>
      <td width="28" align="center"><input type="image" name="imageField" id="imageField" src="imagens/forward.png" /></td>
    </tr>
  </table>
</form>
</body>
</html>