Cod: Selectaţi tot
<form id='form_tbl' action='include/value.inc.php' method="POST"><input type="hidden" name="intrebare" value="1">
<?php
$sql = "SELECT NUME, PRENUME, TIP, ID
FROM personal
WHERE TIP <> 'Inactiv'
ORDER BY NUME ASC";
$result = $conn->query($sql);
echo "<table><tr><th>NUME</th><th>NOTA</th><th>SUGESTII</th></tr>";
while($row = $result->fetch_assoc()) {
echo "<tr><td><input type='hidden' name ='id_personal[". $row['ID'] ."]' value='". $row["ID"]."'>" . $row["NUME"]. ' '. $row["PRENUME"]. "</td>";
echo "<td><select name='nota_pers[". $row['ID'] ."]' autocomplete='off'><option disabled selected>nota</option>";
for($i=1; $i<=10; $i++){
echo "<option value='$i'>$i</option>\n";
};
echo "</select></td>";
echo "<td><textarea name='sugestie[". $row['ID'] "]' form='form_tbl' maxlength='200' autocomplete='off' placeholder='Lasa sugestia ta aici...'></textarea></td></tr>";
}
echo '</table><button>NEXT ></button>';
?>
</form>
Cod: Selectaţi tot
<?php
$insert_str = null;
$nota_pers = $_POST ['nota_pers'];
$intrebare = $_POST ['intrebare'];
$sugestie = $_POST ['sugestie']; //preaia valorile din textarea
foreach ($sugestie as $key2 => $value2) {
echo $value2. ', ';
}
echo '<pre>'.print_r($nota_pers, true).'</pre><br>' ;
echo '<pre>'.print_r($sugestie, true).'</pre><br>' ;
?>
Cod: Selectaţi tot
Array
(
[55] => 6
[29] => 2
)
Cod: Selectaţi tot
Array
(
[80] =>
[82] =>
[98] =>
[50] =>
[99] =>
[79] =>
[78] =>
[103] =>
[84] =>
[62] =>
[55] => text1
[29] => text2
)
Cod: Selectaţi tot
, , , , , , , , , , text1, text2,
Multumesc!