Пример #1
0
                    backgroundColor: "rgba(<?php 
    echo implode(',', EventsAdmin::hex2rgb(EventsAdmin::adjustBrightness($categories[$category]['color'], -50)));
    ?>
,0.2)",
                    borderColor: "rgba(<?php 
    echo implode(',', EventsAdmin::hex2rgb(EventsAdmin::adjustBrightness($categories[$category]['color'], -50)));
    ?>
,1)",
                    pointBackgroundColor: "rgba(<?php 
    echo implode(',', EventsAdmin::hex2rgb(EventsAdmin::adjustBrightness($categories[$category]['color'], -50)));
    ?>
,1)",
                    pointBorderColor: "#fff",
                    pointHoverBackgroundColor: "#fff",
                    pointHoverBorderColor: "rgba(<?php 
    echo implode(',', EventsAdmin::hex2rgb(EventsAdmin::adjustBrightness($categories[$category]['color'], -50)));
    ?>
,1)",
                    data: [<?php 
    echo implode(',', array_column($events, 'staff'));
    ?>
]
                },
            ]
        };
    <?php 
}
?>
    // category events
    new Chart($("#category-events"), { type: 'doughnut', data: categoryEvents });
    // location events
Пример #2
0
 /**
  * _getLocationData
  *
  * @return array  with location data from Request::post
  *
  */
 private static function _getLocationData()
 {
     $address = (string) Request::post('location_address');
     $coordinates = $address ? EventsAdmin::_getCoordinates($address) : Null;
     return array('deleted' => 0, 'title' => (string) htmlspecialchars(Request::post('location_title')), 'website' => (string) Request::post('location_website'), 'address' => $address, 'lon' => $coordinates ? $coordinates['lon'] : '', 'lat' => $coordinates ? $coordinates['lat'] : '');
 }