isMobile() ? 'mobile' : 'desktop'); setcookie("device", $layout, time() + 604800, "/"); // if layout mobile - workout mobile layout if($layout=='mobile'){$device = MobileLayout($detect->isMobile());} }else{ $isMobile = ($_COOKIE['device']=='mobile' ? true : false); if($isMobile==true){$device = MobileLayout($isMobile);} } $content = "

Business Letter

Purpose of a Business Letter
A business letter has many different uses and is a formal way of communicating between two or more parties. Business letters can be informational, persuasive, motivational, or promotional. Business letters should be typed and printed out on standard 8.5\" x 11\" white paper.

Elements of a Good Letter
The most important element of writing a good letter is your ability to identify and write to your audience. If you are addressing your letter to the department of human resources, avoid using highly technical terms that only engineers would understand, even if your letter is addressed to an engineering company, chances are that the personnel in human resources does not have an engineering background.

The next element is that you make sure your present your objective in a clear and concise manner. Don't be vague about your objective, most people will not have the patience to sit there and guess at the meaning of your letter or the time to read a long-winded letter, just get to the point without going into unnecessary details.

Another important element to remember is to remain professional. Even if you are writing a complaint letter, remain polite and courteous, simply state the problem(s) along with any other relevant information and be sure to avoid threats and slander. "; $title = "Business Letter"; $desc = "Business letters can be used for different uses. They are commonly used for informational, persuasive, motivational and promotional uses. With lengths that can vary depending on the objective of the letter."; $tplbody= file_get_contents($index_tpl); $header= file_get_contents($header_tpl); $footer= file_get_contents($footer_tpl); $guide= file_get_contents("../guide_writing.html"); $tplbody = str_replace("{header}", $header, $tplbody); $tplbody = str_replace("{footer}", $footer, $tplbody); $tplbody = str_replace("{ft_year}", date('Y'), $tplbody); $tplbody = str_replace("{guide_writing}", $guide, $tplbody); $tplbody = str_replace("{content}", $content, $tplbody); $tplbody = str_replace("{title}", $title, $tplbody); $tplbody = str_replace("{desc}", $desc, $tplbody); echo $tplbody; /* ########### MOBILE FUNCTIONS --- START ############ */ /* *************************************************** */ // function to manage the template layouts for either desktop or mobile function MobileLayout($isMobile, $test = ""){ // assign global variables, retrieve detection class global $index_tpl;global $header_tpl;global $footer_tpl;global $mob_index_tpl;global $mob_header_tpl;global $mob_footer_tpl;global $device_switch;global $request_uri; $request_uri = ($request_uri ? $request_uri : $_SERVER['REQUEST_URI']); $layouts_arr=array('desktop', 'mobile'); // determining layout if(isset($_GET['layout'])){$layout = $_GET['layout'];}else{if(empty($_COOKIE['layout'])){$layout=($isMobile ? 'mobile' : 'desktop');}else{$layout=$_COOKIE['layout'];$dont_set_cookie = true;}} // if fails choose desktop as default if (!in_array($layout, $layouts_arr)){$layout='desktop';} // setting layout COOKIE if needed if($dont_set_cookie!=true){setcookie("layout", $layout, time() + 604800, "/");} // determine which layout depending on COOKIE $cssSelected="font-weight:bold;text-decoration:none!important;"; if($layout=='mobile' || $test=="test"){$index_tpl=$mob_index_tpl;$header_tpl=$mob_header_tpl;$footer_tpl=$mob_footer_tpl;$mobClass=$cssSelected;$deskClass='';}else{$mobClass='';$deskClass=$cssSelected;} // show device switch if mobile only if($isMobile){$qs = $request_uri;$device_switch = '
mobile site | desktop site
';} return array("type"=>$layout,"mobile"=>$isMobile); } // function to add query string or replace value if exists function addQueryString($url, $key, $value) {$urlarray = explode('?',$url);$query = '';if(isset($urlarray[1])) {$query = $urlarray[1];}parse_str($query,$queryarray);$queryarray[$key]=$value;$queryarray = http_build_query($queryarray);return $urlarray[0].'?'.$queryarray;} /* *************************************************** */ /* ########### MOBILE FUNCTIONS --- END ############## */ ?>