コード例 #1
0
					<input type="text" ><br>
					<button onclick="pesquisar">Ok</button>
				</div>

				<div class="submit">
				<input id="salvar" type="submit" value="Salvar"><br>

			</div>
		</div>

	</form>
		<div class="form_esquerda">
		<form name="form4" id="form4" action="cadastro.php" method="POST">
			<input name="opcao" type="hidden" value="3">
<?php 
$c = new DaoContato();
$resultado = $c->ListaContatosNome($_SESSION["id_usuario"]);
if (mysql_num_rows($resultado) > 0) {
    while ($row = mysql_fetch_assoc($resultado)) {
        $arr_contatos[] = $row;
    }
    $tabela0 = "<table id='tabela_ordem'>";
    $tabela0 .= "<tr>";
    $tabela0 .= "<td><a href='agenda.php'>Nome</td>";
    $tabela0 .= "<td><a href='agenda_email.php'>Email</td>";
    $tabela0 .= "</tr></table>";
    echo $tabela0;
    $tabela = "<table id='tabela'>";
    for ($i = 0; $i < count($arr_contatos); $i++) {
        $tabela .= '<tr><td><input name="excluir[]" type="checkbox" value="' . $arr_contatos[$i]["id_contato"] . '">';
        $tabela .= '<strong>ID: </strong></td><td>' . $arr_contatos[$i]["id_contato"] . '</td>';
コード例 #2
0
 public function inserirModel(ContatoVO $con)
 {
     $dao = new DaoContato();
     return $dao->inserir($con);
 }
コード例 #3
0
					<input type="text" ><br>
					<button onclick="pesquisar">Ok</button>
				</div>

				<div class="submit">
				<input id="salvar" type="submit" value="Salvar"><br>

			</div>
		</div>

	</form>
		<div class="form_esquerda">
		<form name="form4" id="form4" action="cadastro.php" method="POST">
			<input name="opcao" type="hidden" value="3">
<?php 
$c = new DaoContato();
$resultado = $c->ListaContatosEmail($_SESSION["id_usuario"]);
if (mysql_num_rows($resultado) > 0) {
    while ($row = mysql_fetch_assoc($resultado)) {
        $arr_contatos[] = $row;
    }
    //$arr_contatos = $_COOKIE["lista_contatos"];
    $tabela0 = "<table id='tabela_ordem'>";
    $tabela0 .= "<tr>";
    $tabela0 .= "<td><a href='agenda_nome.php'>Nome</td>";
    $tabela0 .= "<td><a href='agenda.php'>Email</td>";
    $tabela0 .= "</tr></table>";
    echo $tabela0;
    $tabela = "<table id='tabela'>";
    for ($i = 0; $i < count($arr_contatos); $i++) {
        $tabela .= '<tr><td><input name="excluir[]" type="checkbox" value="' . $arr_contatos[$i]["id_contato"] . '">';
コード例 #4
0
        $c[] = trim($contato->getTelefone_celular());
        $c[] = trim($contato->getEmail());
        $c[] = trim($contato->getEndereco());
        $c[] = trim($contato->getId_usuario());
        $cn->InserirContato($c);
        $sql = "INSERT INTO log (id_usuario, hora, acao)\n\t\tVALUES (" . $_SESSION["id_usuario"] . ", '" . $hora . "', 'Cadastrou um novo contato" . $c[0] . "' )";
        $result = mysql_query($sql);
        $resultado = $cn->ListaContatos($_SESSION["id_usuario"]);
        echo '<script> alert("Contato salvo com sucesso!!!") </script>';
        echo '<meta http-equiv="refresh" content=0;url=agenda.php>';
    }
}
if (isset($_POST['opcao'])) {
    if ($_POST['opcao'] == 3) {
        $hora = date("d/m/Y, g:i:s a");
        $c = new DaoContato();
        if (isset($_POST["excluir"])) {
            $id = $_POST["excluir"];
            for ($i = 0; $i < count($id); $i++) {
                $c->DeletarContato($id[$i]);
            }
            $ids = "";
            foreach ($id as $key => $value) {
                $ids .= $value;
                $ids .= ', ';
            }
            $sql = "INSERT INTO log (id_usuario, hora, acao)\n\t\tVALUES (" . $_SESSION["id_usuario"] . ", '" . $hora . "', 'Excluiu contato(s) nro " . $ids . "' )";
            $result = mysql_query($sql);
            echo "<meta charset='utf-8'>";
            echo "<script> alert('Exclusão bem sucedida.'); </script>";
            echo '<meta http-equiv="refresh" content=0;url=agenda.php>';