';
- print '';
-
- $sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid ";
- $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u ";
- $sql .= " WHERE a.fk_soc = $societe->id ";
- $sql .= " AND u.rowid = a.fk_user_author";
- $sql .= " AND c.id=a.fk_action AND a.percent = 100";
- $sql .= " ORDER BY a.datea DESC, a.id DESC";
if ( $db->query($sql) )
{
- print '';
-
+
$i = 0 ;
$num = $db->num_rows();
- $oldyear='';
- $oldmonth='';
- while ($i < $num)
+
+ if ($num)
{
- $var = !$var;
+
+ print '';
+ print '| Actions effectuées | ';
+ print '';
+ print '| ';
- $obj = $db->fetch_object( $i);
- print " | ";
+ $sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid ";
+ $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u ";
+ $sql .= " WHERE a.fk_soc = $societe->id ";
+ $sql .= " AND u.rowid = a.fk_user_author";
+ $sql .= " AND c.id=a.fk_action AND a.percent = 100";
+ $sql .= " ORDER BY a.datea DESC, a.id DESC";
- if ($oldyear == strftime("%Y",$obj->da) )
- {
- print '| | | ';
- }
- else
- {
- print "" .strftime("%Y",$obj->da)." | \n";
- $oldyear = strftime("%Y",$obj->da);
- }
+ print '';
- if ($oldmonth == strftime("%Y%b",$obj->da) )
- {
- print '| | | ';
- }
- else
- {
- print "" .strftime("%b",$obj->da)." | \n";
- $oldmonth = strftime("%Y%b",$obj->da);
- }
-
- print "" .strftime("%d",$obj->da)." | \n";
- print "" .strftime("%H:%M",$obj->da)." | \n";
- print ' | ';
- if ($obj->propalrowid)
+ $oldyear='';
+ $oldmonth='';
+ while ($i < $num)
{
- print ''.$obj->libelle.' | ';
+ $var = !$var;
+
+ $obj = $db->fetch_object( $i);
+ print "";
+
+ if ($oldyear == strftime("%Y",$obj->da) )
+ {
+ print '| | | ';
+ }
+ else
+ {
+ print "" .strftime("%Y",$obj->da)." | \n";
+ $oldyear = strftime("%Y",$obj->da);
+ }
+
+ if ($oldmonth == strftime("%Y%b",$obj->da) )
+ {
+ print '| | ';
+ }
+ else
+ {
+ print "" .strftime("%b",$obj->da)." | \n";
+ $oldmonth = strftime("%Y%b",$obj->da);
+ }
+
+ print "" .strftime("%d",$obj->da)." | \n";
+ print "" .strftime("%H:%M",$obj->da)." | \n";
+
+ print ' | ';
+
+ print '';
+ if ($obj->propalrowid)
+ {
+ print ''.img_file().' ';
+ print ''.$obj->libelle.' | ';
+ }
+ else
+ {
+ print ''.img_file().' ';
+ print ''.$obj->libelle.'';
+ }
+ /*
+ * Contact pour cette action
+ *
+ */
+ if ($obj->fk_contact)
+ {
+ $contact = new Contact($db);
+ $contact->fetch($obj->fk_contact);
+ print ''.$contact->fullname.' | ';
+ }
+ else
+ {
+ print ' | ';
+ }
+ /*
+ */
+ print ''.$obj->code.' | ';
+ print " \n";
+ $i++;
}
- else
- {
- print ''.$obj->libelle.' | ';
- }
- /*
- * Contact pour cette action
- *
- */
- if ($obj->fk_contact)
- {
- $contact = new Contact($db);
- $contact->fetch($obj->fk_contact);
- print ''.$contact->fullname.' | ';
- }
- else
- {
- print ' | ';
- }
- /*
- */
- print ''.$obj->code.' | ';
- print "\n";
- $i++;
- }
- print " ";
-
+ print " ";
+ print " ";
+ }
$db->free();
}
else
{
print $db->error();
}
- print " |