Skip to content

Commit

Permalink
доробив модуль profile
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiynovos committed Jun 24, 2015
1 parent cf66b9b commit 8ab1300
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
6 changes: 5 additions & 1 deletion modules/admin/models/v_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ class v_users {
public $sur_name;
public $birthday;
public $entry_year;
public $gradation_year;
public $graduation_year;
public $department_id;
public $speciality_id;
public $teaching_form;
public $education_qualification;
public $additional_info;

function getName() {
return $this->sur_name . ' '. $this->first_name;
Expand Down
4 changes: 3 additions & 1 deletion modules/profile/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function _index()

LoadModel('admin', 'v_users');
LoadModel('account', 'department');
LoadModel('account', 'speciality');
$me = LoadPlugin('User');

$user = $model->getRowByParam(
Expand All @@ -28,8 +29,9 @@ function _index()
}


$this->meta['title'] = $user->sur_name . ' ' . $user->first_name . '' . $user->last_name;
$this->meta['title'] = $user->sur_name . ' ' . $user->first_name . ' ' . $user->last_name;
$this->data['user'] = $user;
$this->data['department'] = $model->getById(new department(), $user->department_id);
$this->data['speciality'] = $model->getById(new speciality(), $user->speciality_id);
}
}
6 changes: 5 additions & 1 deletion modules/profile/views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ <h3><?=$data['user']->sur_name?> <?=$data['user']->first_name?> <?=$data['user']

<ul class="list-group">
<li class="list-group-item"><b><?=ENTRY_YEAR?> :</b> <?=$data['user']->entry_year?></li>
<li class="list-group-item"><b><?=GRADUATION_YEAR?> :</b> <?=$data['user']->gradation_year?></li>
<li class="list-group-item"><b><?=GRADUATION_YEAR?> :</b> <?=$data['user']->graduation_year?></li>
<li class="list-group-item"><b><?=BIRTHDAY?> :</b> <?=$data['user']->birthday?></li>
<li class="list-group-item"><b><?=DEPARTMENT?> :</b> <?=$data['department']->name?></li>
<li class="list-group-item"><b><?=SPECIALITY?> :</b> <?=$data['speciality']->name?></li>
<li class="list-group-item"><b><?=TEACHING_FORM?> :</b> <?=$data['user']->teaching_form?></li>
<li class="list-group-item"><b><?=EDUCATION_QUALIFICATION?> :</b> <?=$data['user']->education_qualification?></li>
<li class="list-group-item"><b><?=ADDITIONAL_INFO?> :</b> <?=$data['user']->additional_info?></li>
</ul>
</div>
</div>
4 changes: 2 additions & 2 deletions plugins/Graduates/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ function get()
{
$sql = LoadPlugin('SafeMySQL');

$result = $sql->getRow('SELECT * FROM users WHERE group_id = 2 ORDER BY RAND() LIMIT 1');
$result = $sql->getRow('SELECT * FROM v_users WHERE group_id = 2 ORDER BY RAND() LIMIT 1');

echo '<a href = "/profile/' . $result['login'] . '"><img class = "thumbnail" src = "/content/avatars/' . $result['avatar'] . '"></a>';
echo '<a href = "/profile/' . $result['login'] . '"><img class = "thumbnail" src = "/content/avatars/' . $result['avatar'] . '"><p>'.$result['sur_name'].' '.$result['first_name'].' </p></a>';
}
}

0 comments on commit 8ab1300

Please sign in to comment.