Vous êtes sur la page 1sur 2

<html>

<meta charset="utf-8">
<body>

<form method="POST">
Nr Rinduri matrice: <input type="number" name="row" min="2" max="10" size="1" ><br>
<br>
Nr Coloane matrice: <input type="number" name="column" min="2" max="10" size="1"
><br>
<br>
<input type="submit" value="Creaza" , name="buton1">
</form>

<?php

if( isset( $_POST['buton1'] ) )


{

echo '<form method="post" action="optimalitate.php" >';

$rows = $_POST["row"]; // количество строк, tr


$cols = $_POST["column"]; // количество столбцов, td
$value = 0;

echo '<div>'.'<table border="1">';


echo "Matricea creata Rinduri/Coloane: $rows pe $cols ";
for ($tr=1; $tr<=$rows; $tr++){
echo '<tr>';
for ($td=1; $td<=$cols; $td++){
echo '<td>'.'<input type="number" name="stare['.$tr.']['.$td.']" min="-
99999" max="99999" maxlength="2" step="any" size="1" autocomplete="off" value="'.
$value.'"/>'.'</td>';
}
echo '</tr>';
}
echo '</table>' .'</div>';

echo '<div>';
echo '<br>';
echo 'Introduceti Alpha';
echo '<br>';
echo '<input type="number" name="alpha" step="any" value="'.$value.'" />';
echo '<br>';
echo'</div>';

echo '<br>';
echo '<div>'.'Introduceti vectorul probabilitatilor(ponderilor)
atributelor(criteriilor): '.'<table border="1">';
for ($td=1; $td<=$cols; $td++){
echo '<td>'.'<input type="number" step="any" name="pondere['.$td.']" min="-
99" max="99" maxlength="2" size="1" autocomplete="off" value="'.
$value.'"/>'.'</td>';
}
echo'</table>'.'</div>';
echo '<br>';

echo'<div>'.'Introduceti Vectori cu obiectivele criteriilor (1->MAX,-1->MIN):


'.'<table border="1">';
for ($td=1; $td<=$cols; $td++){
echo '<td>'.'<input type="number" step="any" name="vector['.$td.']" min="-
1" max="1" maxlength="2" size="1" autocomplete="off" value="'.$value.'"/>'.'</td>';
}
echo '</table>'.'</div>';

echo '<br>';
echo '<input type=hidden name="rows" value="'.$rows.'">'
.'<input type=hidden name="cols" value="'.$cols.'">'.'<input type="submit"
value="Отправить" />';
echo '</form>';
}

?>
</body>
</html>

Vous aimerez peut-être aussi