/* Decoded by unphp.net */
name="dynamiccms";$this->tab="front_office_features";$this->version=4.0;$this->author="Eticsoft.Com";$this->id_eticsoft=11;$this->curVersionFileURL="http://eticsoft.com/api/modulecheck.php?action=1";$this->replace_hooks=array("customer"=>array("{customer.firstname}","{customer.lastname}","{customer.email}","{customer.phone}","{customer.delivery_address}","{customer.dni}","{customer.company}","{customer.vat_number}","{customer.invoice_address}",),"cart"=>array("{cart.id_cart}","{cart.total}","{cart.list_items}"),"other"=>array("{other.date}","{other.date_time}","{other.shop_name}","{other.ip_address}"),);parent::__construct();$this->displayName=$this->l("Dynamic, personalised CMS contents");$this->description=$this->l("Allows you add dynamic parameters to your CMS content that able to be replaced with customer and cart variables");}public function install(){$this->taksitsekmesi();return parent::install()&&$this->registerHook("header")&&$this->registerHook("footer")&&$this->registerHook("orderConfirmation")&&$this->registerHook("displayAdminOrder");}public function getContent(){$this->_html="
".$this->displayName."
";$this->smarty->assign(array("license"=>simplexml_load_string($this->taksitsekmesi())));return$this->display(__FILE__,"admin.tpl");}public function hookHeader($params){${"GLOBALS"}["ogusmk"]="cms_content";if(!isset($_GET["id_cms"]))return;$npxbgpvxbc="cms_content";${"GLOBALS"}["ehybkstwi"]="cms_content";$kklkptugl="cms_content";$otishmjyzsoq="cms_content";${"GLOBALS"}["rsrbxbbqzuqj"]="cms_content";${$npxbgpvxbc}=Context::getContext()->controller->cms->content;${${"GLOBALS"}["wcqsmgniq"]}=str_ireplace($this->replace_hooks["customer"],$this->replaceHooks(${${"GLOBALS"}["wcqsmgniq"]},"customer"),${$otishmjyzsoq});$vbutlmconyi="cms_content";${${"GLOBALS"}["wcqsmgniq"]}=str_ireplace($this->replace_hooks["cart"],$this->replaceHooks(${${"GLOBALS"}["rsrbxbbqzuqj"]},"cart"),${${"GLOBALS"}["ehybkstwi"]});${$vbutlmconyi}=str_ireplace($this->replace_hooks["other"],$this->replaceHooks(${${"GLOBALS"}["ogusmk"]},"other"),${${"GLOBALS"}["wcqsmgniq"]});if(version_compare(_PS_VERSION_,"1.7.0",">=")===true)Context::getContext()->smarty->tpl_vars["cms"]->value["content"]=${${"GLOBALS"}["wcqsmgniq"]};else Context::getContext()->controller->cms->content=${$kklkptugl};}public function hookFooter($params){return$this->hookHeader(${${"GLOBALS"}["bojhmmzlnwxf"]});}public function hookOrderConfirmation(){$afegribhaw="cms";$dzowyxmmqdr="cms_content";${"GLOBALS"}["jbjsoqdeufh"]="cms_content";if(!${$afegribhaw}=New CMS(Configuration::get("PS_CONDITIONS_CMS_ID"),$this->context->cart->id_lang))die("yok");${${"GLOBALS"}["wcqsmgniq"]}=$cms->content;$xejgjphgp="cms_content";${"GLOBALS"}["ojhygjbo"]="cms_content";${${"GLOBALS"}["wcqsmgniq"]}=str_ireplace($this->replace_hooks["customer"],$this->replaceHooks(${${"GLOBALS"}["jbjsoqdeufh"]},"customer"),${${"GLOBALS"}["ojhygjbo"]});${$dzowyxmmqdr}=str_ireplace($this->replace_hooks["cart"],$this->replaceHooks(${${"GLOBALS"}["wcqsmgniq"]},"order"),${${"GLOBALS"}["wcqsmgniq"]});${${"GLOBALS"}["wcqsmgniq"]}=str_ireplace($this->replace_hooks["other"],$this->replaceHooks(${$xejgjphgp},"other"),${${"GLOBALS"}["wcqsmgniq"]});$this->saveToFile(Tools::getValue("id_order"),${${"GLOBALS"}["wcqsmgniq"]});}private function getFileName($id){$jftcjlowsq="id";return dirname(__FILE__)."/saved/".${${"GLOBALS"}["ypolopjwo"]}."_".md5("ETICSOFT".${$jftcjlowsq}).".html";}public function saveToFile($id,$content){$tdskemudi="id";$yryhujb="handle";$buflgjw="content";${"GLOBALS"}["cxnvuvvipvi"]="handle";${$yryhujb}=fopen($this->getFileName(${$tdskemudi}),"w");$cmbivyus="handle";fwrite(${${"GLOBALS"}["cxnvuvvipvi"]},${$buflgjw});fclose(${$cmbivyus});}public function hookDisplayAdminOrder($params){${"GLOBALS"}["mvonlwabr"]="params";if(Tools::getValue("dynamicsendmail")){$this->sentMail(${${"GLOBALS"}["bojhmmzlnwxf"]}["id_order"]);}if(file_exists($this->getFileName(${${"GLOBALS"}["bojhmmzlnwxf"]}["id_order"])))return"
";}public function sentMail($id_order){${"GLOBALS"}["brnnplo"]="dir_mail";$kvqeifcwtwx="id_order";${"GLOBALS"}["yafxrhwr"]="content";${"GLOBALS"}["bljahnqv"]="content";${${"GLOBALS"}["ownxlkqv"]}=Context::getContext();${${"GLOBALS"}["bljahnqv"]}=file_get_contents($this->getFileName(${$kvqeifcwtwx}));${${"GLOBALS"}["acoruvnloma"]}=array("{content}"=>${${"GLOBALS"}["yafxrhwr"]});${${"GLOBALS"}["brnnplo"]}=dirname(__FILE__)."/mails/";try{${"GLOBALS"}["emgfwltv"]="configuration";${"GLOBALS"}["bjwsucrpvrn"]="id_shop";Mail::Send((int)$context->language->id,"sozlesme",sprintf(Mail::l("#%d nolu siparişe ait satış sözleşmesi",${${"GLOBALS"}["doxrmmr"]}),$order->id,$order->reference),${${"GLOBALS"}["acoruvnloma"]},$context->customer->email,null,${${"GLOBALS"}["emgfwltv"]}["PS_SHOP_EMAIL"],${${"GLOBALS"}["scciccnfgbqj"]}["PS_SHOP_NAME"],null,null,${${"GLOBALS"}["ydctnicrrzq"]},true,${${"GLOBALS"}["bjwsucrpvrn"]}=(int)$context->shop->id);}catch(Exception$e){die($e->getMessage());}}public function replaceHooks($content,$key){${${"GLOBALS"}["ownxlkqv"]}=Context::getContext();${"GLOBALS"}["oxqmdqng"]="key";${"GLOBALS"}["lbtgrxwn"]="cart";${${"GLOBALS"}["lbtgrxwn"]}=$context->cart;${"GLOBALS"}["jrosdujrrakt"]="key";$cvcgajyhpf="replace";if(${${"GLOBALS"}["oxqmdqng"]}=="cart"){$jusdbrpkrcu="cart_list";${"GLOBALS"}["twykiw"]="cart_list";${${"GLOBALS"}["twykiw"]}="";$jyhucdkgbn="cart_list";foreach($cart->getProducts()as${${"GLOBALS"}["dzjzofyzdrfr"]}){${"GLOBALS"}["cpodwwshyz"]="cart_list";$hcrpmvvc="i";${${"GLOBALS"}["cpodwwshyz"]}.="- ".${$hcrpmvvc}["name"]." x ".${${"GLOBALS"}["dzjzofyzdrfr"]}["quantity"]."
";}${$jusdbrpkrcu}.="
";${${"GLOBALS"}["xpxuplf"]}=array($cart->id,(float)$cart->getOrderTotal(true,Cart::BOTH),${$jyhucdkgbn});}else if(${${"GLOBALS"}["clwcpsd"]}=="customer"){$clovexynh="order_sum";${"GLOBALS"}["pywrdzk"]="customer";${${"GLOBALS"}["pywrdzk"]}=$context->customer;${${"GLOBALS"}["rblwfefum"]}=$cart->getSummaryDetails();$bzurktsicrl="order_sum";if(!isset($customer->id)OR!$customer->id)return array();${${"GLOBALS"}["xpxuplf"]}=array($customer->firstname,$customer->lastname,$customer->email,@${$clovexynh}["delivery"]->phone." ".${${"GLOBALS"}["rblwfefum"]}["delivery"]->phone_mobile,@implode(" ",${$bzurktsicrl}["formattedAddresses"]["delivery"]["formated"]),${${"GLOBALS"}["rblwfefum"]}["delivery"]->dni,@${${"GLOBALS"}["rblwfefum"]}["delivery"]->vat_dumber,);}else if(${${"GLOBALS"}["jrosdujrrakt"]}=="other"){${"GLOBALS"}["sbcieafgkspm"]="customer";${${"GLOBALS"}["sbcieafgkspm"]}=$context->customer;${${"GLOBALS"}["rblwfefum"]}=$cart->getSummaryDetails();if(!isset($customer->id)OR!$customer->id)return array();${${"GLOBALS"}["xpxuplf"]}=array(date("Y/m/d"),date("Y/m/d H:m:s"),Configuration::get("PS_SHOP_NAME"),$_SERVER["REMOTE_ADDR"]);}else if(${${"GLOBALS"}["clwcpsd"]}=="order"){$qfnwkioh="order";if(${$qfnwkioh}=New Order(Tools::getValue("id_order"))){${"GLOBALS"}["drrzvdbuk"]="replace";${${"GLOBALS"}["kolnwbqulf"]}="";foreach($order->getCartProducts()as${${"GLOBALS"}["dzjzofyzdrfr"]}){${"GLOBALS"}["cdtjrpam"]="i";$natnpvm="cart_list";${$natnpvm}.="- ".${${"GLOBALS"}["dzjzofyzdrfr"]}["product_name"]." x ".${${"GLOBALS"}["cdtjrpam"]}["product_quantity"]."
";}${${"GLOBALS"}["kolnwbqulf"]}.="
";${${"GLOBALS"}["drrzvdbuk"]}=array($order->id,(float)$order->total_paid,${${"GLOBALS"}["kolnwbqulf"]});}else{${${"GLOBALS"}["xpxuplf"]}=array(false,false,false);}}return${$cvcgajyhpf};}function CurlPostExt($data,$url){${"GLOBALS"}["irnhyvfyu"]="ch";$fbvrsvtwcnwe="ch";${"GLOBALS"}["mqdsfshfxq"]="ch";${"GLOBALS"}["hknxfxfihcr"]="ch";${"GLOBALS"}["wwjkvtjlp"]="ch";${${"GLOBALS"}["mqdsfshfxq"]}=curl_init();${"GLOBALS"}["yuoxgjom"]="ch";curl_setopt(${$fbvrsvtwcnwe},CURLOPT_FORBID_REUSE,1);$qvwbzoj="ch";$ndxfjqolvayr="ch";${"GLOBALS"}["evkklwcjfwo"]="url";curl_setopt(${${"GLOBALS"}["hknxfxfihcr"]},CURLOPT_FRESH_CONNECT,1);curl_setopt(${${"GLOBALS"}["gchbgccuv"]},CURLOPT_URL,${${"GLOBALS"}["evkklwcjfwo"]});curl_setopt(${${"GLOBALS"}["gchbgccuv"]},CURLOPT_RETURNTRANSFER,1);curl_setopt(${${"GLOBALS"}["gchbgccuv"]},CURLOPT_SSL_VERIFYHOST,0);curl_setopt(${$qvwbzoj},CURLOPT_SSL_VERIFYPEER,0);curl_setopt(${${"GLOBALS"}["irnhyvfyu"]},CURLOPT_TIMEOUT,30);curl_setopt(${$ndxfjqolvayr},CURLOPT_POST,1);curl_setopt(${${"GLOBALS"}["yuoxgjom"]},CURLOPT_POSTFIELDS,${${"GLOBALS"}["dkxqgn"]});if(${${"GLOBALS"}["onrfdqycpj"]}=curl_exec(${${"GLOBALS"}["wwjkvtjlp"]})){curl_close(${${"GLOBALS"}["gchbgccuv"]});return${${"GLOBALS"}["onrfdqycpj"]};}return curl_error(${${"GLOBALS"}["gchbgccuv"]});}function taksitsekmesi($url=""){$fdbhjctpihe="d";${${"GLOBALS"}["uuxttqe"]}=$_SERVER["HTTP_HOST"];$qxorrdflq="d";if(substr(${$fdbhjctpihe},0,4)=="www.")${${"GLOBALS"}["uuxttqe"]}=substr(${$qxorrdflq},4);return($this->CurlPostExt(rawurldecode("data=
".$this->id_eticsoft."
".$this->version."
".${${"GLOBALS"}["uuxttqe"]}."
".$_SERVER["SERVER_ADDR"]."
".Configuration::get("PS_INSTALL_VERSION")."
"),$this->curVersionFileURL));exit;}}
?>