161
suico
Re: How does the notify function works?
  • 2005/6/28 15:34

  • suico

  • Friend of XOOPS

  • Posts: 374

  • Since: 2003/7/24


Thanks for the answer Julian,

I tried what you suggest, changing the code to pass a parameter via a GET variable but it did not work either.

I think it is not a must have for triggering the event.

Thanks very much to have taken a look at it.

If you have another idea on what it can be just let me know I will be really happy to find what it is, but now I have this doubt:

Is it really necessary to have the parameter via get for triggering the event?
Yogurt Social Network Service
Visit:http://www.marcellobrandao.eti.br/



162
suico
Re: How does the notify function works?
  • 2005/6/28 3:09

  • suico

  • Friend of XOOPS

  • Posts: 374

  • Since: 2003/7/24


Come on , please take a look on this, you coders will find my mistake, i have no one else to ask , sorry to insist :(
www.simcitybrasil.com.br/carros.zip
Yogurt Social Network Service
Visit:http://www.marcellobrandao.eti.br/



163
suico
Re: New module but Notify problem
  • 2005/6/27 18:16

  • suico

  • Friend of XOOPS

  • Posts: 374

  • Since: 2003/7/24


I read and read again the codes and lines of the script but can t find what s wrong, :(

Please do take a look at it.
Yogurt Social Network Service
Visit:http://www.marcellobrandao.eti.br/



164
suico
Re: New module but Notify problem
  • 2005/6/27 12:37

  • suico

  • Friend of XOOPS

  • Posts: 374

  • Since: 2003/7/24


Please can someone take a look at it? It is something simple for sure, just i have no idea of what it can be :(
Yogurt Social Network Service
Visit:http://www.marcellobrandao.eti.br/



165
suico
New module but Notify problem
  • 2005/6/24 15:06

  • suico

  • Friend of XOOPS

  • Posts: 374

  • Since: 2003/7/24


No one?
Yogurt Social Network Service
Visit:http://www.marcellobrandao.eti.br/



166
suico
Re: How does the notify function works?
  • 2005/6/24 3:00

  • suico

  • Friend of XOOPS

  • Posts: 374

  • Since: 2003/7/24


Did someone tried it ?
Yogurt Social Network Service
Visit:http://www.marcellobrandao.eti.br/



167
suico
Re: How does the notify function works?
  • 2005/6/23 21:44

  • suico

  • Friend of XOOPS

  • Posts: 374

  • Since: 2003/7/24


No Mith, no error messages when triggering, no php and no MySQL (debugger on).

I am putting a link to the files of the module translated in a poor english.

What it does:

It shows you vehicules separated in 3 kinds ( KOMBI, UNO and SAVEIRO).

You can reserve(book) one for you. Then if there are no more veicules of that kind to be booked (reserved)for one day and period then you can subscribe yourself to a waiting list.

The admin of the module can pressing the "set free" link for one car cancel a reserve and allow the first person in the waiting list automatically to the reserve. At this time the module should notify the user that he got a reserve but for an uncknown reason it does not :(

Try with the kombi model as there is only one veicule for this kind it will be faster for test ( if you try with UNO you have to reserve all 4 veicules on the morning afternoon or night to have the same efect)

www.suico.brturbo.com/carros.zip (may takes some time to load even beeing a small file)
try this place too (same file)
www.simcitybrasil.com.br/carros.zip



Please help me!
Yogurt Social Network Service
Visit:http://www.marcellobrandao.eti.br/



168
suico
Re: How does the notify function works?
  • 2005/6/23 2:23

  • suico

  • Friend of XOOPS

  • Posts: 374

  • Since: 2003/7/24


Thanks for the tip.
But i tried logging with one user and subscribing him to one event , then loging out and with another user logging in, going to the module and triggering the notification. Andit doesnot seem tobe this the problem :(

But thanks for trying...
Do you have another idea of what it can be?I am pretty syre this must be something stupid thati am missing ...



169
suico
Re: How does the notify function works?
  • 2005/6/22 12:54

  • suico

  • Friend of XOOPS

  • Posts: 374

  • Since: 2003/7/24


I must be doing something wrong, the triggerevent simly seems to be doing nothing:

<?php

###############################################  ---- INSERÇÕES DE OUTROS ARQUIVOS  ----------- ###############################
#INsere o cabeçalho e cria a formatação
include("../../mainfile.php");
#O cabeçalho do nosso módulo
include("header.php");
//$xoopsOption['show_rblock'] = 0;
#Vamos puxar os arquivos do calendário arrumadinho
if (file_exists(XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/calendar.php')) {
    include_once 
XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/calendar.php';
} else {
    include_once 
XOOPS_ROOT_PATH.'/language/english/calendar.php';
}
#Uma outra inclusão desta vez da classe de formulários
include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";

######################## ------ BUSCANDO DADOS DAS RESERVAS ---------- ########################################
#agora vamos puxar no banco as reservas para esse dia e turnos caso alguém não tenha cadastrado antes dele né
$codigo_da_reserva $_GET['cod'];

$quem_libera = !empty($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
if (
$xoopsUser && $xoopsUser->isAdmin($xoopsModule->mid())) {
$isadmin true;
} else {
$isadmin false;
}

if (
$isadmin)
{  



###################### --- Procurar lista de espera para o dia turno tipo ------ ################################
//vamos começar buscando os dados da reserva que está sendo liberada
$sql_reserva "SELECT * FROM ".$xoopsDB->prefix('carros_reservas').' , '.$xoopsDB->prefix('carros_carros')." WHERE ".$xoopsDB->prefix('carros_carros.placa').' = '.$xoopsDB->prefix('carros_reservas.placa').' AND cod_reserva='.$codigo_da_reserva;
$tabela_reserva $xoopsDB->query($sql_reserva) or exit("Erro ao conectar");

while (
$vetor $xoopsDB->fetchArray($tabela_reserva))
{
// Agora temos a data o turno e o modelo que estava reservado
$data_reserva $vetor['inicio'];
$turno_reserva $vetor['turno'];
$modelo_reserva $vetor['modelo'];
$placa_reserva $vetor['placa'];
}

// vamos atras do primeiro da lista se é que tem uma
$sql_reservas_espera "SELECT * FROM ".$xoopsDB->prefix('carros_espera')." WHERE lista_data_reserva ='".$data_reserva."' AND lista_turno ='".$turno_reserva."' AND lista_tipo='".$modelo_reserva."' AND cancela=0 LIMIT 0 , 1"
//echo $sql_reservas_espera;
//echo $sql_reservas_espera;
$tabela_reservas_espera $xoopsDB->query($sql_reservas_espera) or exit("Erro ao conectar sss");    
$qtd_espera $xoopsDB->getRowsNum($tabela_reservas_espera);



//print_r ($xoopsDB->fetchArray($tabela_reservas_espera));
while ($vetor2 $xoopsDB->fetchArray($tabela_reservas_espera))
{
// Agora temos a data o turno e o modelo que estava reservado
$uid_lista $vetor2['lista_uid'];
$trajeto_lista $vetor2['lista_trajeto'];
$ramal_lista $vetor2['lista_ramal'];
$data_ato_lista $vetor2['lista_data_registro'];
$cod_lista $vetor2['cod_lista'];
}
//vamos agora inserir a reserva no banco
$sql_insere "INSERT INTO ".$xoopsDB->prefix('carros_reservas')." (placa, uid, inicio, turno, trajeto, data_ato, ramal) values ('".$placa_reserva."',".$uid_lista.",'".$data_reserva."','".$turno_reserva."','".$trajeto_lista."', '".$data_ato_lista."' , '".$ramal_lista."')";
//echo '<br><br><br><br>'.$sql_insere;
$inserir=mysql_query($sql_insere);// or exit("Erro ao Inserir xx");

//vamos cancelar o item da lista de espera
$sql_cancela_espera "UPDATE ".$xoopsDB->prefix('carros_espera')." SET cancela='1' WHERE cod_lista=".$cod_lista;
//echo '<br><br><br><br>'.$sql_cancela_espera;
$inserir=mysql_query($sql_cancela_espera);


//echo ($cod_lista);


//vamos mudar o status da reserva para devolvido
$sql_libera "UPDATE ".$xoopsDB->prefix('carros_reservas')." SET devolvido='1' WHERE cod_reserva=".$codigo_da_reserva;

$liberar=mysql_query($sql_libera);

//Vamos avisar que mudou para reserva
$tags['A_NAME'] = '1';
$tags['A_URL'] = '2';

$notification_handler =& xoops_gethandler('notification');
$notification_handler->triggerEvent'Espera' $cod_lista 'Reserva' $tags );

if (
$qtd_espera==0)
{
redirect_header(XOOPS_URL."/modules/carros/index.php",10,'Este turno foi liberado com sucesso!<br>Não havia ninguém na lista de espera aguardando esta liberação');
}
redirect_header(XOOPS_URL."/modules/carros/index.php",15,'Este turno foi liberado com sucesso!<br>O primeiro da lista de espera assumiu a reserva!');

}
else
{
redirect_header(XOOPS_URL."/modules/carros/index.php",3,'Somente os administradores do módulo podem liberar uma reserva!');
}
## Rodapé que irá fechar conexões etc...
include(XOOPS_ROOT_PATH."/footer.php");



?>



170
suico
Re: How does the notify function works?
  • 2005/6/21 19:53

  • suico

  • Friend of XOOPS

  • Posts: 374

  • Since: 2003/7/24


Trying to help you to help me:



Resized Image

Even beeing subscribed i didn t receive a private message (it is my form of notification)
Anyone has a idea of what i am doing wrong?




TopTop
« 1 ... 14 15 16 (17) 18 19 20 ... 22 »



Login

Who's Online

223 user(s) are online (140 user(s) are browsing Support Forums)


Members: 0


Guests: 223


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits