Esempio n. 1
0
 public static function getMarkupForPrivateExchangePublisherWebsite($publisher_website_id, $config, $cached = true)
 {
     $PrivateExchangePublisherWebsiteMarkupFactory = \_factory\PrivateExchangePublisherWebsiteMarkup::get_instance();
     $params = array();
     $params["PublisherWebsiteID"] = $publisher_website_id;
     if ($cached === true) {
         $publisher_website_markup = $PrivateExchangePublisherWebsiteMarkupFactory->get_row_cached($config, $params);
     } else {
         $publisher_website_markup = $PrivateExchangePublisherWebsiteMarkupFactory->get_row($params);
     }
     return $publisher_website_markup;
 }
Esempio n. 2
0
 /**
  *
  * @return Ambigous <\Zend\Http\Response, \Zend\Stdlib\ResponseInterface>
  */
 public function changeprivateexchangedomainmarkupAction()
 {
     $initialized = $this->initialize();
     if ($initialized !== true) {
         return $initialized;
     }
     if ($this->is_super_admin == false && $this->is_domain_admin == false) {
         die("You do not have permission to access this page");
     }
     $publisher_website_id = $this->getRequest()->getQuery('markupdomainid');
     $publisher_website_markup = $this->getRequest()->getQuery('private-exchange-domain-markup');
     if ($this->is_super_admin == false && !\util\AuthHelper::domain_user_authorized_publisher_website($this->auth->getUserID(), $publisher_website_id)) {
         die("You are not authorized to perform this action: CODE 101");
     }
     $PrivateExchangePublisherWebsiteMarkupFactory = \_factory\PrivateExchangePublisherWebsiteMarkup::get_instance();
     $params = array();
     $params["PublisherWebsiteID"] = $publisher_website_id;
     $PrivateExchangePublisherWebsiteMarkup = $PrivateExchangePublisherWebsiteMarkupFactory->get_row($params);
     $publisher_website_markup = floatval($publisher_website_markup) / 100;
     if ($publisher_website_markup <= 0) {
         die("Domain Markup can not be less than or equal to zero percent");
     }
     if ($publisher_website_markup >= 1) {
         die("Domain Markup can not be greater than or equal to one hundred percent");
     }
     $publisher_website_markup = sprintf("%1.2f", $publisher_website_markup);
     $_PrivateExchangePublisherWebsiteMarkup = new \model\PrivateExchangePublisherWebsiteMarkup();
     $_PrivateExchangePublisherWebsiteMarkup->PublisherWebsiteID = $publisher_website_id;
     $_PrivateExchangePublisherWebsiteMarkup->MarkupRate = $publisher_website_markup;
     if ($PrivateExchangePublisherWebsiteMarkup != null) {
         $PrivateExchangePublisherWebsiteMarkupFactory->updatePrivateExchangePublisherWebsiteMarkup($_PrivateExchangePublisherWebsiteMarkup);
     } else {
         $PrivateExchangePublisherWebsiteMarkupFactory->insertPrivateExchangePublisherWebsiteMarkup($_PrivateExchangePublisherWebsiteMarkup);
     }
     if ($this->is_domain_admin) {
         return $this->redirect()->toRoute('pxpublishers');
     } else {
         return $this->redirect()->toRoute('publisher');
     }
 }