Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "class-db.php";
- include "data.class.php";
- //Lista os aniversariantes, de hoje a ate daqui a 30 dias.
- // Configure as informacoes pertinentes ao banco:
- $database = "pina";
- $servidor = "localhost";
- $user = "root";
- $pass = "";
- $tabela = "clientes";
- $nome = "nome";
- $telefone = "telefone";
- $datanascimento = "data";
- //EDITAR ATE AQUI!
- define('DB_CONNECTIONSTRING',"mysqldb://$database;$servidor;$user;$pass");
- $db = db::getInstance(DB_CONNECTIONSTRING);
- $db->verbose = 3;
- //mysql_set_charset("uft8");
- $data = Data::b(Data::agora());
- $clientes = $db->select_rows($tabela, "$nome, $telefone, $datanascimento", "$datanascimento", "WHERE '$datanascimento' BETWEEN CURRENT_DATE AND CURRENT_DATE + INTERVAL 30 DAY");
- ?>
- Nome: Telefone: Data de Nascimento: <br />
- <?php
- if (!$clientes) {
- echo "Nao ha clientes cadastrados.";
- }else {
- foreach ($clientes as $cliente) {
- if($cliente[$datanascimento] == $data) {
- echo "<strong> $cliente[$nome] $cliente[$telefone] ".Data::m($cliente[$datanascimento])."</strong>";
- }
- else {
- echo "$cliente[$nome] $cliente[$telefone] ".Data::m($cliente[$datanascimento]);
- }
- echo "<br />";
- }
- }
- ?>
Add Comment
Please, Sign In to add comment