Esempio n. 1
0
											<th class="hidden-phone">Nombre Pièces</th>
											<th class="hidden-phone">Status</th>
											<th class="hidden-phone">Actions</th>
										</tr>
									</thead>
									<tbody>
										<?php 
        foreach ($appartements as $appartement) {
            $client = "";
            $status = "";
            $dateRetour = "";
            if ($appartement->status() == "Disponible") {
                $status = '<a href="#updateAppartementStatus' . $appartement->id() . '" data-toggle="modal" data-id="' . $appartement->id() . '" class="btn mini green">' . $appartement->status() . '</a>';
            } else {
                if ($appartement->status() == "Vendu") {
                    $contratNumber = $contratManager->getContratNumberByIdBienByTypeBien($appartement->id(), 'appartement');
                    if ($contratNumber > 0) {
                        $contrat = $contratManager->getContratByIdBienByTypeBien($appartement->id(), 'appartement');
                        $client = '<a target="_blank" href="controller/ContratPrintController.php?idContrat=' . $contrat->id() . '">' . $contrat->nomClient();
                        $dateRetour = $contrat->dateRetour();
                    }
                    $status = '<a href="#updateAppartementStatus' . $appartement->id() . '" data-toggle="modal" data-id="' . $appartement->id() . '" class="btn mini red">' . $appartement->status() . '</a>';
                } else {
                    $contratNumber = $contratManager->getContratNumberByIdBienByTypeBien($appartement->id(), 'appartement');
                    if ($contratNumber > 0) {
                        $contrat = $contratManager->getContratByIdBienByTypeBien($appartement->id(), 'appartement');
                        $client = '<a target="_blank" href="controller/ContratPrintController.php?idContrat=' . $contrat->id() . '">' . $contrat->nomClient();
                        $dateRetour = $contrat->dateRetour();
                    }
                    $status = '<a href="#updateAppartementStatus' . $appartement->id() . '" data-toggle="modal" data-id="' . $appartement->id() . '" class="btn mini blue">' . $appartement->status() . '</a>';
                }