コード例 #1
0
<?php

require 'Connection.php';
require 'Contact.php';
require 'ContactPhone.php';
require 'ContactAdress.php';
require 'Log.php';
$con = new Connection();
$Contact = new Contact($_REQUEST['fullName'], $_REQUEST['email'], $_COOKIE['USERID']);
$Contact->InsertContact();
$ContactPhone = new ContactPhone($_REQUEST['phoneType'], $_REQUEST['countryId'], $_REQUEST['ddd'], $_REQUEST['phoneNumber']);
$ContactPhone->ContactId($Contact->GetMaxContactId());
$ContactPhone->InsertContactPhone();
$ContactAdress = new ContactAdress($_REQUEST['streetName'], $_REQUEST['number'], $_REQUEST['complement'], $_REQUEST['checkPoint']);
$ContactAdress->ContactId($Contact->GetMaxContactId());
$ContactAdress->InsertContactAdress();
$Log = new Log(1);
// log de inserção, conforme a tabela Actions
$Log->UserId($_COOKIE['USERID']);
//
$Log->InsertLog();
echo '<html>';
echo '<h3> Contato inserido com sucesso! <h3>';
echo '<form action="Main.php">';
echo '<table>';
echo '	<tr>';
echo '		<td><input type="submit" value="Voltar à Página Inicial"> </input> </td>';
echo '	</tr>';
echo '</table>';
echo '</form>';
echo '</html>';
コード例 #2
0
<?php 
include_once 'CheckLogOut.php';
require_once 'Connection.php';
require_once 'ContactAdress.php';
// para atualizar a lista
require_once 'User.php';
require_once 'CacheArquivo.php';
////////////////////////////
require_once 'Log.php';
$con = new Connection();
$ca = new ContactAdress();
$ca->ContactId($_GET['contactId']);
$ca->StreetName($_GET['streetName']);
$ca->Number($_GET['number']);
$ca->Complement($_GET['complement']);
$ca->CheckPoint($_GET['checkPoint']);
$ca->InsertContactAdress();
// para atualizar a lista
$u = new User();
$cacheArquivo = new CacheArquivo();
$cacheArquivo->set_valor($UsId);
$Contacts = $u->GetAllContacts($USERID);
$valor = json_encode($Contacts);
$cacheArquivo->set_valor($USERID, $valor);
////////////////////////////
$Log = new Log(1);
// log de inserção, conforme a tabela Actions
$Log->UserId($USERID);
//
$Log->InsertLog();
echo '<html>';
コード例 #3
0
<?php 
include_once 'CheckLogOut.php';
require_once 'Connection.php';
require_once 'ContactAdress.php';
// para atualizar a lista
require_once 'User.php';
require_once 'CacheArquivo.php';
////////////////////////////
include_once 'CacheSession.php';
require_once 'Log.php';
$con = new Connection();
$ca = new ContactAdress();
$ca->ContactId($_GET['contactId']);
$ca->Sequential($_GET['sequential']);
$ca->DeleteContactAdress();
// para atualizar a lista
$u = new User();
$cacheArquivo = new CacheArquivo();
$cacheArquivo->set_valor($UsId);
$Contacts = $u->GetAllContacts($USERID);
$valor = json_encode($Contacts);
$cacheArquivo->set_valor($USERID, $valor);
////////////////////////////
$Log = new Log(3);
// log de deleção, conforme a tabela Actions
$Log->UserId($USERID);
//
$Log->InsertLog();
echo '<html>';
echo '<script language="JavaScript">';
echo 'alert("Endereço deletado!");';
コード例 #4
0
if (isset($_GET['streetName']) && $_GET['streetName'] != '' && isset($_GET['number']) && $_GET['number'] != '') {
    if (isset($_GET['caSeq']) && $_GET['caSeq'] != '') {
        // update address
        $contactAdress = new ContactAdress($_GET['streetName'], $_GET['number'], $_GET['complement'], $_GET['checkPoint']);
        $contactAdress->ContactId($_GET['contactId']);
        $contactAdress->Sequential($_GET['caSeq']);
        $contactAdress->UpdateContactAdress();
        $contactAdressMessage = "Endereço editado!";
        $Log3 = new Log(2);
        // log de update, conforme a tabela Actions
        $Log3->UserId($USERID);
        //
        $Log3->InsertLog();
    } else {
        // insert address
        $contactAdress = new ContactAdress($_GET['streetName'], $_GET['number'], $_GET['complement'], $_GET['checkPoint']);
        $contactAdress->ContactId($_GET['contactId']);
        $contactAdress->InsertContactAdress();
        $contactAdressMessage = "Endereço inserido!";
        $Log3 = new Log(1);
        // log de inserção, conforme a tabela Actions
        $Log3->UserId($USERID);
        //
        $Log3->InsertLog();
    }
}
// para atualizar a lista
$u = new User();
$cacheArquivo = new CacheArquivo();
$cacheArquivo->set_valor($UsId);
$Contacts = $u->GetAllContacts($USERID);