if (!$res) { die("Include of main fails"); } // Class dol_include_once("/immobilier/class/contrat.class.php"); dol_include_once('/immobilier/lib/immobilier.lib.php'); // Langs $langs->load("immobilier@immobilier"); $id = GETPOST('id', 'int'); $mesg = ''; $limit = $conf->liste_limit; /* * loyer et paiement par contrat * */ llxheader('', $langs->trans("bilancontrat"), ''); $contrat = new Contrat($db); $result = $contrat->fetch($id); $head = contrat_prepare_head($contrat); dol_fiche_head($head, 'info', $langs->trans("Imoinfo"), 0, 'agreement'); $sql = "(SELECT l.periode_du as date , l.montant_tot as debit, 0 as credit , l.nom as des"; $sql .= " FROM " . MAIN_DB_PREFIX . "immo_loyer as l"; $sql .= " WHERE l.contrat_id =" . $id; $sql .= ")"; $sql .= "UNION (SELECT p.date_paiement as date, 0 as debit , p.montant as credit, p.commentaire as des"; $sql .= " FROM " . MAIN_DB_PREFIX . "immo_paie as p"; $sql .= " WHERE p.contrat_id =" . $id; $sql .= ")"; $sql .= "ORDER BY date"; $result = $db->query($sql); if ($result) {
print '<table class="border" width="100%">'; print '<tr><td width="20%">Nom du locataire</td>'; print '<td><input name="nom" size="40" value="' . $locataire->nom . '"</td></tr>'; print '<tr><td width="20%">telephone</td>'; print '<td><input name="telephone" size="15" value="' . $locataire->telephone . '"</td></tr>'; print '<tr><td width="20%">email</td>'; print '<td><input name="email" size="10" value="' . $locataire->email . '"</td></tr>'; print '<tr><td width="20%">Adresse </td>'; print '<td><input name="adresse" size="30" value="' . $locataire->adresse . '"</td></tr>'; print '<tr><td width="20%">Commentaire </td>'; print '<td><input name="commentaire" size="70" value="' . $locataire->commentaire . '"</td></tr>'; print '<tr><td> </td><td><input type="submit" class="button" value="' . $langs->trans("Sauvegarder") . '"><input type="cancel" class="button" value="' . $langs->trans("Cancel") . '"></td></tr>'; print '</table>'; print '</form>'; } elseif ($action == 'update') { llxheader('', $langs->trans("changelocataire"), ''); $html = new Form($db); $nbligne = 0; $locataire = new Locataire($db, GETPOST('id')); $head = locataire_prepare_head($locataire); dol_fiche_head($head, 'maininfo', $langs->trans("ImoLocataireDetail"), 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%">'; print '<tr><td width="20%">Nom du locataire</td>'; print '<td><input name="nom" size="40" value="' . $locataire->nom . '"</td></tr>'; print '<tr><td width="20%">telephone</td>'; print '<td><input name="telephone" size="15" value="' . $locataire->telephone . '"</td></tr>'; print '<tr><td width="20%">email</td>';
dol_add_file_process($upload_dir, 0, 1, 'userfile'); } if ($action == 'delete') { $file = $upload_dir . '/' . GETPOST("urlfile"); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). $ret = dol_delete_file($file); if ($ret) { setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); } else { setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); } } /* * View */ llxheader('', $langs->trans("adddocument"), ''); $form = new Form($db); if ($object->id) { $locataire = new Locataire($db, GETPOST('id')); $head = locataire_prepare_head($locataire); dol_fiche_head($head, 'document', $langs->trans("ImoDocument"), 0, 'renter'); // Construit liste des fichiers $filearray = dol_dir_list($upload_dir, "files", 0, '', '\\.meta$', $sortfield, strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC, 1); $totalsize = 0; foreach ($filearray as $key => $file) { $totalsize += $file['size']; } print '<table class="border" width="100%">'; print '<tr><td width="20%">' . $langs->trans("nomlocataire") . '</td>'; print '<td><input name="nom" size="40" value="' . $locataire->nom . '"</td></tr>'; print '<tr><td>' . $langs->trans("NbOfAttachedFiles") . '</td><td colspan="3">' . count($filearray) . '</td></tr>';
print '<td><input name="superficie" size="10" value="' . $local->superficie . '"</td>'; print '<td>' . $immeuble->numero . ' ' . $immeuble->street . '</td>'; print '<td>' . $immeuble->zipcode . ' ' . $immeuble->town . '</td></tr>'; print '<tr><td width="20%">' . $langs->trans("type") . '</td>'; print '<td><input name="type" size="10" value="' . $local->type . '"</td></tr>'; print '<tr><td width="20%">' . $langs->trans("Commentaire") . '</td>'; print '<td><input name="commentaire" size="10" value="' . $local->commentaire . '"</td></tr>'; print '<tr><td width="20%">' . $langs->trans("Statut") . '</td>'; print '<td>'; print $html->selectarray('statut', $local->status_array, $local->statut); print '</td></tr>'; print '<tr><td> </td><td><input type="submit" class="button" value="' . $langs->trans("Sauvegarder") . '"><input type="cancel" class="button" value="' . $langs->trans("Cancel") . '"></td></tr>'; print '</table>'; print '</form>'; } else { llxheader('', $langs->trans("ImoLocalDetail"), ''); $local = new Local($db, GETPOST('id')); $head = local_prepare_head($local); dol_fiche_head($head, 'maininfo', $langs->trans("ImoLocalDetail"), 0, 'propertie'); $immeuble = new Immeuble($db); $result = $immeuble->fetch($local->immeuble_id); if ($result < 0) { setEventMessage($immeuble->error, 'errors'); } print '<table class="border" width="100%">'; print '<tr><td width="20%">' . $langs->trans("NomLocal") . '</td>'; print '<td>' . $local->nom . '</td></tr>'; print '<tr><td width="20%">' . $langs->trans("Adresse") . '</td>'; print '<td>' . $local->adresse . '</td></tr>'; print '<tr><td width="20%">' . $langs->trans("Commentaire") . '</td>'; print '<td>' . $local->commentaire . '</td></tr>';
if (!empty($accounting->id)) { $result = $accounting->delete($user); if ($result > 0) { Header("Location: account.php"); } } if ($result < 0) { setEventMessage($accounting->error, 'errors'); } } } } /* * View */ llxheader('', $langs->trans('AccountAccounting')); $form = new Form($db); $htmlacc = new FormVentilation($db); if ($action == 'create') { print_fiche_titre($langs->trans('NewAccount')); print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n"; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="add">'; dol_fiche_head(); print '<table class="border" width="100%">'; print '<tr><td width="25%">' . $langs->trans("AccountNumber") . '</td>'; print '<td><input name="account_number" size="30" value="' . $accounting->account_number . '"</td></tr>'; print '<tr><td>' . $langs->trans("Label") . '</td>'; print '<td><input name="label" size="70" value="' . $accounting->label . '"</td></tr>'; print '<tr><td>' . $langs->trans("Accountparent") . '</td>'; print '<td>';
$optName = GETPOST('optName'); $optValue = GETPOST('optValue'); $langs->load("admin"); $langs->load("holiday"); // Si pas administrateur if (!$user->admin) { accessforbidden(); } /* * View */ // Vérification si module activé if (empty($conf->holiday->enabled)) { print $langs->trans('NotActiveModCP'); } llxheader('', $langs->trans('TitleAdminCP')); $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>'; print_fiche_titre($langs->trans('ConfCP'), $linkback); $cp = new Holiday($db); // Contrôle du formulaire if ($action == "add") { $message = ''; $error = 0; // Option du groupe de validation /*if (!$cp->updateConfCP('userGroup',$_POST['userGroup'])) { $error++; }*/ // Option du délai pour faire une demande de congés payés if (!$cp->updateConfCP('delayForRequest', $_POST['delayForRequest'])) { $error++;
if (!$res) { die("Include of main fails"); } // Class dol_include_once("/immobilier/class/local.class.php"); dol_include_once('/immobilier/lib/immobilier.lib.php'); // Langs $langs->load("immobilier@immobilier"); $id = GETPOST('id', 'int'); $mesg = ''; $limit = $conf->liste_limit; /* * loyer et paiement par local * */ llxheader('', $langs->trans("bilanlocal"), ''); $local = new Local($db); $result = $local->fetch($id); $head = contrat_prepare_head($local); dol_fiche_head($head, 'info', $langs->trans("Imoinfo"), 0, 'propertie'); $sql = "(SELECT l.periode_du as date , l.montant_tot as debit, 0 as credit , l.nom as des"; $sql .= " FROM " . MAIN_DB_PREFIX . "immo_loyer as l"; $sql .= " WHERE l.local_id =" . $id; $sql .= ")"; $sql .= "UNION (SELECT p.date_paiement as date, 0 as debit , p.montant as credit, p.commentaire as des"; $sql .= " FROM " . MAIN_DB_PREFIX . "immo_paie as p"; $sql .= " WHERE p.local_id =" . $id; $sql .= ")"; $sql .= "ORDER BY date"; $result = $db->query($sql); if ($result) {
print '<tr><td width="20%">tva</td>'; print '<td><input name="tva" size="10" value="' . $contrat->tva . '"</td></tr>'; print '<tr><td width="20%">periode</td>'; print '<td><input name="periode" size="10" value="' . $contrat->periode . '"</td></tr>'; print '<tr><td width="20%">depot</td>'; print '<td><input name="depot" size="10" value="' . $contrat->depot . '"</td></tr>'; print '<tr><td width="20%">commentaire</td>'; print '<td><input name="commentaire" size="10" value="' . $contrat->commentaire . '"</td></tr>'; print '<tr><td width="20%">proprietaire</td>'; print '<td><input name="proprietaire_id" size="10" value="' . $contrat->proprietaire_id . '"</td></tr>'; print '<tr><td> </td><td><input type="submit" class="button" value="' . $langs->trans("Sauvegarder") . '"><input type="cancel" class="button" value="' . $langs->trans("Cancel") . '"></td></tr>'; print '</table>'; print '</form>'; } if ($id > 0) { llxheader('', $langs->trans("changecontrat"), ''); $nbligne = 0; $contrat = new Contrat($db); $result = $contrat->fetch($id); $head = contrat_prepare_head($contrat); dol_fiche_head($head, 'maininfo', $langs->trans("ImoContratDetail"), 0, 'agreement'); print '<form action="' . $_SERVER['PHP_SELF'] . '" 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%">'; print '<tr><td width="20%">local</td>'; print '<td>'; print $htmlimmo->select_local($contrat->local_id, 'local_id'); print '</td></tr>'; print '<tr><td width="20%">locataire</td>';
$paie->commentaire = $_POST["commentaire"]; $paie->date_paiement = $datepaie; $result = $paie->update($user); header("Location: " . DOL_URL_ROOT . "/immobilier/loyer/fiche_loyer.php?id=" . $paie->loyer_id); if ($id > 0) { } else { $mesg = '<div class="error">' . $paie->error . '</div>'; } } } /* * View * */ $form = new Form($db); llxheader('', $langs->trans("newpaiement"), ''); if (GETPOST("action") == 'create') { $loyer = new Loyer($db); $result = $loyer->fetch($id); print '<form action="fiche_paiement.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 '<input type="hidden" name="contrat_id" size="10" value="' . $loyer->contrat_id . '">'; print '<input type="hidden" name="local_id" size="10" value="' . $loyer->local_id . '">'; print '<input type="hidden" name="locataire_id" size="10" value="' . $loyer->locataire_id . '">'; print '<input type="hidden" name="loyer_id" size="10" value="' . $id . '">'; print '<tr><td width="20%">' . $langs->trans("NomAppartement") . '</td><td>' . $loyer->nomlocal . '</td></tr>'; print '<tr><td width="20%">' . $langs->trans("NomLocataire") . '</td><td>' . $loyer->nomlocataire . '</td></tr>'; print '<tr><td width="20%">' . $langs->trans("RefLoyer") . '</td><td>' . $loyer->nom . '</td></tr>'; print '<tr><td width="20%">' . $langs->trans("Montant") . '</td>';
print '<tr><td width="20%">periode_du</td>'; print '<td align="left">'; print $html->select_date(!empty($datedu) ? $datedu : '-1', 'du', 0, 0, 0, 'fiche_charge', 1); print '</td></tr>'; print '<tr><td width="20%">periode_au</td>'; print '<td align="left">'; print $html->select_date(!empty($dateau) ? $dateau : '-1', 'au', 0, 0, 0, 'fiche_charge', 1); print '</td></tr>'; print '<tr><td width="20%">commentaire</td>'; print '<td><input name="commentaire" size="120" value="' . $contrat->commentaire . '"</td></tr>'; print '<tr><td> </td><td><input type="submit" class="button" value="' . $langs->trans("Sauvegarder") . '"><input type="cancel" class="button" value="' . $langs->trans("Cancel") . '"></td></tr>'; print '</table>'; print '</form>'; } if ($id > 0) { llxheader('', $langs->trans("changecharge"), ''); $nbligne = 0; $charge = new Charge($db); $result = $charge->fetch($id); // $head = contrat_prepare_head ( $contrat ); // dol_fiche_head ( $head, 'maininfo', $langs->trans ( "ImoContratDetail" ), 0, 'agreement' ); print '<form action="' . $_SERVER['PHP_SELF'] . '" 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%">'; print '<tr><td width="20%">libelle</td>'; print '<td><input name="libelle" size="30" value="' . $charge->libelle . '"</td></tr>'; print '<tr><td width="20%">fournisseur</td>'; print '<td>'; print $htmlimmo->select_fournisseur($charge->fournisseur, 'fournisseur', 1);
print '<td width="20%">' . $langs->trans("street") . '</td>'; print '<td><input name="street" size="80" value="' . $immeuble->street . '"</td></tr>'; print '<td>' . $langs->trans('CP') . '</td><td>'; print $formimmo->select_depville($immeuble->fk_departement, 'zipcode', array('town', 'selectcountry_id'), 6) . ''; print '</td><td>' . $langs->trans('Ville') . '</td><td>'; print $formimmo->select_depville($immeuble->town, 'town', array('zipcode', 'selectcountry_id')) . '</tr>'; /* print '<tr><td>'.$langs->trans("Pays").'</td>'; print '<td>'.$form->select_pays($immeuble->fk_pays,'country_id').'</td></tr>'; */ print '<tr><td width="20%">' . $langs->trans("Statut") . '</td>'; print '<td>'; print $html->selectarray('statut', $immeuble->status_array, $immeuble->statut); print '</td></tr>'; print '<tr><td width="20%">' . $langs->trans("longitude") . '</td>'; print '<td><input name="longitude" size="10" value="' . $immeuble->longitude . '"</td>'; print '<td width="20%">' . $langs->trans("latitude") . '</td>'; print '<td><input name="latitude" size="10" value="' . $immeuble->latitude . '"</td></tr>'; print '<tr><td width="20%">' . $langs->trans("commentaire") . '</td>'; print '<td><input name="commentaire" size="80" value="' . $immeuble->commentaire . '"</td></tr>'; print '<tr><td> </td><td><input type="submit" class="button" value="' . $langs->trans("Sauvegarder") . '"><input type="cancel" class="button" value="' . $langs->trans("Cancel") . '"></td></tr>'; print '</table>'; print '</form>'; } else { llxheader('', $langs->trans("changeImmeuble"), ''); $nbligne = 0; $immeuble = new Immeuble($db, GETPOST('id')); $head = immeuble_prepare_head($immeuble); dol_fiche_head($head, 'maininfo', $langs->trans("ImoImmeubleDetail"), 0, 'propertie'); } $db->close();
} dol_include_once("/immobilier/class/local.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("DPE"), ''); $html = new Form($db); $nbligne = 0; $local = new Local($db, GETPOST('id')); $head = local_prepare_head($local); dol_fiche_head($head, 'DPE', $langs->trans("DPE"), 0, 'DPE'); 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%">'; print '<tr><td width="20%">' . $langs->trans("Nom") . '</td>'; print '<td>' . $local->nom . '</td></tr>'; print '<tr><td width="20%">' . $langs->trans("Superficie") . '</td>'; print '<td>' . $local->superficie . '</td></tr>'; print '<tr><td width="20%">' . $langs->trans("DateDPE") . '</td>';
$loyer->periode_au = $dateperiodend; $result = $loyer->update($user); header("Location: " . DOL_URL_ROOT . "/custom/immobilier/loyer/fiche_loyer.php?id=" . $loyer->id); if ($id > 0) { // $mesg='<div class="ok">'.$langs->trans("SocialContributionAdded").'</div>'; } else { $mesg = '<div class="error">' . $loyer->error . '</div>'; } // } } /* * View * */ $form = new Form($db); llxheader('', $langs->trans("newrental"), ''); if (GETPOST("action") == 'create') { print '<form name="fiche_loyer" method="post" action="' . $_SERVER["PHP_SELF"] . '">'; 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 class=\"liste_titre\">"; print '<td align="left">'; print $langs->trans("NomLoyer"); print '</td><td align="center">'; print $langs->trans("echeance"); print '</td><td align="center">'; print $langs->trans("periode_du"); print '</td><td align="center">'; print $langs->trans("periode_au"); print '</td><td align="left">';
$relever = new Immorelever($db); $result = $relever->fetch($id_line); if ($result < 0) { setEventMessage($relever->error, 'errors'); } $result = $relever->delete($user); if ($result < 0) { setEventMessage($relever->error, 'errors'); } else { Header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id); } } /* * View */ llxheader('', $langs->trans("ReleverCompteur"), ''); $local = new Local($db, $id); $head = local_prepare_head($local); $immeuble = new Immeuble($db); $result = $immeuble->fetch($local->immeuble_id); if ($result < 0) { setEventMessage($immeuble->error, 'errors'); } $relever = new Immorelever($db); $relever->fetch_all_by_local($id); if ($result < 0) { setEventMessage($relever->error, 'errors'); } dol_fiche_head($head, 'compteurrelever', $langs->trans("ReleverCompteur"), 0, 'propertie'); print '<table class="border" width="100%">'; print '<tr><td width="20%">' . $langs->trans("NomLocal") . '</td>';
} 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%">'; print '<tr><td width="20%">' . $langs->trans("NomLocataire") . '</td>'; print '<td>' . $locataire->nom . '</td></tr>'; print '<tr><td width="20%">' . $langs->trans("Address") . '</td>'; print '<td>' . $locataire->adresse . '</td></tr>'; print '</table>';
$result = $loyer->create($user); if ($result > 0) { setEventMessage($langs->trans("SocialContributionAdded"), 'mesgs'); } else { dol_print_error($db); } $cpt++; } } } /* * View * */ $form = new Form($db); llxheader('', $langs->trans("newventilcharge"), ''); if (GETPOST("action") == 'create') { print '<form name="fiche_loyer" method="post" action="' . $_SERVER["PHP_SELF"] . '">'; 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 class=\"liste_titre\">"; print '<td align="left">'; print $langs->trans("NomLoyer"); print '</td><td align="center">'; print $langs->trans("echeance"); print '</td><td align="center">'; print $langs->trans("periode_du"); print '</td><td align="center">'; print $langs->trans("periode_au"); print '</td><td align="left">';