Jump to content

Problem with require_once on a while


carlosuc99

Recommended Posts

Hi,

 

I have this code:

 

[/font][/color]
[color=#000000][font=Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif]while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){[/font][/color]
[color=#000000][font=Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif]if($i++%2==0){
$color="#FFFFFF";
}else{
$color="#CCCCCC";
}

?>

<tr bgcolor='<?php echo $color; ?>' onmouseover="this.style.background='#ABFB04';" onmouseout="this.style.background='<?php echo $color; ?>';">
<?php

echo "<td class=tablelist>";

echo $row["ICAO"] . '</td><td class=tablelist>';

echo $row["Name"] . '</td><td class=tablelist>';

echo $row["WeightEmpty"] . '</td><td class=tablelist>';

echo $row["WeightFull"] . '</td><td class=tablelist>';

echo $row["CargoFull"] . '</td><td class=tablelist>';

echo $row["Range"] . '</td><td class=tablelist>';

echo $row["Price"] . '</td><td class=tablelist>';

echo $row["FirstClassSeats"] . '</td><td class=tablelist>';

echo $row["BusinessClassSeats"] . '</td><td class=tablelist>';

echo $row["EconomyClassSeats"]. '</td><td class=tablelist>';

echo "<img class='editaircraft' src='./images/info.png'></td></tr>";

?>
<script>
$(function() {
$( "#editaircraftdialog" ).dialog({
autoOpen: false,
width: 425
});

$( ".editaircraft" ).click(function() {
$( "#editaircraftdialog" ).dialog( "open" );
return false;
});
});
</script>

<div id="editaircraftdialog" title="Edit Aircraft">
<?php include ('./new_aircraft.php'); ?>
</div>

<?php
}

echo "</table>";
$pagination->render();
?>

 

The problem is here:

 

<div id="editaircraftdialog" title="Edit Aircraft">
<?php include('./new_aircraft.php'); ?>
</div>

 

If I use the require once in a while it not works. But if the require is out a while it works fun. If i change the require_once and I put text, It works fun.

The problem is what I see the content of the require_once out a JQuery dialog. Image:

 

k1aslk.png

The while stops when it arrive to the <div>.

new_aircraft.php(file included)

<script>
$(function() {
$("#insertaircraft")
.button()
.click(function(event) {
});
});
</script>[/font][/color]


<form action="new_aircraft_process.php" method="post" enctype="application/x-www-form-urlencoded">
<table>


<tr><td class="forms">ICAO:</td><td><input maxlength="4" type="text" name="icao" size="30"/></td></tr>


<tr><td class="forms">Name:</td><td><input type="text" name="name" size="30"/></td></tr>


<tr><td class="forms">Weight Empty:</td><td><input type="text" name="weightempty" size="30"/></td></tr>


<tr><td class="forms">Weight Full:</td><td><input type="text" name="weightfull" size="30"/></td></tr>


<tr><td class="forms">Cargo Full:</td><td><input type="text" name="cargofull" size="30"/></td></tr>


<tr><td class="forms">Cruise Speed:</td><td><input type="text" name="cruisespeed" size="30"/></td></tr>


<tr><td class="forms">Range:</td><td><input type="text" name="range" size="30"/></td></tr>


<tr><td class="forms">Price:</td><td><input type="text" name="price" size="30"/></td></tr>


<tr><td class="forms">Number Classes:</td><td><select name="numberclasses" id="numberclasses">
<option value="0">Select Number of Classes</option>
<?php
echo '<option value="1">One Classes (Economy)</option>';
echo '<option value="2">Two Classes (Business & Economy)</option>';
echo '<option value="3">Three Classes (First, Business & Economy)</option>';
?>
</select></td></tr>




<tr><td class="forms">First Class Seats:</td><td><input disabled="disabled" type="text" id="firstclassseats" name="firstclassseats" size="30"/></td></tr>


<tr><td class="forms">Business Class Seats:</td><td><input disabled="disabled" type="text" id="businessclassseats" name="businessclassseats" size="30"/></td></tr>


<tr><td class="forms">Economy Class Seats:</td><td><input disabled="disabled" type="text" id="economyclassseats" name="economyclassseats" size="30"/></td></tr>


<script type="text/javascript">


$("#numberclasses").change(function() {
value = $(this).val();


str = parseInt(value);


switch(str)
{
case 0:
$(document).ready(function() {
$("#firstclassseats").attr("disabled","disabled");
$("#businessclassseats").attr("disabled","disabled");
$("#economyclassseats").attr("disabled","disabled");
});
break;


case 1:
$(document).ready(function() {
$("#economyclassseats").removeAttr('disabled');
$("#firstclassseats").attr("disabled","disabled");
$("#businessclassseats").attr("disabled","disabled");
});
break;


case 2:
$(document).ready(function() {
$("#businessclassseats").removeAttr('disabled');
$("#economyclassseats").removeAttr('disabled');
$("#firstclassseats").attr("disabled","disabled");
});
break;


case 3:
$(document).ready(function() {
$("#firstclassseats").removeAttr('disabled');
$("#businessclassseats").removeAttr('disabled');
$("#economyclassseats").removeAttr('disabled');
});
break;


}
});


</script>


<tr><td></td><td><input id="insertaircraft" type="submit" value="Insert Aircraft"/></td></tr>
</table>
</form>

Edited by carlosuc99
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.