?> " class="small num_products"/> </div> <div class="grid_1"><strong id="price_<?php echo $id; ?> ">$<?php echo $price; ?> </strong></div> <div class="clear"></div> </div> <?php } $total_taxes = round($sub_total * (UtilsHelper::Settings("taxes") / 100), 2); $total = $sub_total + $total_taxes; ?> <br /> <div class="row"> <div class="grid_1 right"><strong id="sub_total">$<?php echo $sub_total; ?> </strong></div><div class="grid_2 right">Merchandise Total:</div> <div class="clear"></div> <div class="grid_1 right"><strong id="taxes_total">$<?php echo $total_taxes; ?> </strong></div><div class="grid_2 right">Estimated Taxes:</div>
public function executeProcessSale() { $this->setLayout(false); $this->result = false; $request = $this->getRequest(); $request->setParameter('x_exp_date', $this->getRequestParameter("exp_month") . "/" . $this->getRequestParameter("exp_year")); $request->setParameter("exp_month", ""); $request->setParameter("exp_year", ""); if ($this->getRequestParameter("submitted")) { if (array_key_exists("cart", $_SESSION)) { $products = array(); foreach ($_SESSION["cart"] as $item) { $doc = Document::getDocumentInstance($item); if ($doc) { $cnt = $_SESSION["num"][$item]; if (!$cnt) { $cnt = 1; } $price = $doc->getPrice(); $price = $price * $cnt; echo "price:" . $price . "<br>"; $totalPrice += $price; } } $totalPrice += round($totalPrice * (UtilsHelper::Settings("taxes") / 100), 2); } require_once sfConfig::get('sf_web_dir') . '/anet_php_sdk/AuthorizeNet.php'; $transaction = new AuthorizeNetAIM(); $transaction->setSandbox(AUTHORIZENET_SANDBOX); $transaction->setFields(array('amount' => $totalPrice, 'card_num' => $this->getRequestParameter('x_card_num'), 'exp_date' => $this->getRequestParameter('x_exp_date'), 'first_name' => $this->getRequestParameter('x_first_name'), 'last_name' => $this->getRequestParameter('x_last_name'), 'address' => $this->getRequestParameter('x_address'), 'email' => $this->getRequestParameter('x_email'), 'city' => $this->getRequestParameter('x_city'), 'state' => $this->getRequestParameter('x_state'), 'country' => $this->getRequestParameter('x_country'), 'zip' => $this->getRequestParameter('x_zip'), 'email' => $this->getRequestParameter('x_email'), 'card_code' => $this->getRequestParameter('x_card_code'))); $transaction->setCustomFields(array('products' => $this->getRequestParameter('x_delivery_address'))); $response = $transaction->authorizeAndCapture(); $this->response = $response; if (!$this->getRequestParameter('terms')) { $request->setError('errterms', "Please accept the terms of use"); UtilsHelper::setFlashMsg('', UtilsHelper::MSG_ERROR); } else { if ($response->approved) { $this->result = "success"; $this->transaction_id = $response->transaction_id; $message = "\n\t\t\t\t\tYou successfully ordered products from SubcommPools.com<br>\n\t\t\t\t\t<br>Date:" . date('l jS \\of F Y h:i:s A') . "<br>\n\t\t\t\t\t<br>Transaction number:" . $response->transaction_id . "<br>\n\t\t\t\t\t<br>Name: " . $this->getRequestParameter('x_first_name') . " " . $this->getRequestParameter('x_last_name') . "<br>\n\t\t\t\t\t<br>-------------------<br><br>"; foreach ($_SESSION["cart"] as $item) { $doc = Document::getDocumentInstance($item); if ($doc) { $itemCnt = $_SESSION["num"][$item]; if (!$itemCnt) { $itemCnt = 1; } $itemPrice = $doc->getPrice(); $itemPrice = $itemPrice * $cnt; $message .= $doc->getLabel() . ", Quantity: " . $itemCnt . ", \$" . $itemPrice . "<br>"; } } $message .= "<br>Total+Tax: \$" . $totalPrice . "<br>\n\t\t\t\t\t<br>Thank you for your purchase."; UtilsHelper::sendEmail($this->getRequestParameter('x_email'), $message, "SubcommPools Purchase", UtilsHelper::Settings("main_email"), "SubcommPools", UtilsHelper::Settings("main_email")); $_SESSION["cart"] = null; $_SESSION["num"] = null; } else { $this->response_text = $response->response_reason_text; //var_dump($response); $request->setError('errsubmit', $response->response_reason_text); UtilsHelper::setFlashMsg('', UtilsHelper::MSG_ERROR); //$this->result = $response->response_reason_text; //header('Location: error_page.php?response_reason_code='.$response->response_reason_code.'&response_code='.$response->response_code.'&response_reason_text=' .$response->response_reason_text); } } } }
<div class="mail"> <img src="images/icons/mail.png" alt="E-mail"> <a href="mailto: <?php echo UtilsHelper::Settings("main_email"); ?> "> <?php echo UtilsHelper::Settings("main_email"); ?> </a> </div> <div class="phone indent-top1"> <img src="images/icons/phone-touch.png" alt="Phone"> <?php echo UtilsHelper::Settings("telephone"); ?> </div> </address> </div> </div> </div> <div class="one-third column alpha omega indent-right2 border-right"> <div class="five columns"> <div class="indent-left1 indent-top2"> <nav> <?php echo MenuHelper::get_menu_by_tag("website_menu_main", array('depth' => 1, 'mainMasterClass' => 'menu-bottom', 'currentAClass' => 'selected', 'splitElements' => 4)); /* <ul class="menu-bottom"> <li><a class="selected" href="/">home</a></li>
function run_session_search($task, $args) { ini_set("memory_limit", "8192M"); ini_set("display_errors", 1); define('SF_ROOT_DIR', sfConfig::get('sf_root_dir')); define('SF_APP', 'frontend'); define('SF_ENVIRONMENT', 'prod'); define('SF_DEBUG', true); require_once SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'apps' . DIRECTORY_SEPARATOR . SF_APP . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php'; $databaseManager = new sfDatabaseManager(); $databaseManager->initialize(); //sfConfig::set('sf_cache_objects', false); //sfConfig::set('sf_cache_relations', false); //sfConfig::set('sf_use_relations_cache', false); //get all serch templates $c = new Criteria(); $searcheTemplates = SearchPeer::doSelect($c); //$searcheTemplates = array($st); $fields = array('Label', 'ApplicationNumber', 'RegisterNumber', 'RegistrationDate', 'ApplicationDate', 'ExpiresOn', 'ViennaClasses', 'NiceClasses', 'RightsOwner', 'RightsRepresentative', 'OfficeOfOrigin', 'DesignatedContractingParty'); $c = new Criteria(); //$c->add(ImportSessionPeer::CREATED_AT, "2014-11-03", Criteria::GREATER_EQUAL ); $importSessions = ImportSessionPeer::doSelect($c); /*if($args[0] == "-d") { foreach ($importSessions as $importSession) { $res = Document::getChildrenOf($importSession->getId(), "SearchMatch"); foreach ($res as $r) { $r->delete(); echo "."; } } exit(); }*/ $ind = 0; foreach ($importSessions as $importSession) { $found = false; if ($importSession->getTmCount() == 0) { continue; } $searchMatches = Document::getChildrenOf($importSession->getId(), "SearchMatch", false); //if($importSession->getId() == 552172) continue; if (count($searchMatches) > 0) { continue; } echo ">>> searching session: " . $importSession->getId() . "\n"; try { $sti = 1; foreach ($searcheTemplates as $searcheTemplate) { $searchOf = array(); foreach ($fields as $field) { $getter = "get" . $field; $param = $searcheTemplate->{$getter}(); if ($param) { $param = str_replace(array('+', '-', '&&', '||', '!', '(', ')', '{', '}', '[', ']', '^', '"', '~', ':', '\\', '.', '/'), array('\\+', '\\-', '\\&&', '\\||', '\\!', '\\(', '\\)', '\\{', '\\}', '\\[', '\\]', '\\^', '\\"', '\\~', '\\:', '\\\\', '\\.', '\\/'), $param); $searchOf[$field] = trim($param); } } /////////////////////// QUERY BUILDING ////////////////////////// $q = new Zend_Search_Lucene_Search_Query_Boolean(); $queryTerms = explode(" ", strtolower($query)); $i = 0; $query = ""; foreach ($searchOf as $field => $term) { if ($i > 0) { $query .= ' AND '; } if ($field == "NiceClasses" || $field == "ViennaClasses") { $query .= '('; $parts = explode(",", $term); foreach ($parts as $el) { for ($e = 1; $e < 15; $e++) { $query .= $field . $e . ':"' . trim($el) . '" OR '; } } $query = substr($query, 0, -4) . ')'; } elseif ($field == "ApplicationNumber" || $field == "RegisterNumber") { $query .= $field . ':'; $query .= trim($term); } else { $query .= $field . ':'; if (strpos($term, "*") !== false || strpos($term, "?") !== false) { $query .= trim(UtilsHelper::cyrillicConvert($term)); } else { $query .= trim(UtilsHelper::cyrillicConvert($term)) . '~0.7'; } } $i++; } $q = Zend_Search_Lucene_Search_QueryParser::parse($query); //////////////////////// SEARCH EXECUTION //////////////////// echo " | " . $sti . " > " . $searcheTemplate->getId(); $searchIndex = Zend_Search_Lucene::open(sfConfig::get('sf_root_dir') . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'search/' . $importSession->getId() . "/"); $searchResults = $searchIndex->find($q); $brandId = Document::getParentOf($searcheTemplate->getId(), "Brand", false); foreach ($searchResults as $searchResult) { if ($foundEls[$searchResult->did] == $brandId) { continue; } $foundEls[$searchResult->did] = $brandId; $found = true; $sm = new SearchMatch(); $sm->setLabel("Match"); $sm->setImportSession($importSession->getId()); $sm->setSearch($searcheTemplate->getId()); $sm->setTrademark($searchResult->did); $sm->save(null, $importSession); } $sti++; } if ($found) { UtilsHelper::sendEmail(UtilsHelper::Settings('main_email'), "Matches have been found, click below to see them <br> <a href='http://www.tm-smart.com/import-session-report.html?is=" . $importSession->getId() . "'>http://www.tm-smart.com/import-session-report.html?is=" . $importSession->getId() . "</a>", "TM Smart - Matches foud"); $ind++; } else { // UtilsHelper::sendEmail(UtilsHelper::Settings('main_email'), "No matches have been found", "TM Smart - No matches foud"); } } catch (Exception $e) { echo ">>>>>>>>>> Error on Session " . $importSession->getId() . "\n" . $e->getMessage(); continue; //echo_cms_error("ERROR: ".$e->getMessage()); } if ($ind > 10) { break; } } //sfConfig::set('sf_cache_objects', true); //sfConfig::set('sf_cache_relations', true); //sfConfig::set('sf_use_relations_cache', true); }
public function executeContact() { //exit(UtilsHelper::Settings("main_email")); $this->setLayout(false); if ($this->getRequestParameter("submitted") == "submitted") { $request = $this->getRequest(); $params = $request->getParameterHolder()->getAll(); foreach ($params as $key => $param) { if (!is_array($param)) { ${$key} = trim($param); } else { ${$key} = $param; } } $mail = new sfMail(); $mail->initialize(); $mail->setMailer('sendmail'); $mail->setCharset('utf-8'); $mail->setContentType('text/html'); $mail->setFrom($email, $full_name); $mail->addAddress(UtilsHelper::Settings("main_email")); $mail->setSubject("Съобщение от {$cf_name}"); $mail->setSender($cf_email, $cf_name); $mail->setFrom($cf_email, $cf_name); $mail->addReplyTo($cf_email); //$serviceLabel = null; //$serviceObj = Document::getDocumentInstance($service); //if($serviceObj) $serviceLabel = $serviceObj->getLabel(); $msg = ""; $msg .= "Име: " . $cf_name . "\n" . ($msg .= "И-Мейл: " . $cf_email . "\n"); //$msg .= "Adress: ".$adress."\n"; //$msg .= "City: ".$city."\n"; //$msg .= "Zip Code: ".$zip."\n"; //$msg .= "State: ".$state."\n"; //if($home_phone) $message .= "Home Phone: ".$home_phone."\n"; //$msg .= "Cell Phone: ".$cell_phone."\n"; $msg .= "Съобщение: " . $cf_msg . "\n"; //$msg .= "Date of Opening: ".$date_open."\n"; //if($date_close) $msg .= "Date of Closing: ".$date_close."\n"; //if($serviceLabel) $msg .= "Service: ".$serviceLabel."\n"; $mail->setBody(nl2br($msg)); $mail->send(); //UtilsHelper::setFlashMsg( UtilsHelper::Localize("website.frontend.Sent"), UtilsHelper::MSG_SUCCESS); $this->success = true; } }