correction d'un bug dans la requete sql de la notification
This commit is contained in:
parent
391543bd6f
commit
88d00478b2
@ -58,8 +58,8 @@ class CommandeStats
|
|||||||
{
|
{
|
||||||
$sql .= " AND fk_soc = ".$this->socidp;
|
$sql .= " AND fk_soc = ".$this->socidp;
|
||||||
}
|
}
|
||||||
$sql .= " GROUP BY dm DESC";
|
//pas un group by mais un ORDER// $sql .= " GROUP BY dm DESC";
|
||||||
|
$sql .= " ORDER BY dm DESC";
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
$num = $this->db->num_rows();
|
$num = $this->db->num_rows();
|
||||||
|
|||||||
@ -29,6 +29,8 @@ if ($user->societe_id > 0)
|
|||||||
$socid = $user->societe_id;
|
$socid = $user->societe_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$socid = $_GET["socid"];
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
if ($_POST["action"] == 'add')
|
if ($_POST["action"] == 'add')
|
||||||
@ -36,7 +38,7 @@ if ($_POST["action"] == 'add')
|
|||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
|
||||||
$sql .= " WHERE fk_soc=".$socid." AND fk_contact=".$_POST["contactid"]." AND fk_action=".$_POST["actionid"];
|
$sql .= " WHERE fk_soc=".$socid." AND fk_contact=".$_POST["contactid"]." AND fk_action=".$_POST["actionid"];
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec,fk_soc, fk_contact, fk_action)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec,fk_soc, fk_contact, fk_action)";
|
||||||
$sql .= " VALUES (now(),$socid,".$_POST["contactid"].",".$_POST["actionid"].")";
|
$sql .= " VALUES (now(),$socid,".$_POST["contactid"].",".$_POST["actionid"].")";
|
||||||
|
|
||||||
@ -55,10 +57,10 @@ if ($_POST["action"] == 'add')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == "delete")
|
if ($_GET["action"] == 'delete')
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid=".$_GET["actid"].";";
|
||||||
$sql .= " WHERE rowid = $actid";
|
$db->query($sql);
|
||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
@ -72,6 +74,7 @@ if ($action == "delete")
|
|||||||
*/
|
*/
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
$soc->id = $_GET["socid"];
|
$soc->id = $_GET["socid"];
|
||||||
|
|
||||||
if ( $soc->fetch($soc->id) )
|
if ( $soc->fetch($soc->id) )
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -149,7 +152,6 @@ if ( $soc->fetch($soc->id) )
|
|||||||
{
|
{
|
||||||
$sortfield="c.name";
|
$sortfield="c.name";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<table width="100%" class="noborder" cellspacing="0" cellpadding="3">';
|
print '<table width="100%" class="noborder" cellspacing="0" cellpadding="3">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre_new ("Contact","fiche.php","c.name","","&socid=$socid",'',$sortfield);
|
print_liste_field_titre_new ("Contact","fiche.php","c.name","","&socid=$socid",'',$sortfield);
|
||||||
@ -171,7 +173,9 @@ if ( $soc->fetch($soc->id) )
|
|||||||
|
|
||||||
print '<tr '.$bc[$var].'><td>'.$obj->firstname . " ".$obj->name.'</td>';
|
print '<tr '.$bc[$var].'><td>'.$obj->firstname . " ".$obj->name.'</td>';
|
||||||
print '<td>'.$obj->titre.'</td>';
|
print '<td>'.$obj->titre.'</td>';
|
||||||
print '<td align="center"><a href="fiche.php?socid='.$socid.'&action=delete&actid='.$obj->rowid.'">'.img_delete().'</a>';
|
print'<td align="center">
|
||||||
|
<a href="fiche.php?socid='.$socid.'&action=delete&actid= '.$obj->rowid.'">'.img_delete().'</a>';
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,6 +55,7 @@ class User
|
|||||||
var $pass;
|
var $pass;
|
||||||
var $comm;
|
var $comm;
|
||||||
var $compta;
|
var $compta;
|
||||||
|
var $societe_id;
|
||||||
var $webcal_login;
|
var $webcal_login;
|
||||||
var $errorstr;
|
var $errorstr;
|
||||||
var $userpref_limite_liste;
|
var $userpref_limite_liste;
|
||||||
@ -729,8 +730,6 @@ class User
|
|||||||
$sql = "SELECT login FROM ".MAIN_DB_PREFIX."user WHERE login ='$this->login' AND rowid <> $this->id;";
|
$sql = "SELECT login FROM ".MAIN_DB_PREFIX."user WHERE login ='$this->login' AND rowid <> $this->id;";
|
||||||
|
|
||||||
|
|
||||||
$sql = "SELECT login FROM ".MAIN_DB_PREFIX."user WHERE login ='bennybe' AND
|
|
||||||
email = '$this->id';";
|
|
||||||
|
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user