// Affichage de la fiche des mandat gere if ($id) { print_barre_liste($langs->trans("Gestion des Bien Immobilier"), "", "", "", "", "", '', 0); $agf = new Mandat($db); $result = $agf->fetch($id); if ($result) { $head = mandat_prepare_head($agf); dol_fiche_head($head, 'fiche', $langs->trans("Gestion des Mandats"), 0, 'contrat'); // reference propio $soc = new Societe($db); $soc->fetch($agf->fk_soc); // Affichage en mode "édition" if ($action == 'edit') { $formcompany = new FormCompany($db); // TODO $formimmo = new FormImmobilier($db); print_barre_liste($langs->trans("Modification Mandat"), "", "", "", "", "", '', 0); // debut formulaire mis a jours mandat print '<form name="update" action="' . $_SERVER['PHP_SELF'] . '" method="post">' . "\n"; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">' . "\n"; print '<input type="hidden" name="action" value="update">' . "\n"; print '<input type="hidden" name="id" value="' . $id . '">' . "\n"; print '<table class="border" width="100%">' . "\n"; // referance mandat interne print '<tr><td>' . $langs->trans("REF interne") . '</td>'; print '<td><input name="ref_interne" class="flat" size="50" value="' . $agf->ref_interne . '"></td></tr>'; // numero id a cacher par la suite // print '<tr><td width="30%">'.$langs->trans("Id").'</td>'; // print '<td>'.$agf->id.'</td></tr>'; // TODO warnig creation porprion obligatoire // proprio
if (!$res && file_exists("../../../main.inc.php")) { $res = @(include "../../../main.inc.php"); } if (!$res) { die("Include of main fails"); } dol_include_once("/immobilier/class/contrat.class.php"); dol_include_once('/immobilier/lib/immobilier.lib.php'); dol_include_once('/immobilier/class/html.immobilier.php'); // Langs $langs->load("immobilier@immobilier"); $mesg = ''; $id = GETPOST('id', 'int'); $action = GETPOST('action'); $html = new Form($db); $htmlimmo = new FormImmobilier($db); if (GETPOST("action") == 'add') { $datect = @dol_mktime($_POST["datecthour"], $_POST["datectmin"], $_POST["datectsec"], $_POST["datectmonth"], $_POST["datectday"], $_POST["datectyear"]); $contrat = new Contrat($db); $contrat->local_id = GETPOST("local_id"); $contrat->locataire_id = GETPOST("locataire_id"); $contrat->date_entree = $datect; $contrat->montant_tot = GETPOST("montant_tot"); $contrat->loy = GETPOST("loy"); $contrat->charges = GETPOST("charges"); $contrat->tva = GETPOST("tva"); $contrat->periode = GETPOST("periode"); $contrat->depot = GETPOST("depot"); $contrat->commentaire = GETPOST("commentaire"); $contrat->proprietaire_id = GETPOST("proprietaire_id"); $e_contrat = $contrat;
$res = @(include "../../../main.inc.php"); } if (!$res) { die("Include of main fails"); } dol_include_once("/immobilier/class/local.class.php"); dol_include_once('/immobilier/lib/immobilier.lib.php'); dol_include_once('/immobilier/class/html.immobilier.php'); dol_include_once('/immobilier/class/immeuble.class.php'); // Langs $langs->load("immobilier@immobilier"); $mesg = ''; $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 {
$immeuble->town = GETPOST("town"); $immeuble->longitude = GETPOST("longitude"); $immeuble->latitude = GETPOST("latitude"); $e_immeuble = $immeuble; $res = $immeuble->update(); header("Location: " . DOL_URL_ROOT . "/immobilier/immeuble/fiche_immeuble.php?id=" . $immeuble->id); if ($res >= 0) { setEventMessage($langs->trans("SocialContributionAdded"), 'mesgs'); } else { dol_print_error($db); } } /* * Cr�ation d'un immeuble */ $formimmo = new FormImmobilier($db); if ($action == 'create') { $title = $action == 'create' ? $langs->trans("Creation Immeuble") : $langs->trans("Visu bail"); llxHeader('', $title); $nbligne = 0; print '<form action="fiche_immeuble.php" method="post">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="add">'; print '<table class="border" width="100%">'; print '<tr><td width="20%">' . $langs->trans("nom") . '</td>'; print '<td><input name="nom" size="70" value="' . $immeuble->nom . '"</td>'; print '<td width="20%">' . $langs->trans("nblocaux") . '</td>'; print '<td><input name="nblocaux" size="10" value="' . $immeuble->nblocaux . '"</td></tr>'; print '<tr><td width="20%">' . $langs->trans("numero") . '</td>'; print '<td><input name="numero" size="10" value="' . $immeuble->numero . '"</td>'; print '<td width="20%">' . $langs->trans("street") . '</td>';
$res = @(include "../../../main.inc.php"); } if (!$res) { die("Include of main fails"); } // class dol_include_once("/immobilier/class/charge.class.php"); dol_include_once('/immobilier/lib/immobilier.lib.php'); dol_include_once('/immobilier/class/html.immobilier.php'); // langs $langs->load("immobilier@immobilier"); $mesg = ''; $id = GETPOST('id', 'int'); $action = GETPOST('action'); $html = new Form($db); $htmlimmo = new FormImmobilier($db); if (GETPOST("action") == 'add') { $dateacq = @dol_mktime($_POST["acqhour"], $_POST["acqmin"], $_POST["acqsec"], $_POST["acqmonth"], $_POST["acqday"], $_POST["acqyear"]); $datedu = @dol_mktime($_POST["duhour"], $_POST["dumin"], $_POST["dusec"], $_POST["dumonth"], $_POST["duday"], $_POST["duyear"]); $dateau = @dol_mktime($_POST["auhour"], $_POST["aumin"], $_POST["ausec"], $_POST["aumonth"], $_POST["auday"], $_POST["auyear"]); $charge = new Charge($db); $charge->local_id = GETPOST("local_id"); $charge->libelle = GETPOST("libelle"); $fournisseur = GETPOST("fournisseur"); $nouveau_fournisseur = GETPOST("nouveau_fournisseur"); if (!empty($nouveau_fournisseur)) { $charge->fournisseur = $nouveau_fournisseur; } elseif (!empty($fournisseur)) { $charge->fournisseur = $fournisseur; } $charge->local_id = GETPOST("local_id");
die("Include of main fails"); } dol_include_once("/immobilier/class/local.class.php"); dol_include_once("/immobilier/class/relever.class.php"); dol_include_once("/immobilier/class/compteur.class.php"); dol_include_once("/immobilier/class/compteur_local.class.php"); dol_include_once('/immobilier/lib/immobilier.lib.php'); dol_include_once('/immobilier/class/html.immobilier.php'); dol_include_once('/immobilier/class/immeuble.class.php'); // Langs $langs->load("immobilier@immobilier"); $mesg = ''; $id = GETPOST('id', 'int'); $action = GETPOST('action'); $html = new Form($db); $htmlimmo = new FormImmobilier($db); /* * Action */ if ($action == 'addcompteur') { $nom_compteur = GETPOST('nom_compteur', 'alpha'); $type_compteur = GETPOST('type_compteur', 'int'); //Create Compteur $compteur = new Immocompteur($db); $compteur->label = $nom_compteur; $compteur->type = $type_compteur; $result = $compteur->create($user); if ($result < 0) { setEventMessage($compteur->error, 'errors'); } //Link compteur to local
print '<td><input name="Honoraire" class="flat" size="10" value="'.$agf->Honoraire.'"></td>'; print '<tr><td>'.$langs->trans("Assurance").'</td>'; print '<td><input name="Assurance" class="flat" size="10" value="'.$agf->Assurance.'"></td>'; */ print '</table>'; print '</div>'; print '<table style=noborder align="right">'; print '<tr><td align="center" colspan=2>'; print '<input type="submit" class="butAction" value="' . $langs->trans("Save") . '"> '; // print '<input type="submit" name="importadress" class="butAction" value="'.$langs->trans("AgfImportCustomerAdress").'"> '; print '<input type="submit" name="cancel" class="butActionDelete" value="' . $langs->trans("Cancel") . '">'; print '</td></tr>'; print '</table>'; print '</form>'; print '</div>' . "\n"; } } else { $formimmo = new FormImmobilier($db); print_barre_liste($langs->trans("Modification biens"), "", "", "", "", "", '', 0); print '<tr><td>' . $langs->trans("bail") . '</td>'; print '<td><input name="ref" class="flat" size="50" value="' . $gestimmo->rowid . '"></td></tr>'; // TO DO remplace select_compagy pae select_mandat, rajouter select locataire et select proprio print '<tr><td>' . $langs->trans("Mandat") . '</td>'; print '<td>' . $formimmo->select_mandat($gestimmo->fk_mandat, 'fk_mandat', '', 0, 1) . '</td></tr>'; print '<tr><td>' . $langs->trans("fk_loc") . '</td>'; print '<td><input name="fk_loc" class="flat" size="50" value="' . $gestimmo->fk_loc . '"></td>'; print '<tr><td>' . $langs->trans("fk_logement") . '</td>'; print '<td><input name="fk_logement" class="flat" size="50" value="' . $gestimmo->fk_logement . '"></td>'; } } }
if (!$res && file_exists("../../../main.inc.php")) { $res = @(include "../../../main.inc.php"); } if (!$res) { die("Include of main fails"); } dol_include_once("/immobilier/class/locataire.class.php"); dol_include_once('/immobilier/lib/immobilier.lib.php'); dol_include_once('/immobilier/class/html.immobilier.php'); // Langs $langs->load("immobilier@immobilier"); $mesg = ''; $id = GETPOST('id', 'int'); $action = GETPOST('action'); $html = new Form($db); $htmlimmo = new FormImmobilier($db); /* * Cr�ation d'un courrier * */ llxheader('', $langs->trans("letter"), ''); $html = new Form($db); $nbligne = 0; $locataire = new Locataire($db, GETPOST('id')); $head = locataire_prepare_head($locataire); dol_fiche_head($head, 'letter', $langs->trans("letter"), 0, 'renter'); print '<form action="fiche_locataire.php" method="post">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="maj">'; print '<input type="hidden" name="id" value="' . GETPOST("id") . '">' . "\n"; print '<table class="border" width="100%">';