Skip to content
Snippets Groups Projects
Commit 2d0a323c authored by Rodolphe Quiedeville's avatar Rodolphe Quiedeville
Browse files

Ajout lecture du user create

parent 0ffc7ea6
No related branches found
No related tags found
No related merge requests found
......@@ -157,7 +157,7 @@ class TelephonieContrat {
$sql = "SELECT c.rowid, c.ref, c.fk_client_comm, c.fk_soc, c.fk_soc_facture, c.note";
$sql .= ", c.fk_commercial_sign, c.fk_commercial_suiv";
$sql .= ", c.isfacturable, c.mode_paiement";
$sql .= ", c.fk_user_creat, c.date_creat";
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_contrat as c";
$sql .= " WHERE c.rowid = ".$id;
......@@ -183,6 +183,8 @@ class TelephonieContrat {
$this->mode_paiement = $obj->mode_paiement;
$this->code_analytique = $obj->code_analytique;
$this->user_creat = $obj->fk_user_creat;
if ($obj->isfacturable == 'oui')
{
$this->facturable = 1;
......@@ -256,6 +258,55 @@ class TelephonieContrat {
return $this->db->query($sql);
}
/*
*
*
*/
function count_associated_services()
{
$num = 0;
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."telephonie_contrat_service";
$sql .= " WHERE fk_contrat=".$this->id;
if ( $this->db->query( $sql) )
{
$num = $this->db->num_rows();
}
return $num;
}
/*
*
*
*/
function add_service($user, $sid)
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."telephonie_contrat_service";
$sql .= " (fk_contrat, fk_service, fk_user_creat, date_creat) ";
$sql .= " VALUES ($this->id, $sid, $user->id, now() )";
if ($this->db->query($sql) )
{
return 0 ;
}
}
/*
*
*
*/
function remove_service($user, $sid)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."telephonie_contrat_service";
$sql .= " (fk_contrat, fk_service, fk_user_creat, date_creat) ";
$sql .= " VALUES ($this->id, $sid, $user->id, now() )";
if ($this->db->query($sql) )
{
return 0 ;
}
}
}
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment