/**
  * This function deletes a Group from the MySQL-table based on the given parameter ID
  * @param numeric_string $ID
  */
 function DeleteGroup($ID)
 {
     require_once PATH_ACCESS . '/PriceClassManager.php';
     $pcManager = new PriceClassManager();
     try {
         //delete the priceclass
         $this->groupManager->delEntry($ID);
     } catch (Exception $e) {
         $this->groupInterface->dieError($this->msg['err_del_group'] . ' :' . $e->getMessage());
     }
     try {
         //delete priceclasses which are connected to the groups
         $priceclasses = $pcManager->getTableData(sprintf('GID = %s', $ID));
     } catch (Exception $e) {
         $this->groupInterface->dieError($this->msg['err_del_pc'] . ' :' . $e->getMessage());
     }
     foreach ($priceclasses as $priceclass) {
         try {
             $pcManager->delEntry($priceclass['ID']);
         } catch (Exception $e) {
             $this->groupInterface->dieError($this->msg['err_del_pc'] . ' :' . $e->getMessage());
         }
     }
     $this->groupInterface->dieMsg($this->msg['fin_del_group']);
 }
Beispiel #2
0
 /**
  * Change Settings for Solis
  * Enter description here ...
  */
 function ChangeSettings($soli_price)
 {
     require_once PATH_ACCESS . '/GlobalSettingsManager.php';
     require_once PATH_ACCESS . '/PriceClassManager.php';
     $gbManager = new GlobalSettingsManager();
     $pcManager = new PriceClassManager();
     die_error(SOLI_ERR_INP_PRICE);
     if ($soli_price !== NULL) {
         try {
             try {
                 //inputcheck
                 inputcheck($_POST['soli_price'], 'credits');
             } catch (Exception $e) {
                 die_error(SOLI_ERR_INP_PRICE);
                 $this->soliInterface->dieError($this->msg['SOLI_ERR_INP_PRICE']);
             }
             $gbManager->changeSoliPrice($_POST['soli_price']);
         } catch (Exception $e) {
             die_error(SOLI_ERR_CHANGE_PRICE . ':' . $e->getMessage());
             $this->soliInterface->dieError($this->msg['SOLI_ERR_CHANGE_PRICE '] . ':' . $e->getMessage());
         }
         $this->soliInterface->dieMsg($this->msg['SOLI_FIN_CHANGE']);
     } else {
         try {
             $soli_price = $gbManager->getSoliPrice();
             $priceclasses = $pcManager->getTableData();
         } catch (Exception $e) {
             $this->soliInterface->dieError($this->msg['SOLI_ERR_PRICE']);
         }
         $this->soliInterface->ChangeSettings($soli_price, $priceclasses);
     }
 }