diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 89cdca7591b..7b6f8776d3a 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -110,51 +110,44 @@ $listOfConferences = $listOfBooths = ''.$langs->trans('Label').' '.$langs->trans('DateStart').' '.$langs->trans('DateEnd').' '.$langs->trans('Thirdparty').' - '.$langs->trans('Note').''; + '.$langs->trans('Note').''; - -// For conferences $sql = "SELECT a.id, a.fk_action, a.datep, a.datep2, a.label, a.fk_soc, a.note, ca.libelle FROM ".MAIN_DB_PREFIX."actioncomm as a INNER JOIN ".MAIN_DB_PREFIX."c_actioncomm as ca ON (a.fk_action=ca.id) - WHERE ca.module='conference@eventorganization' - AND a.status<2"; -$result = $db->query($sql); + WHERE a.status<2"; +$sqlforconf = $sql." AND ca.module='conference@eventorganization'"; +$sqlforbooth = $sql." AND ca.module='booth@eventorganization'"; + + +// For conferences +$result = $db->query($sqlforconf); $i = 0; while ($i < $db->num_rows($result)) { $obj = $db->fetch_object($result); - $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc); if ($resultthirdparty) { $thirdpartyname = $tmpthirdparty->name; } else { $thirdpartyname = ''; } - $listOfConferences .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; $listOfConferences .= ''; $i++; } // For booths -$sql = "SELECT a.id, a.fk_action, a.datep, a.datep2, a.label, a.fk_soc, a.note, ca.libelle - FROM ".MAIN_DB_PREFIX."actioncomm as a - INNER JOIN ".MAIN_DB_PREFIX."c_actioncomm as ca ON (a.fk_action=ca.id) - WHERE ca.module='booth@eventorganization' - AND a.status<2"; -$result = $db->query($sql); +$result = $db->query($sqlforbooth); $i = 0; while ($i < $db->num_rows($result)) { $obj = $db->fetch_object($result); - $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc); if ($resultthirdparty) { $thirdpartyname = $tmpthirdparty->name; } else { $thirdpartyname = ''; } - $listOfBooths .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; $listOfBooths .= ''; $i++;