mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
Ajout fonction de gestion des departements
This commit is contained in:
@@ -32,6 +32,40 @@ class Form {
|
||||
|
||||
return 1;
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
Function select_departement($selected='', $addnsp=0)
|
||||
{
|
||||
print '<select name="departement_id">';
|
||||
|
||||
$sql = "SELECT rowid, code_departement as code , nom, active FROM llx_c_departements";
|
||||
$sql .= " WHERE active = 1 ORDER BY code ASC";
|
||||
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
$num = $this->db->num_rows();
|
||||
$i = 0;
|
||||
if ($num)
|
||||
{
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object( $i);
|
||||
if ($selected == $obj->rowid)
|
||||
{
|
||||
print '<option value="'.$obj->rowid.'" SELECTED>['.$obj->code.'] '.$obj->nom.'</option>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<option value="'.$obj->rowid.'">['.$obj->code.'] '.$obj->nom.'</option>';
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
print '</select>';
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user