".$msg["admin_location_list_title"]."";
print list_configuration_docs_location_ui::get_instance()->get_display_list();
if($pmb_location_reservation) {
$form_res_location=
"
".$msg["admin_location_resa_title"]."
";
print $form_res_location;
}
}
$id = intval($id);
switch($action) {
case 'update':
global $form_libelle;
// vérification validité des données fournies.
if($form_actif) {
$requete = " SELECT count(1) FROM docs_location WHERE (location_libelle='$form_libelle' AND idlocation!='$id' ) LIMIT 1 ";
$res = pmb_mysql_query($requete);
$nbr = pmb_mysql_result($res, 0, 0);
if ($nbr > 0) {
error_form_message($form_libelle.$msg["docs_label_already_used"]);
} else {
$docs_location = new docs_location($id);
$docs_location->set_properties_from_form();
$docs_location->save();
}
}
show_location();
break;
case 'add':
$docs_location = new docs_location();
print $docs_location->get_form();
break;
case 'resa_loc':
global $matrice_loc;
if($form_actif) {
$requete = "truncate table resa_loc";
pmb_mysql_query($requete);
if(is_array($matrice_loc))foreach($matrice_loc as $loc_bibli=>$val) {
foreach($val as $loc_empr=>$val1) {
$requete = "INSERT INTO resa_loc SET resa_loc='$loc_bibli', resa_emprloc='$loc_empr'";
pmb_mysql_query($requete);
}
}
}
show_location();
break;
case 'modif':
$docs_location = new docs_location($id);
if(pmb_error::get_instance('docs_location')->has_error()) {
pmb_error::get_instance('docs_location')->display(1, 'admin.php?categ=docs&sub=location&action=');
} else {
print $docs_location->get_form();
}
break;
case 'del':
$deleted = docs_location::delete($id);
if($deleted) {
show_location();
} else {
pmb_error::get_instance('docs_location')->display(1, 'admin.php?categ=docs&sub=location&action=');
}
break;
default:
show_location();
break;
}