public function ExeDelete($UserId)
 {
     $this->Users = (int) $UserId;
     $WsUsers = new WsUsers();
     $WsUsers->setUser_id($this->Users);
     $usuario = $WsUsers->find();
     if (!$WsUsers->getResult()) {
         $this->Result = false;
         $this->Error = ['Oppsss, você tentou remover um usuário que não existe no sistema!', WS_INFOR];
     } else {
         $WsUsers->setUser_id(null);
         $WsUsers->setUser_level(3);
         $WsUsers->Execute()->Query("#user_level#");
         if ($WsUsers->getRowCount() == 1 && $usuario->user_level == 3) {
             $this->Result = false;
             $this->Error = ['<b>Oppsss</b>, você não pode excluir todos os usuários administradores do sistema!', WS_ERROR];
         } else {
             $this->Result = true;
             $WsUsers->setUser_id($this->Users);
             $WsUsers->setUser_level(null);
             $WsUsers->Execute()->delete();
             $this->Error = ["<b>Sucesso:</b> O usuário <b>{$usuario->user_name}</b> foi excluido do sistema!", WS_ACCEPT];
         }
     }
 }
 public function checkLast()
 {
     $WsUsers = new WsUsers();
     $WsUsers->findAll();
     if ($WsUsers->getRowCount() == 1) {
         $WsUsers->setThis($WsUsers->getResult()[0]);
         $WsUsers->setUser_level(3);
         $WsUsers->update();
         $WsUsers->findAll();
     }
     return $WsUsers;
 }
                <label class="label_small">
                    <span class="field">Author:</span>
                    <select name="post_author">
                        <option value="<?php 
echo $_SESSION['userlogin']['user_id'];
?>
"> <?php 
echo "{$_SESSION['userlogin']['user_name']} {$_SESSION['userlogin']['user_lastname']}";
?>
 </option>
                        <?php 
$ReadAut = new WsUsers();
$ReadAut->setUser_id($_SESSION['userlogin']['user_id']);
$ReadAut->setUser_level(2);
$ReadAut->Query("WHERE user_id != :user_id AND user_level >= :user_level ORDER BY user_name ASC");
if ($ReadAut->getRowCount() >= 1) {
    foreach ($ReadAut->getResult() as $aut) {
        echo "<option ";
        if ($post['post_author'] == $aut->user_id) {
            echo "selected = \"selected\" ";
        }
        echo "value=\"{$aut->user_id}\"> {$aut->user_name} {$aut->user_lastname} </option>";
    }
}
?>
                    </select>
                </label>

            </div><!--/line-->

            <div class="label gbform" id="gbfoco">