You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
116 lines
2.3 KiB
116 lines
2.3 KiB
<?php
|
|
/**
|
|
* Function to get json and raw data in moderation table and return as collections or an empty resultset
|
|
*
|
|
* @param string $isJson = string 'true' or 'false'
|
|
* @return array
|
|
* access public function
|
|
*/
|
|
function getModerationResults(string $isJson): array
|
|
{
|
|
|
|
}
|
|
|
|
/**
|
|
* Return collections of moderation fields for raw data or json data
|
|
*
|
|
* @param boolean $isJson = true or false
|
|
* @return string
|
|
* access private function
|
|
*/
|
|
function getFields($isJson): string{
|
|
$jsonFields = '
|
|
no_show,
|
|
reservation,
|
|
event_type,
|
|
event_location,
|
|
event_month,
|
|
subscription_type
|
|
';
|
|
|
|
$nonJsonFields = '
|
|
flex_no_of_hours,
|
|
flex_places_to_lift_moderation,
|
|
flex_is_applied,
|
|
isActive,
|
|
author
|
|
';
|
|
|
|
//return list of selected fields
|
|
return $isJson == 'true' ? $jsonFields : $nonJsonFields;
|
|
}
|
|
|
|
/**
|
|
* Set selected for radio options
|
|
*
|
|
* @param string|integer $isSelected = actual value
|
|
* @param string|integer $compare = element name
|
|
* @return boolean
|
|
* access public function
|
|
*/
|
|
function isSelectedRadio($isSelected, $compare) {
|
|
if (trim($compare) == trim($isSelected)) {
|
|
return 'checked=checked';
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Get recordsets of the FF.
|
|
* - event types
|
|
* - city location
|
|
*
|
|
*
|
|
* @param string $settingsType
|
|
* @return any
|
|
*
|
|
* access private member
|
|
*/
|
|
function getSettingsData(string $settingsType) {
|
|
// Get a reference to the controller object
|
|
$CI = get_instance();
|
|
|
|
// load event city location model
|
|
$CI->load->model('event_city_location_model');
|
|
|
|
// load event type model
|
|
$CI->load->model('event_type_model');
|
|
|
|
//Populate result
|
|
switch ($settingsType) {
|
|
case 'city':
|
|
return $CI->event_city_location_model->list_city();
|
|
break;
|
|
|
|
case 'eventTypes':
|
|
return $CI->event_type_model->list_event_types();
|
|
break;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Set check for event types and locations
|
|
*
|
|
* @param integer $match = element value
|
|
* @param integer $ids = list of selected ids in table
|
|
* @return void
|
|
* access public function
|
|
*/
|
|
function checkOrUncheck(int $match, $listIds) {
|
|
|
|
if(notSet($listIds)){
|
|
return '';
|
|
}
|
|
|
|
//return checked attribute
|
|
if (in_array($match, $listIds)) {
|
|
return 'checked=checked';
|
|
}
|
|
}
|
|
|
|
function convertNumericToBoolean($numericValue): string {
|
|
if ($numericValue > 0) {
|
|
return 'true';
|
|
}
|
|
|
|
return 'false';
|
|
}
|
|
|