<?

//-------------------------------fim da autenticação---------------------//

    include("authentication.php");

	include("conexao_e_agenda.php");

	include("funcoes.php");

	$id_usuario = $_SESSION["id_usuario"];

    $nome_usuario = $_SESSION["nome_usuario"];

//-------------------------------fim da autenticação---------------------//

  if (isset($_GET['id_conf'])){

	  $id_conf=$_GET['id_conf'];

  } else {

	  $id_conf="";

  } 

 $funcao = $_GET["funcao"];

 $funcao_exc = $_GET["funcao_exc"]; 



 $sql_compromisso="select * from configuracao where usuario='$id_usuario'";

 $result_compromisso=mysqli_query($conexao,$sql_compromisso) or die (mysqli_error($conexao));		  

 $linha=mysqli_fetch_array($result_compromisso);

 $id_conf = $linha['id'];



if ($id_conf == ""){

  $funcao = "inc";

  $desc_funcao = "INCLUSÃO";

  } else {

 $funcao = "alt"; 

 if($funcao_exc == 'exc'){ 

 $desc_funcao = "EXCLUSÃO"; 

 } else {

 $desc_funcao = "ALTERAÇÃO";

 }

// $sql_compromisso="select * from configuracao where usuario='$id_usuario'";

 //$result_compromisso=mysqli_query($conexao,$sql_compromisso) or die (mysqli_error($conexao));		  

 //$linha=mysqli_fetch_array($result_compromisso);

 //$id_conf = $linha['id'];

 }



$desc_cliente = "Marcos Antonio";

$for = 'formulario'; // nome do formulário	  

?>

<html>

<head>

<title><? echo $empresa; ?></title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="estilo.css" rel="stylesheet" type="text/css">

<script type="text/javascript1.2" src="js/mascara.js"></script>

<SCRIPT language="javascript">

  function AbreCalendario(largura,altura,formulario,campo,tmpx) {

    vertical   = (screen.height/2) - (altura/2);

    horizontal = (screen.width/2) - (largura/2);

    var jan = window.open('calendario.php?formulario='+formulario+'&campo='+campo+'&tmpx='+tmpx,'','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=0,copyhistory=0,screenX='+screen.width+',screenY='+screen.height+',top='+vertical+',left='+horizontal+',width='+largura+',height='+altura);

    jan.focus();

  }

</SCRIPT>

</head>

<body>

<?php include("cabecalho_e_clube.php"); ?>

<br>

<table width="700" border="0" align="center" cellpadding="0" cellspacing="0" class="cant_cinza_form_peq">

  <tr class="verdana1">

    <td width="552" height="20" bgcolor="#666666"><div align="left"><font color="#FFFFFF"><strong> &nbsp;&nbsp;&nbsp;&nbsp;  CONFIGURA&Ccedil;&Atilde;O DO E-CLUBE</strong></font></div>

    <div align="center"><strong> <a href="index.php" class="link-bco"></a> </strong></div></td>

  </tr>

  <tr class="verdana1">

    <td height="18" bgcolor="#CCCCCC">&nbsp;&nbsp;&nbsp;&nbsp;<strong>VOC&Ecirc; 

      EST&Aacute; EXECUTANDO:</strong> <? echo $desc_funcao; ?></td>

  </tr>

  <tr class="verdana1">

    <td height="5">&nbsp;</td>

  </tr>

  <tr class="verdana1">

    <td height="5"><div align="center"><? 

			  if($linha['caminho_foto']!=""){

			  print "<img src=\"fotos"."/".$linha['caminho_foto']."\" widht='150' height='150' border='0'>";

			  } else {

			  print "<img src=\"fotos"."/"."sem_fotografia.jpg"."\" border='0'>";

			  } ?>

    </div></td>

  </tr>

  <tr>

    <td><div align="right">

      <form name="<? echo $for; ?>" method="post" action="cad_configuracao_exec_alt.php">

        <input name="id_conf" type="hidden" id="id_conf" value="<? echo $id_conf; ?>">

        <input name="campo_funcao" type="hidden" id="campo_funcao" value="<? echo $funcao; ?>">

        <input name="funcao_exc" type="hidden" id="funcao_exc" value="<? echo $funcao_exc; ?>">

         <input name="id_usuario" type="hidden" id="id_usuario" value="<? echo $id_usuario; ?>">

          <table width="100%" border="0" cellspacing="0" cellpadding="3">

            <? if($funcao == "alt"){ ?>

            <? } else { ?>

            <? } ?>

            <tr> 

              <td width="20%" class="verdana1">

                <div align="right"><strong> USU&Aacute;RIO:</strong></div></td>

              <td width="80%">&nbsp;<span class="texto"><? echo $nome_usuario; ?></span></td>

            </tr>

            <tr> 

              <td height="3" class="verdana1"><div align="right"><strong>E-mail:</strong></div></td>

              <td height="6" class="verdana1"><input id="email" name="email" style="width: 400px;" maxlength="100" tabindex="11" value="<? if ($funcao == 'alt') echo $linha['email']; ?>"></td>

            </tr>

            <tr> 

              <td height="2" colspan="2" class="verdana1">&nbsp;</td>

            </tr>

            <tr> 

              <td colspan="2" class="verdana1"><div align="right"></div>

                <div align="right"></div>

                <strong>&nbsp;&nbsp;&nbsp;</strong> <div align="right"></div>

                <div align="right"></div></td>

            </tr>

            <tr> 

              <td height="25" class="verdana1"><div align="center"> 

                  <input name="Button22" type="button" class="botao1" value="Voltar" onClick="window.location='principal.php'">

                </div></td>

              <td height="25" class="verdana1">&nbsp; 

                <? if ($funcao == 'inc') { ?>

                <input name="Button2" type="submit" class="botao1" value="Incluir"> 

                <? } if (($funcao == 'alt') and ($funcao_exc == "")) {  ?>

                <input name="Button2" type="submit" class="botao1" value="Atualizar"> 

                <? } if (($funcao == 'alt') and ($funcao_exc == 'exc')) { ?>

                <input name="Button2" type="submit" class="botao1" value="Excluir"> 

                <? } ?>              </td>

            </tr>

          </table>

      </form>

    </div></td>

  </tr>

  <tr>

    <td height="20">&nbsp;</td>

  </tr>

  <tr>

    <td><form action="upfoto_usuario.php?" method=post  ENCTYPE="multipart/form-data"> 

		<input name="codigo" type="hidden" id="codigo" value="<? echo $id_usuario; ?>"> 

<table width="489" border=0 align=center cellpadding=0 cellspacing=0 class="cant_cinza_form_peq">

  <tr>

    <td width="481" height="20" align=center bgcolor="#666666" class="texto"><font color="#FFFFFF">Inclus&atilde;o 

      ou substitui&ccedil;&atilde;o de seu Logotipo</font></td>

  </tr>

  <tr>

    <td height="4" align=center bgcolor="#999999" class="texto"><span class="verdana_preto_10_bolder_2">Envie 

      a foto em formato .jpg ou .gif </span></td>

  </tr>

  <tr>

    <td width="481" height="9" align=center bgcolor="#999999"><div align="center"><span class="verdana_preto_10_bolder_2"> Foto a ser enviada:</span>

            <input name=documento type=file class="caixa_preto_9" size=30>

    </div></td>

  </tr>

  <tr>

    <td height="30" align=center bgcolor="#999999"><input name="submit" type=reset class="botao1" value="Limpar" style="cursor:hand">

      &nbsp;

      <input type=submit class="botao1" style="cursor:hand" value="Enviar foto"></td>

  </tr>

</table></form><br></td>

  </tr>

</table>

<br>

<br>

<br />

</body>

</html>

