diff --git a/backend/modules/calendar/controllers/AjaxController.php b/backend/modules/calendar/controllers/AjaxController.php
new file mode 100644
index 0000000..85530c3
--- /dev/null
+++ b/backend/modules/calendar/controllers/AjaxController.php
@@ -0,0 +1,32 @@
+search(Yii::$app->request->queryParams)->getModels();
+ $models_array = ArrayHelper::toArray($models, [
+ 'backend\modules\card\models\UserCard' => [
+ 'id',
+ 'dob',
+ 'fio'
+ ],
+ ]);
+
+ $response = Yii::$app->response;
+ $response->format = Response::FORMAT_JSON;
+ $response->getHeaders()->set('Content-Type', 'application/json; charset=utf-8');
+ $response->content = json_encode(
+ $models_array
+ );
+ return $response;
+ }
+}?>
diff --git a/backend/modules/calendar/controllers/CalendarController.php b/backend/modules/calendar/controllers/CalendarController.php
index 86ae7e3..352efac 100644
--- a/backend/modules/calendar/controllers/CalendarController.php
+++ b/backend/modules/calendar/controllers/CalendarController.php
@@ -3,7 +3,6 @@
namespace backend\modules\calendar\controllers;
use backend\modules\card\models\UserCardSearch;
-use common\classes\Debug;
use Yii;
use yii\data\ArrayDataProvider;
use yii\filters\AccessControl;
@@ -43,6 +42,10 @@ class CalendarController extends Controller
* Renders the index view for the module
* @return string
*/
+ public function actionCalendar(){
+ return $this->render('calendar');
+ }
+
public function actionIndex()
{
$searchModel = new UserCardSearch();
diff --git a/backend/modules/calendar/views/calendar/calendar.php b/backend/modules/calendar/views/calendar/calendar.php
new file mode 100644
index 0000000..ca050c5
--- /dev/null
+++ b/backend/modules/calendar/views/calendar/calendar.php
@@ -0,0 +1,59 @@
+title = 'Календарь ДР';
+?>
+= \backend\widgets\Calendar::widget([
+
+ 'css' => '.success{color: orange;}',
+
+ 'button' => Html::a(' Назад',
+ Yii::$app->request->referrer, ['class' => 'btn btn-primary',]),
+ 'runBuild' => "function (date, content){
+ this.build(date, content)
+ }",
+ 'updateContent' => "function(date){
+ let monthNumber = date.substr(5, 2);
+ return fetch('../ajax/get-birthday-by-month?' +
+ 'month=' + monthNumber)
+ .then((res) => {
+ return res.json()
+ })
+ }",
+ 'getColor' => "function (date, dates = null) {
+ for (let contentDate of dates) {
+ if (contentDate['dob'].substr(8, 2) == DateHelper.intToDate(date.getDate())) {
+ return 'success';
+ }
+ }
+ }",
+ 'getHtmlContentForDate' => 'function (content, date) {
+ let flag = false
+ let html = `
+
+
+
#
+
ФИО
+
Дата рождения
+
+
+ `;
+ for (let i = 1; i <= content.length; i++) {
+ let model = content[i - 1];
+ if (model["dob"].substr(8, 2) == date.substr(8, 2)) {
+ flag = true;
+ html += `
`
+ html += `
${i}
`
+ html += `
${model["fio"]}
`
+ html += `
${model["dob"]}
`
+ html += CalendarHelper._getActionColumn(`secure/calendar/calendar`,model[`id`])
+ html += `