3
Here at the company we are doing a plant management. The apartments/units that have equal end (for example, Apto 1, Apto 11, Apto 21) and so on, are below each other in the construction and for this reason the plant linked to them is the same, but if a client asks for customization in his unit, the standard plan of the others needs to be the same of customization. We could just use one UPDATE
in the table but I am doing as I was asked and as we were asked by the builders until because it may be that the customization is done only in the unit purchased by the customer and according to what he ordered but if the company decides to change all the plants so that the the pattern is the same as the custom pattern, We need to select all of that column to link.
Each building contains a different amount of units per floor, some contain 4, others 5 and so on, so the amount of columns returned in the table may vary. At the moment, we are only using a function to select all the units or no unit but I wanted to know, how can I modify my function to select or deselect the units of only one column.
The function is
<script>
function marcardesmarcar(status){
$(".chk").each(
function(){
if ($(".chk").prop("checked"))
$(this).prop("checked", status);
else $(this).prop("checked", status);
}
);
}
</script>'
And the method to show the checkboxes for each unit is
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
if ($nome_torre_old != $row['nome_torre'] OR
$nome_bloco_old != $row['nome_bloco'] OR
$andar_old != $row['andar']) {
echo '</tr><tr>';
$nome_torre_old = $row['nome_torre'];
$nome_bloco_old = $row['nome_bloco'];
$andar_old = $row['andar'];
}
echo '<td>
<input class="chk" style="margin-left:20px;" type="checkbox" id="p'.$row['id'].'" name="p'.$row['id'].'" ';
if ($row['plt_uni_in_id_unidade']== $row['id'] AND $row['plt_uni_in_id_planta'] == $id_work) echo 'checked="checked"';
echo ' />'.$row['nome_torre'].' '.$row['nome_bloco'].' '.$row['nome_apto'].'</td>';
}
Here the image of how it looks, in this case, the building has 4 units per floor and shows 4 columns.
So I was wondering if you have any way to enter the check/uncheck option in the header of each column, to be able to check/uncheck the options in it. Of the ways I thought, I need to know in advance how many columns will be displayed in the table but as I said, each building has a different amount of units per floor so the amount of columns will vary. Sorry for the huge question but I wanted to explain some things to avoid answers that won’t suit me.
What you want is when selecting, select only everyone from a tower?
– Sr. André Baill
I understood according to André Baill’s question. I think he just wants to select everyone from a certain block. What makes it confusing is the introduction regarding the business model. Avoid posting something very specific. Post something generic with fictitious data, even for privacy. Just post this last text that is after the image.
– Daniel Omine
The apartment 1 is below the 11 that is under the 21 and so it goes This means that the plan of all Apto 1, 11, 21, 31 of the South and North Tower will be equal. But when a guy goes in there and buys a plant unit and says, "Look, I want you to take a room and do an office." the company can change only the plan of the unit that the customer bought or that of all the units that are above and below and the units of the same one of the other block/ tower will be equal because it has to follow standard.
– Diéfani Favareto Piovezan
Like, just look at the image I posted from the table and tell me how to select only by column, and the number of columns can vary according to the number of units per floor, that is I have no way of knowing if the table will have 2/3/4/5/6 columns but I need to select BY column.
– Diéfani Favareto Piovezan