Skip to content

Commit

Permalink
Remove "FACILITY_ENABLED" Flag
Browse files Browse the repository at this point in the history
  • Loading branch information
think-mcunanan committed Dec 21, 2020
1 parent 768fb88 commit b1e380e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 36 deletions.
26 changes: 0 additions & 26 deletions app/controllers/components/misc_function.php
Original file line number Diff line number Diff line change
Expand Up @@ -1812,32 +1812,6 @@ function GetDailyKanzashiCustomersLimit(&$controller, $dbname, $storecode, $ymd)
return $result;
}

/**
* Determine whether Facility is Enabled
*
* @param controller &$controller
* @param string $dbname
* @param int $storecode
* @return boolean
*/
function IsFacilityEnabled(&$controller, $dbname, $storecode)
{
$controller->Store->set_company_database($dbname, $controller->Store);
$query = "
SELECT *
FROM store_settings
WHERE
storecode = :storecode AND
optionname = 'FacilityEnabled' AND
optionvaluei = 1
";

$param = compact('storecode');
$result = $controller->Store->query($query, $param, false);

return (bool)$result;
}

/**
* Get the available Facilities
*
Expand Down
16 changes: 6 additions & 10 deletions app/controllers/servers_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -1164,8 +1164,7 @@ class ServersController extends WebServicesController
'storetype' => 'tns:storetypeInformation',
'allstoretype' => 'tns:AllStoreTypes',
'KanzashiSalons' => 'tns:KanzashiSalons',
'KanzashiInfo' => 'tns:KanzashiInfo',
'FACILITY_ENABLED' => 'xsd:boolean'
'KanzashiInfo' => 'tns:KanzashiInfo'
)),

'_AllStoreTypes' => array('struct' => array(
Expand Down Expand Up @@ -3335,9 +3334,6 @@ function wsLogin($param)
}
}

$arrReturn['FACILITY_ENABLED'] = $this->MiscFunction
->IsFacilityEnabled($this, $arrReturn['dbname'], $arrReturn['storecode']);

if ($arrReturn['YOYAKU_HYOU_OPEN_TIME'] == "") {
$arrReturn['YOYAKU_HYOU_OPEN_TIME'] = $arrReturn['OPEN_TIME'];
$arrReturn['YOYAKU_HYOU_CLOSE_TIME'] = $arrReturn['CLOSE_TIME'];
Expand Down Expand Up @@ -9317,18 +9313,18 @@ function wsGetDataOfTheDay($sessionid, $param)

$facilities['records'] = array();
#----------------------------------------------------------------------------------------------------------------
if ($this->MiscFunction->IsFacilityEnabled($this, $storeinfo['dbname'], $param['STORECODE'])) {
$facilities = $this->MiscFunction
->GetAvailableFacilities($this, $storeinfo['dbname']);
$facilities = $this->MiscFunction
->GetAvailableFacilities($this, $storeinfo['dbname']);

if($facilities) {
$programs = $this->MiscFunction->
GetFacilityPrograms($this, $storeinfo['dbname'], $storeinfo['companyid'], $param['STORECODE'], $param['date']);

foreach($facilities['records'] as &$facility) {
foreach($programs as &$program){
if($facility['Id'] != $program['FacilityId'])
continue;

$facility['Programs'][] = $program;
unset($program);
}
Expand Down

0 comments on commit b1e380e

Please sign in to comment.