var update = function() {
var val = +$('#f_lr1ro option:selected').val();
var showFirst = [2, 3].indexOf(val) >= 0;
$('#f_lr1rowtd').toggle(showFirst);
};
$(document).ready(function(){
$('#f_lr1ro').change(update);
update();
});
var update = function() {
var val = +$('#f_lr1ro option:selected').val();
var showFirst = [2, 3].indexOf(val) >= 0;
$('#f_lr1rowtd').toggle(showFirst);
};
var update2 = function() {
var val = +$('#f_lr1rowtd option:selected').val();
var showFirst = [3, 4, 5, 6, 7, 8].indexOf(val) >= 0;
var showSecond = [9, 10, 11, 12].indexOf(val) >= 0;
$('#f_lr1rooq').toggle(showFirst);
$('#f_lr1ronq').toggle(showSecond);
};
$(document).ready(function(){
$('#f_lr1ro').change(update);
$('#f_lr1rowtd').change(update2);
update();
update2();
});
$(this).val()
var val = +$(this).val(); // значения ведь числа?
// массивы подставьте свои
var showFirst = [1, 4, 6, 7].indexOf(val) >= 0;
var showSecond = [2, 3, 4, 8].indexOf(val) >= 0;
$('#f_lr1rooq').toggle(showFirst);
$('#f_lr1ronq').toggle(showSecond);
$('#f_lr1rowtd option:selected').each(function () { ... }
var val = +$('#f_lr1rowtd option:selected').val();
// дальше логика выше
var i
$("[name=w_q_s1]").click(function(e) {
var i;
$(document).ready(function(){
var i;
for(i=1;i<=this.value;i++){
for(i=1;i<=this.value-0;i++){
for(i=$(this).val();i<$(".spalnya").length;i++){
for(i=$(this).val()-0;i<$(".spalnya").length;i++){
<?php
$all_price = array();
while($row = mysql_fetch_assoc($sql)):
$i++;
if(checkKod($i)):
$size = isset($sizes[$row['id']]) ? $sizes[$row['id']] : $S_1_s1;
$sum = $row['price'] * $size;
if($sum != 0):
$pdf->Row(
array(
'id' => $row['id'],
'name' => $row['name'],
'size' => $size,
'type' => $row['type'],
'price' => $row['price'],
'sum' => $sum
)
);
$all_price [] = $sum;
endif;
endif;
endwhile;
echo array_sum($all_price);
while($row = mysql_fetch_assoc($sql)):
$i++;
if(checkKod($i)):
$size = isset($sizes[$row['id']]) ? $sizes[$row['id']] : $S_1_s1;
$sum = $row['price'] * $size;
if($sum != 0):
$pdf->Row(
array(
'id' => $row['id'],
'name' => $row['name'],
'size' => $size,
'type' => $row['type'],
'price' => $row['price'],
'sum' => $sum
)
);
endif;
endif;
endwhile;
$pdf->Row(array($row[0],$row[1],$row[2],$row[3],$row[4],$row[5]));
$pdf->Row($row);
if($row["id"] == '1' or $row["id"] == '2' or $row["id"] == '3' or $row["id"] == '4') {
if(in_array($row["id"], ['1', '2', '3', '4'])) {
while($row = mysql_fetch_row($sql))
{
if($row["id"] == '1' or $row["id"] == '2' or $row["id"] == '3' or $row["id"] == '4') {
$row[0] = $S_1;
}
$pdf->Row(array($row[0],$row[1],$row[2],$row[3],$row[4],$row[5]));
}