function showForm()
{
global $DB;
$query = "SELECT * FROM\n `" . $this->getTable() . "`\n ORDER BY `states_id` ASC";
if ($result = $DB->query($query)) {
$number = $DB->numrows($result);
if ($number != 0) {
echo "<form method='post' name='massiveaction_form' id='massiveaction_form' action='" . $this->getFormURL() . "'>";
echo "<div align='center'>";
echo "<table class='tab_cadre_fixe' cellpadding='5'>";
echo "<tr>";
echo "<th>" . __('Status') . "</th><th></th>";
echo "</tr>";
while ($ligne = $DB->fetch_array($result)) {
$ID = $ligne["id"];
echo "<tr class='tab_bg_1'>";
echo "<td width='10'>";
echo "<input type='checkbox' name='item[{$ID}]'";
if (isset($_POST['check']) && $_POST['check'] == 'all') {
echo " checked ";
}
echo ">";
echo "</td>";
echo "<td>" . Dropdown::getDropdownName("glpi_states", $ligne["states_id"]) . "</td>";
echo "</tr>";
}
echo "</table></div>";
Html::openArrowMassives("massiveaction_form", true);
Html::closeArrowMassives(array('delete_state' => _sx('button', 'Delete permanently')));
Html::closeForm();
echo "<div align='center'><form method='post' action='" . $this->getFormURL() . "'>";
echo "<table class='tab_cadre_fixe' cellpadding='5'><tr ><th colspan='2'>";
echo __('Disposal status', 'financialreports') . " : </th></tr>";
echo "<tr class='tab_bg_1'><td>";
Dropdown::show('State', array('name' => "states_id", 'value' => $ligne["states_id"]));
echo "</td>";
echo "<td>";
echo "<div align='center'>";
echo "<input type='submit' name='add_state' value='" . _sx('button', 'Post') . "' class='submit' >";
echo "</div></td></tr>";
echo "</table>";
Html::closeForm();
echo "</div>";
} else {
echo "<div align='center'><form method='post' action='" . $this->getFormURL() . "'>";
echo "<table class='tab_cadre' cellpadding='5'><tr ><th colspan='2'>";
echo __('Disposal status', 'financialreports') . " : </th></tr>";
echo "<tr class='tab_bg_1'><td>";
Dropdown::show('State', array('name' => "states_id"));
echo "</td>";
echo "<td>";
echo "<div align='center'>";
echo "<input type='submit' name='add_state' value='" . _sx('button', 'Post') . "' class='submit' >";
echo "</div></td></tr>";
echo "</table>";
Html::closeForm();
echo "</div>";
}
}
}