<?php
/**
 *  Desliga o Cache do Servidot HTTP
 */
Header("Cache-control: private, no-cache");
Header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
Header("Pragma: no-cache");
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>

<!-- Definições -->
<?php include_once("include/PhPage.cfg.php");?>
<!-- End Definições -->

<!-- Uses -->
<!-- End Uses -->

<head>
  <title><?php echo TIT.' '.VER;?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/<:::::</title>

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

  <meta name="author"    content="Ricardo Othuki" />
  <meta name="revised"   content="Ricardo Othuki, 27/01/2004" />
  <meta name="generator" content="PhPage Studio">

<!-- JavaScripts -->
  <?php include_once( INC . "mainJavaScript.js" ); ?>
  
  <script type="text/javascript" src="lib_JS/findDOM.js"></script>
  
  <script type="text/javascript" src="lib_JS/wddx.js"></script>
  <script type="text/javascript" src="lib_JS/wddxDes.js"></script>
  <script type="text/javascript" src="lib_JS/jsrsClient.js"></script>
  <script type="text/javascript" src="lib_JS/msgIndex.js"></script>

  <script type="text/javascript" src="lib_JS/index.js"></script>
  <script type="text/javascript" src="lib_JS/EventoGlobal.js"></script>
<!-- End JavaScripts -->

<!-- Folha de Estilos -->
  <?php include_once( CSS."index.css"); ?>
<!-- End Folha de Estilos -->

</head>

<HTML>
<BODY id="bodyMain">

<?php

  if(!isset($_REQUEST["nUser"])  )
  {
    //  Tela de Login  //
    //  *************  //
?>
  <form id="form1" name="formMain" method="POST" action="<?php echo($_SERVER["SCRIPT_NAME"]);?>">
    <input id="codID" name="codiUSER" type="hidden">
    <input id="nUser" name="nameUSER" type="hidden">

  <div id="divPrincipal">
  
    <img id="imgPhPage" src="imagens/PhPage_Logomarca.gif" />
    <img id="imgKey"    src="imagens/login1.jpg" />

    <div id="divTable">
    <table border="0">
      <colgroup align="right" width="80px"></colgroup>
      <colgroup align="left"></colgroup>
      <tr>
        <td class="tdClass">
          Usuário</td>
        <td class="tdClass">
          <input id="userLogin" type="text" name="nUser" value="" class="inputTxt" />
        </td>
      </tr>
      <tr>
        <td class="tdClass">
          Senha</td>
        <td class="tdClass">
          <input id="userPass" type="password" name="nPass" value="" class="inputTxt" /></td>
      </tr>
      <tr>
        <td class="tdClass">&nbsp;</td>
        <td class="tdClass">&nbsp;</td>
      </tr>
      <tr>
        <td class="tdClass">&nbsp;</td>
        <td class="tdClass" align="center">
          <button id="submit1" class="button1">
          Entrar</button></td>
      </tr>
    </table>
    </div>
    <div id="divMsg">WEB Service Tecnology</div>
  </div>

  </form>
  <script type="text/javascript">
    var objID = findDOM('userLogin',0);
    objID.focus();
  </script>
<?php
  }else
  {
    //  Modo Edição  //
    //  ***********  //
    //include_once("dbConnect.php");
/*
    open_Window( 'core/PhPage.main.php','WindowMenu',Window_tam_,Window_alt_,0 );
    windowFocus( 'WindowMenu' );
    mainPage

    src="_Desenv/Usuarios/ricardo/temp/teste.tmp.php"
    <button onclick="testeMain();">Teste I</button>
*/

  // echo(PHP_SELF );
//  $pathNew = "/phpage/desenv/usuarios/ricardo/temp/teste.tmp.php";
//  $pathNew = "/teste/php5/desenv/usuarios/ricardo/temp/teste.tmp.php";
  $pathNew = "emBranco.php";

  $_SESSION["codiUSER"]  = $_REQUEST["codiUSER"];
  $_SESSION["nameUSER"]  = $_REQUEST["nameUSER"];
  $_SESSION["loginUSER"] = $_REQUEST["nUser"];
  $_SESSION["modeRAD"]   = true;
  
?>
  <script type="text/JavaScript" language="JavaScript">
    openWindow( 'PhPage.main.php','WindowRAD',Window_tam_,Window_alt_,0 );
    windowFocus( 'WindowRAD' );
  </script>

  <img src="imagens/right.gif"
       onclick="windowFocus('WindowRAD');"
       alt="Voltar ao RAD" />

  <iframe id="iFrame_exec"
          name="Frame_exec"
          src= "<?php echo($pathNew);?>"
          height="100%"
          width="100%"
          frameborder="0"
          >
  </iframe>
<?php
  }// End
?>
</BODY>
</HTML>
