public static function update_internal_fees()
 {
     $id = Core::validate(self::getVar('id'));
     $fieldName = Core::validate(self::getVar('fieldName'));
     $value = Core::validate(self::getVar('value'));
     $goodInput = false;
     switch ($fieldName) {
         case 'Fee':
             if ($value != null && Core::isDouble($value) && $value >= 0) {
                 $goodInput = true;
             }
             break;
         default:
             break;
     }
     if ($goodInput == true) {
         $rate = new Rate();
         $rate->setId($id);
         $rate->update(array($fieldName => $value));
         Core::printSuccessJson('');
     } else {
         Core::printErrorJson('Invalid input: ' . $value);
     }
 }
 public static function getPages()
 {
     $usr = usr::getCurrentUser(1);
     if (!isset($usr)) {
         return;
     }
     $widget = new Widget();
     $widget->setUID($usr->getId());
     $pages = $widget->getAllPages();
     foreach ($pages as $key => $value) {
         $id = $value['rate'];
         $rt = new Rate();
         $rt->setId($id);
         $rt->findById($id);
         $fcId = $rt->getFirstCurrencyId();
         $scId = $rt->getSecondCurrencyId();
         $cur = new Currency();
         $cur->findById($fcId);
         $firstCurr = $cur->getName();
         $cur->findById($scId);
         $secondCurr = $cur->getName();
         $arr = array();
         $arr['firstCurrency'] = $firstCurr;
         $arr['secondCurrency'] = $secondCurr;
         $pages[$key]['rate'] = $arr;
     }
     return $pages;
 }