$oid = 0;
if (isset($_POST['oid'])) {
    $oid = $_POST['oid'];
}
$item = Item::from_mysql_id($oid);
if ($item == null) {
    $item = new Item();
}
$buttons = isset($_POST['buttons']) ? $_POST['buttons'] : array();
$i = 0;
foreach ($buttons as $buttonName) {
    if ($buttonName == "") {
        continue;
    }
    $i++;
    $button = $item->get_Button($buttonName);
    ?>

    <tr>
        <td class="ui-corner-all">#<?php 
    echo $i;
    ?>
</td>
        <td class="ui-corner-all"><b><?php 
    echo $buttonName;
    ?>
</b></td>
        <td style="width:100%;" id="td_button_function_<?php 
    echo $buttonName;
    ?>
">