mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
rajout de la fonction de recherche sur les adherents
gestion (bagarre) avec les constantes
This commit is contained in:
parent
7325d7f98b
commit
f9ab95a34d
|
|
@ -66,6 +66,7 @@ if ($result)
|
|||
print "</table>";
|
||||
|
||||
print '<form action="liste.php" method="post" name="action" value="search">';
|
||||
print '<input type="hidden" name="action" value="search">';
|
||||
print '<p><TABLE border="0" cellspacing="0" cellpadding="4">';
|
||||
print '<TR class="liste_titre">';
|
||||
print "<td>Rechercher un adhérent</td>";
|
||||
|
|
|
|||
|
|
@ -31,7 +31,16 @@ if ($sortfield == "") { $sortfield="d.nom"; }
|
|||
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
|
||||
/*
|
||||
* SIZE_LISTE_LIMIT : constante de taille maximale des listes
|
||||
*/
|
||||
if (defined("SIZE_LISTE_LIMIT"))
|
||||
{
|
||||
$conf->liste_limit=SIZE_LISTE_LIMIT;
|
||||
}
|
||||
|
||||
$offset = $conf->liste_limit * $page ;
|
||||
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
|
|
@ -44,6 +53,12 @@ $sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, ".$db->pdate("d.datefin")."
|
|||
$sql .= " , d.email, t.libelle as type, d.morphy, d.statut, t.cotisation";
|
||||
$sql .= " FROM llx_adherent as d, llx_adherent_type as t";
|
||||
$sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = $statut";
|
||||
if ( $_POST["action"] == 'search')
|
||||
{
|
||||
if (isset($_POST['search']) && $_POST['search'] != ''){
|
||||
$sql .= " AND (d.prenom LIKE '%".$_POST['search']."%' OR d.nom LIKE '%".$_POST['search']."%')";
|
||||
}
|
||||
}
|
||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset);
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
|
@ -72,9 +87,14 @@ if ($result)
|
|||
print_liste_field_titre("Type",$PHP_SELF,"t.libelle","&page=$page&statut=$statut");
|
||||
print "</td>\n";
|
||||
|
||||
print "<td>";
|
||||
print_liste_field_titre("Personne",$PHP_SELF,"d.morphy","&page=$page&statut=$statut");
|
||||
print "</td>\n";
|
||||
|
||||
print "<td>";
|
||||
print_liste_field_titre("Statut",$PHP_SELF,"d.statut","&page=$page&statut=$statut");
|
||||
print "</td>\n";
|
||||
|
||||
print "<td><a href=\"".$_SERVER['SCRIPT_NAME'] . "?page=$page&statut=$statut&sortorder=ASC&sortfield=d.morphy\">Personne</a></td>\n";
|
||||
print "<td><a href=\"".$_SERVER['SCRIPT_NAME'] . "?page=$page&statut=$statut&sortorder=ASC&sortfield=d.statut\">Statut</a></td>\n";
|
||||
print "<td>Action</td>\n";
|
||||
print "</TR>\n";
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ llxHeader();
|
|||
|
||||
print_titre("Constantes de configuration Dolibarr");
|
||||
|
||||
//print_r(get_defined_constants());
|
||||
|
||||
print '<table border="1" cellpadding="3" cellspacing="0">';
|
||||
print '<TR class="liste_titre">';
|
||||
print '<TD>Nom</TD>';
|
||||
|
|
@ -36,31 +38,34 @@ print "</TR>\n";
|
|||
$db = new Db();
|
||||
$form = new Form($db);
|
||||
|
||||
if ($HTTP_POST_VARS["action"] == 'update' || $HTTP_POST_VARS["action"] == 'add')
|
||||
if ($user->admin)
|
||||
{
|
||||
|
||||
if ($HTTP_POST_VARS["consttype"] == 0){
|
||||
$sql = "REPLACE INTO llx_const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."', type='yesno'";
|
||||
}else{
|
||||
$sql = "REPLACE INTO llx_const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."'";
|
||||
}
|
||||
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (!$result)
|
||||
if ($HTTP_POST_VARS["action"] == 'update' || $HTTP_POST_VARS["action"] == 'add')
|
||||
{
|
||||
print $db->error();
|
||||
|
||||
if ($HTTP_POST_VARS["consttype"] == 0){
|
||||
$sql = "REPLACE INTO llx_const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."', type='yesno'";
|
||||
}else{
|
||||
$sql = "REPLACE INTO llx_const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."'";
|
||||
}
|
||||
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (!$result)
|
||||
{
|
||||
print $db->error();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$sql = "DELETE FROM llx_const WHERE rowid='$rowid'";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (!$result)
|
||||
if ($action == 'delete')
|
||||
{
|
||||
print $db->error();
|
||||
$sql = "DELETE FROM llx_const WHERE rowid='$rowid'";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (!$result)
|
||||
{
|
||||
print $db->error();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ if ($result)
|
|||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object( $i);
|
||||
define ($objp->name, $objp->value);
|
||||
define ("$objp->name", $objp->value);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
|
@ -196,12 +196,14 @@ Function left_menu($menu)
|
|||
|
||||
}
|
||||
|
||||
if (defined(MAIN_SEARCHFORM_SOCIETE) or defined(MAIN_SEARCHFORM_CONTACT))
|
||||
if ((defined("MAIN_SEARCHFORM_SOCIETE") && MAIN_SEARCHFORM_SOCIETE > 0)|| (defined("MAIN_SEARCHFORM_CONTACT") && MAIN_SEARCHFORM_CONTACT > 0))
|
||||
{
|
||||
print '<tr><td class="barre" valign="top" align="right">';
|
||||
|
||||
if (defined(MAIN_SEARCHFORM_SOCIETE) && MAIN_SEARCHFORM_SOCIETE > 0)
|
||||
|
||||
if (defined("MAIN_SEARCHFORM_SOCIETE") && MAIN_SEARCHFORM_SOCIETE > 0)
|
||||
{
|
||||
// print constant("MAIN_SEARCHFORM_SOCIETE");
|
||||
// echo MAIN_SEARCHFORM_SOCIETE."==MAIN_SEARCHFORM_SOCIETE; le type est " . gettype( MAIN_SEARCHFORM_SOCIETE ) . "<br>\n";
|
||||
print '<A class="menu" href="/comm/clients.php3">Societes</A>';
|
||||
print '<form action="/comm/clients.php3">';
|
||||
print '<input type="hidden" name="mode" value="search">';
|
||||
|
|
@ -211,7 +213,7 @@ Function left_menu($menu)
|
|||
print '</form>';
|
||||
}
|
||||
|
||||
if (defined(MAIN_SEARCHFORM_CONTACT) && MAIN_SEARCHFORM_CONTACT > 0)
|
||||
if (defined("MAIN_SEARCHFORM_CONTACT") && MAIN_SEARCHFORM_CONTACT > 0)
|
||||
{
|
||||
print '<A class="menu" href="/comm/contact.php3">Contacts</A>';
|
||||
print '<form action="/comm/contact.php3">';
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user