61 |
$comm_names[$row[0]]= $row[1];//." ".$row[2]; |
$comm_names[$row[0]]= $row[1];//." ".$row[2]; |
62 |
} |
} |
63 |
} |
} |
64 |
|
$datetime = time(); |
65 |
foreach ($this->commerciaux as $commercial) |
foreach ($this->commerciaux as $commercial) |
66 |
{ |
{ |
67 |
$datas = array(); |
$datas = array(); |
69 |
$sql = "SELECT date_format(datepo, '%m'), sum(montant)"; |
$sql = "SELECT date_format(datepo, '%m'), sum(montant)"; |
70 |
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_contrat_priseordre as p"; |
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_contrat_priseordre as p"; |
71 |
$sql .= " WHERE p.fk_commercial = ".$commercial; |
$sql .= " WHERE p.fk_commercial = ".$commercial; |
72 |
|
$sql .= " AND date_format(datepo, '%Y') = '".strftime('%Y',$datetime)."'"; |
73 |
$sql .= " GROUP BY date_format(datepo, '%Y%m')"; |
$sql .= " GROUP BY date_format(datepo, '%Y%m')"; |
74 |
$resql = $this->db->query($sql); |
$resql = $this->db->query($sql); |
75 |
|
|