Beispiel #1
0
	function max_reached()
	{
		$dbh = dbops::getpdo();
		$stmt = $dbh->prepare("SELECT COUNT(*) FROM entity_grouping WHERE eg_type=:eg_type");
		$stmt->bindParam(":eg_type",$this->grouping_type);
		$stmt->execute() or die("an error occurred: EntityGrouping,+8465410");
		$result = $stmt->fetchColumn();
		return ($result >= AppSettings::gv("NumGroupedItemsType".$this->grouping_type."Max")) ? 1 : 0;
	}
Beispiel #2
0
 function send_basic_text_email($email_tos, $email_ccs, $email_subject, $email_message)
 {
     //following code adapted from phpMailer 2.2.1 README
     $mail = new PHPMailer();
     if (AppSettings::gv("smtp_server") == "localhost") {
         $mail->IsSendmail();
     } else {
         $mail->IsSMTP();
         // set mailer to use SMTP
         $mail->Host = AppSettings::gv("smtp_server");
         // specify main and backup server
         $mail->SMTPAuth = true;
         // turn on SMTP authentication
         $mail->Username = AppSettings::gv("smtp_user");
         // SMTP username
         $mail->Password = AppSettings::gv("smtp_pass");
         // SMTP password
     }
     $mail->From = AppSettings::gv("std_email_from");
     $mail->FromName = "New England Trade";
     foreach ($email_tos as $email_to) {
         //$mail->AddAddress("*****@*****.**", "Josh Adams");
         //$mail->AddAddress("*****@*****.**");                  // name is optional
         $mail->AddAddress($email_to);
         //echo "yo:".$email_to;
     }
     foreach ($email_ccs as $email_cc) {
         $mail->AddCC($email_cc);
     }
     //$mail->AddReplyTo("*****@*****.**", "Information");
     $mail->WordWrap = 50;
     // set word wrap to 50 characters
     //$mail->AddAttachment("/var/tmp/file.tar.gz");         // add attachments
     //$mail->AddAttachment("/tmp/image.jpg", "new.jpg");    // optional name
     //$mail->IsHTML(true);                                  // set email format to HTML
     $mail->Subject = $email_subject;
     $mail->Body = $email_message;
     //$mail->AltBody = "This is the body in plain text for non-HTML mail clients";
     if (!$mail->Send()) {
         echo "Message could not be sent. <p>";
         echo "Mailer Error: " . $mail->ErrorInfo . " ++";
         echo "<p>Developer note: Maybe the email address is invalid? Please try changing the user email address. <a href='/index.php'>Go back</a> to site.";
         exit;
     }
     return true;
     //echo "Message has been sent";
 }
 function add_entity_grouping_featured_list()
 {
     $doc = new DOMDocument("1.0", "UTF-8");
     $encap_elem = $doc->createElement("entity_grouping");
     $encap_elem = $doc->appendChild($encap_elem);
     $gdbs = new RotatedXMLTable(AppSettings::gv("NumGroupItemsType1Display"), "entity_grouping", array(), array());
     $gdbs->where_clause = "where eg_type = " . AppSettings::gv("eg_type__featured");
     $gdbs->get_xml_dataset("entity_grouping", $doc);
     //$this->append_child_from_xml($xmlstring);
     /* append all nodes from $nodeList to the new dom, as children of $root:
     		foreach ($nodeList as $domElement){
     		   $domNode = $newDom->importNode($domElement, true);
     		   $root->appendChild($domNode);
     		}*/
     $gdbs = new RotatedXMLTable(AppSettings::gv("NumGroupItemsType2Display"), "entity_grouping", array(), array());
     $gdbs->where_clause = "where eg_type = " . AppSettings::gv("eg_type__populartrades");
     $gdbs->get_xml_dataset("entity_grouping", $doc);
     $gdbs = new RotatedXMLTable(AppSettings::gv("NumGroupItemsType3Display"), "entity_grouping", array(), array());
     $gdbs->where_clause = "where eg_type = " . AppSettings::gv("eg_type__tradeoftheday");
     $gdbs->get_xml_dataset("entity_grouping", $doc);
     $xmlstring = $doc->saveXML();
     $this->append_child_from_xml($xmlstring);
 }
Beispiel #4
0
	function __construct()
	{
		$this->grouping_type = AppSettings::gv("eg_type__featured");
		parent::__construct();
	}
Beispiel #5
0
 static function email_to_defined_email_address($myent_settings_email, $subject, $message)
 {
     $the_email = AppSettings::gv($myent_settings_email);
     $email_producer = new EmailProducer();
     return $email_producer->send_basic_text_email(array($the_email), array(), $subject, $message);
 }
Beispiel #6
0
	function __construct()
	{
		$this->grouping_type = AppSettings::gv("eg_type__populartrades");
		parent::__construct();
	}
Beispiel #7
0
	function admin_product_search_results($xml_string)
	{
		//echo microtime()." in OutputProcessor::admin_product_search_results<br>";
		$params = myedbPager::get_xsl_pager_params($xml_string);
		$xslt_file = XSLT_Catalog::get_template('admin_product_search_results_tpl');

		$xmlprocessor = XMLProcessor::encap_with_lists($xml_string); 
		
		$xmlprocessor->add_city_state_zip_lists();
		$xml_string = $xmlprocessor->doc->saveXML();

		$params["eg_type__featured"] = AppSettings::gv("eg_type__featured");
		$params["NumFeaturedMax"] = AppSettings::gv("NumGroupedItemsType".$params["eg_type__featured"]."Max");
		$params["eg_type__populartrades"] = AppSettings::gv("eg_type__populartrades");
		$params["NumPopularTradesMax"] = AppSettings::gv("NumGroupedItemsType".$params["eg_type__populartrades"]."Max");
		$params["eg_type__tradeoftheday"] = AppSettings::gv("eg_type__tradeoftheday");
		$params["NumTradeOfTheDayMax"] = AppSettings::gv("NumGroupedItemsType".$params["eg_type__tradeoftheday"]."Max");
		OutputProcessor::preprocess_output($xml_string, $xslt_file, $params);
	}
Beispiel #8
0
	function __construct()
	{
		$this->grouping_type = AppSettings::gv("eg_type__tradeoftheday");
		parent::__construct();
	}