php class AreaController extends BaseController public function indexA

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
class AreaController extends BaseController {
public function indexAction() {
$this->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)
]);
}
}
}