first commit

This commit is contained in:
2026-04-24 15:32:21 +02:00
commit 20d40fead4
5046 changed files with 641038 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
<?php
class FileController extends MainController implements ControllerInterface
{
/**
* (non-PHPdoc)
* @see class/ControllerInterface#IndexAction($param)
*/
public function IndexAction($param) {
$data = array();
$data['lang']= $param['lang'] ;
$data['mf_file.publication']= 1 ;
$date = Utils::GetNowDate();
$data[' '] = array('value' => " mf_file.date_publication <= '$date' " ,'condition' => '');
$dalData = MfFileDAL::GetDalDataObj();
$dalData->setCondition($data);
//$dalData->setLimit(10);
$dalData->setSortBy('title');
$arrayFile = MfFileDAL::GetResult($dalData);
$arrayFileType = Utils::GetArrayList('mf_file_type', 'id_mf_file_type', 'name');
$arrayFileByCategory = array();
foreach ($arrayFileType as $idCategory => $categoryName) {
foreach ($arrayFile as $file) {
if ($idCategory == $file->GetType()) {
$arrayFileByCategory[$categoryName][] = $file;
}
}
}
// Utils::ArrayDisplay($param['urlParam']);
// Utils::ArrayDisplay(Router::GenerateUrl('PlikiLabel'));
//$this->RunShared('FormDownload', $param);
if (SessionProxy::IsSetValue('sendFormInfo')) {
$this->addRedirectInfo( Dictionary::Translate('message_sent'),null, Router::GenerateUrl('PlikiLabel'),array(),0);
}
$this->smarty->assign('arrayFileByCategory', $arrayFileByCategory);
$this->smarty->assign('arrayFileType', $arrayFileType);
$this->smarty->assign('arrayFile', $arrayFile);
}
/**
*
* @param unknown_type $param
* @return unknown_type
*/
public function preDispatch($param) {
$this->smarty->assign('lang', $param['lang']);
$this->Run($param);
//$this->AddTitle('');
// $this->RunShared('Banner', $param);
}
/**
*
* @param unknown_type $param
* @return unknown_type
*/
public function postDispatch($param) {
}
}

View File

@@ -0,0 +1,572 @@
<?php
/**
* $Id: IndexController.php 1254 2008-09-09 08:39:51Z lule $
* Modul strony glownej
*
*/
class IndexController extends MainController implements ControllerInterface {
/**
* Strona glowna
*
*/
public function IndexAction($param) {
//Utils::ArrayDisplay($param);
//Utils::ArrayDisplay($_POST);
//SessionProxy::SetValue("infoSent",'true');
$arrayPrice = Utils::GetArrayList('mf_parameters', 'id_mf_parameters', 'price');
$arrayPriceProm = Utils::GetArrayList('mf_parameters', 'id_mf_parameters', 'price_prom');
foreach ($arrayPrice as $key => $price) {
$priceVat = $price*1.23;
$arrayPriceVat[$key] = $priceVat;
}
foreach ($arrayPriceProm as $key => $price) {
$priceVat = $price*1.23;
$arrayPricePromVat[$key] = $priceVat;
}
$this->smarty->assign('arrayPriceJson', str_replace('"', '', json_encode($arrayPrice)));
$this->smarty->assign('arrayPriceVatJson', str_replace('"', '', json_encode($arrayPriceVat)));
$this->smarty->assign('arrayPricePromJson', str_replace('"', '', json_encode($arrayPriceProm)));
$this->smarty->assign('arrayPricePromVatJson', json_encode($arrayPricePromVat));
$type = 1;
if (isset($_POST['send'])) {
$type = Request::GetPost('type');
}
$this->addScript('jQuery/messages_pl.js');
$this->addScript('validate/validate.sendCalc.js');
$this->addScript('validate/extras.sendCalc.js');
$obj = MfArticleBoxDAL::GetById(1);
$this->smarty->assign('showNews', false);
$this->smarty->assign('indexNews', $obj);
$dalData = MfParametersDAL::GetDalDataObj();
$dalData->addCondition('type', $type);
$dalData->addCondition('publication', 1);
$dalData->setSortBy('sort');
$arrayObjParameters = MfParametersDAL::GetResult($dalData);
if (SessionProxy::GetValue('infoSent')) {
SessionProxy::ClearValue('infoSent');
$textPrice = SessionProxy::GetValue("textPrice");
$arrayTextPrice = SessionProxy::GetValue("arrayTextPrice");
$formData = SessionProxy::GetValue("formData");
$idObj = SessionProxy::GetValue("qlfon");
$objParticipant = MfParticipantDAL::GetById($idObj);
$arrayFee = $objParticipant->getFeeFullUnserialize();
//added 1,2 od 3-days
if (in_array($arrayFee[0], ['5', '6', '7'])) {
unset($arrayFee['disc']);
}
//Utils::ArrayDisplay($arrayTextPrice);
$this->smarty->assign('arrayObjParameters', $arrayObjParameters);
$this->smarty->assign('discPrice', $arrayFee['disc']);
$this->smarty->assign('arrayFee', $arrayFee);
$this->smarty->assign('objParticipant', $objParticipant);
$this->smarty->assign('formData', $formData);
$this->smarty->assign('textPrice', $textPrice);
$this->smarty->assign('arrayTextPrice', $arrayTextPrice);
$days = SessionProxy::GetValue("days");
$this->smarty->assign('days', $days);
$this->partialTemplate = 'IndexSent.tpl';
}
//Utils::ArrayDisplay($arrayObjParameters);
if (isset($_POST['send'])) {
//$this->SetAjaxRender();
$this->smarty->assign('error', '');
// $this->smarty->assign('wrongPhone', '');
$this->smarty->assign('wrongEmail', '');
$this->smarty->assign('success', '');
//===Kalkuator===============================================
$data = Request::GetAllPost();
//Utils::ArrayDisplay($data);
$validator = new Validator($data);
$errorList = '';
$error = '';
$empty = '';
$wrongEmail = '';
$wrongPhone = '';
//$validator->IsEmpty('name', Dictionary::Translate('required_name'));
$validator->IsEmpty('name', Dictionary::Translate('required_field'));
$validator->IsEmpty('surname', Dictionary::Translate('required_field'));
$validator->IsEmpty('address', Dictionary::Translate('required_field'));
$validator->IsEmpty('post_code', Dictionary::Translate('required_field'));
$validator->IsEmpty('email', Dictionary::Translate('required_email'));
$validator->IsEmailAddress('email', Dictionary::Translate('invalid_email'));
$validator->IsEmpty('agree1', Dictionary::Translate('required_field'));
//$validator->IsEmpty('message', Dictionary::Translate('required_message'));
$validator->IsEmpty('g-recaptcha-response', Dictionary::Translate('required_field'));
//Priv key: 6LfUVuoUAAAAAMurSPkwCrRja_6j5E4shtAFCzmz
//public html key: 6LfUVuoUAAAAAD7noZ6S0rf8ZPiZKQ2KVpNBA274
$out = $validator->GetErrorList();
if (!empty($out)) {
$errorList = true;
}
//Utils::ArrayDisplay($out);
if ($errorList) {
$this->smarty->assign('errorList', $validator->GetErrorList());
} elseif ($wrongEmail) {
} else {
// Dodawanie do bazy
$objParticipant = MfParticipantDAL::GetEmptyObj();
$objParticipant->setName(Request::GetPost('name'));
$objParticipant->setSurname(Request::GetPost('surname'));
$objParticipant->setDegree(Request::GetPost('degree'));
$objParticipant->setPosition(Request::GetPost('position'));
$objParticipant->setPhone(Request::GetPost('phone'));
$objParticipant->setFax(Request::GetPost('fax'));
$objParticipant->setEmail(Request::GetPost('email'));
$objParticipant->setInstitution(Request::GetPost('institution'));
$objParticipant->setAddress(Request::GetPost('address'));
$objParticipant->setPostCode(Request::GetPost('post_code'));
$objParticipant->setCity(Request::GetPost('city'));
$objParticipant->setNip(Request::GetPost('nip'));
$objParticipant->setReferat(Request::GetPost('referat'));
$objParticipant->setPoster(Request::GetPost('poster'));
$objParticipant->setMessage(Request::GetPost('message'));
$objParticipant->setMessageLong(Request::GetPost('message_long'));
$objParticipant->setAutor(Request::GetPost('autor'));
$objParticipant->setAgree1(Request::GetPost('agree1') ? 1 : 0);
$objParticipant->setAgree2(Request::GetPost('agree2') ? 1 : 0);
$objParticipant->setStatus(1);
$objParticipant->setLocation(1);
$objParticipant->setConferenceFee(Request::GetPost('conference_fee'));
$participationOption = Request::GetPost('participation_option');
if (!$participationOption) {
switch (Request::GetPost('conference_fee')) {
case '1':
$participationOption = 'full';
break;
case '6':
$participationOption = 'three_days';
break;
case '7':
$participationOption = 'two_days';
break;
case '5':
$participationOption = Request::GetPost('one_day_lodging') ? 'one_day_lodging' : 'one_day_no_lodging';
break;
}
}
$participationDays = Request::GetPost('participation_days');
if (!$participationDays) {
$participationDays = Request::GetPost('days');
}
if (!$participationDays) {
$participationDays = Request::GetPost('day_conference');
}
$objParticipant->setParticipationOption($participationOption);
$objParticipant->setParticipationDays($participationDays);
$objParticipant->setOneDayLodging(Request::GetPost('one_day_lodging') ? 1 : 0);
$objParticipant->setDiet(Request::GetPost('diet') ? Request::GetPost('diet') : 1);
$objParticipant->setDietSpecial(Request::GetPost('diet_special'));
$feeRoom1 = Request::GetPost('fee_room1');
$feeRoomAddPerson = Request::GetPost('fee_room_add_person');
$feeAngConference = Request::GetPost('fee_ang_conference');
$objParticipant->setFeeRoom1($feeRoom1 ? 1 : 0);
$objParticipant->setFeeRoomAddPerson($feeRoomAddPerson ? 1 : 0);
$arrayFee = array_filter([
Request::GetPost('conference_fee'),
$feeRoom1,
$feeRoomAddPerson,
$feeAngConference,
'disc' => Request::GetPost('conference_fee_disc')
]);
if (Request::GetPost('conference_fee') == 5) {
$objParticipant->setFeeOneDay($participationDays);
}
//Utils::ArrayDisplay($arrayObjParameters);
//Utils::ArrayDisplay($objParticipant->getFeeFullUnserialize());
$resultPrice = 0;
$textPrice = '';
$arrayTextPrice = array();
$arrayPrice2Value = array();
$objParticipant->setFeeFull(serialize($arrayFee));
if (isset($arrayFee['disc'])) {
unset($arrayFee['disc']);
}
foreach ($arrayObjParameters as $objParam) {
if (in_array($objParam->GetId(), $arrayFee) != '') {
if (Request::GetPost('conference_fee_disc') == 2) {
if($objParam->GetId() != 2 || $_POST['fee_room1'] != null){
$resultPrice = $resultPrice + $objParam->getPrice();
}
} else {
/*
* TODO: poprawić disc ma być z innego pola
* 'disc' => Request::GetPost('conference_fee') na 'disc' => Request::GetPost('conference_fee_disc') ale nadać value inne niż 2 bo
* if (in_array($objParam->GetId(), $arrayFee)) wyszukuje 2 i ododaje jako dodatkowy pokój :(
* jakieś value="10" albo inne rozwiazanie
*
*/
// Jesli zmienie się data to zmienić na zwykłą cenę
$resultPrice = $resultPrice + $objParam->getPriceProm();
//$resultPrice = $resultPrice + $objParam->getPrice();
}
}
// tutaj policzę sobie całość
}
$objParticipant->setPrice($resultPrice);
$objParticipant->setDateAdd(Utils::GetNowDate());
$idObj = MfParticipantDAL::Save($objParticipant);
//Utils::ArrayDisplay($resultPrice);
$textPrice .= '<p>Razem: ' . number_format($resultPrice, 2, ".", "") . '</p>';
$arrayTextPrice['Razem'] = number_format($resultPrice, 2, ".", "");
// Utils::ArrayDisplay($textPrice);
//Utils::ArrayDisplay($arrayTextPrice);
//Utils::ArrayDisplay('wynik:'.$resultPrice);
//$this->smarty->assign('message', $data['message']);
$this->smarty->assign('email', $data['email']);
$this->smarty->assign('post', $data);
$this->smarty->assign('textPrice', $textPrice);
//$this->smarty->assign('name', $post['name']);
// $textPrice = SessionProxy::GetValue("textPrice");
// $arrayTextPrice = SessionProxy::GetValue("arrayTextPrice");
// $formData = SessionProxy::GetValue("formData");
$this->smarty->assign('formData', $data);
$this->smarty->assign('textPrice', $textPrice);
$this->smarty->assign('arrayTextPrice', $arrayTextPrice);
$this->smarty->assign('arrayFee', $arrayFee);
$this->smarty->assign('discPrice', $arrayFee['disc']);
$this->smarty->assign('resultPrice', $resultPrice);
$this->smarty->assign('arrayObjParameters', $arrayObjParameters);
$this->smarty->assign('objParticipant', $objParticipant);
$this->smarty->assign('days', isset($data['days']) ? $data['days'] : '');
$this->smarty->assign('participationDays', $participationDays);
$txtmessage = '';
$txtmessage .= $this->smarty->fetch('partial/Index/IndexSent.tpl');
$txtmessage .= '';
$mail = new PHPMailer();
$mail->PluginDir = 'core/lib/phpmailer/';
$mail->CharSet = "utf-8";
$mail->Subject = "Formularz zgloszenia";
$mail->SMTPAuth = true;
$mail->Mailer = 'mail';
$mail->Host = Registry::Get('mail_host');
$mail->Port = 587;
$mail->IsHTML(true);
$mail->From = Registry::Get('mail_from');
$mail->FromName = Registry::Get('name_from');
$mail->Username = Registry::Get('user_smtp');
$mail->Password = Registry::Get('password_smtp');
$mail->AddAddress(Registry::Get('address_to'), Registry::Get('name_to'));
$mail->AddAddress(Registry::Get('address_to_2'), Registry::Get('name_to_2'));
$mail->AddAddress($data['email'], $data['name'] . ' ' . $data['surname']);
$mail->Body = $txtmessage;
$mail->Send();
//Utils::ArrayDisplay($mail);
//Utils::ArrayDisplay($txtmessage);
SessionProxy::SetValue("qlfon", $idObj);
SessionProxy::SetValue("formData", $data);
SessionProxy::SetValue("textPrice", $textPrice);
SessionProxy::SetValue("arrayTextPrice", $arrayTextPrice);
$this->smarty->assign('days', $participationDays);
SessionProxy::SetValue("infoSent", Dictionary::Translate('message_sent'));
SessionProxy::SetValue("days", $participationDays);
//$_POST = array();
//Utils::ArrayDisplay($arrayTextPrice);
//Utils::ArrayDisplay($_SESSION);
$this->addRedirectInfo(Dictionary::Translate('message_sent'), 'info', Router::GenerateUrl('current', array()), 0);
}
}
//---Koniec-Kalakulator
//Utils::ArrayDisplay($arrayGroupParam);
//Utils::ArrayDisplay($_POST);
}
public function AjaxFormAction($param) {
$this->SetAjaxRender();
$type = Request::GetPost('type');
$dalData = MfParametersDAL::GetDalDataObj();
$dalData->addCondition('type', $type);
$dalData->addCondition('publication', 1);
$dalData->setSortBy('sort');
$arrayObjParameters = MfParametersDAL::GetResult($dalData);
//Utils::ArrayDisplay($arrayObjParameters);
//===grupowanie====
$arrayParam = array();
$arrayGroupParam = array();
foreach ($arrayObjParameters as $objParam) {
$idLink = $objParam->GetLinkId();
$arrayGroupParam[$objParam->GetLinkId()][] = $objParam;
}
$this->smarty->assign('arrayObjParameters', $arrayObjParameters);
$this->smarty->assign('arrayGroupParam', $arrayGroupParam);
$this->smarty->assign('type', $type);
}
public function SearchAction($param) {
//Art
$search = trim(Request::GetPost('search'));
$arraySearch = explode(' ', $search);
$dalDataArt = SimpleArticle_MfArticleDAL::GetDalDataObj();
if (count($arraySearch) > 0) {
$where = ' ( ';
foreach ($arraySearch as $key => $search) {
$where .= $key == 0 ? '' : ' OR ';
$where .= ' mf_article_description.title LIKE "%' . Utils::AddSlashes($search) . '%" ';
$where .= ' OR mf_article_description.description LIKE "%' . Utils::AddSlashes($search) . '%" ';
}
$where .= ' ) ';
//Utils::ArrayDisplay($where);
$dalDataArt->addCondition(' ', $where, ' ');
}
$dalDataArt->setJoin(array('SimpleArticle_MfArticleDescription' => ' LEFT JOIN mf_article_description ON mf_article.id_mf_article=mf_article_description.id_mf_article'));
$arrayObjArt = SimpleArticle_MfArticleDAL::GetResult($dalDataArt);
$arrayObjArtStr = array();
foreach ($arrayObjArt as $objArt) {
$dalDataStr = StructureDAL::GetDalDataObj();
$dalDataStr->addCondition('id_content', $objArt->GetId());
$obStr = StructureDAL::GetResult($dalDataStr);
if (isset($obStr[0])) {
$objArt->setStructure($obStr[0]);
$arrayObjArtStr[] = $objArt;
}
}
$this->smarty->assign('arrayObjArtStr', $arrayObjArtStr);
//Utils::ArrayDisplay($arrayObjArtStr);
}
/**
* Wysyłka
*
* @param array $param
*/
public function AjaxSendMessageAction($param) {
header('Content-Type: text/html; charset=utf-8');
$this->SetAjaxRender();
$this->smarty->assign('error', '');
$this->smarty->assign('wrongPhone', '');
$this->smarty->assign('wrongEmail', '');
$this->smarty->assign('success', '');
//Utils::ArrayDisplay($_POST);
$validator = new Validator($_POST);
$errorList = '';
$error = '';
$empty = '';
$wrongEmail = '';
$wrongPhone = '';
if (!$validator->IsEmpty('name', '')) {
$empty = " Podpis </ br>";
}
if (!$validator->IsEmpty('temat', '')) {
$empty = " Temat </ br>";
}
if (!$validator->IsEmpty('email', '')) {
$empty .= " Email ";
} else {
if (!$validator->IsEmailAddress('email', '')) {
$wrongEmail = " Podany adres email jest niepoprawny.";
$this->smarty->assign('wrongEmail', $wrongEmail);
}
}
// if (!$validator->CheckCaptcha('captcha', '')) {
// $empty .= " Treść Captcha </ br>";
// }
if ($empty) {
$errorList = true;
}
//Utils::ArrayDisplay($empty);
//Utils::ArrayDisplay($errorList);
if ($errorList) {
$this->smarty->assign('error', "Wymagane pola muszą być wypełnione.");
} elseif ($wrongEmail) {
} elseif ($wrongPhone) {
} else {
$this->smarty->assign('content', $_POST['content']);
$this->smarty->assign('email', $_POST['email']);
$this->smarty->assign('temat', $_POST['temat']);
$this->smarty->assign('name', $_POST['name']);
//$this->smarty->assign('typ', $_POST['typ']);
//$this->smarty->assign('city', $_POST['city']);
$txtmessage = $this->smarty->fetch('partial/Index/MailTxt.tpl');
$mail = new PHPMailer();
$mail->CharSet = "utf-8";
$mail->Subject = FROM_NAME_MAIL . " - " . $_POST['temat'];
$mail->SMTPAuth = true;
$mail->Mailer = 'smtp';
$mail->Host = HOST_MAIL;
$mail->Port = 25;
$mail->From = FROM_MAIL;
$mail->FromName = FROM_NAME_MAIL;
$mail->Username = USER_MAIL;
$mail->Password = PASS_MAIL;
$mail->IsHTML(true);
//$mail -> AddAddress(FORM_MAIL, FROM_NAME_MAIL);
$mail->AddBCC("studio@aem.pl", "AEM");
$mail->Body = $txtmessage;
$mail->Send();
$this->smarty->assign('success', 'Wiadomość została wysłana');
}
}
/**
* Wyswietlanie obrazka captcha
*/
public function CaptchaAction() {
//$this->disableTemplates = true;
$this->SetAjaxRender();
include(PATH_CORE . '/plugins/Captcha.php');
$word = rand(2, 9) . rand(2, 9) . rand(2, 9) . rand(2, 9) . rand(2, 9);
setcookie(CAPTCHA_COOKIE_NAME, (md5(strtolower($word) . CAPTCHA_SEED)));
//session_start();
//$_SESSION['captcha'] = $word;
$image = confirm($word);
$this->content = $image;
//die();
}
public function AjaxRegisterCaptchaCheckAction($param) {
$this->setAjaxRender();
$data = array('captcha' => Request::GetGet('captcha', true));
$validator = new Validator($data);
$validator->CheckCaptcha('captcha', '');
$errors = $validator->GetErrorList();
$this->content = empty($errors) ? "true" : "false";
}
public function NewsletterAction($param) {
//$this->setAjaxRender();
if (isset($_POST['send'])) {
$dalData = MfSubscriptionDAL::GetDalDataObj();
$objSubscripton = new MfSubscription();
$objSubscripton->setEmail($_POST['email_newsletter']);
$objSubscripton->setDateAdd(Utils::GetNowDate());
$dalData->setObj($objSubscripton);
MfSubscriptionDAL::Save($objSubscripton);
$this->addRedirectInfo(Dictionary::Translate('Email has been added'), null, $_POST['urlFrom'], 0);
} else {
// $this->addRedirectInfo(Dictionary::Translate('message_sent'), null, $_POST['urlFrom'], 0);
}
}
public function SubsiteAction($param) {
try {
$dalData = StructureDAL::GetDalDataObj();
$dalData->setCondition(array('mf_structure.lang' => $param['lang'], 'mf_structure.publication' => '1', 'id_parent' => $param['idStructure']));
$dalData->setSortBy('sort');
$dalData->setJoin(array('SimpleArticle_MfArticleDescription' => ' LEFT JOIN mf_article_description ON mf_article_description.id_mf_article=mf_structure.id_content'));
$arrayObjSubsite = StructureDAL::GetResult($dalData);
$this->smarty->assign('arrayObjSubsite', $arrayObjSubsite);
//Utils::ArrayDisplay($arrayObjSubsite);
} catch (Exception $e) {
Utils::ArrayDisplay($e);
}
}
public function PlayerAction($param) {
$this->SetAjaxRender();
}
public function MapsAction($param) {
//$this->SetAjaxRender();
}
public function TestAction($param) {
Utils::ArrayDisplay('test');
$this->smarty->assign('indexSG', false);
//$this->SetAjaxRender();
}
/**
* Czesc wspolna wszystkich podstron
*
*/
public function PreDispatch($param) {
//$this->AddScript('swfobject.js');
$this->smarty->assign('lang', $param['lang']);
$this->smarty->assign('indexSG', true);
$this->Run($param);
$this->RunShared('MenuBox', $param);
//$this->RunShared('TagCloudBox', $param);
//$this->RunShared('News', $param);
//$this->RunShared('CustomerBox', $param);
//$this->RunShared('LinksBox', $param);
}
public function PostDispatch($param) {
}
}
?>

View File

@@ -0,0 +1,118 @@
<?php
class ProductController extends ModuleController implements ControllerInterface
{
/**
* (non-PHPdoc)
* @see class/ControllerInterface#IndexAction($param)
*/
public function IndexAction($param) {
//Utils::ArrayDisplay($param);
$idCategory = $param['idCategory'];
$this->smarty->assign('idCategory', $idCategory);
$idsProduct = MfProductLinkDAL::GetIdStringDestinaion('mf_product_category', 'mf_product',$idCategory, $param['lang']);
$dalData = MfProductDAL::GetDalDataObj();
$dalData->setJoin(array('MfProductDescription' => ' LEFT JOIN mf_product_description ON mf_product.id_mf_product=mf_product_description.id_mf_product'));
$dalData->setCondition(array('lang' => $param['lang']));
//Utils::ArrayDisplay('ss'.$idsProduct);
$dalData->addCondition(' ', 'mf_product.id_mf_product IN ('.$idsProduct.') ', ' ');
$arrayObj = MfProductDAL::GetResult($dalData);
$this->smarty->assign('arrayObj', $arrayObj);
$this->smarty->assign('urlProductDetailLabel', $param['urlDetailLabel']);
}
public function ViewAction($param) {
$idCategory = $param['idCategory'];
$this->smarty->assign('idCategory', $idCategory);
//====Attribute======================================================
$idsAttribute = MfProductLinkDAL::GetIdStringDestinaion('mf_product_category', 'mf_product_attribute', $idCategory, $param['lang']);
$dalData = MfProductAttributeDAL::GetDalDataObj();
$dalData->setCondition(array('lang' => $param['lang']));
$dalData->addCondition(' ', 'mf_product_attribute.id_mf_product_attribute IN ('.$idsAttribute.') ', ' ');
$dalData->setJoin(array('MfProductAttributeDescription' => ' LEFT JOIN mf_product_attribute_description ON mf_product_attribute.id_mf_product_attribute=mf_product_attribute_description.id_mf_product_attribute'));
$arrayObjAttribute = MfProductAttributeDAL::GetResult($dalData);
//--------------------------------------------------------------------
//====Attribute=Value=================================================
$dalDataValue = MfProductAttributeValueDAL::GetDalDataObj();
$dalDataValue->setCondition(array('lang' => $param['lang'], 'id_mf_product' => $param['id']));
$dalDataValue->addCondition(' ', 'id_mf_product_attribute IN ('.$idsAttribute.') ', ' ');
$arrayObjAttributeValue = MfProductAttributeValueDAL::GetResult($dalDataValue);
//Utils::ArrayDisplay($dalDataValue);
//Utils::ArrayDisplay($arrayObjAttributeValue);
$arrayObjAttributeValueTmp = array();
foreach ($arrayObjAttributeValue as $attrValKey => $objAttributValue ) {
$arrayObjAttributeValueTmp[$objAttributValue->getIdMfProductAttribute()] = $objAttributValue;
}
$arrayObjAttributeValue = $arrayObjAttributeValueTmp;
foreach ($arrayObjAttribute as $attrKey => $objAttribut ) {
if (key_exists($objAttribut->getId(), $arrayObjAttributeValue)) {
$arrayObjAttribute[$attrKey]->setValue($arrayObjAttributeValue[$objAttribut->getId()]->getValue());
}
}
//---------------------------------------------------------------------
//=====Product=========================================================
$dalData = MfProductAttributeDAL::GetDalDataObj();
$dalData->setCondition(array('lang' => $param['lang']));
$dalData->addCondition(' ', 'mf_product_attribute.id_mf_product_attribute IN ('.$idsAttribute.') ', ' ');
$dalData->setJoin(array('MfProductAttributeDescription' => ' LEFT JOIN mf_product_attribute_description ON mf_product_attribute.id_mf_product_attribute=mf_product_attribute_description.id_mf_product_attribute'));
$objProduct = MfProductDAL::GetById($param['id'], $param['lang']);
$this->smarty->assign('arrayObjAttribute', $arrayObjAttribute);
$this->smarty->assign('idProduct', $param['id']);
$this->smarty->assign('objProduct', $objProduct);
$this->addScript('jQuery/jquery.jcarousel.min.js');
$this->addScript('jQuery/jquery.lightbox-0.5.js');
$this->addScript('gallery.js');
$this->AddCSS('jquery.lightbox-0.5.css');
$this->AddCSS('skin.css');
$this->smarty->assign('showGallery', true);
}
/**
*
* @param unknown_type $param
* @return unknown_type
*/
public function preDispatch($param) {
$this->smarty->assign('lang', $param['lang']);
$this->Run($param);
//$this->AddTitle('');
// $this->RunShared('Banner', $param);
}
/**
*
* @param unknown_type $param
* @return unknown_type
*/
public function postDispatch($param) {
}
}
?>

View File

@@ -0,0 +1,83 @@
<?php
class SearchController extends MainController implements ControllerInterface
{
/**
* (non-PHPdoc)
* @see class/ControllerInterface#IndexAction($param)
*/
public function IndexAction($param) {
//Utils::ArrayDisplay($param);
//Utils::ArrayDisplay($_POST);
if (Request::GetPost('search')) {
//Art
$search= trim(Request::GetPost('search'));
$arraySearch = explode(' ', $search);
$dalDataArt = SimpleArticle_MfArticleDAL::GetDalDataObj();
if (count($arraySearch) > 0) {
$where = ' ( ';
foreach ($arraySearch as $key => $search) {
$where .= $key == 0 ? '' : ' OR ';
$where .= ' mf_article_description.title LIKE "%'.Utils::AddSlashes($search).'%" ';
$where .= ' OR mf_article_description.description LIKE "%'.Utils::AddSlashes($search).'%" ';
}
$where .= ' ) ';
//Utils::ArrayDisplay($where);
$dalDataArt->addCondition('mf_article_description.lang', $param['lang']);
$dalDataArt->addCondition('mf_article_description.publication', 1);
$dalDataArt->addCondition(' ', $where, ' ');
}
$dalDataArt->setJoin(array('SimpleArticle_MfArticleDescription' => ' LEFT JOIN mf_article_description ON mf_article.id_mf_article=mf_article_description.id_mf_article'));
$arrayObjArt = SimpleArticle_MfArticleDAL::GetResult($dalDataArt);
$arrayObjArtStr = array();
foreach ($arrayObjArt as $objArt) {
$dalDataStr = StructureDAL::GetDalDataObj();
$dalDataStr->addCondition('id_content', $objArt->GetId());
$obStr = StructureDAL::GetResult($dalDataStr);
if (isset($obStr[0])) {
$objArt->setStructure($obStr[0]);
$arrayObjArtStr[] = $objArt;
}
}
$this->smarty->assign('arrayObjArtStr', $arrayObjArtStr);
$this->smarty->assign('search', Request::GetPost('search'));
} else {
$this->smarty->assign('arrayObjArtStr', array());
}
}
/**
*
* @param unknown_type $param
* @return unknown_type
*/
public function preDispatch($param) {
$this->smarty->assign('lang', $param['lang']);
$this->smarty->assign('showGallery', true);
$this->Run($param);
//$this->AddTitle('');
// $this->RunShared('Banner', $param);
}
/**
*
* @param unknown_type $param
* @return unknown_type
*/
public function postDispatch($param) {
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,790 @@
<?php
/**
* $Id$
* Proste artykuly
*
*/
class SimpleArticle_IndexController extends ModuleController implements ControllerInterface {
const TITLE = 'Artykuły';
/**
* Domyślna metoda
*
* @param array $param
*/
public function IndexAction($param) {
$maxArtOnPage = 8;
//Utils::ArrayDisplay($param);
$data = array();
if ($param['idCategory']) {
//Utils::ArrayDisplay($param);
switch ($param['idCategory']) {
case '8':
//Utils::ArrayDisplay($param);
$objArticle = SimpleArticle_MfArticleDAL::GetById($param['id'], $param['lang']);
//$this->AddTitle($objArticle->GetTitle());
$this->smarty->assign('titleGif', 'firma.gif');
//Utils::ArrayDisplay($objArticle->GetDescriptionArray());
$this->smarty->assign('objArticle', $objArticle);
$this->partialTemplate = 'IndexCompany.tpl';
$showList = false;
$maxArtOnPage = 1000;
break;
case '5':
//Utils::ArrayDisplay($param);
$this->smarty->assign('titleGif', 'portfolio.gif');
$objArticle = SimpleArticle_MfArticleDAL::GetById($param['id'], $param['lang']);
//$this->AddTitle($objArticle->GetTitle());
//$this->smarty->assign('showGallery', true);
//Utils::ArrayDisplay($objArticle->GetDescriptionArray());
$this->smarty->assign('objArticle', $objArticle);
$this->partialTemplate = 'IndexProject.tpl';
$showList = true;
$maxArtOnPage = 1000;
break;
case '9':
//Utils::ArrayDisplay($param);
$this->smarty->assign('titleGif', 'portfolio.gif');
$objArticle = SimpleArticle_MfArticleDAL::GetById($param['id'], $param['lang']);
//$this->AddTitle($objArticle->GetTitle());
$this->smarty->assign('showGallery', true);
//Utils::ArrayDisplay($objArticle->GetDescriptionArray());
$this->smarty->assign('objArticle', $objArticle);
$this->partialTemplate = 'IndexProject.tpl';
$showList = true;
$maxArtOnPage = 15;
break;
case '3':
$objArticle = SimpleArticle_MfArticleDAL::GetById($param['id'], $param['lang']);
//$this->AddTitle($objArticle->GetTitle());
$this->smarty->assign('showGallery', true);
//Utils::ArrayDisplay($objArticle->GetDescriptionArray());
//$this->RunShared('CustomerBox', $param);
$this->smarty->assign('objArticle', $objArticle);
$this->partialTemplate = 'IndexProgram.tpl';
$showList = true;
$maxArtOnPage = 8;
break;
case '6':
$objArticle = SimpleArticle_MfArticleDAL::GetById($param['id'], $param['lang']);
//$this->AddTitle($objArticle->GetTitle());
$this->smarty->assign('showGallery', true);
//Utils::ArrayDisplay($objArticle->GetDescriptionArray());
//$this->RunShared('CustomerBox', $param);
$this->smarty->assign('objArticle', $objArticle);
$this->partialTemplate = 'IndexKnowledge.tpl';
$showList = true;
$maxArtOnPage = 8;
break;
case '11':
$objArticle = SimpleArticle_MfArticleDAL::GetById($param['id'], $param['lang']);
//$this->AddTitle($objArticle->GetTitle());
$this->smarty->assign('showGallery', true);
//Utils::ArrayDisplay($objArticle->GetDescriptionArray());
//$this->RunShared('CustomerBox', $param);
$this->smarty->assign('objArticle', $objArticle);
$this->partialTemplate = 'IndexProgram.tpl';
$showList = true;
$maxArtOnPage = 8;
break;
default:
//$this->AddTitle('aktualności');
$this->smarty->assign('titleGif', 'aktualnosci.gif');
$this->partialTemplate = 'Index.tpl';
$showList = true;
}
} else {
$idsContent = '()';
$categoryData = array();
}
if ($showList) {
$data = array('mf_article.id_structure' => $param['idStructure']);
$idsContent = '()';
$categoryData = array();
//Utils::ArrayDisplay($categoryData);
$data = array_merge($data, $categoryData);
$data['mf_article_description.lang'] = $param['lang'];
$data['mf_article.publication'] = 1;
$date = Utils::GetNowDate();
$data[' '] = array('value' => " mf_article.date_publication <= '$date' ", 'condition' => '');
//Utils::ArrayDisplay($data);
$page = 1;
if (isset($param['p']) && $param['p'] > 0) {
$page = $param['p'];
}
SessionProxy::SetValue('__news_page_no__', $page);
$offset = ($page - 1) * $maxArtOnPage;
//Utils::ArrayDisplay($param);
//Utils::ArrayDisplay($offset);
try {
if ($param['idCategory'] == 5) {
$sortBy = 'mf_article.date_publication ASC';
} else {
$sortBy = 'mf_article.date_publication DESC';
}
$arrayObj = SimpleArticle_MfArticleDAL::GetList($data, sprintf(' %d OFFSET %d', $maxArtOnPage, $offset), $sortBy);
$arrayObjCount = SimpleArticle_MfArticleDAL::GetResultOld($data, array(), null, null, true);
} catch (Exception $e) {
$this->AddRedirect(Router::GenerateUrl('Index', array('lang' => $param['lang'])), 0);
}
//$this->smarty->assign('tableModuleName', $tableModuleName);
//$this->smarty->assign('lang', $lang);
$this->smarty->assign('page', $page);
$this->smarty->assign('maxPage', ceil($arrayObjCount / $maxArtOnPage));
$this->smarty->assign('arrayObj', $arrayObj);
$arrayName = array();
foreach ($arrayObj as $objArt) {
$arrayName[] = $objArt->GetTitle();
}
//Utils::ArrayDisplay($arrayName);
$this->smarty->assign('articleList', $arrayObj);
$this->smarty->assign('arrayName', $arrayName);
//if ($param['idCategory'] == 3) {
//$this->RunShared('FormCareer', $param);
//if (SessionProxy::IsSetValue('sendFormInfo')) {
//$this->addRedirectInfo( Dictionary::Translate('message_sent'),null, Router::GenerateUrl($param['urlParam'].'Label',array()),0);
//}
//}
}
}
public function SubsiteAction($param) {
//Utils::ArrayDisplay($param);
$this->smarty->assign('hideSubMenu', true);
switch ($param['idModule']) {
case '14':
$limit = 1000;
if ($param['urlParam'] == 'skolresor') {
$limit = 2;
}
break;
case '18':
$limit = 8;
$this->partialTemplate = 'SubPremium.tpl';
break;
case '19':
$limit = 1000;
$this->partialTemplate = 'SubMore.tpl';
$this->smarty->assign('hideSubMenu', true);
$this->smarty->assign('forcedTitle', 'Usługi dodatkowe');
break;
}
// Utils::ArrayDisplay($param);
try {
$dalData = StructureDAL::GetDalDataObj();
$dalData->setCondition(array('mf_structure.lang' => $param['lang'], 'mf_structure.publication' => '1', 'id_parent' => $param['idStructure']));
$dalData->setSortBy('sort');
$dalData->setLimit($limit);
$dalData->setJoin(array('SimpleArticle_MfArticleDescription' => ' LEFT JOIN mf_article_description ON mf_article_description.id_mf_article=mf_structure.id_content'));
$arrayObjSubsite = StructureDAL::GetResult($dalData);
//Utils::ArrayDisplay($arrayObjSubsite);
// if ($param['idModule'] == 14 && count($arrayObjSubsite) > 0) {
//
// $objSubsite = end($arrayObjSubsite);
// //Utils::ArrayDisplay($objSubsite);
// $dalData = StructureDAL::GetDalDataObj();
// $dalData->setCondition(array('mf_structure.lang' => $param['lang'], 'mf_structure.publication' => '1', 'id_parent' => $objSubsite->GetId()));
// $dalData->setSortBy('sort');
// //$dalData->setLimit(4);
// $arrayObjSubsiteMore = StructureDAL::GetResult($dalData);
// if (!is_array($arrayObjSubsiteMore)) {
// $arrayObjSubsiteMore = array();
// }
// array_pop($arrayObjSubsite);
// //Utils::ArrayDisplay($arrayObjSubsite);
// $arrayObjSubsite = array_merge($arrayObjSubsite, $arrayObjSubsiteMore);
// }
$this->smarty->assign('arrayObjSubsite', $arrayObjSubsite);
try {
$objArticle = SimpleArticle_MfArticleDAL::GetById($param['id'], $param['lang']);
$this->AddTitle($objArticle->GetTitle());
//Utils::ArrayDisplay($objArticle);
$arrayImage = $objArticle->getArrayImage();
//Utils::ArrayDisplay($arrayImage);
$this->smarty->assign('arrayImage', $arrayImage);
$this->smarty->assign('objArticle', $objArticle);
//$this->AddBreadCrumb($objArticle->GetTitle(), '#');
} catch (Exception $e) {
//Utils::ArrayDisplay($e);
$this->AddRedirect(Router::GenerateUrl('Index', array('lang' => $param['lang'])), 0);
}
//Utils::ArrayDisplay($arrayObjSubsite);
} catch (Exception $e) {
Utils::ArrayDisplay($e);
}
}
/**
* Lista artykułów
*
* @param array $param
*/
public function ListAction($param) {
$articleList = SimpleArticle_MfArticleDAL::GetList(10);
//Utils::ArrayDisplay($articleList);
}
public function DownloadImageAction($param) {
//$this->SetNoRender();
$idImage = $param['idImage'];
$idArticle = $param['idArticle'];
$objImage = ImageDAL::GetResult(array('id_mf_image' => $idImage));
if (count($objImage) > 0) {
//Utils::ArrayDisplay($objImage[0]);
//$pathImage = PATH_STATIC_CONTENT.'upload/Article/'.$idArticle.''.$objImage->GetPath();
$pathImage = $objImage[0]->GetFullPathMaxId($idArticle);
//Utils::ArrayDisplay($pathImage);
header('Content-type: image/jpg');
header('Content-Disposition: attachment; filename="' . $objImage[0]->GetPath() . '"');
readfile($pathImage);
}
}
public function RealizationAction($param) {
$dalDataElements = SimpleArticle_MfArticleDAL::GetDalDataObj();
$dalDataElements->setCondition(array('mf_article_description.lang' => $param['lang'], 'mf_article.publication' => '1', 'id_structure' => $param['idStructure']));
$dalDataElements->setSortBy('mf_article.date_publication');
$dalDataElements->setLimit(4);
$dalDataElements->setJoin(array('SimpleArticle_MfArticleDescription' => ' LEFT JOIN mf_article_description ON mf_article_description.id_mf_article=mf_article.id_mf_article'));
$arrayObjElements = SimpleArticle_MfArticleDAL::GetResult($dalDataElements, false);
$this->smarty->assign('arrayObjElements', $arrayObjElements);
}
public function ProjectListAction($param) {
//Utils::ArrayDisplay($param);
if (isset($param['id'])) {
// if (!Utils::CheckPublication($param['id'], 'mf_article', 'id_mf_article')) {
//
// $this->AddRedirect(URL_MAIN, 0);
// }
try {
$objArticle = SimpleArticle_MfArticleDAL::GetById($param['id'], $param['lang']);
//$this->AddTitle($objArticle->GetTitle());
//Utils::ArrayDisplay($objArticle);
$arrayImage = $objArticle->getArrayImage();
//Utils::ArrayDisplay($arrayImage);
$this->smarty->assign('arrayImage', $arrayImage);
$this->smarty->assign('objArticle', $objArticle);
//$this->AddBreadCrumb($objArticle->GetTitle(), '#');
} catch (Exception $e) {
//Utils::ArrayDisplay($e);
$this->AddRedirect(Router::GenerateUrl('Index', array('lang' => $param['lang'])), 0);
}
} else {
$this->AddRedirect(Router::GenerateUrl('Index', array('lang' => $param['lang'])), 0);
throw new UserException('Nie podano id artykułu.');
}
$dalData = StructureDAL::GetDalDataObj();
$dalData->setCondition(array('mf_structure.lang' => $param['lang'], 'mf_structure.publication' => '1', 'id_parent' => $param['idStructure']));
$dalData->setSortBy('sort');
$dalData->setLimit(4);
$dalData->setJoin(array('SimpleArticle_MfArticleDescription' => ' LEFT JOIN mf_article_description ON mf_article_description.id_mf_article=mf_structure.id_content'));
$arrayObjSubsite = StructureDAL::GetResult($dalData);
foreach ($arrayObjSubsite as $objSubsite) {
$dalDataElements = SimpleArticle_MfArticleDAL::GetDalDataObj();
$dalDataElements->setCondition(array('mf_article_description.lang' => $param['lang'], 'mf_article.publication' => '1', 'id_structure' => $objSubsite->GetId()));
$dalDataElements->setSortBy('mf_article.date_publication');
$dalDataElements->setLimit(4);
$dalDataElements->setJoin(array('SimpleArticle_MfArticleDescription' => ' LEFT JOIN mf_article_description ON mf_article_description.id_mf_article=mf_article.id_mf_article'));
$arrayObjElements[$objSubsite->GetId()] = SimpleArticle_MfArticleDAL::GetResult($dalDataElements, false);
}
//Utils::ArrayDisplay($arrayObjElements);
$this->smarty->assign('arrayObjSubsite', $arrayObjSubsite);
$this->smarty->assign('arrayObjElements', $arrayObjElements);
}
/**
*
* @param <type> $param
*/
public function ViewAction($param) {
//Utils::ArrayDisplay($param);
$this->smarty->assign('showGallery', true);
if (isset($param['idCategory'])) {
$this->smarty->assign('idCategory', $param['idCategory']);
switch ($param['idCategory']) {
case '1':
$this->partialTemplate = 'View.tpl';
$this->smarty->assign('titleGif', 'portfolio.gif');
break;
case '2':
$similarBox = true;
$this->smarty->assign('showGallery', true);
$this->smarty->assign('titleGif', 'aktualnosci.gif');
$this->partialTemplate = 'News.tpl';
$this->addScript('jQuery/jquery.jcarousel.min.js');
$this->addScript('jQuery/jquery.lightbox-0.5.js');
$this->addScript('gallery.js');
$this->AddCSS('jquery.lightbox-0.5.css');
$this->AddCSS('skin.css');
break;
case '11':
$similarBox = true;
$this->smarty->assign('titleGif', 'aktualnosci.gif');
$this->partialTemplate = 'Program.tpl';
break;
case '19':
$this->partialTemplate = 'Registration.tpl';
break;
case '3':
$similarBox = true;
$this->smarty->assign('titleGif', 'aktualnosci.gif');
$this->partialTemplate = 'Program.tpl';
break;
case '9':
$this->smarty->assign('titleGif', 'portfolio.gif');
$this->smarty->assign('showGallery', true);
$this->partialTemplate = 'Project.tpl';
$this->addScript('jQuery/jquery.jcarousel.min.js');
$this->addScript('jQuery/jquery.lightbox-0.5.js');
$this->addScript('gallery.js');
$this->AddCSS('jquery.lightbox-0.5.css');
$this->AddCSS('skin.css');
//$this->RunShared('CustomerBox', $param);
//Utils::ArrayDisplay($param);
$dataPAg = array('mf_article.id_structure' => $param['idStructure']);
$dataPAg['mf_article_description.lang'] = $param['lang'];
$dataPAg['mf_article.publication'] = 1;
$date = Utils::GetNowDate();
$dataPAg[' '] = array('value' => " mf_article.date_publication <= '$date' ", 'condition' => '');
$arrayIds = SimpleArticle_MfArticleDAL::GetArrayIds($dataPAg, 'mf_article.date_publication DESC');
$selected = array_search($param['id'], $arrayIds);
$last = count($arrayIds) - 1;
$this->smarty->assign('arrayIds', $arrayIds);
$this->smarty->assign('selected', $selected);
$this->smarty->assign('last', $last);
break;
default:
$this->partialTemplate = 'View.tpl';
}
}
if (isset($param['id'])) {
// if (!Utils::CheckPublication($param['id'], 'mf_article', 'id_mf_article')) {
//
// $this->AddRedirect(URL_MAIN, 0);
// }
try {
$objArticle = SimpleArticle_MfArticleDAL::GetById($param['id'], $param['lang']);
//$this->AddTitle($objArticle->GetTitle());
//Utils::ArrayDisplay($objArticle);
$arrayImage = $objArticle->getArrayImage();
//Utils::ArrayDisplay($arrayImage);
$this->smarty->assign('arrayImage', $arrayImage);
$this->smarty->assign('objArticle', $objArticle);
//$this->AddBreadCrumb($objArticle->GetTitle(), '#');
} catch (Exception $e) {
//Utils::ArrayDisplay($e);
$this->AddRedirect(Router::GenerateUrl('Index', array('lang' => $param['lang'])), 0);
}
} else {
$this->AddRedirect(Router::GenerateUrl('Index', array('lang' => $param['lang'])), 0);
throw new UserException('Nie podano id artykułu.');
}
//Archiwum
//Utils::ArrayDisplay($param);
$data = array();
if ($param['idCategory']) {
$idCategory = $param['idCategory'];
$this->smarty->assign('idCategory', $idCategory);
if ($idCategory == 2) {
$idCategory = null;
}
$idsContent = MfLinkDAL::GetIdString('mf_article', 'mf_article_category', $idCategory, 1);
$categoryData = array('mf_article.id_mf_article' => array('condition' => 'IN', 'value' => $idsContent));
} else {
$idsContent = '()';
$categoryData = array();
}
//Utils::ArrayDisplay($categoryData);
$data = array_merge($data, $categoryData);
$data['mf_article_description.lang'] = $param['lang'];
$data['mf_article.publication'] = 1;
$date = Utils::GetNowDate();
$data[' '] = array('value' => " mf_article.date_publication <= '$date' ", 'condition' => '');
$page = 1;
if (isset($param['p']) && $param['p'] > 0) {
$page = $param['p'];
}
SessionProxy::SetValue('__news_page_no__', $page);
$maxArtOnPage = 10;
$offset = ($page - 1) * $maxArtOnPage;
//Utils::ArrayDisplay($data);
$arrayObj = SimpleArticle_MfArticleDAL::GetList($data, sprintf(' %d OFFSET %d', $maxArtOnPage, $offset), 'mf_article.date_publication DESC');
//$arrayObj = SimpleArticle_MfArticleDAL::GetResult($data, array(), sprintf(' %d OFFSET %d', $maxArtOnPage, $offset), 'mf_article.id_mf_article DESC');
$arrayObjCount = SimpleArticle_MfArticleDAL::GetResultOld($data, array(), null, null, true);
//$this->smarty->assign('tableModuleName', $tableModuleName);
//$this->smarty->assign('lang', $lang);
// if (isset($similarBox)) {
// //Utils::ArrayDisplay($objArticle->getCustomerArrayId());
// $param['arrayTag'] = $objArticle->getTagsArrayId();
// $this->RunShared('SimilarBox', $param);
// }
// //Utils::ArrayDisplay($param['arrayTag']);
// if (isset($similarBox)) {
// //Utils::ArrayDisplay($objArticle->getCustomerArrayId());
// $param['arrayTag'] = $objArticle->getCustomerArrayId();
// $this->RunShared('CustomerProjectBox', $param);
// }
//Utils::ArrayDisplay($param['arrayTag']);
$this->smarty->assign('page', $page);
$this->smarty->assign('maxPage', ceil($arrayObjCount / $maxArtOnPage));
$this->smarty->assign('arrayObj', $arrayObj);
$this->smarty->assign('articleList', $arrayObj);
}
public function FormAction($param) {
//Utils::ArrayDisplay($_SESSION);
$this->addScript('jQuery/jquery.validate.js');
if ($param['lang'] == 'pl') {
$this->addScript('jQuery/messages_pl.js');
}
$this->addScript('jQuery/validate.sendContact.js');
$this->addScript('jQuery/extras.sendContact.js');
// Utils::ArrayDisplay($param);
// Utils::ArrayDisplay(__METHOD__);
// $this->AddScript("scriptaculous.js?load=effects");
// $this->AddScript("lightbox.js");
//$this->AddScript("prototype.js");
//$this->AddScript("Dosia.js");
if (isset($param['id'])) {
// if (!Utils::CheckPublication($param['id'], 'mf_article', 'id_mf_article')) {
//
// $this->AddRedirect(URL_MAIN, 0);
// }
try {
$objArticle = SimpleArticle_MfArticleDAL::GetById($param['id'], $param['lang']);
//$this->AddTitle($objArticle->GetTitle());
$this->smarty->assign('objArticle', $objArticle);
//$this->AddBreadCrumb($objArticle->GetTitle(), '#');
} catch (Exception $e) {
$this->AddRedirect(Router::GenerateUrl('Index', array('lang' => $param['lang'])), 0);
}
} else {
$this->AddRedirect(Router::GenerateUrl('Index', array('lang' => $param['lang'])), 0);
throw new UserException('Nie podano id artykułu.');
}
//Utils::ArrayDisplay($_POST);
if (isset($_POST['send'])) {
//$this->SetAjaxRender();
$this->smarty->assign('error', '');
// $this->smarty->assign('wrongPhone', '');
$this->smarty->assign('wrongEmail', '');
$this->smarty->assign('success', '');
//Utils::ArrayDisplay($_POST);
$post = Request::GetAllPost();
$validator = new Validator($post);
$errorList = '';
$error = '';
$empty = '';
$wrongEmail = '';
$wrongPhone = '';
//$validator->IsEmpty('name', Dictionary::Translate('required_name'));
$validator->IsEmpty('email', Dictionary::Translate('required_email'));
$validator->IsEmailAddress('email', Dictionary::Translate('invalid_email'));
$validator->IsEmpty('message', Dictionary::Translate('required_message'));
$validator->IsEmpty('g-recaptcha-response', Dictionary::Translate('required_field'));
$out = $validator->GetErrorList();
if (!empty($out)) {
$errorList = true;
}
//Utils::ArrayDisplay($validator->GetErrorList());
//Utils::ArrayDisplay($errorList);
if ($errorList) {
$this->smarty->assign('errorList', $validator->GetErrorList());
} elseif ($wrongEmail) {
} else {
$this->smarty->assign('message', $post['message']);
$this->smarty->assign('email', $post['email']);
$this->smarty->assign('post', $post);
//$this->smarty->assign('temat', $post['temat']);
//$this->smarty->assign('name', $post['name']);
$txtmessage = $this->smarty->fetch('partial/SimpleArticle/Index/MailTxt.tpl');
$mail = new PHPMailer();
$mail->PluginDir = 'core/lib/phpmailer/';
$mail->CharSet = "utf-8";
$mail->Subject = "Formularz";
$mail->SMTPAuth = true;
$mail->Mailer = 'mail';
$mail->Host = Registry::Get('mail_host');
$mail->Port = 587;
$mail->IsHTML(true);
$mail->From = Registry::Get('mail_from');
$mail->FromName = "Ogiela";
// $mail->Username = Registry::Get('user_smtp');
// $mail->Password = Registry::Get('password_smtp');
$mail->AddAddress(Registry::Get('address_to'), "Ogiela");
$mail->AddBCC("maciej.kloch@gmail.com", "aem");
$mail->Body = $txtmessage;
$mail->Send();
//Utils::ArrayDisplay($mail);
$this->addRedirectInfo(Dictionary::Translate('message_sent'), 'ok', Router::GenerateUrl('current', array()), 0);
}
}
$this->smarty->assign('titleGif', 'kontakt.gif');
}
public function FormSentActon($param) {
}
public function RegistrationAction($param) {
//Utils::ArrayDisplay($param);
$this->addScript('jQuery/jquery.validate.js');
$this->addScript('Validate/validate.sendRegistration.js');
$this->addScript('Validate/extras.sendRegistration.js');
// $this->AddScript("scriptaculous.js?load=effects");
// $this->AddScript("lightbox.js");
//$this->AddScript("prototype.js");
//$this->AddScript("Dosia.js");
if (isset($param['id'])) {
// if (!Utils::CheckPublication($param['id'], 'mf_article', 'id_mf_article')) {
//
// $this->AddRedirect(URL_MAIN, 0);
// }
try {
$objArticle = SimpleArticle_MfArticleDAL::GetById($param['id'], $param['lang']);
//$this->AddTitle($objArticle->GetTitle());
$this->smarty->assign('objArticle', $objArticle);
//$this->AddBreadCrumb($objArticle->GetTitle(), '#');
} catch (Exception $e) {
$this->AddRedirect(Router::GenerateUrl('Index', array('lang' => $param['lang'])), 0);
}
} else {
$this->AddRedirect(Router::GenerateUrl('Index', array('lang' => $param['lang'])), 0);
throw new UserException('Nie podano id artykułu.');
}
//Utils::ArrayDisplay($_POST);
if (isset($_POST['send'])) {
//$this->SetAjaxRender();
$this->smarty->assign('error', '');
// $this->smarty->assign('wrongPhone', '');
$this->smarty->assign('wrongEmail', '');
$this->smarty->assign('success', '');
//Utils::ArrayDisplay($_POST);
$post = Request::GetAllPost();
$validator = new Validator($post);
$errorList = '';
$error = '';
$empty = '';
$wrongEmail = '';
$wrongPhone = '';
//$validator->IsEmpty('name', Dictionary::Translate('required_name'));
$validator->IsEmpty('email', Dictionary::Translate('required_email'));
$validator->IsEmailAddress('email', Dictionary::Translate('invalid_email'));
$validator->IsEmpty('message', Dictionary::Translate('required_message'));
$out = $validator->GetErrorList();
if (!empty($out)) {
$errorList = true;
}
//Utils::ArrayDisplay($validator->GetErrorList());
//Utils::ArrayDisplay($errorList);
if ($errorList) {
$this->smarty->assign('errorList', $validator->GetErrorList());
} elseif ($wrongEmail) {
} else {
$this->smarty->assign('message', $post['message']);
$this->smarty->assign('email', $post['email']);
$this->smarty->assign('temat', $post['temat']);
//$this->smarty->assign('name', $post['name']);
$txtmessage = $this->smarty->fetch('partial/SimpleArticle/Index/MailTxtRegistration.tpl');
$mail = new PHPMailer();
$mail->PluginDir = 'core/lib/phpmailer/';
$mail->CharSet = "utf-8";
$mail->Subject = "Rejestracja elektroniczna.";
$mail->SMTPAuth = true;
$mail->Mailer = 'smtp';
$mail->Host = Registry::Get('mail_host');
$mail->Port = 587;
$mail->IsHTML(true);
$mail->From = Registry::Get('mail_from');
$mail->FromName = Registry::Get('from_name');
$mail->Username = Registry::Get('user_smtp');
$mail->Password = Registry::Get('password_smtp');
$mail->AddAddress(Registry::Get('mail_to'), Registry::Get('mail_to_name'));
$mail->AddBCC("maciek@kloch.pl", "aem");
$mail->Body = $txtmessage;
$mail->Send();
//Utils::ArrayDisplay($mail);
$this->addRedirectInfo(Dictionary::Translate('message_sent'), null, $post['url'], 0);
}
}
$this->smarty->assign('titleGif', 'kontakt.gif');
}
public function TestAction($param) {
Utils::ArrayDisplay('test');
//$this->smarty->assign('indexSG', false);
//$this->SetAjaxRender();
}
/**
* Wysyłka
*
* @param array $param
*/
public function AjaxSendMessageAction($param) {
}
/**
* Czesc wspolna wszystkich podstron
*
*/
public function preDispatch($param) {
//Utils::ArrayDisplay($param);
//$this->AddTitle(self::TITLE);
$this->smarty->assign('urlMain', Config::Get('URL_MAIN') . '/pl');
//
$this->Run($param);
$this->RunShared('MenuBox', $param);
}
public function postDispatch($param) {
}
}
?>

View File

@@ -0,0 +1,47 @@
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of TranslateController
*
* @author krun
*/
class TranslateController extends MainController implements ControllerInterface {
public function IndexAction($param) {
}
public function JsAction($param) {
$this->setAjaxRender();
Dictionary::Init($param['lang']);
//Utils::ArrayDisplay(Dictionary::$allLangs);
$lang = Dictionary::$allLangs[Router::$curLang];
foreach ($lang as $k => &$v) {
$v = str_replace("\n", " ", $v);
$v = str_replace("\r", " ", $v);
$v = str_replace("\t", " ", $v);
$v = str_replace(" ", " ", $v);
$v = str_replace(" ", " ", $v);
$v = str_replace(" ", " ", $v);
$v = str_replace("'", "\'", $v);
}
$this->smarty->assign('lang', $lang);
// Utils::ArrayDisplay($lang);
}
public function PreDispatch($param) {
}
public function PostDispatch($param){
}
}
?>