";
-
- 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 ' '.$obj->societe.' | ';
-
- print ''.$obj->libelle.' | ';
- /*
- * Contact
- */
- print '';
- if ($obj->fk_contact) {
- $cont = new Contact($db);
- $cont->fetch($obj->fk_contact);
- print ''.$cont->fullname.'';
- } else {
- print " ";
- }
- print ' | ';
- /*
- *
- */
- print "$obj->code | \n";
-
+ if ( $db->query($sql) )
+ {
+ $num = $db->num_rows();
+ $i = 0;
+ print "";
+ print '';
+ print '| Date | ';
+ print 'Société | ';
+ print 'Action | ';
+ print 'Contact | ';
+ print "Auteur | ";
print "
\n";
- $i++;
+ $var=True;
+ while ($i < $num) {
+ $obj = $db->fetch_object( $i);
+
+ $var=!$var;
+
+ 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 ' '.$obj->societe.' | ';
+
+ print ''.$obj->libelle.' | ';
+ /*
+ * Contact
+ */
+ print '';
+ if ($obj->fk_contact)
+ {
+ $cont = new Contact($db);
+ $cont->fetch($obj->fk_contact);
+ print ''.$cont->fullname.'';
+ }
+ else
+ {
+ print " ";
+ }
+ print ' | ';
+ /*
+ *
+ */
+ print "$obj->code | \n";
+
+ print "
\n";
+ $i++;
+ }
+ print "
";
+ $db->free();
+ }
+ else
+ {
+ print $db->error() . ' ' . $sql ;
}
- print "