Page 1 of 1

Dropdown boxes failure

Posted: Mon Feb 11, 2019 5:24 am
by manosalexo
Hello.

I am new to php. My task right now is to take a php code that was created from a previews IT administrator and edit two dropdown boxes that listen and write to the database

This is the other guy's code.

='border: 2px solid black; margin-bottom:10px; margin-top:20px'>
<tr>
<th style='padding:5px;'>

<label><input id="id_radio1" type="radio" name="radio" value="1" checked /><strong> Υπάρχουσα Διεύθυνση</strong></label>


<!--<p> <input id="id_radio2" type="radio" name="radio" value="2" /><strong><label> Νέα Διεύθυνση</label></strong></p>



<div id="div2" style="display:none">
<div id="div2">
<p>gap <input type="text" name="gap" id="gap" value="" /></p>
<p>Οδός και Αριθμός <input type="text" name="od" id="od" value="" /></p>
<p>ΤΚ <input type="text" name="tk" id="tk" value="" /></p>
<p>Περιοχή/Πόλη <input type="text" name="per" id="per" value="" /></p>
</div>-->



<div id="div1">
<?php


$mypar = JRequest::getVar('iid');


$stmt="Select distinct LTGA_ID,LTGA_STREET from T_LTG_ADDR
join
(
select distinct DOC_LTG from T_DOCS
where DOC_PLACE>0
and (DOC_PLACE=$user->username)

)
on DOC_LTG=LTGA_LTG
where LTGA_LTG=$mypar";



$query = ibase_prepare($stmt);
$rs=ibase_execute($query);



echo '<label><strong>Διεύθυνση : </strong></label><select id="dropdown2" class="txbx" name="dropdown2" style="height: 30px;">';


while($row = ibase_fetch_row($rs))

{
$ns =iconv("ISO-8859-7","UTF-8",$row[1]);

echo '<option value="' . $row[0] .'" > ' . $ns . '</option>';

}




echo ' </select>';

echo"</th>";
echo"</tr>";
echo "</table>";


<br />

echo "<table style='border: 2px solid black; margin-bottom:10px; margin-top:20px'>";
echo"<tr>";
echo"<th style='padding:5px;'>";

echo ' <div style="margin-bottom:20px; margin-top:10px"><label> <input id="id_radio2" type="radio" name="radio" value="2" /><strong> Νέα Διεύθυνση</strong></label></div>';
echo ' <div id="div2">';


echo ' <input type="text" class="txbx" name="od" id="od" value="" placeholder="Οδός και Αριθμός" />';
echo"<BR>";
echo ' <input type="text" class="txbx" name="tk" id="tk" value="" placeholder="ΤΚ" />';
echo"<BR>";
echo ' <input type="text" class="txbx" name="per" id="per" value="" placeholder="Περιοχή/Πόλη" />';
echo"<BR>";



echo"</th>";
echo"</tr>";
echo "</table>";


echo ' </div>';


Now i try to add two more boxes.


<br>
<table style='border: 2px solid black; margin-bottom:10px; margin-top:20px'>
<tr>
<th style='padding:5px;'>

<label><input id="id_radio3" type="radio" name="radio" value="1" checked /><strong> Συχνός Μάρτυς</strong></label>

<div id="div1">
<?php


$mypar = JRequest::getVar('iid');


$stmt="Select distinct DEP_MARTYRES from T_DEP where ((dep_id=$adep) or (dep_assign_dep=$adep)) AND (dep_act=1)";


$query = ibase_prepare($stmt);
$rs=ibase_execute($query);



echo '<label><strong>Μάρτυς : </strong></label><select id="dropdown3" class="txbx" name="dropdown3" style="height: 30px;">';


while($row = ibase_fetch_row($rs))

{
$ns =iconv("ISO-8859-7","UTF-8",$row[1]);

echo '<option value="' . $row[0] .'" > ' . $ns . '</option>';

}




echo ' </select>';

echo"</th>";
echo"</tr>";
echo "</table>";


echo ' </div>';


<br>
echo "<table style='border: 2px solid black; margin-bottom:10px; margin-top:20px'>";
echo"<tr>";
echo"<th style='padding:5px;'>";

echo ' <div style="margin-bottom:20px; margin-top:10px"><label> <input id="id_radio4" type="radio" name="radio" value="2" /><strong>Νέος Μάρτυς</strong></label></div>';
echo ' <div id="div2">';


echo ' <input type="text" class="txbx" name="onom" id="onom" value="" placeholder="Όνομα" />';
echo"<BR>";
echo ' <input type="text" class="txbx" name="epon" id="epon" value="" placeholder="Επώνυμο" />';
echo"<BR>";
echo ' <input type="text" class="txbx" name="pol" id="pol" value="" placeholder="Περιοχή" />';
echo"<BR>";
echo ' <input type="text" class="txbx" name="street_and_number" id="street_and_number" value="" placeholder="Οδός και αριθμός" />';
echo"<BR>";




echo"</th>";
echo"</tr>";
echo "</table>";

<br/>

?>


Assuming that my database entries are not correct, at least i should be able to see the boxes designed, but i seem to miss something.
Can someone point me in the right direction?
Thank you in advance