Example #1
0
 public function create()
 {
     dbCreate($this->db)->run($this->conn);
     \r\db($this->db)->tableCreate('t1')->run($this->conn);
     \r\db($this->db)->tableCreate('t2')->run($this->conn);
     \r\db($this->db)->table('t1')->indexCreate('other')->run($this->conn);
     \r\db($this->db)->table('t2')->indexCreate('other')->run($this->conn);
 }
Example #2
0
<?php

dbCreate(_BBDD);
function getCabecera($nombre, $desc, $showButtons, $IDcurso, $IDtema)
{
    $OUT = '';
    $OUT .= '<div class="jumbotron">';
    $OUT .= '<div class="container">';
    $OUT .= '<h1>' . $nombre . '</h1>';
    $OUT .= '<p class="lead">' . $desc . '</p>';
    if ($showButtons == 1) {
        $OUT .= '<div class="btn-group pull-right">';
        $OUT .= '<a class="btn btn-default" href="' . _PORTALROOT . '">Volver al listado de cursos</a>';
        if ($IDcurso != '') {
            $OUT .= '<a class="btn btn-default" href="?IDcurso=' . $IDcurso . '">Volver al curso</a>';
        }
        if ($IDtema != '') {
            $OUT .= '<a class="btn btn-default" href="?IDcurso=' . $IDcurso . '&IDtema=' . $IDtema . '">Volver al tema</a>';
        }
        $OUT .= '</div>';
    }
    $OUT .= '</div>';
    $OUT .= '</div>';
    echo $OUT;
}
Example #3
0
        if ($create_table) {
            //Connect to the MySQL database
            $conn = dbConnect($dbHost, $dbUser, $dbPass);
            //Create table (and database)
            dbCreate($conn);
            //Close the MySQL connection
            mysqli_close($conn);
            //Finish
            return;
        } else {
            //Process the CSV file - loading, capitalization, email validation etc
            $lines = csvProcessing($filename);
            //Connect to the MySQL database
            $conn = dbConnect($dbHost, $dbUser, $dbPass);
            //Create table (and database)
            dbCreate($conn);
            //Insert the CSV data into the table
            insertData($lines, $conn);
            //Close the MySQL connection
            mysqli_close($conn);
            //Finish
            return;
        }
    }
}
//Process the CSV file - loading, capitalization, email validation etc
function csvProcessing($filename)
{
    //Open the CSV file
    $file = fopen($filename, "r");
    //Create an empty array to put the csv file into