コード例 #1
0
        break;
    case "Setembro":
        $dataFinal = $Array_Data[2] . "-" . "09-" . $Array_Data[0];
        break;
    case "Outubro":
        $dataFinal = $Array_Data[2] . "-" . "10-" . $Array_Data[0];
        break;
    case "Novembro":
        $dataFinal = $Array_Data[2] . "-" . "11-" . $Array_Data[0];
        break;
    case "Dezembro":
        $dataFinal = $Array_Data[2] . "-" . "12-" . $Array_Data[0];
        break;
}
$ID_Espaco = $mysql->mysqlSelect("diverte_espaco", "nome", $unidadeEscolhida);
$resultado = $mysql->mysqlSelectQuery("SELECT * FROM diverte_alugueis WHERE ID_ESPACO ='" . $ID_Espaco[0]['ID'] . "' AND DATA ='" . $dataFinal . "'");
if ($resultado == null) {
    $usuarioExiste = $mysql->mysqlSelect("diverte_usuario", 'Nome', $nome);
    if ($usuarioExiste != null) {
        $mysql->mysqlInsert("diverte_alugueis", "ID_USUARIO,ID_ESPACO,DATA", "'" . $usuarioExiste[0]['ID'] . "','" . $ID_Espaco[0]['ID'] . "','" . $dataFinal . "'");
        $home_url = 'http://' . $_SERVER['HTTP_HOST'] . "/diverte_festas/obrigado.php?unidade={$unidadeEscolhida}&nome={$nome}&email={$email}&telefone={$telefone}&data={$dataFinal}&preco={$preco}";
        header('Location: ' . $home_url);
    } else {
        if ($usuarioExiste == null) {
            $mysql->mysqlInsert("diverte_usuario", "NOME,EMAIL,TELEFONE", "'" . $nome . "','" . $email . "','" . $telefone . "'");
            $ID_usuario_criado = $mysql->mysqlSelect("diverte_usuario", "NOME", $nome);
            $mysql->mysqlInsert("diverte_alugueis", "ID_USUARIO,ID_ESPACO,DATA", "'" . $ID_usuario_criado[0]['ID'] . "','" . $ID_Espaco[0]['ID'] . "','" . $dataFinal . "'");
            $home_url = 'http://' . $_SERVER['HTTP_HOST'] . "/diverte_festas/obrigado.php?unidade={$unidadeEscolhida}&nome={$nome}&email={$email}&telefone={$telefone}&data={$dataFinal}&preco={$preco}";
            header('Location: ' . $home_url);
        }
    }
コード例 #2
0
     echo '<table border="1" class="calendar" cellpadding="10" cellspacing="10">';
     echo '<caption id="tituloCalendario" title="(diverte_espaco)">';
     echo '<tbody id="calendario" >';
     echo '<tr>
                             <th width="10%" abbr="ID" title="ID" class="TituloTabela">ID</th>
                             <th width="30%" abbr="Nome" title="Nome" class="TituloTabela">NOME</th>
                             <th width="30%" abbr="Email" title="Email" class="TituloTabela">ENDEREÇO</th>
                             <th width="30%" abbr="Telefone" title="Telefone" class="TituloTabela">PREÇO</th>
                         </tr>';
     echo '<tr>
                             <th width="10%" abbr="ID" title="ID" class="TituloTabela">(id)</th>
                             <th width="30%" abbr="Nome" title="Nome" class="TituloTabela">(nome)</th>
                             <th width="30%" abbr="Email" title="Email" class="TituloTabela">(endereco)</th>
                             <th width="30%" abbr="Telefone" title="Telefone" class="TituloTabela">(preco)</th>
                         </tr>';
     $resultado = $mysql->mysqlSelectQuery("SELECT * FROM diverte_espaco");
     foreach ($resultado as $valor) {
         echo "\n<tr>\n";
         echo "<td> {$valor['0']}</td>\n";
         echo "<td> {$valor['1']}</td>\n";
         echo "<td> {$valor['2']}</td>\n";
         echo "<td> {$valor['3']}</td>\n";
         echo "\n</tr>\n";
     }
     echo '</tbody>
                 </table>';
     //var_dump($resultado);
 } else {
     if ($_POST['usuarios'] == "Usuarios") {
         echo '<table border="1" class="calendar" cellpadding="10" cellspacing="10">';
         echo '<caption id="tituloCalendario" title="(diverte_usuario)">';