</fieldset> <?php } } ?> </div> </div> <div style="display: inline-block; width:325px; float: left"> <div> <?php //Dotari $tipp = $apartament->TipProprietate + 1; $sql = "SELECT * FROM CategorieDotari where TipControl='2' ORDER BY Prioritate"; $categorieDotariList = Categoriedotari::find_by_sql($sql); if (!empty($categorieDotariList)) { $rows = 0; foreach ($categorieDotariList as $categorie) { $rows = $rows + 2; if ($rows > 22) { $rows = 0; echo "</div></div>"; echo "<div style=\"display: inline-block; width:325px; float: left\"><div>"; } ?> <fieldset id="FS<?php echo $categorie->id . "_" . $categorie->Proprietati; ?> "> <legend><?php
function CategoriiDot($tip) { if ($tip != "nc") { $tip = "Proprietati LIKE '%{$tip}%'"; } else { $tip = "Proprietati='' OR Proprietati IS NULL"; } ?> <div id="butoane" class="butoanestanga"> <input type="button" value="Adauga categorie" onclick="addCategoriedotare()"></input> </div> <?php $sql = "SELECT * FROM CategorieDotari WHERE {$tip} ORDER BY Prioritate"; echo $sql; $categoriedotariList = Categoriedotari::find_by_sql($sql); if (!empty($categoriedotariList)) { foreach ($categoriedotariList as $categoriedotari) { ?> <div class="view"> <h3><?php echo $categoriedotari->Prioritate . " - " . $categoriedotari->Descriere . ($categoriedotari->Privat == 1 ? " - Privat - " : "") . ($categoriedotari->TipControl == 1 ? " - checkbox - " : " - lista - "); ?> | <a class="header" href="categoriedotare_update.php?id=<?php echo $categoriedotari->id; ?> ">modifica</a></h3> <?php $sql = "SELECT * FROM Dotare WHERE idCategorieDotari={$categoriedotari->id}"; $dotareList = Dotare::find_by_sql($sql); if (!empty($dotareList)) { $i = 0; ?> <table width="650px"> <tr> <td class="header" width="40%">Denumire</td> <td class="header" width="10%">Implicit</td> <td class="header" width="20%">ID Imobiliare</td> <td class="header" width="30%">Operatii</td> </tr> <?php foreach ($dotareList as $dotare) { $i++; $class = $i % 2 ? "impar" : "par"; ?> <tr id="<?php echo $dotare->id; ?> " class="<?php echo $class; ?> " ondblclick='dotareEdit("<?php echo $dotare->id; ?> ")' onmouseover='onOver("<?php echo $dotare->id; ?> ",1,<?php echo $i; ?> )' onmouseout='onOver("<?php echo $dotare->id; ?> ",0,<?php echo $i; ?> )'> <td><?php echo $dotare->Descriere; ?> </td> <td><input type="checkbox" disabled="disabled" <?php if ($dotare->Implicit == 1) { echo "checked=\"checked\""; } ?> /></td> <td><?php echo $dotare->idImobiliare; ?> </td> <td> <a href="dotare_update.php?id=<?php echo $dotare->id; ?> ">modifica</a> | <a href="dotare_delete.php?id=<?php echo $dotare->id; ?> ">sterge</a> | <a href="dotare_new.php?idCateg=<?php echo $categoriedotari->id; ?> ">adauga</a></td> </tr> <?php } ?> </table> <?php } else { ?> <input type="button" value="Adauga Dotare" onclick="addDotare(<?php echo $categoriedotari->id; ?> )"></input> <input type="button" value="Sterge Categorie" onclick="delCategoriedotare(<?php echo $categoriedotari->id; ?> )"></input> <?php } ?> </div> <?php } } }