<?php

include_once 'CheckLogOut.php';
require_once 'Connection.php';
require_once 'Layout.php';
require_once 'CacheArquivo.php';
require_once 'User';
$c = new Connection();
$lay = new Layout();
$lay->IncreaseStyles();
$lay->displayTitle(1, $USERNAME);
$lay->displayMenu('NewContact.php', 'Adicionar Contato', 'Images/addContact.png', 'EditUser.php', 'Gerenciamento de Conta', 'Images/settings.png', 'Logout.php', 'Deslogar-se', 'Images/logout.png');
echo '<html>';
echo '<body>';
echo '<div id="BODY">';
echo '<form action="User_edt.php" method=POST name="frmUser_edt" Class="form-center">';
echo '<fieldset class="fieldset-auto-width">';
echo '<legend> <h2> <font face="Arial" color="blue"> Edição de Usuário</h2> </font></legend>';
echo 'Login: <br>';
echo '<input type="text" name="userName" value="' . $USERNAME . '" readonly="readonly"> </input> <br>';
echo 'Senha: <br>';
echo '<input type="password" name="password"> </input> <br>';
echo 'Nome do usuário: <br>';
echo '<input type="text" name="fullName"> </input> <br>';
echo '</fieldset>';
echo '<br><input type="submit" value="Salvar Dados"> </input>';
echo '</form>';
echo '</div>';
echo '</body>';
echo '</html>';
<?php

require_once 'Layout.php';
$lay = new Layout();
$lay->IncreaseStyles();
$lay->displayTitle(1, "Visitante");
$lay->displayMenu('NewUser.php', 'Criar usuário', 'Images/newUser.png');
echo '<html>';
echo '<body>';
echo '<div id="BODY">';
echo '<form action="User_ins.php" method=POST name="frmUser_ins" Class="form-center">';
echo '<fieldset class="fieldset-auto-width">';
echo '<legend> <h2> <font face="Arial" color="blue"> Cadastro de Usuário</h2> </font></legend>';
echo 'Login: <br>';
echo '<input type="text" name="userName"> </input> <br>';
echo 'Senha: <br>';
echo '<input type="password" name="password"> </input> <br>';
echo 'Nome do usuário: <br>';
echo '<input type="text" name="fullName"> </input> <br>';
echo '</fieldset>';
echo '<br><input type="submit" value="Salvar Dados"> </input>';
echo '</form>';
echo '</div>';
echo '</body>';
echo '</html>';
<?php 
include_once 'CheckLogOut.php';
require_once 'Layout.php';
$lay = new Layout();
$lay->IncreaseStyles();
$lay->displayTitle(1, $USERNAME);
$lay->displayMenu('NewContact.php', '', 'Images/addContact.png');
echo '<html>';
echo '<body>';
echo '<div id="BODY">';
echo '<form action="Contact_ins.php" method=GET>';
echo '<fieldset>';
echo '<legend> Novo contato </legend>';
echo '<label for="fullName"> Nome: </label> ';
echo '<input type="text" name="fullName"> </input>';
echo '<label for="email"> Email: </label>';
echo '<input type="text" name="email"> </input>';
echo '</fieldset>';
echo '<fieldset>';
echo '<legend> Novo Endereço </legend>';
echo 'Nome da rua: <br><input type="text" name="streetName"> </input> <br>';
echo 'Número: <br><input type="text" name="number"> </input> <br>';
echo 'Complemento: <br><input type="text" name="complement"> </input> <br>';
echo 'Ponto de referência: <br><input type="text"  name="checkPoint"> </input> <br> ';
echo '</fieldset>';
echo '<fieldset>';
echo '<legend> Telefone de Contato </legend>';
echo 'Tipo de Telefone: <br>';
echo '<select name="phoneType">';
echo '<option value="Celular">Celular</option>';
echo '<option value="Residencial">Fone residencial</option>';
$isSet = "false";
if (isset($_GET['orderNome']) && $_GET['orderNome'] != "") {
    $orderBy = "orderNome";
    $orderType = $_GET['orderNome'];
    $isSet = "true";
} else {
    if (isset($_GET['orderId']) && $_GET['orderId'] != "") {
        $orderBy = "orderId";
        $orderType = $_GET['orderId'];
        $isSet = "true";
    } else {
        if (isset($_GET['orderEmail']) && $_GET['orderEmail'] != "") {
            $orderBy = "orderEmail";
            $orderType = $_GET['orderEmail'];
            $isSet = "true";
        }
    }
}
$c = new Connection();
$u = new User();
$lay = new Layout();
$lay->IncreaseStyles();
$lay->displayTitle(1, $USERNAME);
$lay->displayMenu('NewContact.php', 'Adicionar Contato', 'Images/addContact.png', 'Logout.php', 'Deslogar-se', 'Images/logout.png');
if ($isSet == "true") {
    $CacheArquivo = new CacheArquivo();
    $CacheArquivo->set_valor($USERID);
    $u->printContacts($USERID, $orderBy, $orderType);
} else {
    $u->printContacts($USERID);
}