<?php
require_once 'vendor/autoload.php';

class User
{
    public $username;
    public $first_name;
    public $last_name;
    public $organization;
    public $user_hash;
    public $password;
    public $street;
    public $zip;
    public $city;
    public $country;
    public $email;
    public $phone;
    public bool $eula_signed;
    public bool $privacy_policy_signed;
    public bool $author;
    public $accepted_paper_id;
    public $participation_confirmed;
    public $participation_confirmed_at;
    public bool $student;
    public bool $conference_dinner;
    public $total_costs;

    function __construct()
    {
        $this->username = "";
        $this->first_name = "";
        $this->last_name = "";
        $this->email = "";
        $this->organization = "";
        $this->user_hash = "";
        $this->password = "";
        $this->city = "";
        $this->country = "";
        $this->zip = "";
        $this->street = "";
        $this->phone = "";
        $this->eula_signed = false;
        $this->privacy_policy_signed = false;
        $this->author = false;
        $this->accepted_paper_id = "";
        $this->participation_confirmed = false;
        $this->participation_confirmed_at = "";
        $this->student = false;
        $this->conference_dinner = false;
        $this->total_costs = 0;
    }

    function __construct1(object $data)
    {
        foreach ($data as $key => $value) {
            if (array_key_exists($key, (array) $this))
                $this->{$key} = $value;
        }
        if (isset($data->password)) $this->set_password($data->password);
    }

    function init_from_object(object $data)
    {
        foreach ($data as $key => $value) {
            if (array_key_exists($key, (array) $this))
                $this->{$key} = $value;
        }
        if (isset($data->password)) $this->set_password($data->password);
    }

    function init_from_array(array $data)
    {
        foreach ($data as $key => $value) {
            if (array_key_exists($key, (array) $this)) {
                if (is_bool(gettype($this->{$key})) && is_string($value))
                    $this->{$key} = !empty($value);
                else
                    $this->{$key} = $value;
            }
        }
        if (!empty($data["password"])) $this->set_password($data["password"]);
    }


    function set_password(string $password)
    {
        include 'config.php';
        if ($ENCRYPT_PASSWORDS) {
            $this->user_hash = "{crypt}" . crypt($password, '$6$' . generateSalt(10) . '$');
            # $this->user_hash = "{SHA}" .  base64_encode(sha1($password, true));
        } else {
            $this->user_hash = "{CLEAR}" . $password;
        }
        $this->password = $this->user_hash;
    }

    function to_string()
    {
        $tmp_user = $this;
        $tmp_user->password = "***";
        $tmp_user->user_hash = "***";
        return  json_encode($tmp_user);
    }

    function backup_in_session()
    {
        global $_SESSION;
        foreach ($this as $key => $value) {
            $_SESSION[$key] = $value;
        }
    }

    function to_table() {
        $table = "<table  style='border: 1px solid #e1e4e8; border-collapse: collapse; width: 100%;'>";
        foreach ($this as $key => $value) {
            if ($key != "password" && $key != "user_hash" && !empty($value)) {
                if (is_bool($value)) {
                    if ($value) $value = "yes";
                    else $value = "no";
                }
                $value = str_replace("\r\n", "<br>", $value);
                $key = str_replace("_", " ", ucfirst($key));
                $table .= " <tr>
  <td style='border: 1px solid #e1e4e8; padding: 6px 13px;'><strong>$key</strong></td>
  <td style='border: 1px solid #e1e4e8; padding: 6px 13px;'>$value</td>
 </tr>\n";
            }
        }
        $table .= "</table>";
        return $table;
    }
}