<?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("Name");
$name->class();
$name->required();

$email = new input();
$email->id("email");
$email->name("email");
$email->type("text");
$email->placeholder("Email");
$email->class();
$email->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_email");
$add_site->name("add_site");
$add_site->value("ADD");
$add_site->class("app_buttons");
$add_site->onclick("add_email()");


?>

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

    $email->add();
    $company_id->add();
    echo "<br>";
    $add_site->add();
    ?>
</div>

<?php 

$ajax = new js_ajax();
$ajax->function_name("add_email");
$ajax->insert("email_notifications");
$ajax->on_success("EMAIL ADDED SUCCESSFULLY");
$ajax->redirect("home.php");