<?php
class InstallationModel {
  protected $database;

  public function __construct() {
    $this->database = new Database("localhost", SQL_USER_NAME, SQL_USER_PASS, SQL_DATABASE_NAME, "panel_information");
  }

  public function install_database_tables() {
    require_once 'sql.php';

    foreach ($tables_to_install as $table_to_install) {
      $table_installation_query = $this->database->run_query($table_to_install);

      if (!$table_installation_query) { return false; }
    }

    return true;
  }

  public function change_installed_status($status) {
    return file_put_contents("../app/config/installed", $status);
  }

  public function set_installation_time() {
    return file_put_contents("../app/config/installation_time", time());
  }
}
?>
