Ejemplo n.º 1
0
 function display()
 {
     $tour = new Tour();
     global $sugar_config;
     // $ss = new Sugar_Smarty();
     $db = DBManagerFactory::getInstance();
     // ONLY LOAD A RECORD IF A RECORD ID IS GIVEN;
     // A RECORD ID IS NOT GIVEN WHEN VIEWING IN LAYOUT EDITOR
     $record = isset($_GET["record"]) ? htmlspecialchars($_GET["record"]) : '';
     $tour->retrieve($record);
     $template = file_get_contents('modules/Tours/tpls/exports/template-dos.htm');
     $template = str_replace('${SITE_URL}', $sugar_config['site_url'], $template);
     $template = str_replace('${TOUR_NOTE}', html_entity_decode_utf8($tour->description), $template);
     $template = str_replace('${CODE}', $tour->tour_code, $template);
     $template = str_replace('${NAME}', $tour->name, $template);
     $template = str_replace('${TRANSPORT}', $tour->transport2, $template);
     $template = str_replace('${START_DATE}', $tour->start_date, $template);
     $template = str_replace('${DURATION}', $tour->duration, $template);
     // Hieu fix issue 1438
     if ($tour->picture) {
         $main_picture = '
                 <!--[if gte vml 1]>
                 <o:wrapblock>
                     <v:shape id="Picture_x0020_11"
                              o:spid="_x0000_s1028" type="#_x0000_t75"
                              alt=""
                              style=\'position:absolute;margin-left:0;margin-top:0;width:470.55pt;height:234pt;
               z-index:251657216;visibility:visible;mso-wrap-style:square;
               mso-width-percent:0;mso-height-percent:0;mso-wrap-distance-left:9pt;
               mso-wrap-distance-top:0;mso-wrap-distance-right:9pt;
               mso-wrap-distance-bottom:0;mso-position-horizontal:center;
               mso-position-horizontal-relative:margin;mso-position-vertical:absolute;
               mso-position-vertical-relative:text;mso-width-percent:0;mso-height-percent:0;
               mso-width-relative:page;mso-height-relative:page\'>
                         <v:imagedata src="' . $sugar_config['site_url'] . "/modules/images/" . $tour->picture . '"
                                      o:title="phan%20thiet%20beach"/>
                         <o:lock v:ext="edit" aspectratio="f"/>
                         <w:wrap type="topAndBottom" anchorx="margin"/>
                     </v:shape><![endif]--><![if !vml]><img width=627 height=312
                                                            src="' . $sugar_config['site_url'] . "/modules/images/" . $tour->picture . '"
                                                            alt=""
                                                            v:shapes="Picture_x0020_11"><![endif]><!--[if gte vml 1]></o:wrapblock>
                 <![endif]-->
             ';
     } else {
         $main_picture = '';
     }
     $template = str_replace('${PICTURE}', $main_picture, $template);
     // End issue 1438
     $template = str_replace('${TOUR_PROGRAM_LINES}', html_entity_decode_utf8($tour->get_data_to_expor2word()), $template);
     $size = strlen($template);
     $filename = "TOUR_PROGRAM_" . $tour->name . ".doc";
     ob_end_clean();
     header("Cache-Control: private");
     header("Content-Type: application/force-download;");
     header("Content-Disposition:attachment; filename=\"{$filename}\"");
     header("Content-length:{$size}");
     echo $template;
     ob_flush();
 }
function get_table_flash_bbcode_pkids($table_name, $id_field, $content_field, $uid_field, $bitfield_field)
{
	global $db;

	$ids = array();

	$sql = "SELECT $id_field, $content_field, $uid_field, $bitfield_field
		FROM $table_name
		WHERE $content_field LIKE '%[/flash:%'
			AND $bitfield_field <> ''";

	$result = $db->sql_query($sql);
	while ($row = $db->sql_fetchrow($result))
	{
		$uid = $row[$uid_field];

		// thanks support toolkit
		$content = html_entity_decode_utf8($row[$content_field]);
		set_var($content, $content, 'string', true);
		$content = utf8_normalize_nfc($content);

		$bitfield_data = $row[$bitfield_field];

		if (!is_valid_flash_bbcode($content, $uid) && has_flash_enabled($bitfield_data))
		{
			$ids[] = (int) $row[$id_field];
		}
	}
	$db->sql_freeresult($result);

	return $ids;
}
Ejemplo n.º 3
0
function WF_filter_math($text, $editor)
{
    global $TAGS;
    $output = '';
    $n0 = 0;
    // Search for '«math'. If it is not found, the
    // content is returned without any modification
    $n1 = strpos($text, $TAGS->in_mathopen);
    if ($n1 === FALSE) {
        return $text;
        // directly return the content
    }
    // filtering
    while ($n1 !== FALSE) {
        $output .= substr($text, $n0, $n1 - $n0);
        $n0 = $n1;
        $n1 = strpos($text, $TAGS->in_mathclose, $n0);
        if (!$n1) {
            break;
        }
        $n1 = $n1 + strlen($TAGS->in_mathclose);
        // Getting the substring «math ... «/math»
        $sub = substr($text, $n0, $n1 - $n0);
        // remove html entities (such as &quot;)
        //Solves BUG 25670 of php 4.3, solved at version 5
        if (version_compare(phpversion(), "5.0.0", ">=")) {
            $sub = html_entity_decode($sub, ENT_COMPAT, $TAGS->ucharset);
            // needs php 4.3 to work, php 5.0 if charset is utf (bug 25670)
        } else {
            if (strtolower($TAGS->ucharset) == "utf-8") {
                $sub = html_entity_decode_utf8($sub);
            } else {
                $sub = html_entity_decode($sub, ENT_COMPAT, $TAGS->ucharset);
            }
        }
        // replacing '«' by '<'
        $sub = str_replace($TAGS->in_open, $TAGS->out_open, $sub);
        // replacing '»' by '>'
        $sub = str_replace($TAGS->in_close, $TAGS->out_close, $sub);
        // replacing '§' by '&amp;'
        $sub = str_replace($TAGS->in_entity, $TAGS->out_entity, $sub);
        // generate the image code
        $sub = WF_math_image($sub, $editor);
        // appending the modified substring
        $output .= $sub;
        $n0 = $n1;
        // searching next '«math'
        $n1 = strpos($text, $TAGS->in_mathopen, $n0);
    }
    $output .= substr($text, $n0);
    return $output;
}
Ejemplo n.º 4
0
 function __construct()
 {
     parent::SugarView();
     global $current_user;
     if (!$current_user->isDeveloperForModule("Leads")) {
         die("Unauthorized Access to Administration");
     }
     $this->jsonHelper = getJSONobj();
     $this->parser = new ConvertLayoutMetadataParser("Contacts");
     if (isset($_REQUEST['updateConvertDef']) && $_REQUEST['updateConvertDef'] && !empty($_REQUEST['data'])) {
         $this->parser->updateConvertDef(object_to_array_recursive($this->jsonHelper->decode(html_entity_decode_utf8($_REQUEST['data']))));
         // clear the cache for this module only
         MetaDataManager::refreshModulesCache(array('Leads'));
     }
 }
Ejemplo n.º 5
0
 function preDisplay()
 {
     parent::preDisplay();
     $tour = new Tour();
     $html = file_get_contents("custom/modules/Tours/tpls/basic_pdf.tpl");
     $html = str_replace("{NAME}", $this->bean->name, $html);
     $desc = html_entity_decode_utf8($this->bean->description);
     $desc = $tour->removeHtmlTags($desc);
     $html = str_replace("{TOUR_NOTE}", $desc, $html);
     $picture = '<img width="627" height="312" src="modules/images/' . $this->bean->picture . '">';
     $html = str_replace("{PICTURE}", $picture, $html);
     $html = str_replace("{CODE}", $this->bean->tour_code, $html);
     $html = str_replace("{DURATION}", $this->bean->duration, $html);
     $html = str_replace("{TRANSPORT}", $this->bean->transport2, $html);
     $html = str_replace("{START_DATE}", $this->bean->start_date, $html);
     $program = html_entity_decode_utf8($tour->get_data_to_export2pdf($_GET['record']));
     $html = str_replace("{TOUR_PROGRAM_LINES}", $program, $html);
     // Xuat ra pdf
     $mpdf = new mPDF("vi");
     $mpdf->SetFooter('{PAGENO}');
     $mpdf->WriteHTML($html);
     $mpdf->Output("Tour.pdf", "D");
     exit;
 }
Ejemplo n.º 6
0
	function output() {
		global $user;

		$umode = strtoupper($this->mode);

		$items = '';
		foreach ($this->xml as $item)
		{
			$items .= "\t" . '<item>
		' . (isset($item['author']) ? '<author>' . $item['author'] . '</author>' : '') . '
		<title><![CDATA[' . html_entity_decode_utf8($item['title']) . ']]></title>
		<link>' . $item['link'] . '</link>
		<guid>' . $item['link'] . '</guid>
		<description><![CDATA[' . html_entity_decode_utf8($item['description']) . ']]></description>
		<pubDate>' . date('D, d M Y H:i:s \G\M\T', $item['pubdate']) . '</pubDate>
	</item>' . nr();
		}

		header('Content-type: text/xml');
		echo '<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
	<title>' . html_entity_decode_utf8(lang('rss_' . $umode)) . '</title>
	<link>http://www.rockrepublik.net/</link>
	<description><![CDATA[' . html_entity_decode_utf8(lang('rss_desc_' . $umode)) . ']]></description>
	<lastBuildDate>' . date('D, d M Y H:i:s \G\M\T', $this->xml[0]['pubdate']) . '</lastBuildDate>
	<webMaster>info@rockrepublik.net</webMaster>
' . $items . '</channel>
</rss>';

		sql_close();
		exit;
	}
Ejemplo n.º 7
0
    }
}
$FLIR['color'] = convert_color($FStyle['cColor']);
if ($FLIR['bkg_transparent']) {
    $FLIR['bkgcolor'] = array('red' => abs($FLIR['color']['red'] - 100), 'green' => abs($FLIR['color']['green'] - 100), 'blue' => abs($FLIR['color']['blue'] - 100));
} else {
    $FLIR['bkgcolor'] = convert_color($FStyle['cBackground'], false, 'FFFFFF');
}
$FLIR['opacity'] = is_number($FStyle['cOpacity'], true) ? $FStyle['cOpacity'] * 100 : 100;
if ($FLIR['opacity'] > 100 || $FLIR['opacity'] < 0) {
    $FLIR['opacity'] = 100;
}
$FLIR['text'] = $_GET['text'] != '' ? str_replace(array('{amp}nbsp;', '{amp}', '{plus}'), array(' ', '&', '+'), trim($_GET['text'], "\t\n\r")) : 'null';
$FLIR['cache'] = get_cache_fn(md5(($FLIR['mode'] == 'wrap' ? $FLIR['maxwidth'] : '') . $FLIR['font'] . (print_r($FStyle, true) . $FLIR['text'])), $FLIR['output']);
$FLIR['text_encoded'] = $FLIR['text'];
$FLIR['text'] = $FLIR['original_text'] = strip_tags(html_entity_decode_utf8($FLIR['text']));
$SPACE_BOUNDS = false;
if (is_number($FStyle['cSpacing'], true, false, true)) {
    $SPACE_BOUNDS = bounding_box(' ');
    $spaces = ceil($FStyle['cSpacing'] / $SPACE_BOUNDS['width']);
    if ($spaces > 0) {
        $FLIR['text'] = space_out($FLIR['text'], $spaces);
        define('SPACING_GAP', $spaces);
    }
    if ($FLIR['postscript']) {
        $FLIR['ps']['kerning'] = $FStyle['cSpacing'] / $FLIR['size'] * 1000;
    }
}
if ($FLIR['postscript'] && isset($FStyle['space_width'])) {
    $FLIR['ps']['space'] = $FStyle['space_width'] / $FLIR['size'] * 1000;
}
Ejemplo n.º 8
0
                        $numPending = (int) $numPending;
                        //    get latest post info
                        unset($thisThread);
                        $kunena_db->setQuery("SELECT m.thread, COUNT(*) AS totalmessages\n                                FROM #__fb_messages AS m\n                                LEFT JOIN #__fb_messages AS mm ON m.thread=mm.thread\n                                WHERE m.id='{$singlerow->id_last_msg}'\n                                GROUP BY m.thread");
                        $thisThread = $kunena_db->loadObject();
                        if (!is_object($thisThread)) {
                            $thisThread = new stdClass();
                            $thisThread->totalmessages = 0;
                            $thisThread->thread = 0;
                        }
                        $latestthreadpages = ceil($thisThread->totalmessages / $fbConfig->messages_per_page);
                        $latestthread = $thisThread->thread;
                        $latestname = $singlerow->mname;
                        $latestcatid = stripslashes($singlerow->catid);
                        $latestid = $singlerow->id_last_msg;
                        $latestsubject = html_entity_decode_utf8(stripslashes($singlerow->subject));
                        $latestuserid = $singlerow->userid;
                        ?>

                                <tr class = "<?php 
                        echo '' . $boardclass . '' . $tabclass[$k] . '';
                        ?>
" id="fb_cat<?php 
                        echo $singlerow->id;
                        ?>
">
                                    <td class = "td-1" align="center">
                                        <?php 
                        $tmpIcon = '';
                        $cxThereisNewInForum = 0;
                        if ($fbConfig->shownew && $kunena_my->id != 0) {
Ejemplo n.º 9
0
?>
:
                            <label for="exactname"><input type="checkbox" name="exactname" value="1" <?php 
if ($exactname) {
    echo $checked;
}
?>
 />
                            <?php 
echo _KUNENA_SEARCH_EXACT;
?>
</label>
                        </div>
                        <div id="userfield" style="line-height: 28px">
                            <input class="fbs input" type="text" name="searchuser" value="<?php 
echo html_entity_decode_utf8($searchuser);
?>
" style="width:250px"/>

                            <select class="fbs" name="starteronly">
                                <option value="0"<?php 
if ($starteronly == 0) {
    echo $selected;
}
?>
><?php 
echo _KUNENA_SEARCH_USER_POSTED;
?>
</option>
                                <!--<option value="1"<?php 
if ($starteronly == 1) {
Ejemplo n.º 10
0
 /**
  * Get the forum index
  * @since Version 3.2
  * @version 3.2
  * @return array
  * @todo Include newest post username, user id, post id, thread name, thread id
  */
 public function forums()
 {
     $query = "SELECT * FROM nuke_bbforums";
     if ($this->db instanceof \sql_db) {
         if ($rs = $this->db->query($query)) {
             while ($row = $rs->fetch_assoc()) {
                 $row['forum_name'] = html_entity_decode_utf8($row['forum_name']);
                 $this->forums[$row['forum_id']] = $row;
             }
             return $this->forums;
         } else {
             trigger_error("phpBB Index : Could not retrieve forums");
             return false;
         }
     } else {
         foreach ($this->db->fetchAll($query) as $row) {
             $row['forum_name'] = html_entity_decode_utf8($row['forum_name']);
             $this->forums[$row['forum_id']] = $row;
         }
         return $this->forums;
     }
 }
Ejemplo n.º 11
0
 /**
  * Format a title
  * @since Version 3.9.1
  * @param string $text
  * @return $text
  */
 public static function FormatTitle($text = NULL)
 {
     if (is_null($text)) {
         return $text;
     }
     $timer = Debug::getTimer();
     Debug::RecordInstance();
     $text = htmlentities($text, ENT_COMPAT, "UTF-8");
     $text = str_replace("&trade;&trade;", "&trade;", $text);
     if (function_exists("html_entity_decode_utf8")) {
         $text = html_entity_decode_utf8($text);
     }
     $text = stripslashes($text);
     if (substr($text, 0, 4) == "Re: ") {
         $text = substr($text, 4, strlen($text));
     }
     if (substr($text, -1) == ".") {
         $text = substr($text, 0, -1);
     }
     Debug::logEvent(__METHOD__, $timer);
     return $text;
 }
Ejemplo n.º 12
0
 /**
  * Load the forum
  * @since Version 3.9.1
  * @return \Railpage\Forums\Forum
  * @param int|string $id
  * @param boolean $getParent
  */
 public function load($id = false, $getParent = false)
 {
     if ($id === false) {
         throw new InvalidArgumentException("No valid forum ID or shortname was provided");
     }
     $this->url = new Url(sprintf("/f-f%d.htm", $id));
     if (filter_var($id, FILTER_VALIDATE_INT)) {
         #$query = "SELECT * FROM nuke_bbforums f LEFT JOIN (nuke_bbtopics t, nuke_bbposts p, nuke_bbposts_text pt) ON (f.forum_last_post_id = p.post_id AND p.topic_id = t.topic_id AND pt.post_id = p.post_id) WHERE f.forum_id = ? LIMIT 1";
         $query = "SELECT f.*, p.post_time, p.poster_id, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid,\r\n                            t.topic_id, t.topic_title, t.topic_time,\r\n                            f.forum_name, f.forum_desc\r\n                        FROM nuke_bbforums AS f\r\n                            LEFT JOIN nuke_bbposts AS p ON f.forum_last_post_id = p.post_id\r\n                            LEFT JOIN nuke_bbtopics AS t ON p.topic_id = t.topic_id\r\n                            LEFT JOIN nuke_bbposts_text AS pt ON pt.post_id = p.post_id\r\n                        WHERE f.forum_id = ?";
         $row = $this->db->fetchRow($query, $id);
     }
     if (isset($row) && is_array($row)) {
         $this->id = $row['forum_id'];
         $this->catid = $row["cat_id"];
         $this->name = function_exists("html_entity_decode_utf8") ? html_entity_decode_utf8($row["forum_name"]) : $row['forum_name'];
         $this->description = function_exists("html_entity_decode_utf8") ? html_entity_decode_utf8($row["forum_desc"]) : $row['forum_desc'];
         $this->status = $row["forum_status"];
         $this->order = $row["forum_order"];
         $this->posts = $row["forum_posts"];
         $this->topics = $row["forum_topics"];
         $this->last_post = $row["forum_last_post_id"];
         $this->last_post_id = $this->last_post;
         $this->last_post_time = $row['post_time'];
         $this->last_post_user_id = $row['poster_id'];
         $this->last_post_username = $row['post_username'];
         $this->last_post_subject = $row['post_subject'];
         $this->last_post_text = $row['post_text'];
         $this->last_post_bbcodeuid = $row['bbcode_uid'];
         $this->last_post_topic_id = $row['topic_id'];
         $this->last_post_topic_title = $row['topic_title'];
         $this->last_post_topic_time = $row['topic_time'];
         $this->acl_resource = sprintf("railpage.forums.forum:%d", $this->id);
         if ($getParent) {
             $this->category = ForumsFactory::CreateCategory($this->catid);
         }
         if (filter_var($row['forum_parent'], FILTER_VALIDATE_INT) && $row['forum_parent'] > 0) {
             $this->Parent = new Forum($row['forum_parent']);
         }
     }
 }
Ejemplo n.º 13
0
}
$xtpl->assign("VALUE", $focus->contract_value);
if (!empty($focus->currency)) {
    $xtpl->assign("CURRENCY", translate('currency_dom', '', $focus->currency));
} else {
    $xtpl->assign("CURRENCY", '');
}
if (!empty($focus->deparment)) {
    $xtpl->assign("DEPARMENT", translate('deparment_dom', '', $focus->deparment));
} else {
    $xtpl->assign("DEPARMENT", '');
}
if (!empty($focus->type)) {
    $xtpl->assign('TYPE', translate('tourprogram_type_dom', '', $focus->type));
} else {
    $xtpl->assign('TYPE', '');
}
$xtpl->assign("DESCRIPTION", nl2br(html_entity_decode_utf8($focus->description)));
$xtpl->assign("TOUR_PROGRAM_LINE_DETAIL", $focus->getDetailViewHTMLTourProgramDetail($focus->id));
// $xtpl->assign("TOUR_PROGRAM_LINE_DETAIL", '');
$xtpl->parse("main");
$xtpl->out("main");
require_once 'include/SubPanel/SubPanelTiles.php';
$subpanel = new SubPanelTiles($focus, 'Tours');
//    ob_end_clean();
echo $subpanel->display();
/* $str = "<script>
    YAHOO.util.Event.addListener(window, 'load', SUGAR.util.fillShortcuts, $savedSearchSelects);
    </script>";

    echo $str;*/
Ejemplo n.º 14
0
    $template = str_replace("{START_DATE}", $row['start_date'],$template); 
    $template = str_replace("{END_DATE}", $row['end_date'],$template); 
    $template = str_replace("{VALUE}", $row['contract_value'],$template);  
    $template = str_replace("{CURRENCY}",   translate('currency_dom','',$row['currency']),$template);  
    $template = str_replace("{DIVISION}",   translate('division_dom','',$row['division']),$template);  
    $template = str_replace("{ASSIGNED_TO}", $row['first_name'].' '.$row['last_name'],$template);  
    $template = str_replace("{OPERATOR}", $row['operator'],$template);  
    $template = str_replace("{DESCRIPTION}", html_entity_decode(nl2br( $row['description'])),$template);  
    $template = str_replace("{TOUR_PROGRAM_LINE_DETAIL}", $tour->get_data_to_expor2word($record),$template);*/
$template = str_replace('${CODE}', $tour->tour_code, $template);
$template = str_replace('${NAME}', $tour->name, $template);
$template = str_replace('${TRANSPORT}', $tour->transport2, $template);
$template = str_replace('${START_DATE}', $tour->start_date, $template);
$template = str_replace('${DURATION}', $tour->duration, $template);
$template = str_replace('${PICTURE}', $sugar_config['site_url'] . "/modules/images/" . $tour->picture, $template);
$template = str_replace('${TOUR_PROGRAM_LINES}', html_entity_decode_utf8($tour->get_data_to_expor2word()), $template);
$size = strlen($template);
/*$filename = "TOUR_PROGRAM_".$tour->name.".doc";
  ob_end_clean();
  header("Cache-Control: private");
  header("Content-Type: application/force-download;");
  header("Content-Disposition:attachment; filename=\"$filename\"");
  header("Content-length:$size");
  echo $template;
  ob_flush();*/
//added 09-06-2012
$filename = "TOUR_PROGRAM_" . $tour->name;
/*$mpdf=new mPDF(); 

    $mpdf->WriteHTML($template);
    $mpdf->Output($filename, "D");//D=Download; I-Internal - xem trực tiếp file*/
Ejemplo n.º 15
0
 function GenerateChiTietTruongTrinh()
 {
     global $sugar_config;
     $result = $this->get_tour_program_lines($this->id);
     $html = "";
     $i = 1;
     while ($row = $this->db->fetchByAssoc($result)) {
         $notes = $row['notes'] ? "(" . $row['notes'] . ")" : "";
         $html .= "<div>";
         $html .= "<strong style='text-decoration:underline'>Ngày {$i}: " . $row['name'] . "</strong>&nbsp;" . $notes . "<br/>";
         $html .= "<div style='min-height: 154px'>";
         $html .= html_entity_decode_utf8($row['description']);
         $html .= "<img width='196' style='float:right' src='" . $sugar_config['site_url'] . "/modules/images/" . $row['picture'] . "' alt='Image'/>";
         $html .= "</div>";
         $html .= "</div>";
         $i++;
     }
     //echo $html;
     return $html;
 }
Ejemplo n.º 16
0
 /**
  * Constructor
  * @since Version 3.0.1
  * @version 3.0.1
  * @param int $forumid
  * @param object $database
  */
 function __construct($forumid, $getParent = true)
 {
     parent::__construct();
     if (RP_DEBUG) {
         global $site_debug;
         $debug_timer_start = microtime(true);
     }
     $this->Module = new Module("forums");
     $this->url = new Url(sprintf("/f-f%d.htm", $forumid));
     if ($this->db instanceof \sql_db) {
         $query = "SELECT * FROM nuke_bbforums f LEFT JOIN (nuke_bbtopics t, nuke_bbposts p, nuke_bbposts_text pt) ON (f.forum_last_post_id = p.post_id AND p.topic_id = t.topic_id AND pt.post_id = p.post_id) WHERE f.forum_id = '" . $this->db->real_escape_string($forumid) . "' LIMIT 1";
         $result = $this->db->query($query);
         if ($result->num_rows == 1) {
             $row = $result->fetch_assoc();
             foreach ($row as $key => $val) {
                 //$row[$key] = iconv('windows-1256', 'UTF-8', $val);
             }
         }
         $result->close();
     } else {
         $query = "SELECT * FROM nuke_bbforums f LEFT JOIN (nuke_bbtopics t, nuke_bbposts p, nuke_bbposts_text pt) ON (f.forum_last_post_id = p.post_id AND p.topic_id = t.topic_id AND pt.post_id = p.post_id) WHERE f.forum_id = ? LIMIT 1";
         $row = $this->db->fetchRow($query, $forumid);
     }
     if (isset($row) && is_array($row)) {
         $this->id = $forumid;
         $this->catid = $row["cat_id"];
         $this->name = html_entity_decode_utf8($row["forum_name"]);
         $this->description = html_entity_decode_utf8($row["forum_desc"]);
         $this->status = $row["forum_status"];
         $this->order = $row["forum_order"];
         $this->posts = $row["forum_posts"];
         $this->topics = $row["forum_topics"];
         $this->last_post = $row["forum_last_post_id"];
         $this->last_post_id = $this->last_post;
         $this->last_post_time = $row['post_time'];
         $this->last_post_user_id = $row['poster_id'];
         $this->last_post_username = $row['post_username'];
         $this->last_post_subject = $row['post_subject'];
         $this->last_post_text = $row['post_text'];
         $this->last_post_bbcodeuid = $row['bbcode_uid'];
         $this->last_post_topic_id = $row['topic_id'];
         $this->last_post_topic_title = $row['topic_title'];
         $this->last_post_topic_time = $row['topic_time'];
         $this->acl_resource = sprintf("railpage.forums.forum:%d", $this->id);
         if ($getParent) {
             $this->category = new Category($this->catid);
         }
     }
     if (RP_DEBUG) {
         $site_debug[] = __CLASS__ . "::" . __METHOD__ . " completed in " . round(microtime(true) - $debug_timer_start, 5) . "s";
     }
 }
Ejemplo n.º 17
0
 /**
  * This method will return the given message into its state as it would have
  * been just *after* request_var.
  * It expects the parse_message object related to this post but the object
  * should only be filled, no changes should be made before this call
  * @param Object &$parser the parser object
  */
 function _clean_message(&$parser)
 {
     // Format the content as if it where *INSIDE* the posting field.
     $parser->decode_message($this->data['bbcode_uid']);
     $message =& $parser->message;
     // tmp copy
     if (defined('RUN_HTMLSPECIALCHARS_DECODE') && RUN_HTMLSPECIALCHARS_DECODE == true) {
         $message = htmlspecialchars_decode($message);
     }
     $message = html_entity_decode_utf8($message);
     // Now we'll *request_var* the post
     set_var($message, $message, 'string', true);
     $message = utf8_normalize_nfc($message);
     // Update the parser
     $parser->message =& $message;
     unset($message);
 }
Ejemplo n.º 18
0
 private function changeModuleDashletStrings($moduleName, $replacementLabels, $dashletsFiles)
 {
     $GLOBALS['log']->debug("Beginning to change module dashlet labels for: {$moduleName} ");
     $replacementStrings = array();
     foreach ($dashletsFiles as $dashletName => $dashletData) {
         if (isset($dashletData['module']) && $dashletData['module'] == $moduleName && file_exists($dashletData['meta'])) {
             require $dashletData['meta'];
             $dashletTitle = $dashletMeta[$dashletName]['title'];
             $currentModuleStrings = return_module_language($this->selectedLanguage, $moduleName);
             $modStringKey = array_search($dashletTitle, $currentModuleStrings);
             if ($modStringKey !== FALSE) {
                 $replacedString = str_replace(html_entity_decode_utf8($replacementLabels['prev_plural'], ENT_QUOTES), $replacementLabels['plural'], $dashletTitle);
                 if ($replacedString == $dashletTitle) {
                     $replacedString = str_replace(html_entity_decode_utf8($replacementLabels['prev_singular'], ENT_QUOTES), $replacementLabels['singular'], $replacedString);
                 }
                 $replacementStrings[$modStringKey] = $replacedString;
             }
         }
     }
     //Now we can write out the replaced language strings for each module
     if (count($replacementStrings) > 0) {
         $GLOBALS['log']->debug("Writing out labels for dashlet changes for module {$moduleName}, labels: " . var_export($replacementStrings, true));
         ParserLabel::addLabels($this->selectedLanguage, $replacementStrings, $moduleName);
     }
 }
Ejemplo n.º 19
0
	WHERE post_id = ' . $post_id;
$result = $db->sql_query($sql);
$f_id = (int) $db->sql_fetchfield('forum_id');
$db->sql_freeresult($result);
$sql = 'SELECT f.*, t.*, p.*, u.username, u.username_clean, u.user_sig, u.user_sig_bbcode_uid, u.user_sig_bbcode_bitfield
	FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f, ' . USERS_TABLE . " u\n\tWHERE p.post_id = {$post_id}\n\t\tAND t.topic_id = p.topic_id\n\t\tAND u.user_id = p.poster_id\n\t\tAND (f.forum_id = t.forum_id\n\t\t\tOR f.forum_id = {$f_id})";
$result = $db->sql_query($sql);
$post_data = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Load parser
$message_parser = new parse_message($post_data['post_text']);
unset($post_data['post_text']);
// Format the content as if it where *INSIDE* the posting field.
$message_parser->decode_message($post_data['bbcode_uid']);
$message =& $message_parser->message;
$message = html_entity_decode_utf8($message);
//var_dump($message);echo"\n\n\n\n";
// Here we "request_var" the post
set_var($message, $message, 'string', true);
$message = utf8_normalize_nfc($message);
//var_dump($message);echo"\n\n\n\n";
// Restore the var
$message_parser->message =& $message;
//var_dump($message_parser->message);echo"\n\n\n\n";
/*
*Now we can handle the post as in the submit action
*/
// Define flags
$post_flags = array('enable_bbcode' => $config['allow_bbcode'] ? $post_data['enable_bbcode'] : false, 'enable_magic_url' => $config['allow_post_links'] ? $post_data['enable_magic_url'] : false, 'enable_smilies' => $post_data['enable_smilies'], 'img_status' => $config['allow_bbcode'] ? true : false, 'flash_status' => $config['allow_bbcode'] && $config['allow_post_flash'] ? true : false, 'enable_urls' => $config['allow_post_links']);
// Parse the post
$message_parser->parse($post_flags['enable_bbcode'], $post_flags['enable_magic_url'], $post_flags['enable_smilies'], $post_flags['img_status'], $post_flags['flash_status'], true, $post_flags['enable_urls']);
Ejemplo n.º 20
0
        $status = get_select_options_with_id($app_list_strings['tour_status_dom'], $row['status']);
        /*$tour = array(
          "id" => $row['id'],
          "name" => $row['name'],
          "description" => $row['description'],
          "from_place" => $row['from_place'],
          "to_place" => $row['to_place'],
          "start_date" => $row[''],
          "end_date" => $row[''],
          "transport" => $transport,
          "transport_dom" => $transport_dom,
          "picture" => $row['picture']
          );*/
        foreach ($row as $key => $value) {
            if ($key == "description") {
                $tour[$key] = html_entity_decode_utf8($value);
            } else {
                $tour[$key] = $value;
            }
        }
        $tour['transport'] = $transport;
        $tour['transport_dom'] = $transport_dom;
        $tour['destination_dom'] = $destiantion_dom;
        $tour['currency'] = $currency;
        $tour['status'] = $status;
        $tours[$row['id']] = $tour;
    }
    $response = json_encode($tours);
} else {
    if (isset($_POST['tour_id']) && isset($_POST['department'])) {
        //tour id
Ejemplo n.º 21
0
 /**
  * Replace a label with a new value based on metadata which specifies the label as either singular or plural.
  *
  * @param  string $oldStringValue
  * @param  string $replacementLabels
  * @param  array $replacementMetaData
  * @return string
  */
 private function replaceSingleLabel($oldStringValue, $replacementLabels, $replacementMetaData, $modifier = '')
 {
     $replaceKey = 'prev_' . $replacementMetaData['type'];
     $search = html_entity_decode_utf8($replacementLabels[$replaceKey], ENT_QUOTES);
     $replace = $replacementLabels[$replacementMetaData['type']];
     if (!empty($modifier)) {
         $search = call_user_func($modifier, $search);
         $replace = call_user_func($modifier, $replace);
     }
     // Bug 47957
     // If nothing was replaced - try to replace original string
     $result = '';
     $replaceCount = 0;
     $result = str_replace($search, $replace, $oldStringValue, $replaceCount);
     if (!$replaceCount) {
         $replaceKey = 'key_' . $replacementMetaData['type'];
         $search = html_entity_decode_utf8($replacementLabels[$replaceKey], ENT_QUOTES);
         $result = str_replace($search, $replace, $oldStringValue, $replaceCount);
     }
     return $result;
 }
Ejemplo n.º 22
0
function utf8_urldecode($str)
{
    $str = preg_replace("/%u([0-9a-f]{3,4})/i", "&#x1;", urldecode($str));
    return html_entity_decode_utf8($str);
}
Ejemplo n.º 23
0
    function editUserProfile($user, $subslist, $selectRank, $selectPref, $selectMod, $selectOrder, $uid, $modCats)
    {
        $fbConfig =& CKunenaConfig::getInstance();
        $kunena_db =& JFactory::getDBO();
        //fill the variables needed later
        $signature = $user->signature;
        $username = $user->name;
        $avatar = $user->avatar;
        $ordering = $user->ordering;
        //that's what we got now; later the 'future_use' columns can be used..
        $csubslist = count($subslist);
        //        include_once ('components/com_kunena/bb_adm.js');
        ?>

        <form action = "index2.php?option=<?php 
        echo $option;
        ?>
" method = "POST" name = "adminForm">
            <table border = 0 cellspacing = 0 width = "100%" align = "center" class = "adminheading">
                <tr>
                    <th colspan = "3" class = "user">
<?php 
        echo _KUNENA_PROFFOR;
        ?>
 <?php 
        echo $username;
        ?>
                    </th>
                </tr>
            </table>

            <table border = 0 cellspacing = 0 width = "100%" align = "center" class = "adminlist">
                <tr>
                    <th colspan = "3" class = "title">
<?php 
        echo _KUNENA_GENPROF;
        ?>

                </tr>

                <tr>
                    <td width = "150" class = "contentpane"><?php 
        echo _KUNENA_PREFOR;
        ?>
                    </td>

                    <td align = "left" valign = "top" class = "contentpane">
<?php 
        echo $selectOrder;
        ?>
                    </td>

                    <td>&nbsp;

                    </td>
                </tr>

                         <tr>
                    <td width = "150" class = "contentpane"><?php 
        echo _KUNENA_RANKS;
        ?>
                    </td>

                    <td align = "left" valign = "top" class = "contentpane">
<?php 
        echo $selectRank;
        ?>
                    </td>

                    <td>&nbsp;

                    </td>
                </tr>



                            <td width = "150" valign = "top" class = "contentpane">
<?php 
        echo _GEN_SIGNATURE;
        ?>
:
<?php 
        /*
        // FIXME: bbcode broken
        
                <br/> <?php echo $fbConfig->maxsig; ?>
        
                <input readonly type = text name = rem size = 3 maxlength = 3 value = "" class = "inputbox"> <?php echo _CHARS; ?><br/>
        <?php echo _HTML_YES; ?>
        */
        ?>
                            </td>

                            <td align = "left" valign = "top" class = "contentpane">
                                <textarea rows = "6"
                                    class = "inputbox"
                                    onMouseOver = "textCounter(this.form.message,this.form.rem,<?php 
        echo $fbConfig->maxsig;
        ?>
);"
                                    onClick = "textCounter(this.form.message,this.form.rem,<?php 
        echo $fbConfig->maxsig;
        ?>
);"
                                    onKeyDown = "textCounter(this.form.message,this.form.rem,<?php 
        echo $fbConfig->maxsig;
        ?>
);"
                                    onKeyUp = "textCounter(this.form.message,this.form.rem,<?php 
        echo $fbConfig->maxsig;
        ?>
);" cols = "50" type = "text" name = "message"><?php 
        echo html_entity_decode_utf8(stripslashes($signature));
        ?>
</textarea>

<?php 
        /*
        // FIXME: bbcode broken
                                        <br/>
        
                                        <input type = "button" class = "button" accesskey = "b" name = "addbbcode0" value = " B " style = "font-weight:bold; width: 30px" onClick = "bbstyle(0)" onMouseOver = "helpline('b')"/>
        
                                        <input type = "button" class = "button" accesskey = "i" name = "addbbcode2" value = " i " style = "font-style:italic; width: 30px" onClick = "bbstyle(2)" onMouseOver = "helpline('i')"/>
        
                                        <input type = "button" class = "button" accesskey = "u" name = "addbbcode4" value = " u " style = "text-decoration: underline; width: 30px" onClick = "bbstyle(4)" onMouseOver = "helpline('u')"/>
        
                                        <input type = "button" class = "button" accesskey = "p" name = "addbbcode14" value = "Img" style = "width: 40px" onClick = "bbstyle(14)" onMouseOver = "helpline('p')"/>
        
                                        <input type = "button" class = "button" accesskey = "w" name = "addbbcode16" value = "URL" style = "text-decoration: underline; width: 40px" onClick = "bbstyle(16)" onMouseOver = "helpline('w')"/>
        
                                        <br/><?php echo _KUNENA_COLOR; ?>:
        
                <select name = "addbbcode20" onChange = "bbfontstyle('[color=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onMouseOver = "helpline('s')">
                    <option style = "color:black;  background-color: #FAFAFA" value = ""><?php echo _COLOUR_DEFAULT; ?></option>
        
                    <option style = "color:red;    background-color: #FAFAFA" value = "#FF0000"><?php echo _COLOUR_RED; ?></option>
        
                    <option style = "color:blue;   background-color: #FAFAFA" value = "#0000FF"><?php echo _COLOUR_BLUE; ?></option>
        
                    <option style = "color:green;  background-color: #FAFAFA" value = "#008000"><?php echo _COLOUR_GREEN; ?></option>
        
                    <option style = "color:yellow; background-color: #FAFAFA" value = "#FFFF00"><?php echo _COLOUR_YELLOW; ?></option>
        
                    <option style = "color:orange; background-color: #FAFAFA" value = "#FF6600"><?php echo _COLOUR_ORANGE; ?></option>
                </select>
        <?php echo _SMILE_SIZE; ?>:
        
                <select name = "addbbcode22" onChange = "bbfontstyle('[size=' + this.form.addbbcode22.options[this.form.addbbcode22.selectedIndex].value + ']', '[/size]')" onMouseOver = "helpline('f')">
                    <option value = "1"><?php echo _SIZE_VSMALL; ?></option>
        
        
                    <option value = "2"><?php echo _SIZE_SMALL; ?></option>
        
                    <option value = "3" selected><?php echo _SIZE_NORMAL; ?></option>
        
                    <option value = "4"><?php echo _SIZE_BIG; ?></option>
        
                    <option value = "5"><?php echo _SIZE_VBIG; ?></option>
                </select>
        
                <a href = "javascript: bbstyle(-1)"onMouseOver = "helpline('a')"><small><?php echo _BBCODE_CLOSA; ?></small></a>
        
                <br/>
        
                <input type = "text" name = "helpbox" size = "45" maxlength = "100" style = "width:400px; font-size:8px" class = "options" value = "<?php echo _BBCODE_HINT;?>"/>
        */
        ?>
                            </td>

                            <?php 
        if ($fbConfig->allowavatar) {
            ?>

                                <td class = "contentpane" align = "center">
<?php 
            echo _KUNENA_UAVATAR;
            ?>
<br/>

<?php 
            if ($avatar != '') {
                echo '<img src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/' . $avatar . '" ><br />';
                echo '<input type="hidden" value="' . $avatar . '" name="avatar">';
            } else {
                echo "<em>" . _KUNENA_NS . "</em><br />";
                echo '<input type="hidden" value="$avatar" name="avatar">';
            }
            ?>
                                </td>

                            <?php 
        } else {
            echo "<td>&nbsp;</td>";
            echo '<input type="hidden" value="" name="avatar">';
        }
        ?>
                        </tr>

                        <tr>
                            <td colspan = "2" class = "contentpane">
                                <input type = "checkbox" value = "1" name = "deleteSig"><i><?php 
        echo _KUNENA_DELSIG;
        ?>
</i>
                            </td>

                            <?php 
        if ($fbConfig->allowavatar) {
            ?>

                                <td class = "contentpane">
                                    <input type = "checkbox" value = "1" name = "deleteAvatar"><i><?php 
            echo _KUNENA_DELAV;
            ?>
</i>
                                </td>

                            <?php 
        } else {
            echo "<td>&nbsp;</td>";
        }
        ?>
                        </tr>

                        <tr cellspacing = "3" colspan = "2">
                            &nbsp;

                            </td>
                        </tr>
            </table>

        <table border = 0 cellspacing = 0 width = "100%" align = "center" class = "adminform">
            <tr>
                <th colspan = "2" class = "title">
<?php 
        echo _KUNENA_MOD_NEW;
        ?>

            </td>
            </tr>
                        </tr>

                        <tr>


    <td width = "150" class = "contentpane">
    <?php 
        echo _KUNENA_ISMOD;
        ?>

                    <?php 
        //admins are always moderators
        if (CKunenaTools::isModOrAdmin($uid)) {
            echo _KUNENA_ISADM;
            ?>
 <input type = "hidden" name = "moderator" value = "1">
                    <?php 
        } else {
            echo $selectMod;
        }
        ?>
                        </td>
                        <td>
<?php 
        echo $modCats;
        ?>
                        </td>
                        </tr>

            </table>
            <input type = "hidden" name = "uid" value = "<?php 
        echo $uid;
        ?>
">

            <input type = "hidden" name = "task" value = ""/>

            <input type = "hidden" name = "option" value = "com_kunena"/>
        </form>

        <table border = 0 cellspacing = 0 width = "100%" align = "center" class = "adminform">
            <tr>
                <th colspan = "2" class = "title">
<?php 
        echo _KUNENA_SUBFOR;
        ?>
 <?php 
        echo $username;
        ?>

            </td>
            </tr>

            <?php 
        $enum = 1;
        //reset value
        $k = 0;
        //value for alternating rows
        if ($csubslist > 0) {
            foreach ($subslist as $subs) {
                //get all message details for each subscription
                $kunena_db->setQuery("select * from #__fb_messages where id={$subs->thread}");
                $subdet = $kunena_db->loadObjectList();
                check_dberror("Unable to load subscription messages.");
                foreach ($subdet as $sub) {
                    $k = 1 - $k;
                    echo "<tr class=\"row{$k}\">";
                    echo "  <td>{$enum}: " . html_entity_decode_utf8(stripslashes($sub->subject)) . " by " . html_entity_decode_utf8(stripslashes($sub->name));
                    echo "  <td>&nbsp;</td>";
                    echo "</tr>";
                    $enum++;
                }
            }
        } else {
            echo "<tr><td class=\"message\">" . _KUNENA_NOSUBS . "</td></tr>";
        }
        echo "</table>";
    }
Ejemplo n.º 24
0
 function display()
 {
     $focus = new Tour();
     $quotes = new Quotes();
     global $sugar_config, $mod_strings, $timedate;
     $ss = new Sugar_Smarty();
     $db = DBManagerFactory::getInstance();
     // ONLY LOAD A RECORD IF A RECORD ID IS GIVEN;
     // A RECORD ID IS NOT GIVEN WHEN VIEWING IN LAYOUT EDITOR
     $record = isset($_GET["record"]) ? htmlspecialchars($_GET["record"]) : '';
     $department = isset($_GET["department"]) ? htmlspecialchars($_GET["department"]) : '';
     $template = file_get_contents('modules/Quotes/tpls/export.tpl');
     $quotes->retrieve($record);
     $focus->retrieve($quotes->quotes_toufa8brstours_idb);
     $content = $quotes->cost_detail;
     $content = base64_decode($content);
     $content = json_decode($content);
     $template = str_replace('{SITE_URL}', $sugar_config['site_url'], $template);
     if (!empty($focus->picture)) {
         $img = "<br/><img src='" . $sugar_config['site_url'] . "/modules/images/" . $focus->picture . "' width='600'/><br/><br/>";
     } else {
         $img = "";
     }
     $html = '';
     if ($quotes->department == 'dos') {
         $html .= '<table cellpadding="0" cellspacing="0" border="0" class="content1" align="center">';
         $html .= '<tr><td>&nbsp;&nbsp; </td> </tr>';
         $html .= '<tr><td align="center"><i>' . $mod_strings['LBL_MOD_STRING_DOS_HEAD'] . '</i></td> </tr>';
         $html .= '<tr><td align="center" style="font-size: 24px; color: blue">' . $focus->name . '</td></tr>';
         $html .= '<tr><td align="justify">' . $focus->description . ' </tr>';
         $html .= '<tr>';
         $html .= '<tr><td class="tabDetailViewDL" align="center">' . $img . '</td></tr>';
         $html .= '</tr>';
         $html .= '</table>';
         if (!empty($focus->start_date)) {
             $start_date = $timedate->to_display($focus->start_date, $timedate->get_date_format($current_user), 'd/m/Y');
             //                                    $start_date = date('d/m/Y',strtotime());
         } else {
             $start_date = '';
         }
         $html .= '<table align="center">';
         $html .= '<tr>';
         $html .= '<td class="tabDetailViewDL" align="left"><p>Thời gian : ' . $focus->duration . ' <br/> Mã tour: ' . $focus->tour_code . ' <br/> Phương tiện : ' . $focus->transport2 . ' <br/> Khởi hành : ' . $start_date . '<br/></p></td>';
         $html .= '</tr>';
         $html .= '</table><br/>';
         $template = str_replace('{HEAD}', $html, $template);
         $html = '';
         $cost_detail = $content->dos_cost_detail;
         if (count($cost_detail) > 0) {
             $html .= '<div id="dos" align="center"><table width="100%" class="table_clone" border="1" cellpadding="0" cellspacing="0" style="border-collapse:collapse">';
             $html .= '<thead>';
             $html .= '<tr height="15">';
             $html .= '<td class="tdborder" rowspan="2" style="text-align:center">' . $mod_strings['LBL_DOS_TICKET_VN'] . '</td>';
             $html .= '<td class="tdborder" colspan="2" style="text-align:center">' . $mod_strings['LBL_DOS_TOUR_COST_VN'] . '</td>';
             $html .= '<td class="tdborder" colspan="2" style="text-align:center">' . $mod_strings['LBL_DOS_SURCHANGE_VN'] . '</td>';
             $html .= '</tr>';
             $html .= '<tr height="15">';
             $html .= '<td class="tdborder" style="text-align:center">' . $mod_strings['LBL_DOS_FARE_VN'] . '</td>';
             $html .= '<td class="tdborder" style="text-align:center">' . $mod_strings['LBL_DOS_FACILITY_COST_VN'] . '</td>';
             $html .= '<td class="tdborder" style="text-align:center">' . $mod_strings['LBL_DOS_SINGLE_ROM_VN'] . '</td>';
             $html .= '<td class="tdborder" style="text-align:center">' . $mod_strings['LBL_DOS_FOREIGN_VN'] . '</td>';
             $html .= '</tr>';
             $html .= '</thead>';
             $html .= '<tbody>';
             if (count($cost_detail) > 0) {
                 foreach ($cost_detail as $val) {
                     $html .= '<tr height="15">';
                     $html .= '<td class="tdborder" align="center">' . translate('quotes_dos_hotel_standard', '', $val->dos_hotel_standard) . '</td>';
                     $html .= '<td class="tdborder" align="center">' . number_format($val->ticket_cost, 0, '', '.') . '</td>';
                     $html .= '<td class="tdborder" align="center">' . number_format($val->facility_cost, 0, '', '.') . '</td>';
                     $html .= '<td class="tdborder" align="center">' . number_format($val->single_room, 0, '', '.') . '</td>';
                     $html .= '<td class="tdborder" align="center">' . number_format($val->foreign, 0, '', '.') . '</td>';
                     $html .= '</tr>';
                 }
             }
             $html .= '</tbody>';
             $html .= '</table> </div> ';
             $template = str_replace('{COST_DETAIL}', $html, $template);
         }
         $html = '';
         $html .= '<h3 align="center">GIÁ TOUR TRỌN GÓI CHO CÁC DỊCH VỤ:</h3>';
         $html .= '<table cellpadding="0" cellspacing="0" border="0" width="100%">';
         $html .= '<tr>';
         $html .= '<td align="justify"><h2><u><b>I. GIÁ TRÊN BAO GỒM:</b></u></h2></td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td align="justify"><u><b>Vận chuyển:</b></u><br/>' . html_entity_decode(nl2br($quotes->transport)) . '</td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td align="justify"><u><b>Khách sạn:</b></u><br/>' . html_entity_decode(nl2br($quotes->hotel)) . '</td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td align="justify"><u><b>Hướng dẫn viên</b></u>: <br/> ' . html_entity_decode(nl2br($quotes->guide)) . '</td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td align="justify"><u><b>Tham quan</b></u><br/>' . html_entity_decode(nl2br($quotes->room)) . '</td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td align="justify"><u><b>Ăn uống</b></u>: ' . html_entity_decode(nl2br($quotes->food)) . '</td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td align="justify"><u><b>Bảo hiểm</b></u>: <br/>' . html_entity_decode(nl2br($quotes->insurance)) . '</td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td align="justify"><u><b>Khăn, nón, nước và quà tặng</b></u>: <br/>' . html_entity_decode(nl2br($quotes->other)) . '</td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<tr>';
         $html .= '<td>&nbsp;</td>';
         $html .= '</tr>';
         $html .= '<td align="justify"><h2><u><b>II. GIÁ TRÊN KHÔNG BAO GỒM :</b></u></h2></td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td align="justify">' . html_entity_decode(nl2br($quotes->not_content)) . '</td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td align="justify"><h2><u><b>III.GIÁ TOUR DÀNH CHO TRẺ EM</b></u> :</h2></td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td align="justify">' . html_entity_decode(nl2br($quotes->child_cost)) . '</td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td align="center"><h2>THÔNG TIN HƯỚNG DẪN</h2></td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td align="justify">' . html_entity_decode(nl2br($quotes->surcharge)) . '</td>';
         $html .= '</tr>';
         $html .= '</table>';
         $html .= '<p align="center"> <br/> <b>CARNIVAL TOURS HÂN HẠNH PHỤC VỤ QUÝ KHÁCH</b> </p>';
         $template = str_replace('{DETAIL}', $html, $template);
     } elseif ($quotes->department == 'ib') {
         $html .= '<p align="center" style="font-size: 24px;">&nbsp;</p>';
         $html .= '<p align="center" style="font-size: 24px; color: blue">' . $focus->name . '</p>';
         $html .= '<table>';
         $html .= '<tr><td class="tabDetailViewDL" align="center">' . $img . '</td></tr>';
         $html .= '</table>';
         $html .= '<table align="center" cellpadding="0" cellspacing="0">';
         $html .= '<tr> <td>Duration : </td> <td>' . $focus->duration . '</td></tr>';
         $html .= '<tr> <td>Code tour : </td> <td>' . $focus->tour_code . '</td></tr>';
         if (!empty($focus->start_date)) {
             $start_date = $timedate->to_display($focus->start_date, $timedate->get_date_format($current_user), 'd/m/Y');
             //                                    $start_date = date('d/m/Y',strtotime());
         } else {
             $start_date = '';
         }
         $html .= '<tr> <td>Start : </td> <td>' . $start_date . '</td></tr>';
         $html .= '<tr> <td>Transport : </td> <td>' . $focus->transport2 . '</td></tr>';
         //                $html .= '<tr> <td>Depart from : </td> <td>'.$focus->.'</td></tr>';
         $html .= '</table><br />';
         $template = str_replace("{HEAD}", $html, $template);
         $html = '';
         $cost_detail_head = $content->cost_detail_head;
         $ib_cose_detai = $content->ib_cose_detai;
         $html .= '<div id="inbound">';
         $html .= '<table width="100%" border="1" class="table_clone" cellspacing="0" cellpadding="2" style="border-collapse:collapse">';
         $html .= '<thead>';
         $html .= '<tr height="15">';
         $html .= '<td colspan="7" style="text-align:center" class="tdborder"><strong>' . $mod_strings['LBL_IB_TABLE_TITLE'] . '</strong></td>';
         $html .= '</tr>';
         $html .= '<tr height="15">';
         $html .= '<td class="tdborder"><strong>' . $mod_strings['LBL_IB_GROUP_SIZE'] . '</strong></td>';
         $html .= '<td class="tdborder">' . $cost_detail_head->group_site1 . '</td>';
         $html .= '<td class="tdborder">' . $cost_detail_head->group_site2 . '</td>';
         $html .= '<td class="tdborder">' . $cost_detail_head->group_site3 . '</td>';
         $html .= '<td class="tdborder">' . $cost_detail_head->group_site4 . '</td>';
         $html .= '<td class="tdborder">' . $cost_detail_head->group_site5 . '</td>';
         $html .= '<td class="tdborder">' . $cost_detail_head->group_site6 . '</td>';
         $html .= '</tr>';
         $html .= '</thead>';
         $html .= '<tbody>';
         if (count($ib_cose_detai) > 0) {
             foreach ($ib_cose_detai as $val) {
                 $html .= '<tr height="15">';
                 $html .= '<td class="tdborder">' . translate('quotes_ib_hotel_standard', '', $val->ib_hotel_standard) . '</td>';
                 $html .= '<td class="tdborder">' . $val->group_site1_cost . '</td>';
                 $html .= '<td class="tdborder">' . $val->group_site2_cost . '</td>';
                 $html .= '<td class="tdborder">' . $val->group_site3_cost . '</td>';
                 $html .= '<td class="tdborder">' . $val->group_site4_cost . '</td>';
                 $html .= '<td class="tdborder">' . $val->group_site5_cost . '</td>';
                 $html .= '<td class="tdborder">' . $val->group_site6_cost . '</td>';
                 $html .= '</tr>';
             }
         }
         $html .= '</tbody>';
         $html .= '</table>';
         $html .= '</div>';
         $template = str_replace('{COST_DETAIL}', $html, $template);
         $html = '';
         $html .= '<table width="100%" border="1" cellspacing="0" cellpadding="0" style="border-collapse:collapse">';
         $html .= '<tr bgcolor="#CCCCCC">';
         $html .= '<td align="center">' . $mod_strings['LBL_IB_INCLUDE'] . '</td>';
         $html .= '<td align="center">' . $mod_strings['LBL_IB_EXCLUDE'] . '</td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td align="justify">' . html_entity_decode_utf8(nl2br($quotes->ib_include)) . '</td>';
         $html .= '<td align="justify">' . html_entity_decode_utf8(nl2br($quotes->not_content)) . '</td>';
         $html .= '</tr>';
         $html .= '<tr bgcolor="#CCCCCC">';
         $html .= '<td colspan="2" align="center">' . $mod_strings['LBL_IB_EXPORT_HOTEL'] . '</td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td colspan="2" align="justify">' . html_entity_decode_utf8(nl2br($quotes->hotel)) . '</td>';
         $html .= '</tr>';
         $html .= '<tr bgcolor="#CCCCCC" align="justify">';
         $html .= '<td colspan="2" align="center">' . $mod_strings['LBL_IB_EXPORT_SURCHARGE'] . '</td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td colspan="2" align="justify">' . html_entity_decode_utf8(nl2br($quotes->surcharge)) . '</td>';
         $html .= '</tr>';
         $html .= '<tr bgcolor="#CCCCCC">';
         $html .= '<td colspan="2" align="center">' . $mod_strings['LBL_IB_EXPORT_CHILD_POLICY'] . '</td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td colspan="2" align="justify">' . html_entity_decode_utf8(nl2br($quotes->child_cost)) . '</td>';
         $html .= '</tr>';
         $html .= '</table>';
         $html .= '<p> &nbsp;</p>';
         $html .= '<p align="center">CARNIVAL TOURS – WITH YOU ALL THE WAY!</p>';
         $template = str_replace('{DETAIL}', $html, $template);
     } elseif ($quotes->department == 'ob') {
         $html .= '<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse">';
         $html .= '<tr><td><br /><br /><br /></td> </tr>';
         $html .= '<tr>';
         $html .= '<td align="center">Chương trình du lịch</td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td align="center"><p align="center" style="font-size: 24px; color: blue">' . $focus->name . '</p></td>';
         $html .= '</tr>';
         $html .= '<tr><td class="tabDetailViewDL" align="center">' . $img . '</td></tr>';
         $html .= '<tr>';
         $html .= '<td>';
         $html .= '<table align="center" border="1" cellspacing="0" cellpadding="0" style="border-collapse:collapse">';
         $html .= '<tr>';
         $html .= '<td align="left">Thời gian : ' . $focus->duration . '</td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td align="left">Tour Code : ' . $focus->tour_code . '</td>';
         $html .= '</tr>';
         $html .= '<tr>';
         if (!empty($focus->start_date)) {
             $start_date = $timedate->to_display($focus->start_date, $timedate->get_date_format($current_user), 'd/m/Y');
             //                                    $start_date = date('d/m/Y',strtotime());
         } else {
             $start_date = '';
         }
         $html .= '<td align="left">Khởi hành : ' . $start_date . '</td>';
         $html .= '</tr>';
         $html .= '</table>';
         $html .= '</td>';
         $html .= '</tr>';
         $html .= '</table><br/>';
         $html .= '<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse">';
         $html .= '<tr>';
         $html .= '<td> Lịch bay tham khảo </td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td> <br/>' . html_entity_decode_utf8(nl2br($quotes->flight_schedules)) . '</td>';
         $html .= '</tr>';
         $html .= '</table>';
         $template = str_replace("{HEAD}", $html, $template);
         $html = '';
         $ob_cost_detail = $content->ob_cost_detail;
         $html .= '<table width="100%" border="0" class="table_clone" cellspacing="0" cellpadding="2" style="border-collapse:collapse">';
         $html .= '<tr>';
         $html .= '<td align="center"><b>Giá: ' . $ob_cost_detail->price . ' ' . translate('currency_dom', '', $ob_cost_detail->currency) . ' + ' . $ob_cost_detail->tax . ' ' . translate('currency_dom', '', $ob_cost_detail->currency) . '(Thuế) = ' . $ob_cost_detail->total_price . ' ' . translate('currency_dom', '', $ob_cost_detail->currency) . ' </b></td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td align="center"><b>' . html_entity_decode_utf8(nl2br($ob_cost_detail->price_note)) . '</b></td>';
         $html .= '</tr>';
         $html .= '</table>';
         $template = str_replace('{COST_DETAIL}', $html, $template);
         $html = '';
         $html .= '<table cellspacing="0" cellpadding="0" border="0" style="border-collaspe:collapse" width="100%">';
         $html .= '<tr>';
         $html .= '<td> <u><b>' . $mod_strings['LBL_OB_INCLUDE_EXPORT'] . '</b></u><br/>' . html_entity_decode_utf8(nl2br($quotes->ib_include)) . '</td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td><br/> <u><b>' . $mod_strings['LBL_OB_EXCLUDE_EXPORT'] . '</b></u><br/>' . html_entity_decode_utf8(nl2br($quotes->not_content)) . '</td>';
         $html .= '</tr>';
         $html .= '<tr>';
         $html .= '<td><br/> <u><b>' . $mod_strings['LBL_OB_NOTE_EXPORT'] . '</b></u><br/>' . html_entity_decode_utf8(nl2br($quotes->ob_notes)) . '</td>';
         $html .= '</tr>';
         $html .= '</table>';
         $html .= '<p align="center"><font size="14pt">Carnival Tours Kính Chúc Quý Khách Một Chuyến Du Lịch Vui Vẻ. </p></p>';
         $template = str_replace('{DETAIL}', $html, $template);
     }
     $template = str_replace("{TOUR_PROGRAM_LINE_DETAIL}", html_entity_decode_utf8($focus->get_data_to_expor2word($focus->id)), $template);
     $size = strlen($template);
     $filename = $quotes->name . ".doc";
     ob_end_clean();
     header("Cache-Control: private");
     header("Content-Type: application/force-download;");
     header("Content-Disposition:attachment; filename=\"{$filename}\"");
     header("Content-length:{$size}");
     echo $template;
     ob_flush();
 }
Ejemplo n.º 25
0
 /**
  * Replace a label with a new value based on metadata which specifies the label as either singular or plural.
  *
  * @param  string $oldStringValue
  * @param  string $replacementLabels
  * @param  array $replacementMetaData
  * @return string
  */
 private function replaceSingleLabel($oldStringValue, $replacementLabels, $replacementMetaData, $modifier = '')
 {
     $replaceKey = 'prev_' . $replacementMetaData['type'];
     $search = html_entity_decode_utf8($replacementLabels[$replaceKey], ENT_QUOTES);
     $replace = $replacementLabels[$replacementMetaData['type']];
     if (!empty($modifier)) {
         $search = call_user_func($modifier, $search);
         $replace = call_user_func($modifier, $replace);
     }
     return str_replace($search, $replace, $oldStringValue);
 }
Ejemplo n.º 26
0
         $fr_title_name = $fr_name;
         $jr_path_menu[] = $fr_name;
     } else {
         $jr_path_menu[] = $sname;
     }
     // next looping
     $catids = $parent_ids;
 }
 //reverse the array
 $jr_path_menu = array_reverse($jr_path_menu);
 //attach topic name
 $jr_topic_title = '';
 if ($sfunc == "view" and $id) {
     $sql = "SELECT subject, id FROM #__fb_messages WHERE id='{$id}'";
     $kunena_db->setQuery($sql);
     $jr_topic_title = stripslashes(html_entity_decode_utf8($kunena_db->loadResult()));
     $jr_path_menu[] = $jr_topic_title;
 }
 // print the list
 if (count($jr_path_menu) == 0) {
     $jr_path_menu[] = '';
 }
 $jr_forum_count = count($jr_path_menu);
 $fireinfo = '';
 if (!empty($forumLocked)) {
     $fireinfo = isset($fbIcons['forumlocked']) ? ' <img src="' . KUNENA_URLICONSPATH . $fbIcons['forumlocked'] . '" border="0" alt="' . _GEN_LOCKED_FORUM . '" title="' . _GEN_LOCKED_FORUM . '"/>' : ' <img src="' . KUNENA_URLEMOTIONSPATH . 'lock.gif"  border="0"  alt="' . _GEN_LOCKED_FORUM . '" title="' . _GEN_LOCKED_FORUM . '">';
     $lockedForum = 1;
 }
 if (!empty($forumReviewed)) {
     $fireinfo = isset($fbIcons['forummoderated']) ? ' <img src="' . KUNENA_URLICONSPATH . $fbIcons['forummoderated'] . '" border="0" alt="' . _GEN_MODERATED . '" title="' . _GEN_MODERATED . '"/>' : ' <img src="' . KUNENA_URLEMOTIONSPATH . 'review.gif" border="0"  alt="' . _GEN_MODERATED . '" title="' . _GEN_MODERATED . '">';
     $moderatedForum = 1;
Ejemplo n.º 27
0
 static function addLabels($language, $labels, $moduleName, $basepath = null, $forRelationshipLabel = false)
 {
     $GLOBALS['log']->debug("ParserLabel->addLabels({$language}, \$labels, {$moduleName}, {$basepath} );");
     $GLOBALS['log']->debug("\$labels:" . print_r($labels, true));
     $deployedModule = false;
     if (is_null($basepath)) {
         $deployedModule = true;
         $basepath = "custom/modules/{$moduleName}/language";
         if ($forRelationshipLabel) {
             $basepath = "custom/modules/{$moduleName}/Ext/Language";
         }
         if (!is_dir($basepath)) {
             mkdir_recursive($basepath);
         }
     }
     $filename = "{$basepath}/{$language}.lang.php";
     if ($forRelationshipLabel) {
         $filename = "{$basepath}/{$language}.lang.ext.php";
     }
     $dir_exists = is_dir($basepath);
     $mod_strings = array();
     if ($dir_exists) {
         if (file_exists($filename)) {
             // obtain $mod_strings
             include $filename;
         } else {
             if ($forRelationshipLabel) {
                 $fh = fopen($filename, 'a');
                 fclose($fh);
             }
         }
     } else {
         return false;
     }
     $changed = false;
     //$charset = (isset($app_strings['LBL_CHARSET'])) ? $app_strings['LBL_CHARSET'] : $GLOBALS['sugar_config']['default_charset'] ;
     foreach ($labels as $key => $value) {
         if (!isset($mod_strings[$key]) || strcmp($value, $mod_strings[$key]) != 0) {
             $mod_strings[$key] = html_entity_decode_utf8($value, ENT_QUOTES);
             // must match encoding used in view.labels.php
             $changed = true;
         }
     }
     if ($changed) {
         $GLOBALS['log']->debug("ParserLabel->addLabels: writing new mod_strings to {$filename}");
         $GLOBALS['log']->debug("ParserLabel->addLabels: mod_strings=" . print_r($mod_strings, true));
         if (!write_array_to_file("mod_strings", $mod_strings, $filename)) {
             $GLOBALS['log']->fatal("Could not write {$filename}");
         } else {
             // if we have a cache to worry about, then clear it now
             if ($deployedModule) {
                 $GLOBALS['log']->debug("PaserLabel->addLabels: clearing language cache");
                 $cache_key = "module_language." . $language . $moduleName;
                 sugar_cache_clear($cache_key);
                 LanguageManager::clearLanguageCache($moduleName, $language);
             }
         }
     }
     return true;
 }
Ejemplo n.º 28
0
function handle_video($action, $attributes, $content, $params, $node_object)
{
    global $vbulletin, $fr_platform, $db, $nuke_quotes;
    if ($action == 'validate') {
        return true;
    }
    if (!isset($attributes['default'])) {
        $comment = 'Video Link: ' . $content;
        $url = $content;
    } else {
        if (substr($attributes['default'], 0, 6) == '&quot;') {
            $attributes['default'] = substr($attributes['default'], 6);
        }
        if (substr($attributes['default'], -6) == '&quot;') {
            $attributes['default'] = substr($attributes['default'], 0, -6);
        }
        // Format is type;code
        $split = preg_split('/;/', html_entity_decode_utf8($attributes['default'], true));
        if (count($split) == 2) {
            switch (strtolower($split[0])) {
                case 'youtube':
                    $type = 'YouTube';
                    $url = 'http://www.youtube.com/watch?v=' . $split[1];
                    break;
                case 'hulu':
                    $type = 'Hulu';
                    $url = $content;
                    break;
                case 'facebook':
                    $type = 'Facebook';
                    $url = 'http://www.facebook.com/v/' . $split[1];
                    break;
                default:
                    $type = 'Video';
                    $url = $content;
                    break;
            }
            $comment = $type . ' Link: ' . $content;
        } else {
            // Unknown?  Just treat as a full URL.
            $comment = 'Video Link: ' . $attributes['default'];
            $url = $attributes['default'];
        }
    }
    if ($nuke_quotes) {
        if ($comment) {
            return '[URL="' . $url . '"]' . $comment . '[/URL]';
        } else {
            return '[URL]' . $url . '[/URL]';
        }
    }
    return '<a href="' . $url . '">' . $comment . '</a>';
}
Ejemplo n.º 29
0
function getAssignField($aow_field, $view, $value)
{
    global $app_list_strings;
    $value = json_decode(html_entity_decode_utf8($value), true);
    $roles = get_bean_select_array(true, 'ACLRole', 'name', '', 'name', true);
    if (!file_exists('modules/SecurityGroups/SecurityGroup.php')) {
        unset($app_list_strings['aow_assign_options']['security_group']);
    } else {
        $securityGroups = get_bean_select_array(true, 'SecurityGroup', 'name', '', 'name', true);
    }
    $field = '';
    if ($view == 'EditView') {
        $field .= "<select type='text' name='{$aow_field}" . '[0]' . "' id='{$aow_field}" . '[0]' . "' onchange='assign_field_change(\"{$aow_field}\")' title='' tabindex='116'>" . get_select_options_with_id($app_list_strings['aow_assign_options'], $value[0]) . "</select>&nbsp;&nbsp;";
        if (!file_exists('modules/SecurityGroups/SecurityGroup.php')) {
            $field .= "<input type='hidden' name='{$aow_field}" . '[1]' . "' id='{$aow_field}" . '[1]' . "' value=''  />";
        } else {
            $display = 'none';
            if ($value[0] == 'security_group') {
                $display = '';
            }
            $field .= "<select type='text' style='display:{$display}' name='{$aow_field}" . '[1]' . "' id='{$aow_field}" . '[1]' . "' title='' tabindex='116'>" . get_select_options_with_id($securityGroups, $value[1]) . "</select>&nbsp;&nbsp;";
        }
        $display = 'none';
        if ($value[0] == 'role' || $value[0] == 'security_group') {
            $display = '';
        }
        $field .= "<select type='text' style='display:{$display}' name='{$aow_field}" . '[2]' . "' id='{$aow_field}" . '[2]' . "' title='' tabindex='116'>" . get_select_options_with_id($roles, $value[2]) . "</select>&nbsp;&nbsp;";
    } else {
        $field = $app_list_strings['aow_assign_options'][$value[1]];
    }
    return $field;
}
Ejemplo n.º 30
0
 static function addLabels($currLanguage, $labels, $moduleName, $basepath = null)
 {
     $GLOBALS['log']->debug("ParserLabel->addLabels({$currLanguage}, \$labels, {$moduleName}, {$basepath} );");
     $GLOBALS['log']->debug("\$labels:" . print_r($labels, true));
     $languages = get_languages();
     foreach ($languages as $language => $langlabel) {
         $currentLabels = self::getCustomLabels($language, $moduleName, $basepath);
         if ($currentLabels === false) {
             return false;
         }
         //Unable to create a custom folder.
         $mod_strings = $currentLabels['labels'];
         $changed = false;
         foreach ($labels as $key => $value) {
             if (!isset($mod_strings[$key]) || strcmp($value, $mod_strings[$key]) != 0 && $language == $currLanguage) {
                 $mod_strings[$key] = html_entity_decode_utf8($value, ENT_QUOTES);
                 // must match encoding used in view.labels.php
                 $changed = true;
             }
         }
         if ($changed) {
             $GLOBALS['log']->debug("ParserLabel->addLabels: writing new mod_strings to {$currentLabels['file']}");
             $GLOBALS['log']->debug("ParserLabel->addLabels: mod_strings=" . print_r($mod_strings, true));
             if (!write_array_to_file("mod_strings", $mod_strings, $currentLabels["file"])) {
                 $GLOBALS['log']->fatal("Could not write {$currentLabels['file']}");
             } else {
                 // if we have a cache to worry about, then clear it now
                 if ($currentLabels['deployed']) {
                     $GLOBALS['log']->debug("PaserLabel->addLabels: clearing language cache");
                     $cache_key = "module_language." . $language . $moduleName;
                     sugar_cache_clear($cache_key);
                     LanguageManager::clearLanguageCache($moduleName, $language);
                 }
             }
         }
     }
     return true;
 }