<?php
require_once(__DIR__."/../includes/sysinit.php");
include("client.php");
$_client = new Client; //new class instance
$_client->hddnClientId			= $_POST['hddnClientId'] ?? 0;
$_client->edtClientName			= $_POST['edtClientName'] ?? 0;
$_client->edtClientSurname			= $_POST['edtClientSurname'] ?? 0;
$_client->hddnIdTypeId			= $_POST['hddnIdTypeId'] ?? 0;
$_client->edtClientIdNo			= $_POST['edtClientIdNo'] ?? 0;
$_client->hddnClientTypeId			= $_POST['hddnClientTypeId'] ?? 0;
$_client->hddnAddressId			= $_POST['hddnAddressId'] ?? 0;
$_client->edtClientAddressNote			= $_POST['edtClientAddressNote'] ?? 0;
$_client->edtClientDistance			= $_POST['edtClientDistance'] ?? 0;
$_client->cbClientAddrBill			= $_POST['cbClientAddrBill'] ?? 0;
$_client->edtClientPhone			= $_POST['edtClientPhone'] ?? 0;
$_client->edtClientPhoneAlt			= $_POST['edtClientPhoneAlt'] ?? 0;
$_client->edtClientEmail			= $_POST['edtClientEmail'] ?? 0;
$_client->txtClientNote			= $_POST['txtClientNote'] ?? 0;
$_client->hddnGenderId			= $_POST['hddnGenderId'] ?? 0;
$_client->edtClientBusinessName			= $_POST['edtClientBusinessName'] ?? 0;
$_client->edtClientVatNo			= $_POST['edtClientVatNo'] ?? 0;
$_client->edtClientRegNo			= $_POST['edtClientRegNo'] ?? 0;
$_client->cbClientContract			= $_POST['cbClientContract'] ?? 0;
$_client->hddnClientParentId			= $_POST['hddnClientParentId'] ?? 0;
$_client->hddnRewardLevelId			= $_POST['hddnRewardLevelId'] ?? 0;
$_client->hddnClientDeleted			= $_POST['hddnClientDeleted'] ?? 0;
if ($_POST['action']=='0') $_client->addClient();
if ($_POST['action']=='1') $_client->addClient();
if ($_POST['action']=='2') $_client->viewClient();
if ($_POST['action']=='3') $_client->editClient();
if ($_POST['action']=='4') $_client->deleteClient();
unset($_client);
