<?php

include "../../root.class.php";

$html = new html();
$html->add_styles_page();

$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();
$add_site->onclick("add_site()");


?>

<div class="form_down">
    <h2>ADD SITE</h2>
    <?php
    $name->add();
    $company_id->add();
    $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");