view->setVar('user', $this->auth->user); $actions = LocationsActions::find(); foreach($actions as $action){ $line = LocationLines::FindFirst([ 'conditions' => 'action = ?1 AND action_ = ?2 AND action_ <> ?1', 'bind' => [1 => $this->auth->user->action, 2 => $action->id] ]); if($action->id !== $this->auth->user->action and $line) $this->view->setVars([ 'top' => (($action->left / 222) * 100), 'left' => (($action->top / 300) * 100) ]); } } }