Example #1
0
copy($main_dir . '/mobile/css/style.css', $source . '/mobile/css/style.css');
/*
============================================
creating the database table
============================================
*/
$DB = new Database();
//a new connection to the database
$DB->table = strtolower($_POST['company'] . '_' . $folder_name);
//set table name
$table = $DB->table;
//get table name
if (!$DB->TableExists($table)) {
    //sql to create a table
    $sql = "CREATE TABLE `{$table}` (          \n\t\tId int(7) NOT NULL AUTO_INCREMENT,\n\t\tfirst_name varchar(50) NOT NULL,\n\t\tlast_name varchar(50) NOT NULL,\n\t\tmiddle_name varchar(50),\n\t\tname varchar(150),\n\t\temail varchar(50) NOT NULL,\n\t\ttelephone varchar(15),\n\t\ttimezone tinyint(4), \n\t\tgender varchar(20),\n\t\tlocale varchar(50),\n\t\tlink varchar(50),\n\t\tdesktop tinyint(1),\n\t\tmobile tinyint(1),\n\t\tnon_fb tinyint(1),\n\t\tPRIMARY KEY (Id),\n\t\tUNIQUE id (Id)\n\t)";
    $DB->MakeTable($sql);
} else {
    $title = 'Error';
    $html .= "<br>That table already exists";
    $mySmarty->assign('html', $html);
    $mySmarty->assign('success', $success);
    $mySmarty->assign('title', $title);
    $mySmarty->display("install.html");
    exit;
}
$DB->CloseDB();
//close database connection
$title = 'Success';
//the title of the html page
$success = true;
//no errors have occured up to this point. we have had a successfull installation