function getValueByKey($section, $key, $defaultValue = '') { $configValue = U_ReConfig::_init(); $value = $configValue[$section][$key]; if (!$value) { return $defaultValue; } return $value; }
function _sendMail(&$user, $password) { global $mainframe; $db =& JFactory::getDBO(); $name = $user->get('name'); $email = $user->get('email'); $username = $user->get('username'); $usersConfig =& JComponentHelper::getParams('com_users'); $sitename = $mainframe->getCfg('sitename'); $useractivation = $usersConfig->get('useractivation'); $mailfrom = $mainframe->getCfg('mailfrom'); $fromname = $mainframe->getCfg('fromname'); $siteURL = JURI::base(); //$subject = sprintf ( JText::_( 'Account details for' ), $name, $sitename); //$subject = html_entity_decode($subject, ENT_QUOTES); if ($useractivation == 1) { $message = sprintf(JText::_('SEND_MSG_ACTIVATE'), $name, $sitename, $siteURL . "index.php?option=com_user&task=activate&activation=" . $user->get('activation'), $siteURL, $username, $password); } else { $message = sprintf(JText::_('SEND_MSG'), $name, $sitename, $siteURL); } $message = html_entity_decode($message, ENT_QUOTES); //get all super administrator $query = 'SELECT name, email, sendEmail' . ' FROM #__users' . ' WHERE LOWER( usertype ) = "super administrator"'; $db->setQuery($query); $rows = $db->loadObjectList(); // Send email to user if (!$mailfrom || !$fromname) { $fromname = $rows[0]->name; $mailfrom = $rows[0]->email; } include_once 'libraries/com_u_re/php/config.php'; $art_id = U_ReConfig::getValueByKey('TEMPLATEEMAIL', 'dang_ky'); $sqlcontent = "SELECT introtext from jos_content where id = '{$art_id}'"; $db =& JFactory::getDBO(); $db->setQuery($sqlcontent); $rowcontent = $db->loadRow(); $noidung = $rowcontent[0]; $noidung = str_replace("%tên%", $name, $noidung); images / ($noidung = str_replace("images/", JURI::base() . "images/", $noidung)); $subject = 'Chào mừng đến với website Mạng lưới Bất động sản'; //$body = JText::sprintf('PASSWORD_RESET_CONFIRMATION_EMAIL_TEXT', $sitename, $token, $url); $body = $noidung; JUtility::sendMail($mailfrom, $fromname, $email, $subject, $body, $mod = 1); // Send notification to all administrators $subject2 = sprintf(JText::_('Account details for'), $name, $sitename); $subject2 = html_entity_decode($subject2, ENT_QUOTES); // get superadministrators id foreach ($rows as $row) { if ($row->sendEmail) { $message2 = sprintf(JText::_('SEND_MSG_ADMIN'), $row->name, $sitename, $name, $email, $username); $message2 = html_entity_decode($message2, ENT_QUOTES); JUtility::sendMail($mailfrom, $fromname, $row->email, $subject2, $message2); } } }
function _sendReminderMail($email, $username) { $config =& JFactory::getConfig(); $uri =& JFactory::getURI(); $url = $uri->toString(array('scheme', 'host', 'port')) . JRoute::_('index.php?option=com_user&view=login', false); $name = UserModelRemind::getNameByUsername($username); //$from = $config->getValue('mailfrom'); //$fromname = $config->getValue('fromname'); //$subject = JText::sprintf('USERNAME_REMINDER_EMAIL_TITLE', $config->getValue('sitename')); //$body = JText::sprintf('USERNAME_REMINDER_EMAIL_TEXT', $config->getValue('sitename'), $username, $url); include_once 'libraries/com_u_re/php/config.php'; $art_id = U_ReConfig::getValueByKey('TEMPLATEEMAIL', 'quen_username'); $sqlcontent = "SELECT introtext from jos_content where id = '{$art_id}'"; $db =& JFactory::getDBO(); $db->setQuery($sqlcontent); $rowcontent = $db->loadRow(); $noidung = $rowcontent[0]; $noidung = str_replace("%username%", $username, $noidung); $noidung = str_replace("%name%", $name, $noidung); $noidung = str_replace("%link%", $url, $noidung); $noidung = str_replace("images/", JURI::base() . "images/", $noidung); $from = $config->getValue('mailfrom'); $fromname = $config->getValue('fromname'); $subject = 'Quên tên đăng nhập vào Mạng lưới Bất động sản.'; //$body = JText::sprintf('PASSWORD_RESET_CONFIRMATION_EMAIL_TEXT', $sitename, $token, $url); $body = $noidung; if (!JUtility::sendMail($from, $fromname, $email, $subject, $body, $mod = 1)) { $this->setError('ERROR_SENDING_REMINDER_EMAIL'); return false; } return true; }
function displayPropertyDetail($id) { global $u_reGlobalConfig; $language = ilandCommonUtils::getLanguage(); // get data $propertyModel = new U_ReModelProperties(); $propertyData = $propertyModel->layChiTietBDS($id, $language); // get template $templateName = JFactory::getApplication()->getTemplate(); $templatePath = JPATH_THEMES . DS . $templateName . DS . "html" . DS . "com_u_re" . DS . "properties"; $this->addTemplatePath($templatePath); $hien_thi_luot_xem = 0; if (isset($propertyData['hien_thi_ra_ngoai']) && $propertyData['hien_thi_ra_ngoai'] != 0 || !empty($_GET['preview'])) { $ip = $_SERVER['REMOTE_ADDR']; $session = JFactory::getSession(); $ipSession = $session->get('bds_' . $propertyData['id']); ilandCommonUtils::themLuotXemBDS($id, $propertyData['luot_xem']); if (empty($ipSession) || $ipSession != $ip) { $propertyData['luot_xem'] += 1; } //$propertyData['luot_xem'] += 1; //$propertyData['luot_xem'] = ilandCommonUtils::demLuotXemBDS($id, 0); if ($u_reGlobalConfig['COMMON']['luot_xem_bds'] == 1) { $hien_thi_luot_xem = 1; } else { $hien_thi_luot_xem = 0; } $this->setLayout($u_reGlobalConfig['PROPERTY']['detail_template']); } else { $this->setLayout($u_reGlobalConfig['PROPERTY']['detail_template'] . '_error'); parent::display(); return; } $this->assign('hien_thi_luot_xem', $hien_thi_luot_xem); // neu la loai can mua, can thue, hien thi template can mua can thue if ($propertyData['loai_giao_dich_id'] == '3' || $propertyData['loai_giao_dich_id'] == '4') { $this->assignRef('propertyData', $propertyData); $this->setLayout($u_reGlobalConfig['PROPERTY']['can_mua_template']); parent::display(); return; } // status 0 => trang chi tiet bat dong san $this->assign('status', 0); $this->assign('googlemapDisplay', $u_reGlobalConfig['MAP']['property_map_function_on']); $this->assign('googlemapEnable', $u_reGlobalConfig['MAP']['property_map_function_enable']); // hien thi cho trinh dien anh $mainImage = ilandCommonUtils::getPropertyMainImage($id); //$this->assignRef('mainImage' , $mainImage ); // hien thi cho trinh dien anh $subImages = ilandCommonUtils::getPropertySubImages($id); //$this->assignRef('secondariesImages' , $secondariesImages ); $imageData = array(); $imageData['mainImage'] = $mainImage; $imageData['subImages'] = $subImages; $imageData['status'] = 0; // chi tiet bds front end $imageData['id'] = $id; // chi tiet bds front end $imageTemplateName = 'image_block'; $imageData['title'] = $propertyData['tieu_de']; $imageBlockHTML = ilandCommonUtils::fetchImageBlockTemplate($templatePath, $imageTemplateName, $imageData); $this->assignRef('imageBlockHTML', $imageBlockHTML); // Lấy chuỗi thông tin diện tích khuôn viên $areaInfoString = U_ReViewProperties::getAreaInfoString($propertyData['dien_tich_khuon_vien_rong'], $propertyData['dien_tich_khuon_vien_dai']); $this->assignRef('areaInfoString', $areaInfoString); // Lấy chuỗi thông tin diện tích sử dụng $usedAreaInfoString = U_ReViewProperties::getAreaInfoString($propertyData['dien_tich_su_dung_rong'], $propertyData['dien_tich_su_dung_dai']); $this->assignRef('usedAreaInfoString', $usedAreaInfoString); // Lấy chuỗi thông tin diện tích xay dung $construcAreaInfoString = U_ReViewProperties::getAreaInfoString($propertyData['dien_tich_xay_dung_rong'], $propertyData['dien_tich_xay_dung_dai']); $this->assignRef('construcAreaInfoString', $construcAreaInfoString); $livingSpaceString = U_ReViewProperties::getLivingSpaceString($propertyData['dien_tich_su_dung']); $this->assignRef('livingSpaceString', $livingSpaceString); // phong khach if (empty($propertyData['phong_khach'])) { $propertyData['phong_khach'] = '_'; } // phong ngu if (empty($propertyData['phong_ngu'])) { $propertyData['phong_ngu'] = '_'; } // phong tam if (empty($propertyData['phong_tam'])) { $propertyData['phong_tam'] = '_'; } // cac phong khac if (empty($propertyData['phong_khac'])) { $propertyData['phong_khac'] = '_'; } // huong if (empty($propertyData['huong'])) { $propertyData['huong'] = '_'; } // dien tich xay dung if (empty($propertyData['dien_tich_xay_dung_dai'])) { $propertyData['dien_tich_xay_dung_dai'] = '_'; } if (empty($propertyData['dien_tich_xay_dung_rong'])) { $propertyData['dien_tich_xay_dung_rong'] = '_'; } // phap ly if (empty($propertyData['phap_ly'])) { $propertyData['phap_ly'] = '_'; } if (empty($propertyData['dia_chi'])) { $propertyData['dia_chi'] = ilandCommonUtils::ketHopDiaChi($propertyData['so_nha'], $propertyData['duong_pho'], $propertyData['phuong_xa'], $propertyData['quan_huyen'], $propertyData['tinh_thanh']); } /* * Get same properties * - Get id * - Get current page */ // mặc định là trang 1 $currentPage = 1; // get data & fetch template $returnFieldList = U_ReConfig::getValueByKey('PROPERTY', 'bdslq_truong_du_lieu'); $conditionStr = U_ReConfig::getValueByKey('PROPERTY', 'bdslq_dieu_kien'); $sameProperties = $propertyModel->getSameProperties($language, $returnFieldList, $conditionStr, $propertyData, $currentPage); $sameProperties[3] = ilandCommonUtils::boSungThongTinBDS($sameProperties[3], $templatePath, 'bdslq'); // get ajax paging $samePropertiesConditionParam = ilandCommonUtils::genBDSLQConditionParam($conditionStr, $propertyData); $samePropertiesTemplate = $u_reGlobalConfig['PROPERTY']['bdslq_template']; $url = JURI::base() . 'ajax_function.php?task=bdslq&page=' . $currentPage . '&id=' . $id . '&condition=' . $conditionStr . '&return_field=' . $returnFieldList . '&template_path=' . $templatePath . '&template_name=' . $samePropertiesTemplate . '&tienTemplatePath=tiente3&moduleId=tranga&id=' . $propertyData['id'] . '&idContentElement=tranga' . '&ajaxPagingTemplate=' . $u_reGlobalConfig['COMMON']['ajax_paging_template']; $conditionParam = explode(',', $conditionStr); foreach ($conditionParam as $param) { $url .= '&' . $param . '=' . $propertyData[$param]; } $idContentElement = 'tranga'; $totalPage = $sameProperties[1]; $samePropertiesAjaxPagingTemplateName = $u_reGlobalConfig['COMMON']['ajax_paging_template']; $samePropertiesAjaxPagingHTML = ilandCommonUtils::getAjaxPagination($idContentElement, $url, $currentPage, $totalPage, $templatePath, $samePropertiesAjaxPagingTemplateName); if (!empty($sameProperties[3])) { $samePropertiesHTML = ilandCommonUtils::fetchPropertiesTemplate($templatePath, $samePropertiesTemplate, $sameProperties[3]); } else { $samePropertiesHTML = 0; } $this->assignRef('samePropertiesHTML', $samePropertiesHTML); $this->assignRef('samePropertiesAjaxPagingHTML', $samePropertiesAjaxPagingHTML); // getAdvantageslist // $advantagesList = $propertyModel->layDanhSachTienIch( $id ); // $this->assignRef( 'advantagesList', $advantagesList ); $tempalateName = 'tien_te3'; // lay template gia tien $gia = array($propertyData['VND'], $propertyData['USD'], $propertyData['SJC']); $donViTien = array('VND', 'USD', 'SJC'); $templateTien = $u_reGlobalConfig['PROPERTY']['tien_template']; $tienHTML = ilandCommonUtils::fetchCurrencyTemplate($propertyData, $templatePath, 'chitietBDS', $tempalateName); $this->assignRef('tienHTML', $tienHTML); $gia_nguyen_can = ilandCommonUtils::reFormatPrice($propertyData['gia_nguyen_can']); $gia_m2 = ilandCommonUtils::reFormatPrice($propertyData['gia_m2']); /* $giam2 = ilandCommonUtils::layGiaM2( array('dien_tich_su_dung'=>$propertyData['dien_tich_su_dung'],'gia'=>$propertyData['gia']) ); $gia1 = ilandCommonUtils::layGiaTien( array('don_vi_tien_id'=>$propertyData['don_vi_tien_id'], 'don_vi_dien_tich_id'=>$propertyData['don_vi_dien_tich_id'], 'gia'=>$propertyData['gia']) ); */ $this->assignRef('gia_nguyen_can', $gia_nguyen_can); $this->assignRef('gia_m2', $gia_m2); //$this->assignRef( 'gia', ilandCommonUtils::reFormatPrice($gia1 )); // get all flag & fetch tien ich template $tienIchAllFlag = $u_reGlobalConfig['PROPERTY']['tien_ich_all_flag']; $tienIchTemplate = $u_reGlobalConfig['PROPERTY']['tien_ich_template']; $tienIchHTML = $propertyModel->fetchTienIchTemplate($propertyData['tien_ich_id'], $templatePath, $tienIchTemplate, $tienIchAllFlag, $language); $this->assignRef('tienIchHTML', $tienIchHTML); // get map config $this->assignRef('mapZoom', $u_reGlobalConfig['MAP']['map_zoom']); // get comment $commentHTML = ilandCommonUtils::getComment($propertyData['id'], $propertyData['tieu_de'], 'bds'); $this->assignRef('commentHTML', $commentHTML); /* thông tắt 2 mod // get module tim kiem bat dong san $timKiemBDSHTML = ilandCommonUtils::getModuleTimKiemBDS( 'TÌM KIẾM BẤT ĐỘNG SẢN TRANG CHI TIẾT' ); $this->assignRef( 'timKiemBDSHTML', $timKiemBDSHTML ); // get quang cao*/ $moduleChiase = 'CHIA SE'; $quangCaoHTML = ilandCommonUtils::getChiaSe($moduleChiase); $this->assignRef('chiase', $quangCaoHTML); $moduleQC = 'Banner Ad - Chi tiết tin'; $QCHTML = $this->getModuleQC($moduleQC); $this->assignRef('quangcao', $QCHTML); // $propertyData['dien_tich_khuon_vien'] =''; $this->assignRef('propertyData', $propertyData); $document =& JFactory::getDocument(); $subject = $this->propertyData['tieu_de']; $nguoinhan = $this->propertyData['email_nguoi_lien_he']; $tennguoinhan = $this->propertyData['ten_nguoi_lien_he']; $lienhe = $this->getModule('mod_jdcontact', 'mod_jdcontact', 'raw', $subject, $nguoinhan, $tennguoinhan); $this->assignRef('lienhe', $lienhe); // print_r( $u_reGlobalConfig['SEO']['mo_ta_trang_mac_dinh'] ); if ($this->escape($propertyData['tieu_de_trang']) == NULL) { if ($propertyData['du_an'] == 'Vui lòng chọn') { $da = ''; } else { $da = $propertyData['du_an']; } // $page_title = $propertyData['thong_tin_tong_quan'] ; $title = $propertyData['loai_giao_dich'] . " " . $propertyData['loai_bds'] . " " . $da . ", " . $propertyData['quan_huyen'] . ", " . $propertyData['tinh_thanh']; $page_title = $title; } else { $page_title = ucfirst($this->escape($propertyData['tieu_de_trang'])); } if ($this->escape($propertyData['tu_khoa_trang']) == NULL) { $page_keywords = $u_reGlobalConfig['SEO']['tu_khoa_trang_mac_dinh']; } else { $page_keywords = ucfirst($this->escape($propertyData['tu_khoa_trang'])); } $document->setMetaData('keywords', $page_keywords); if ($this->escape($propertyData['mo_ta_trang']) == NULL) { $page_description = $u_reGlobalConfig['SEO']['mo_ta_trang_mac_dinh']; } else { $page_description = ucfirst($this->escape($propertyData['mo_ta_trang'])); } $document->setMetaData('description', $page_description); $mainframe =& JFactory::getApplication(); $pathway =& $mainframe->getPathway(); $pathway->addItem($page_title); $document->setTitle($page_title); parent::display(); }
function lay_du_lieu($table) { $language = ''; if ($language == NULL) { $language = ilandCommonUtils::getLanguage(); } $propertyModel = new U_reModelProperties(); $projectModel = new U_ReModelProjects(); switch ($table) { case 'loai_giao_dich': return $propertyModel->layDanhSachLoaiGiaoDich($language); case 'huong': return $propertyModel->layDanhSachHuong($language); case 'loai_bds': return $propertyModel->layDanhSachLoaiBatDongSan($language); case 'tinh_thanh': return $propertyModel->layDanhSachTinhThanh($language); case 'quan_huyen': if (JRequest::getVar('tinh_thanh_id')) { $townId = JRequest::getVar('tinh_thanh_id'); } else { // $townId = U_ReConfig::getValueByKey( 'COMMON', 'tinh_thanh_mac_dinh' ); if (isset($_SESSION['tmp'])) { $townId = $_SESSION['tmp']['tinh_thanh_id']; } else { $townId = 0; } } return $propertyModel->layDanhSachQuanHuyen($townId, 'vi'); case 'phuong_xa': if (JRequest::getVar('quan_huyen_id')) { $quanHuyenId = JRequest::getVar('quan_huyen_id'); } else { $quanHuyenId = U_ReConfig::getValueByKey('COMMON', 'quan_huyen_mac_dinh'); } return $propertyModel->layDanhSachPhuongXa($quanHuyenId); case 'duong_pho': if (JRequest::getVar('quan_huyen_id')) { $quanHuyenId = JRequest::getVar('quan_huyen_id'); } else { $quanHuyenId = U_ReConfig::getValueByKey('COMMON', 'quan_huyen_mac_dinh'); } return $propertyModel->layDanhSachDuongPho($quanHuyenId); case 'nhom_du_an': return $nhomduan = $projectModel->laynhomduan($language); case 'tien_ich': return $propertyModel->layDanhSachTienIch($language); case 'du_an': $ix_quan_huyen_id = JRequest::getVar('quan_huyen_id', 0); $ix_tinh_thanh_id = JRequest::getVar('tinh_thanh_id', 0); return $projectModel->laydanhsachduan($ix_quan_huyen_id, $ix_tinh_thanh_id); } }
function getPropertyLink($alias, $id, $itemId = '') { /*return "index.php?option=com_u_re&task=viewDetail&view=properties&id=" . $id . '&Itemid=' . $itemId;*/ global $u_reGlobalConfig; $rootLink = U_ReConfig::getValueByKey('COMMON', 'root'); $itemId = U_ReConfig::getValueByKey('PROPERTY', 'itemid_chi_tiet_BDS'); //$itemIds = '186'; return $rootLink . "nhadat/" . trim($alias) . "/viewDetail/" . $itemId . "/" . $id; }
$mailphp->AddAddress($recipient); $mailphp->Subject = $subject; //$mailphp->Body = $mess; $mailphp->MsgHTML($mess); $mailphp->CharSet = 'UTF-8'; $se = $mailphp->Send(); if ($se) { $sucs = 1; } // gửi cho người liên hệ $from = $sales_address; $recipient1 = $email; $subject = "Liên hệ " . $attribs['subject']; $body = $message; //lấy templates mail $art_id = U_ReConfig::getValueByKey('TEMPLATEEMAIL', 'lien_he_chi_tiet_gui'); $sqlcontent = "SELECT introtext from jos_content where id = '{$art_id}'"; $db =& JFactory::getDBO(); $db->setQuery($sqlcontent); $rowcontent = $db->loadRow(); $mess = $rowcontent[0]; $mess = str_replace('%nguoigui%', $ten, $mess); $mess = str_replace('%batdongsan%', $attribs['subject'], $mess); $mess = str_replace("images/", JURI::base() . "images/", $mess); $mess = str_replace('%link%', $_SERVER['HTTP_REFERER'], $mess); $mailphp1->From = "*****@*****.**"; $mailphp1->FromName = "Mạng lưới bất động sản"; $mailphp1->AddAddress($recipient1); $mailphp1->Subject = $subject; //$mailphp1->Body = $mess; $mailphp1->MsgHTML($mess);
<?php /** * This file is part of Joomla Estate Agency - Joomla! extension for real estate agency * * @version 0.9 2009-10-14 * @package Jea.admin * @copyright Copyright (C) 2008 PHILIP Sylvain. All rights reserved. * @license GNU/GPL, see LICENSE.php * Joomla Estate Agency is free software. This version may have been modified pursuant to the * GNU General Public License, and as distributed it includes or is derivative * of works licensed under the GNU General Public License or other free or open * source software licenses. * */ // no direct access defined('_JEXEC') or die('Restricted access'); require JPATH_COMPONENT . DS . 'jea.class.php'; require_once JPATH_ROOT . DS . 'libraries' . DS . 'com_u_re' . DS . 'php' . DS . 'config.php'; // global config global $u_reGlobalConfig; $u_reGlobalConfig = U_ReConfig::getParams(); ComJea::run();
function getacticle() { $lists = mod_project_slideshowHelper::getsession(); $limit = U_ReConfig::getValueByKey('SLIDESHOWIMAGE', 'list_limit'); $db =& JFactory::getDBO(); $query = "SELECT id, title, introtext FROM #__content WHERE state = '1' "; $query .= " AND sectionid=1"; $query .= " ORDER BY created DESC, modified "; $db->setQuery($query, 0, $limit); $rows = $db->loadObjectList(); return $rows; }
} if (!defined('JPATH_COMPONENT')) { define('JPATH_COMPONENT', JPATH_ROOT . DS . 'components' . DS . 'com_u_re'); } $task = $_GET['task']; $language = $_GET['language']; $dbConfig = array(); $dbConfig[] = U_ReConfig::getValueByKey('DB', 'host'); $dbConfig[] = U_ReConfig::getValueByKey('DB', 'user'); $dbConfig[] = U_ReConfig::getValueByKey('DB', 'pass'); $dbConfig[] = U_ReConfig::getValueByKey('DB', 'name'); //$dbConfig[] = "localhost"; //$dbConfig[] = "mlbds_db"; //$dbConfig[] = "1234mldbqwer"; //$dbConfig[] = "mlbds_db"; $ordering = U_ReConfig::getValueByKey('MOD_DANH_SACH_BDS', 'orderby'); if ($task == 'bdslq') { // Lay data bdslq require_once 'libraries/com_u_re/models/properties.php'; $lang = ilandCommonUtils::getLanguage(); $currentPage = $_GET['page']; $condition = $_GET['condition']; $limit = 10; $returnField = $_GET['return_field']; $conditionArr = explode(',', $condition); // tao data property $propertyData = array(); foreach ($conditionArr as $con) { $propertyData[$con] = $_GET[$con]; } $conditionParam = ilandCommonUtils::genBDSLQConditionParam($condition, $propertyData);
<?php require_once 'includes/ham_tien_ich.php'; include_once 'libraries/com_u_re/php/config.php'; $sotu = U_ReConfig::getValueByKey('MOD_DANH_SACH_BDS', 'so_tu_tieu_de'); if (isset($_GET['loai_bds_id'])) { ?> <div class="property-town"> <?php if (!empty($datatp)) { ?> <!-- TP.Hồ Chí Minh --> <div class="list-bds"> <h3>TP.Hồ Chí Minh</h3> <div id="xtc"><a href="index.php?tinh_thanh_id=1&task=search&option=com_u_re&Itemid=218&Issearch=1">Xem tất cả</a></div> <?php foreach ($datatp as $item) { ?> <div class='items-icon-list'> <div class='f-l-tm1'> <a href='<?php echo $item['link']; ?> ' > <?php if (!file_exists("images/property/" . $item['id'] . "/min.jpg")) { echo "<img class=\"img_bds_tm\" src='" . JURI::base() . "{$item['image']}' >"; } else { echo "<img class=\"img_bds_tm\" src='" . JURI::base() . "images/property/{$item['id']}/min.jpg' > ";
function _sendConfirmationMail($email, $token) { //include_once (JURI::root().'tools/phpmailer.php'); //$mailphp = new PHPMailer(); $config =& JFactory::getConfig(); $uri =& JFactory::getURI(); $url = JURI::base() . 'index.php?option=com_user&view=reset&layout=confirm&Itemid=19'; $sitename = $config->getValue('sitename'); $name = $this->getNameByEmail($email); $from = $config->getValue('mailfrom'); $fromname = $config->getValue('fromname'); $subject = 'Quên mật khẩu vào Mạng lưới Bất động sản.'; include_once 'libraries/com_u_re/php/config.php'; $art_id = U_ReConfig::getValueByKey('TEMPLATEEMAIL', 'quan_mat_khau'); $sqlcontent = "SELECT introtext from jos_content where id = '{$art_id}'"; $db =& JFactory::getDBO(); $db->setQuery($sqlcontent); $rowcontent = $db->loadRow(); $noidung = $rowcontent[0]; $noidung = str_replace("%ten%", $name, $noidung); $noidung = str_replace("%maxacnhan%", $token, $noidung); $noidung = str_replace("%link%", $url, $noidung); $noidung = str_replace("images/", JURI::base() . "images/", $noidung); if (!JUtility::sendMail($from, $fromname, $email, $subject, $noidung, $mode = 1)) { $this->setError('ERROR_SENDING_CONFIRMATION_EMAIL'); return false; } return true; }
function saveUser() { global $mainframe; $username = JRequest::getVar('email', '', 'POST', 'string'); $password = JRequest::getVar('password', '', 'POST', 'string'); $password2 = JRequest::getVar('password2', '', 'POST', 'string'); $name = JRequest::getVar('name', '', 'POST', 'string'); $email = JRequest::getVar('email', '', 'POST', 'string'); $address = JRequest::getVar('address', '', 'POST', 'string'); $phone = JRequest::getVar('phone', '', 'POST', 'string'); $tim = date('Y-d-m H:i:s'); //$salt = JUserHelper::genRandomPassword(32); //$crypt = JUserHelper::getCryptedPassword($password, $salt); $pass = md5($password); if (JRequest::getVar('chinh_chu', '', 'POST', 'string') == 'on') { $chinh_chu = 0; $groupid = 34; $usertype = "Mô giới"; } else { $chinh_chu = 1; $groupid = 35; $usertype = "Chính chủ"; } if (JRequest::getVar('speak_english', '', 'POST', 'string') == 'on') { $speak_english = 1; } else { $speak_english = 0; } if (JRequest::getVar('nhan_mail', '', 'POST', 'string') == 'on') { $nhan_mail = 1; } else { $nhan_mail = 0; } $db =& JFactory::getDBO(); $query = "insert into jos_users (username,password,name,email,phone,address,usertype,gid,registerDate,chinh_chu,speak_english,nhan_mail) \n\t\t\t\t\t\tvalue ('{$username}','{$pass}','{$name}','{$email}','{$phone}','{$address}','{$usertype}',{$groupid},'{$tim}',{$chinh_chu},{$speak_english},{$nhan_mail})"; $db->setQuery($query); $db->query(); $id = $db->insertid(); $sql = "insert into jos_core_acl_aro (section_value,value,name) value ('users','{$id}','{$name}')"; $db->setQuery($sql); $db->query(); $ids = $db->insertid(); $sql1 = "insert into jos_core_acl_groups_aro_map (group_id,aro_id) value ({$groupid},{$ids})"; $db->setQuery($sql1); $db->query(); $mailfrom = $mainframe->getCfg('mailfrom'); $fromname = $mainframe->getCfg('fromname'); include_once 'libraries/com_u_re/php/config.php'; $art_id = U_ReConfig::getValueByKey('TEMPLATEEMAIL', 'dang_ky'); $sqlcontent = "SELECT introtext from jos_content where id = '{$art_id}'"; $db =& JFactory::getDBO(); $db->setQuery($sqlcontent); $rowcontent = $db->loadRow(); $noidung = $rowcontent[0]; $noidung = str_replace("%tên%", $name, $noidung); images / ($noidung = str_replace("images/", JURI::base() . "images/", $noidung)); $subject = 'Chào mừng đến với website Mạng lưới Bất động sản'; //$body = JText::sprintf('PASSWORD_RESET_CONFIRMATION_EMAIL_TEXT', $sitename, $token, $url); $body = $noidung; JUtility::sendMail($mailfrom, $fromname, $email, $subject, $body, $mod = 1); //$mainframe->redirect('index.php'); //return $id; }
// get tien te, link, hinh anh $data = ilandCommonUtils::boSungThongTinBDS($data, $templatePath, $module->id, $tempalateName); //$data1 = ilandCommonUtils::boSungThongTinBDS( $dataFull[3], $templatePath, $module->id, $tempalateName ); //$data = array_merge( $data, $data1 ); if (U_ReConfig::getValueByKey('COMMON', 'luot_xem_ds_bds') == 1) { $hien_thi_luot_xem = 1; } else { $hien_thi_luot_xem = 0; } // get ajax paging $contentElementId = 'noi_dung' . $module->id; $module->noiDungId = $contentElementId; $language = ilandCommonUtils::getLanguage(); $moduleTemplatePath = JPATH_THEMES . DS . $currentTemplate . DS . "html" . DS . "mod_danh_sach_BDS"; $ajaxPagingTemplate = U_ReConfig::getValueByKey('PROPERTY', 'ajax_paging_template'); $url = U_ReConfig::getValueByKey('COMMON', 'root') . 'ajax_function.php?task=dsbds&condition=' . $conditionParam . '&returnField=' . $returnField . '&limit=' . $limit . '&templatePath=' . $moduleTemplatePath . '&templateName=' . $template . '&tienTemplatePath=' . $templatePath . '&idContentElement=' . $contentElementId . '&ajaxPagingTemplate=' . $ajaxPagingTemplate . '&language=' . $language . '&moduleId=' . $module->id; // count all page $getCountAll = " SELECT count(*) FROM iland4_bat_dong_san_vi WHERE " . $conditionParam; $db1 = JFactory::getDBO(); $db1->setQuery($getCountAll); $db1->query(); $totalPage = round($db1->loadResult() / $limit); $ajaxPaging = ilandCommonUtils::getAjaxPagination($contentElementId, $url, $currentPage, $totalPage, $templatePath, $ajaxPagingTemplate); if ($layoutname == 'map') { require JModuleHelper::getLayoutPath('mod_danh_sach_BDS', 'map'); } else { if (JRequest::getVar('Itemid') == 229) { require JModuleHelper::getLayoutPath('mod_danh_sach_BDS', 'moinhat'); } else { require JModuleHelper::getLayoutPath('mod_danh_sach_BDS', 'listhome'); }
<?php defined('_JEXEC') or die('Restricted access'); require dirname(__FILE__) . DS . 'helper.php'; $loai_slide_show = U_ReConfig::getValueByKey('SLIDESHOWIMAGE', 'loai_slide_show'); if ($loai_slide_show == "project") { // slideshow cho du an $getprovalueTitle = mod_project_slideshowHelper::getProjectValueTitle($params); } else { // slideshow cho bai viet $getprovalueTitle = mod_project_slideshowHelper::getSessionvalue(); } /* lay thong tin moi */ $getnew = mod_project_slideshowHelper::getnew(); $speed = U_ReConfig::getValueByKey('SLIDESHOWIMAGE', 'speed'); require 'libraries/com_u_re/php/slideshow.php'; require JModuleHelper::getLayoutPath('mod_project_slideshow', 'default');