<?php
session_start();
include "../../html.class.php";
include "../../root.class.php";
include "../../classes/db.class.php";
$html = new html();
$functions = new functions();


$name = new input();
$name->id("name");
$name->name("name");
$name->type("text");
$name->placeholder("Site Name");
$name->class();
$name->required();


$company_id = new input();
$company_id->id("company_id");
$company_id->name("company_id");
$company_id->type("hidden");
$company_id->value($_SESSION['company_id']);
$company_id->class();


$add_site = new button();
$add_site->id("add_site");
$add_site->name("add_site");
$add_site->value("Add Site");
$add_site->class("app_buttons");
$add_site->onclick("add_site()");


?>

<div class="tank_item_container form_down">
    <h2>ADD SITE</h2>
    <?php
    $name->add();
    $company_id->add();
    echo "<br>";
    $add_site->add();
    ?>
</div>

<?php 

$ajax = new js_ajax();
$ajax->function_name("add_site");
$ajax->insert("sites");
$ajax->on_success("SITE ADDED SUCCESSFULLY");
$ajax->redirect("site_settings.php");