예제 #1
0
$id = GETPOST('id', 'int');
$action = GETPOST('action');
$html = new Form($db);
$htmlimmo = new FormImmobilier($db);
/*
 * Actions
 */
if (GETPOST("action") == 'add') {
    $local = new Local($db);
    $local->nom = GETPOST("nom");
    $local->adresse = GETPOST("adresse");
    $local->commentaire = GETPOST("commentaire");
    $local->statut = GETPOST("statut");
    $local->immeuble_id = GETPOST("immeuble_id");
    $e_local = $local;
    $res = $local->create($user);
    if ($res == 0) {
        Header("Location: " . DOL_URL_ROOT . "/immobilier/local.php");
    } else {
        if ($res == -3) {
            $_error = 1;
            $action = "create";
        }
        if ($res == -4) {
            $_error = 2;
            $action = "create";
        }
    }
} elseif (GETPOST("action") == 'maj') {
    $local = new Local($db, GETPOST('id'));
    $local->nom = GETPOST("nom");
예제 #2
0
 public function run()
 {
     DB::table('Locales')->delete();
     Local::create(array('nombre' => 'Cine Superseis', 'direccion' => 'Mcal Lopez', 'telefono' => '0214445555', 'funcionarioId' => '1'));
 }