WHERE="WHERE titre ILIKE '%pot%' "
fi
-psql bde -c "SELECT * FROM activites ${WHERE}ORDER BY debut DESC;"
+psql note -c "SELECT * FROM activites ${WHERE}ORDER BY debut DESC;"
export LESS='-S'
-psql bde -c "
- SELECT t.id,t.date,t.quantite,t.montant,t.remarque,t.valide,t.emetteur,t.destinataire,
+psql note -c "
+ SELECT t.id,t.date,t.quantite,t.montant,t.description,t.valide,t.emetteur,t.destinataire,
adhe.pseudo AS emetteur, adhd.pseudo AS destinataire
- FROM transactions AS t, adherents AS adhe, adherents AS adhd
- WHERE $1 in (emetteur, destinataire) AND t.emetteur=adhe.numcbde AND t.destinataire=adhd.numcbde AND valide
+ FROM transactions AS t, comptes AS adhe, comptes AS adhd
+ WHERE $1 in (emetteur, destinataire) AND t.emetteur=adhe.idbde AND t.destinataire=adhd.idbde AND valide
ORDER BY date DESC;"
if [ $i = "--no-mail" ]
then nomail=1;
fi;
- if [ $i = "--numcbde" ]
- then searchnumcbde=1;
+ if [ $i = "--idbde" ]
+ then searchidcbde=1;
fi
done
# Si on n'a *pas* mis --no-mail (too many negations, I know)
if [ -z "${nomail}" ]
then
- adding=" OR email ILIKE '%$1%'"
+ adding=" OR mail ILIKE '%$1%'"
fi
-# Si on a mis --numcbde, il faut matcher numcbde de manière plus lâche
-if [ "${searchnumcbde}" = "1" ]
+# Si on a mis --idcbde, il faut matcher numcbde de manière plus lâche
+if [ "${searchidcbde}" = "1" ]
then
wild="%"
fi
-psql bde -c "SELECT * FROM adherents WHERE pseudo ILIKE '%$1%' OR nom ILIKE '%$1%'
- OR prenom ILIKE '%$1%'${adding} OR CAST(numcbde AS varchar) LIKE '${wild}$1${wild}' ORDER BY nom;"
+psql note -c "SELECT * FROM comptes WHERE pseudo ILIKE '%$1%' OR nom ILIKE '%$1%'
+ OR prenom ILIKE '%$1%'${adding} OR CAST(idbde AS varchar) LIKE '${wild}$1${wild}' ORDER BY nom;"