<?php
require_once(__DIR__.'/../includes/sysinit.php');
require("user.php");
$_user = new User; //new class instance
$_user->edtImage		= $_POST['edtImage'] ?? '';
$_user->edtName			= $_POST['edtName'] ?? '';
$_user->edtSurname		= $_POST['edtSurname'] ?? '';
$_user->edtEmail		= $_POST['edtEmail'] ?? '';
$_user->edtCell			= SableGeneralFunctions::getNumericPhoneNo($_POST['edtCell'] ?? '');
$_user->edtPhone		= SableGeneralFunctions::getNumericPhoneNo($_POST['edtPhone'] ?? '');

$_user->selCountryCode	= $_POST['selCountryCode'] ?? 0;
$_user->addresses 		= json_decode($_POST['addresses'] ?? '', true);

$_user->selGender		= $_POST['selGender'] ?? 0;
$_user->selPosition		= $_POST['selPosition'] ?? 0;

$_user->hddnUserCode	= $_POST['hddnUserCode'] ?? 0;
$_user->edtPwd			= $_POST['edtPwd'] ?? '';
$_user->edtConfirm		= $_POST['edtConfirm'] ?? '';


if ($_POST['action']=='0') $_user->addUser();
if ($_POST['action']=='1') $_user->addUser();
if ($_POST['action']=='2') $_user->viewUser();
if ($_POST['action']=='3') $_user->editUser();
if ($_POST['action']=='4') $_user->deleteUser();
if ($_POST['action']=='5') $_user->copyUser();
if ($_POST['action']=='6') $_user->addUser();
unset($_user);