copy($statics . 'inc.paging.php', $dir . 'inc.paging.php'); copy($statics . 'inc.auth.php', $dir . 'inc.auth.php'); copy($statics . 'css/stylesheet.css', $dir . 'css/stylesheet.css'); /* Don't override configuration file */ if (!file_exists($dir . 'inc.config.php')) { copy($statics . 'inc.config.php', $dir . 'inc.config.php'); } /* Create each CRUD folder and files */ foreach ($project['tables'] as $table_name => $table_info) { $s = new Scaffold($project, $table_name, $table_info); $abm = "{$table_name}/"; if (!is_dir($dir . $abm)) { mkdir($dir . $abm); } file_put_contents($dir . $abm . $project['list_page'], $s->list_page()); file_put_contents($dir . $abm . $project['search_page'], $s->search_page()); file_put_contents($dir . $abm . $project['crud_page'], $s->crud_page()); } /* Log table schema definition */ file_put_contents($dir . 'schema.sql', $_POST['sql'] . "\n\n", FILE_APPEND); } } ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="assets/functions.js"></script> <title>PHP MySQL CRUD Scaffold</title> <link href="assets/style.css" rel="stylesheet" type="text/css" />