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 display() { global $db; $focus = new Tour(); $focus->retrieve($_GET['record']); if (isset($_POST['department']) && isset($_POST['department']) != '') { $data = $focus->loadAreaByDepartment($_POST['department']); if (count($data) > 0) { $area_options .= '<option value ="">none</option>'; foreach ($data as $row) { $selected = ''; if ($focus->area == $row['id']) { $selected = 'selected="selected"'; } $area_options .= "<option data-code='" . $row['code'] . "' data-country='" . $row['country_id'] . "' value='" . $row['id'] . "' " . $selected . ">" . $row['name'] . '-' . $row['country'] . "</option>"; } echo $area_options; } } }
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> </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> </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;"> </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> </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(); }
$module_type = $_REQUEST['module']; $module = new ContractLiquidate(); $module_type_file = strtoupper(ltrim(rtrim($module_type, 's'), '')); $module_type_low = strtolower($module_type); $module->retrieve($_REQUEST['contractid']); //Lay thong tin cua hop dong goc $contract = new Contract(); $contract->retrieve($module->contract_id); //End //Lay thong tin cua made tour $madetour = new GroupProgram(); $madetour->retrieve($contract->groupprogr4251rograms_ida); //End //Lay thong tin cua tour $tour = new Tour(); $tour->retrieve($madetour->tour_id); //End $task = $_REQUEST['task']; $doc = new clsMsDocGenerator(); $contractliquidatevalue = array(); $sql = "SELECT * FROM contractliquidatevalues WHERE contract_liquidate_id ='" . $module->id . "'and deleted = 0"; $res = $module->db->query($sql); while ($row = $module->db->fetchByAssoc($res)) { $contractliquidatevalue[$row['id']] = $row['contract_liquidate_id']; } $contractliquidateincre = array(); $sql1 = "SELECT * FROM contractliquidateincre WHERE contract_liquidate_id ='" . $module->id . "' AND deleted = 0"; $res1 = $module->db->query($sql1); while ($row1 = $module->db->fetchByAssoc($res1)) { $contractliquidateincre[$row1['id']] = $row1['contract_liquidate_id']; }
"note" => $row['note'], "picture" => $row['picture'] ); $programs[$row['id']]=$program; }*/ $response = json_encode($lines); } else { if ($action == "sync") { if (isset($_POST['tour_id_sync'])) { $synced = array(); $id = $_POST['tour_id_sync']; if (!empty($id)) { $ids = explode("|", $id); foreach ($ids as $i) { $tour = new Tour(); $tour->retrieve($i); if ($synced[$i] = $tour->sync()) { $tour->synced = true; $tour->save(); } } $response = json_encode($synced); } else { return false; } } } else { if ($action == "get_tour_num") { $response = Tour::get_tour_num(); } else { if ($action == "get_destination_by_area") {
<?php if (!defined('sugarEntry') || !sugarEntry) { die('Not A Valid Entry Point'); } require_once 'modules/Tours/Tour.php'; require_once 'include/formbase.php'; require_once 'modules/TourPrograms/TourProgram.php'; include "config.php"; global $sugar_config; $focus = new Tour(); /*$isUpdate = true;*/ $focus->retrieve($_POST['record']); if (!$focus->ACLAccess('Save')) { ACLController::displayNoAccess(true); sugar_cleanup(true); } if (!empty($_POST['assigned_user_id']) && $focus->assigned_user_id != $_POST['assigned_user_id'] && $_POST['assigned_user_id'] != $current_user->id) { $check_notify = TRUE; } else { $check_notify = FALSE; } foreach ($focus->column_fields as $field) { if (isset($_POST[$field])) { $value = $_POST[$field]; switch ($field) { case 'transport': $value = implode("^,^", $_POST[$field]); break; case 'noiden': $value = implode('^,^', $_POST[$field]);
<?php require_once 'modules/Tours/Tour.php'; require_once 'modules/Tours/Forms.php'; require_once "custom/include/MPDF54/mpdf.php"; $tour = new Tour(); global $sugar_config, $db; // $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); //$sql = "select * from tours where id ='".$record."' and deleted = 0"; /*$sql = " SELECT t.id,t.name,t.tour_code,t.picture, t.duration,t.transport2, t.operator,t.description, t.deleted,t.tour_code,t.from_place,t.to_place, t.start_date,t.end_date,t.division,contract_value,currency_id, currency,u.first_name,u.last_name FROM tours t INNER JOIN users u ON t.assigned_user_id = u.id WHERE t.id = '".$record."' AND t.deleted = 0 AND u.deleted = 0 "; $result = $db->query($sql); $row = $db->fetchByAssoc($result); $template = str_replace("{ID}",$row['id'],$template); if(!empty($row['name'])){ $template = str_replace("{NAME}",$row['name'],$template );
require_once 'modules/Tours/Tour.php'; require_once 'modules/Tours/Forms.php'; require_once 'data/Tracker.php'; require_once 'modules/Releases/Release.php'; global $db; global $app_strings; global $mod_strings; global $mod_strings; global $current_user; global $sugar_version, $sugar_config; $focus = new Tour(); $seedRelease = new Release(); $json = getJSONobj(); $ss = new Sugar_Smarty(); if (isset($_REQUEST['record'])) { $focus->retrieve($_REQUEST['record']); } if (isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') { $focus->id = ""; $focus->number = ""; } // BUILD MODULE TITLE LINE echo "\n<p>\n"; echo get_module_title($mod_strings['LBL_MODULE_ID'], $mod_strings['LBL_MODULE_NAME'] . ": " . $focus->name, true); echo "\n</p>\n"; global $theme; $theme_path = "themes/" . $theme . "/"; $image_path = $theme_path . "images/"; require_once $theme_path . 'layout_utils.php'; $GLOBALS['log']->info("Tour edit view"); require_once 'include/QuickSearchDefaults.php';