예제 #1
0
 public static function getMarkupForPublisherWebsite($publisher_website_id, $config, $cached = true)
 {
     $PublisherWebsiteMarkupFactory = \_factory\PublisherWebsiteMarkup::get_instance();
     $params = array();
     $params["PublisherWebsiteID"] = $publisher_website_id;
     if ($cached === true) {
         $publisher_website_markup = $PublisherWebsiteMarkupFactory->get_row_cached($config, $params);
     } else {
         $publisher_website_markup = $PublisherWebsiteMarkupFactory->get_row($params);
     }
     return $publisher_website_markup;
 }
예제 #2
0
 /**
  *
  * @return Ambigous <\Zend\Http\Response, \Zend\Stdlib\ResponseInterface>
  */
 public function changedomainmarkupAction()
 {
     $initialized = $this->initialize();
     if ($initialized !== true) {
         return $initialized;
     }
     if ($this->is_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('domain-markup');
     $PublisherWebsiteMarkupFactory = \_factory\PublisherWebsiteMarkup::get_instance();
     $params = array();
     $params["PublisherWebsiteID"] = $publisher_website_id;
     $PublisherWebsiteMarkup = $PublisherWebsiteMarkupFactory->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);
     $_PublisherWebsiteMarkup = new \model\PublisherWebsiteMarkup();
     $_PublisherWebsiteMarkup->PublisherWebsiteID = $publisher_website_id;
     $_PublisherWebsiteMarkup->MarkupRate = $publisher_website_markup;
     if ($PublisherWebsiteMarkup != null) {
         $PublisherWebsiteMarkupFactory->updatePublisherWebsiteMarkup($_PublisherWebsiteMarkup);
     } else {
         $PublisherWebsiteMarkupFactory->insertPublisherWebsiteMarkup($_PublisherWebsiteMarkup);
     }
     return $this->redirect()->toRoute('publisher');
 }