<h4>Notify <span class="notfications-name"><?php echo $selected['firstName']; ?> </span> When:</h4> </div> <div class="col-md-2 col-sm-2 col-xs-2"> <div class="col-md-6 col-sm-6 col-xs-6 notifications-title no-padd"><h5>SMS</h5></div> <div class="col-md-6 col-sm-6 col-xs-6 notifications-title no-padd"><h5>EMAIL</h5></div> </div> </div> <div class="col-md-12 col-sm-12 col-xs-12 notifications-info"> <?php foreach ($settingsArray as $settingCategories) { echo '<ul data-id="' . $showUser . '" class="clearfix"> '; foreach ($settingCategories as $key => $setting) { $title = ComponentString::settings($setting['name'], $setting['value'], 'notifications-enter-date', 'ENTER'); ?> <li class="nh-default col-md-12 col-sm-12 col-xs-12 no-padd active" data-id="<?php echo $key; ?> "> <div class="col-md-10 col-sm-10 col-xs-10 no-padd"> <h4><?php echo $title; ?> </h4> </div> <div class="col-md-2 col-sm-2 col-xs-2"> <div class="col-md-6 col-sm-6 col-xs-6"> <div class="col-md-12 col-sm-12 col-xs-12 switch white"> <label>
public function actionCalendar() { // $this->layout = "//layouts/calendar"; Yii::app()->clientScript->registerCssFile(Yii::app()->theme->baseUrl . "/css/my-calendar.css"); Yii::app()->clientScript->registerCssFile(Yii::app()->theme->baseUrl . "/css/my-calendar-resp.css"); Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . "/js/plugins/jQuery/jquery-ui.min.js", CClientScript::POS_HEAD); Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . "/js/plugins/fullcalendar/fullcalendar.js", CClientScript::POS_END); Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . "/js/plugins/spin/spin.js", CClientScript::POS_END); Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . "/js/main.js", CClientScript::POS_END); Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . "/js/my-calendar.js", CClientScript::POS_END); $returnArray = array(); $day = 60 * 60 * 24; $time = time(); $from = Yii::app()->request->getParam('from', ''); $to = Yii::app()->request->getParam('to', ''); $criteria = new CDbCriteria(); $criteria->addCondition('mstRequestUsers.user_id = ' . Yii::app()->user->getInfo()); $criteria->addCondition('mstRequestUsers.archived = 0'); // $criteria->addCondition('booking_type > 0'); if (!empty($from)) { $criteria->addCondition('bookingDate >= ' . $from); } if (!empty($to)) { $criteria->addCondition('bookingDate < ' . $to); } $criteria->with = array('mstRequestUsers'); $modelArray = Requests::model()->findAll($criteria); $eventsArray = array(); $requestsTempArray = array(); foreach ($modelArray as $model) { if ($model->booking_type > 0) { $criteria = new CDbCriteria(); $criteria->select = 'sum(amount) as amount'; $criteria->addCondition('request_id = ' . $model->id); $criteria->addCondition('status = 1'); $modelSum = Payments::model()->find($criteria); $moneyPaid = (int) $modelSum->amount; $eventsArray[] = array('id' => $model->id, 'creator' => $model->createdBy->firstName . ' ' . $model->createdBy->lastName, 'title' => ComponentString::showPart($model->map->name, 14), 'map' => ComponentString::showPart($model->map->name, 28), 'event_type' => $model->eventType->name, 'start_time' => date('H:i A', strtotime($model->start_time)), 'end_time' => date('H:i A', strtotime($model->end_time)), 'start' => $model->eventDate, 'dateName' => date('l, F d, Y', strtotime($model->eventDate)), 'allDay' => true, 'type' => $model->booking_type, 'daysTotal' => ceil((strtotime($model->eventDate) - strtotime($model->created_on)) / $day), 'daysLeft' => ceil((strtotime($model->eventDate) - $time) / $day), 'moneyPaid' => $moneyPaid, 'moneyTotal' => $model->amount); } else { $requestsTempArray[date('d-m-Y', strtotime($model->eventDate))][] = 1; } } $criteria = new CDbCriteria(); $criteria->addCondition(' (LOWER(calendarType.name) = "flag" AND t.created_by = ' . Yii::app()->user->getInfo() . ') OR (LOWER(calendarType.name) = "unavailable" AND t.created_by = ' . Yii::app()->user->getInfo() . ') OR (LOWER(calendarType.name) = "holiday") '); $criteria->addCondition('calendarType.status = 1'); $criteria->addCondition('t.status = 1'); $criteria->with = array('calendarType'); $modelArray = Calendar::model()->findAll($criteria); $flagsArray = array(); $holidaysArray = array(); $unavailableArray = array(); foreach ($modelArray as $model) { switch (strtolower($model->calendarType->name)) { case 'flag': $flagsArray[] = array('id' => $model->id, 'title' => ComponentString::showPart($model->message, 30), 'start' => $model->calendar_date); break; case 'holiday': $holidaysArray[] = array('id' => $model->id, 'title' => $model->message, 'start' => $model->calendar_date); break; case 'unavailable': $unavailableArray[] = array('id' => $model->id, 'title' => $model->message, 'start' => $model->calendar_date); break; } } $requestsArray = array(); foreach ($requestsTempArray as $key => $request) { $requestsArray[$key] = count($request); } $returnArray['events'] = $eventsArray; $returnArray['flags'] = $flagsArray; $returnArray['requests'] = $requestsArray; $returnArray['holidays'] = $holidaysArray; $returnArray['unavailable'] = $unavailableArray; $json = json_encode($returnArray); Yii::app()->clientScript->registerScript('mapvar10', "var json='" . $json . "';", CClientScript::POS_HEAD); $this->render('calendar'); }