Пример #1
0
along with this program.  If not, see <http://www.gnu.org/licenses/>.

If you want to contact me by e-mail, this is my address: eugenio.tacchini@unicatt.it
***********************************************************************************
*/
// installed and allowed tables
$tables_names_ar = build_tables_names_array();
if (count($tables_names_ar) == 0) {
    // no tables installed and allowed
    echo "<p><b>[04] Error:</b> it is impossible to run DaDaBIK, probably because you have decided to exclude all the tables from the DaDaBIK interface; go to the <a href='admin.php'>administration interface</a> and include some tables.";
    exit;
} else {
    if (!isset($_GET["table_name"])) {
        $table_name = $tables_names_ar[0];
    } else {
        $table_name = $_GET["table_name"];
        if (!in_array($table_name, $tables_names_ar)) {
            // someone try to manage a not-allowed table by changing the url
            echo "<p><b>[05] Error:</b> you are attemping to manage a not allowed table.";
            exit;
        }
    }
    // end else
    $enabled_features_ar = build_enabled_features_ar($table_name);
    $enable_insert = $enabled_features_ar["insert"];
    $enable_edit = $enabled_features_ar["edit"];
    $enable_delete = $enabled_features_ar["delete"];
    $enable_details = $enabled_features_ar["details"];
    $table_internal_name = $prefix_internal_table . $table_name;
}
// end else
Пример #2
0
function build_enable_features_checkboxes($table_name)
{
    $enabled_features_ar = build_enabled_features_ar($table_name);
    $enable_features_checkboxes = "";
    $enable_features_checkboxes .= "<input type='checkbox' name='enable_insert' value='1'";
    $enable_features_checkboxes .= "";
    if ($enabled_features_ar["insert"] == "1") {
        $enable_features_checkboxes .= "checked";
    }
    // end if
    $enable_features_checkboxes .= ">Insert ";
    $enable_features_checkboxes .= "<input type='checkbox' name='enable_edit' value='1'";
    if ($enabled_features_ar["edit"] == "1") {
        $enable_features_checkboxes .= "checked";
    }
    // end if
    $enable_features_checkboxes .= ">Edit ";
    $enable_features_checkboxes .= "<input type='checkbox' name='enable_delete' value='1'";
    if ($enabled_features_ar["delete"] == "1") {
        $enable_features_checkboxes .= "checked";
    }
    // end if
    $enable_features_checkboxes .= ">Delete ";
    $enable_features_checkboxes .= "<input type='checkbox' name='enable_details' value='1'";
    if ($enabled_features_ar["details"] == "1") {
        $enable_features_checkboxes .= "checked";
    }
    // end if
    $enable_features_checkboxes .= ">Details ";
    return $enable_features_checkboxes;
}