$i_Email = $_POST['E-mail'];
        $i_UserName = $_POST['UserName'];
        $i_Password = $_POST['Password'];
        $i_ID = $_POST['ID'];
        $userType = $db->getUserType($i_ID);
        if ($userType == 0) {
            //write client
            $i_Rank = $_POST['Rank'];
            $client = new Client($i_FirstName, $i_SecondName, $i_Phone, $i_Email, $i_UserName, $i_Password, $i_Rank, $i_ID);
            $ok = $db->updateObjectInDB($client, DataBase::CilentTable);
        } else {
            if ($userType == 1 || $userType == 2) {
                //write employee
                $i_premmsion = $_POST['Permission'];
                $employee = new Employee($i_FirstName, $i_SecondName, $i_Phone, $i_Email, $i_premmsion, $i_UserName, $i_Password);
                $employee->setID($i_ID);
                if ($userType == 1) {
                    $ok = $db->updateObjectInDB($employee, DataBase::RepresentativeTable);
                } else {
                    $ok = $db->updateObjectInDB($employee, DataBase::ManagerTable);
                }
            }
        }
        if ($ok) {
            return self::getUserFromDatabase($i_ID);
        }
    }
}
if ($_POST['callSubmit']) {
    echo personalInfoPageGenerator::submit();
}
 public function __construct($i_UserID)
 {
     $this->m_user = personalInfoPageGenerator::getUserFromDatabase($i_UserID);
     //TODO:move to DB?
 }
<?php

include_once 'personalInfoPageGenerator.php';
$genaretor = new personalInfoPageGenerator($_POST['queriedUserID'], $_POST['queryingUserID']);
?>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="jquery-1.7.2.min.js"></script>
        <script type="text/javascript" src ="bootstrap/js/bootstrap.min.js"></script>
        <link href="bootstrap/css/bootstrap.css" rel="stylesheet">
        <TITLE>Personal Info Screen</TITLE>
        <script type="text/javascript">





<?php 
echo $genaretor->getInitScripttAccordingToViewingPreviliges();
echo $genaretor->getJSFunctionsAccordingToPremmisions();
?>

    $(document).ready(init);
        </script>
    </head>
    <body>