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 = "

Apology Letter

An apology letter shows that you are sorry and says that you value your relationship with the other party. The sooner an apology letter is written and sent out the better it is for the relationship. Depending on the nature of the letter, it can either be written in the friendly or the business letter format.

Friendly/Personal Apology Letter
If this is a personal letter you should start the letter by saying that you are sorry to the recipient. Next you should admit your fault and take responsibility for your actions. Next you should volunteer or ask if there is any way that you can help out to resolve the situation. Then you should let the recipient that you will try to make sure that the situation will not happen again. To close off the letter you should apologize again. When writing a personal apology letter it should come from the heart and be sincere.

Formal/Business Apology Letter
If this is a business letter you should start the letter by saying that you are sorry to the recipient. Next you should give an explanation as to what went wrong. Then you should try to rectify the problem. To close off the letter you should apologize again. "; $title = "Apology Letter"; $desc = "Apology letters are often written in friendly or business letter formats, making it informal or formal. The letter should contain state what you are trying to do to rectify the problem."; $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 ############## */ ?>