Пример #1
0
 public function actionDeleteUser()
 {
     $selection = (array) Yii::$app->request->post('selection');
     foreach ($selection as $id) {
         if ($id != Yii::$app->params['adminId']) {
             User::deleteAll(['id' => $id]);
             Post::deleteAll(['user_id' => $id]);
             PostNotification::deleteAll(['action_id' => $id]);
             PostNotification::deleteAll(['receiver_id' => $id]);
             Comment::deleteAll(['user_id' => $id]);
             Like::deleteAll(['user_id' => $id]);
             Message::deleteAll(['sender_id' => $id]);
             Message::deleteAll(['receiver_id' => $id]);
             Relationship::deleteAll(['user_id_1' => $id]);
             Relationship::deleteAll(['user_id_2' => $id]);
             RelationshipNotification::deleteAll(['action_id' => $id]);
             RelationshipNotification::deleteAll(['receive_id' => $id]);
             Schedule::deleteAll(['own_id' => $id]);
             ScheduleNotification::deleteAll(['action_id' => $id]);
             ScheduleNotification::deleteAll(['receiver_id' => $id]);
         }
     }
     return $this->render('user-manage');
 }
Пример #2
0
                                            </li>';
        }
    }
}
?>
                            </ul>
                        </li>
                        <li class="footer">
                            <a href="#">Xem tất cả</a>
                        </li>
                    </ul>
                </li>
                <!-- User Account: style can be found in dropdown.less -->
                <li class="notify_rel dropdown tasks-menu">
                    <?php 
$listScheduleNotify = \common\models\ScheduleNotification::find()->where(['receiver_id' => Yii::$app->user->getId()])->asArray()->all();
?>
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <i class="fa fa-flag-o"></i>
                        <span class="rel_notify_count label label-danger"><?php 
if (sizeof($listScheduleNotify) > 0) {
    echo sizeof($listScheduleNotify);
}
?>
</span>
                    </a>
                    <ul class="dropdown-menu">
                        <li class="header">Bạn có <?php 
echo sizeof($listScheduleNotify);
?>
 thông báo công việc </li>
Пример #3
0
 public function actionDeclineReceivedSchedule($id)
 {
     ScheduleNotification::deleteAll(['id' => $id]);
     $this->redirect('?r=schedule/create-event');
 }