update gán lịch trình cho nhân viên
This commit is contained in:
22
widgets/ScheduleDepartment.php
Normal file
22
widgets/ScheduleDepartment.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace app\widgets;
|
||||
|
||||
use yii\base\Widget;
|
||||
|
||||
class ScheduleDepartment extends Widget {
|
||||
|
||||
public $pid;
|
||||
|
||||
public function init() {
|
||||
parent::init();
|
||||
}
|
||||
|
||||
public function run() {
|
||||
|
||||
return $this->render("schedule-department", [
|
||||
"lists" => \app\models\Department::find()->andWhere(['pid' => $this->pid])->all()
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
15
widgets/views/schedule-department.tpl
Normal file
15
widgets/views/schedule-department.tpl
Normal file
@@ -0,0 +1,15 @@
|
||||
{foreach from=$lists item=l}
|
||||
<div style="cursor: pointer;">
|
||||
<i class="fa fa-minus-square-o" onclick="schedule.tree(this);" data="{$l->code}" data-stt="true"></i>
|
||||
<span class="department-schedule" onclick="schedule.chooseDepartment(this);" data-href='{yii\helpers\Url::to(['/assign/staff','id'=>$l->code])}'>
|
||||
{$l->name}
|
||||
{$staff=$l->countStaff}
|
||||
{if $staff>0}
|
||||
[<span class="text-red">{$staff}</span>]
|
||||
{/if}
|
||||
</span>
|
||||
<div id="sub-department-schedule-{$l->code}" style="padding-left: 20px;">
|
||||
{\app\widgets\ScheduleDepartment::widget(["pid"=>$l->code])}
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
Reference in New Issue
Block a user