diff --git a/htdocs/adherents/cotisation.class.php b/htdocs/adherents/cotisation.class.php
index 33d8dbef255..86f5d3b44b1 100644
--- a/htdocs/adherents/cotisation.class.php
+++ b/htdocs/adherents/cotisation.class.php
@@ -280,8 +280,8 @@ class Cotisation extends CommonObject
*/
function info($id)
{
- $sql = 'SELECT c.rowid, '.$this->db->pdate('c.datec').' as datec,';
- $sql.= ' '.$this->db->pdate('c.tms').' as datem';
+ $sql = 'SELECT c.rowid, c.datec,';
+ $sql.= ' c.tms as datem';
$sql.= ' FROM '.MAIN_DB_PREFIX.'cotisation as c';
$sql.= ' WHERE c.rowid = '.$id;
@@ -293,8 +293,8 @@ class Cotisation extends CommonObject
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
- $this->date_creation = $obj->datec;
- $this->date_modification = $obj->datem;
+ $this->date_creation = $this->db->jdate($obj->datec);
+ $this->date_modification = $this->db->jdate($obj->datem);
}
$this->db->free($result);
diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php
index e6e39f7d151..82695d5f97f 100644
--- a/htdocs/adherents/cotisations.php
+++ b/htdocs/adherents/cotisations.php
@@ -146,8 +146,8 @@ if ($msg) print $msg.'
';
// Liste des cotisations
$sql = "SELECT d.rowid, d.login, d.prenom, d.nom, d.societe,";
$sql.= " c.rowid as crowid, c.cotisation,";
-$sql.= " ".$db->pdate("c.dateadh")." as dateadh,";
-$sql.= " ".$db->pdate("c.datef")." as datef,";
+$sql.= " c.dateadh,";
+$sql.= " c.datef,";
$sql.= " c.fk_bank as bank, c.note,";
$sql.= " b.fk_account";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."cotisation as c";
@@ -157,7 +157,7 @@ if (isset($date_select) && $date_select != '')
{
$sql.= " AND dateadh LIKE '$date_select%'";
}
-$sql.= " ORDER BY $sortfield $sortorder";
+$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($conf->liste_limit+1, $offset);
$result = $db->query($sql);
@@ -229,7 +229,7 @@ if ($result)
print '
';
if ($allowinsertbankafter && $user->rights->banque->modifier && ! $objp->fk_account && $conf->banque->enabled && $conf->global->ADHERENT_BANK_USE && $objp->cotisation)
{
- print "trans("Subscriptions").' '.dol_print_date($objp->dateadh,"%Y")."\" >\n";
+ print "trans("Subscriptions").' '.dol_print_date($db->jdate($objp->dateadh),"%Y")."\" >\n";
// print " | | ";
// print " | ";
print '';
@@ -272,10 +272,10 @@ if ($result)
}
// Date start
- print ''.dol_print_date($objp->dateadh,'day')." | \n";
+ print ''.dol_print_date($db->jdate($objp->dateadh),'day')." | \n";
// Date end
- print ''.dol_print_date($objp->datef,'day')." | \n";
+ print ''.dol_print_date($db->jdate($objp->datef),'day')." | \n";
// Price
print ''.price($objp->cotisation).' | ';
diff --git a/htdocs/adherents/htpasswd.php b/htdocs/adherents/htpasswd.php
index a3df0d98f53..936571fa265 100644
--- a/htdocs/adherents/htpasswd.php
+++ b/htdocs/adherents/htpasswd.php
@@ -46,14 +46,14 @@ if (! isset($cotis))
-$sql = "SELECT d.login, d.pass, ".$db->pdate("d.datefin")." as datefin";
+$sql = "SELECT d.login, d.pass, d.datefin";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d ";
$sql .= " WHERE d.statut = $statut ";
if ($cotis==1)
{
$sql .= " AND datefin > ".$db->idate(mktime());
}
-$sql.= " ORDER BY $sortfield $sortorder";
+$sql.= $db->order($sortfield,$sortorder);
//$sql.=$db->plimit($conf->liste_limit, $offset);
$resql = $db->query($sql);
diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php
index e5825e19b8a..92e2d8d6984 100644
--- a/htdocs/adherents/index.php
+++ b/htdocs/adherents/index.php
@@ -189,11 +189,11 @@ print "
\n";
$max=5;
$sql = "SELECT a.rowid, a.statut, a.nom, a.prenom,";
-$sql.= " ".$db->pdate("a.tms")." as datem, ".$db->pdate("datefin")." as date_end_subscription,";
+$sql.= " a.tms as datem, datefin as date_end_subscription,";
$sql.= " ta.rowid as typeid, ta.libelle, ta.cotisation";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta";
$sql.= " WHERE a.fk_adherent_type = ta.rowid";
-$sql.= " ORDER BY a.tms DESC";
+$sql.= $db->order("a.tms","DESC");
$sql.= $db->plimit($max, 0);
$resql=$db->query($sql);
@@ -219,8 +219,8 @@ if ($resql)
$statictype->libelle=$obj->libelle;
print ''.$staticmember->getNomUrl(1,24).' | ';
print ''.$statictype->getNomUrl(1,16).' | ';
- print ''.dol_print_date($obj->datem,'dayhour').' | ';
- print ''.$staticmember->LibStatut($obj->statut,($obj->cotisation=='yes'?1:0),$obj->date_end_subscription,5).' | ';
+ print ''.dol_print_date($db->jdate($obj->datem),'dayhour').' | ';
+ print ''.$staticmember->LibStatut($obj->statut,($obj->cotisation=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).' | ';
print '';
$i++;
}
@@ -240,7 +240,7 @@ $Number=array();
$tot=0;
$numb=0;
-$sql = "SELECT c.cotisation, ".$db->pdate("c.dateadh")." as dateadh";
+$sql = "SELECT c.cotisation, c.dateadh";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."cotisation as c";
$sql.= " WHERE d.rowid = c.fk_adherent";
if(isset($date_select) && $date_select != '')
@@ -255,7 +255,7 @@ if ($result)
while ($i < $num)
{
$objp = $db->fetch_object($result);
- $year=dol_print_date($objp->dateadh,"%Y");
+ $year=dol_print_date($db->jdate($objp->dateadh),"%Y");
$Total[$year]=(isset($Total[$year])?$Total[$year]:0)+$objp->cotisation;
$Number[$year]=(isset($Number[$year])?$Number[$year]:0)+1;
$tot+=$objp->cotisation;
@@ -298,10 +298,6 @@ print '';
print '';
-
-
-
-
$db->close();
llxFooter('$Date$ - $Revision$');
diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php
index eb71071c33c..87511fb73bf 100644
--- a/htdocs/adherents/liste.php
+++ b/htdocs/adherents/liste.php
@@ -72,7 +72,7 @@ $form=new Form($db);
$membertypestatic=new AdherentType($db);
$sql = "SELECT d.rowid, d.login, d.prenom, d.nom, d.societe, ";
-$sql.= " ".$db->pdate("d.datefin")." as datefin,";
+$sql.= " d.datefin,";
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
$sql.= " t.libelle as type, t.cotisation";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
@@ -218,6 +218,8 @@ if ($resql)
{
$objp = $db->fetch_object($resql);
+ $datefin=$db->jdate($objp->datefin);
+
$adh=new Adherent($db);
// Nom
@@ -250,20 +252,20 @@ if ($resql)
// Statut
print '';
- print $adh->LibStatut($objp->statut,$objp->cotisation,$objp->datefin,2);
+ print $adh->LibStatut($objp->statut,$objp->cotisation,$datefin,2);
print " | ";
// Date fin cotisation
- if ($objp->datefin)
+ if ($datefin)
{
print '';
- if ($objp->datefin < time() && $objp->statut > 0)
+ if ($datefin < time() && $objp->statut > 0)
{
- print dol_print_date($objp->datefin,'day')." ".img_warning($langs->trans("SubscriptionLate"));
+ print dol_print_date($datefin,'day')." ".img_warning($langs->trans("SubscriptionLate"));
}
else
{
- print dol_print_date($objp->datefin,'day');
+ print dol_print_date($datefin,'day');
}
print ' | ';
}
diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php
index a13f0f11fed..4b839604369 100644
--- a/htdocs/adherents/type.php
+++ b/htdocs/adherents/type.php
@@ -333,7 +333,7 @@ if ($rowid > 0)
$membertypestatic=new AdherentType($db);
$sql = "SELECT d.rowid, d.login, d.prenom, d.nom, d.societe, ";
- $sql.= " ".$db->pdate("d.datefin")." as datefin,";
+ $sql.= " d.datefin,";
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
$sql.= " t.libelle as type, t.cotisation";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
@@ -484,6 +484,8 @@ if ($rowid > 0)
{
$objp = $db->fetch_object($resql);
+ $datefin=$db->jdate($objp->datefin);
+
$adh=new Adherent($db);
// Nom
@@ -517,20 +519,20 @@ if ($rowid > 0)
// Statut
print '';
- print $adh->LibStatut($objp->statut,$objp->cotisation,$objp->datefin,2);
+ print $adh->LibStatut($objp->statut,$objp->cotisation,$datefin,2);
print " | ";
// Date fin cotisation
- if ($objp->datefin)
+ if ($datefin)
{
print '';
- if ($objp->datefin < time() && $objp->statut > 0)
+ if ($datefin < time() && $objp->statut > 0)
{
- print dol_print_date($objp->datefin,'day')." ".img_warning($langs->trans("SubscriptionLate"));
+ print dol_print_date($datefin,'day')." ".img_warning($langs->trans("SubscriptionLate"));
}
else
{
- print dol_print_date($objp->datefin,'day');
+ print dol_print_date($datefin,'day');
}
print ' | ';
}
diff --git a/htdocs/core/menubase.class.php b/htdocs/core/menubase.class.php
index d5d27b6496f..316d4fe6e23 100644
--- a/htdocs/core/menubase.class.php
+++ b/htdocs/core/menubase.class.php
@@ -243,7 +243,7 @@ class Menubase
$sql.= " t.perms,";
$sql.= " t.enabled,";
$sql.= " t.usertype as user,";
- $sql.= " ".$this->db->pdate('t.tms')."";
+ $sql.= " t.tms";
$sql.= " FROM ".MAIN_DB_PREFIX."menu as t";
$sql.= " WHERE t.rowid = ".$id;
@@ -273,7 +273,7 @@ class Menubase
$this->perms = $obj->perms;
$this->enabled = $obj->enabled;
$this->user = $obj->user;
- $this->tms = $obj->tms;
+ $this->tms = $this->db->jdate($obj->tms);
}
$this->db->free($resql);
diff --git a/htdocs/imports/index.php b/htdocs/imports/index.php
index 5f8b37f53d2..dc8576af284 100644
--- a/htdocs/imports/index.php
+++ b/htdocs/imports/index.php
@@ -133,42 +133,6 @@ if (sizeof($import->array_import_code))
}
print '';
-/*
-// Affiche les profils d'exports
-$sql = "SELECT rowid, label, public, fk_user, ".$db->pdate("datec");
-$sql .= " FROM ".MAIN_DB_PREFIX."export as e";
-$result=$db->query($sql);
-if ($result)
-{
- print '
';
- print '';
- print '';
- print '| '.$langs->trans("ExportProfiles").' | ';
- print ''.$langs->trans("Public").' |
';
-
- $num = $db->num_rows($result);
- if ($num > 0)
- {
- $var = true;
- $i = 0;
-
- while ($i < $num )
- {
- $obj = $db->fetch_object($result);
- $var=!$var;
-
- print "";
- print '| '.$obj->label.' | ';
- print ''.$yn($obj->public).' | ';
- print '
';
- $i++;
- }
- }
-
- print "
";
-}
-*/
-
print '';
print '';