<?php
/* idempotent control */
/* For licensing terms, see /license.txt */
require_once __DIR__.'/../../main/inc/global.inc.php';

if(!api_is_platform_admin()){
    die('You must have admin permissions to install plugins');
}

$h = "<h2>Chamidoc Tools Health Checkup</h2><br><ul>";

$sql = "CREATE TABLE IF NOT EXISTS plugin_chamidoc_state(
    id INT NOT NULL AUTO_INCREMENT,
    user_id INT,
    lp_id INT,
    item_id INT,
    path_item INT,
    c_id INT,
    url_id INT,
    title VARCHAR(255) NOT NULL,
    typec VARCHAR(255) NOT NULL,
    code VARCHAR(255) NOT NULL,
    path_file VARCHAR(255) NOT NULL,
    creation_date DATETIME,
    id_session INT,
    PRIMARY KEY (id));";
Database::query($sql);

$h .= '<li>plugin_chamidoc_state table created</li><br>';

echo $h;
