/** * Get chart changer * @param $tabid * @param $chart_type * @param $year * @param $page **/ function get_chart_changer($tabid, $chart_type, $year, $page = 'statistics') { $output = '<form action="' . APPHP_BASE . 'index.php?admin=' . $page . '" name="frmStatistics" method="post"> ' . draw_hidden_field('tabid', $tabid, false) . ' ' . draw_token_field(false) . ' <table width="98%" align="center" style="background-color:#efefef;border:1px solid #ddd;"> <tr> <td valign="middle"> ' . _TYPE . ': <select name="chart_type"> <option value="barchart" ' . ($chart_type == 'barchart' ? ' selected="selected"' : '') . '>Barchart</option> <option value="columnchart" ' . ($chart_type == 'columnchart' ? ' selected="selected"' : '') . '>ColumnChart</option> <option value="piechart" ' . ($chart_type == 'piechart' ? ' selected="selected"' : '') . '>PieChart</option> <option value="areachart" ' . ($chart_type == 'areachart' ? ' selected="selected"' : '') . '>AreaChart</option> </select> ' . _YEAR . ': <select name="year">'; for ($y = date('Y') - 5; $y < date('Y') + 5; $y++) { $output .= '<option value="' . $y . '" ' . ($year == $y ? ' selected="selected"' : '') . '>' . $y . '</option>'; } $output .= '</select> '; $output .= '</td> <td valign="middle" align="' . Application::Get('defined_right') . '"> <input type="button" class="form_button" onclick="frmStatistics_Submit();" value="' . _SUBMIT . '" /> </td> </tr> </table> </form>'; return $output; }
/** * Draws inquiry direct form * @param $params * @param $draw */ public static function DrawInquiryDirectForm($params, $draw = true) { $listing_id = isset($params['listing_id']) ? $params['listing_id'] : ''; $business_name = isset($params['business_name']) ? $params['business_name'] : ''; $output = ''; //print_r($_POST); $output .= '<form id="frmInquiryForm" action="index.php?page=inquiry_form" method="post">'; $output .= draw_token_field(false); $output .= draw_hidden_field('act', 'send', false, 'id_act'); $output .= draw_hidden_field('business_name', $business_name, false); $output .= draw_hidden_field('listing_id', $listing_id, false); $output .= draw_hidden_field('inquiry_type', '1', false); $output .= '<div class="inquiry_wrapper">'; $output .= '<h3>' . $business_name . '</h3>'; $output .= self::DrawInquirySubForm($params, false); $output .= '</div>'; $output .= '</form>'; if ($draw) { echo $output; } else { return $output; } }
/** * Draws comment submission form * @param $article_id * @param $image_verification * @param $focus_field * @param $task_completed * @param $draw */ private function DrawCommentsForm($article_id = '', $image_verification = 'no', $focus_field = '', $task_completed = false, $draw = true) { if (!$article_id) { return ''; } global $objLogin; $user_id = ''; $user_name = ''; $user_name = isset($_POST['comment_user_name']) && !$task_completed ? decode_text(prepare_input($_POST['comment_user_name'])) : ''; $user_email = isset($_POST['comment_user_email']) && !$task_completed ? decode_text(prepare_input($_POST['comment_user_email'])) : ''; $comment_text = isset($_POST['comment_text']) && !$task_completed ? prepare_input($_POST['comment_text']) : ''; $comment_length = ModulesSettings::Get('comments', 'comment_length'); if ($objLogin->IsLoggedInAs($this->user_type_name)) { $user_id = $objLogin->GetLoggedID(); $user_name = $objLogin->GetLoggedName(); } $output = ' <div class="comments_form_container"> <form class="comments-form" method="post" name="frmComments" id="frmComments"> ' . draw_hidden_field('task', 'publish_comment', false, 'comment_task') . ' ' . draw_hidden_field('comment_id', '', false, 'comment_id') . ' ' . draw_hidden_field('article_id', $article_id, false) . ' ' . draw_hidden_field('user_id', $user_id, false) . ' ' . draw_token_field(false) . ' <table border="0" width="98%"> <tr><td colspan="3" nowrap height="7px"></td></tr> <tr> <td colspan="3"> <b>' . _LEAVE_YOUR_COMMENT . '</b> </td> </tr> <tr> <td>'; if ($user_id == '') { $output .= _YOUR_NAME . ': <input type="text" name="comment_user_name" id="comment_user_name" style="width:140px" value="' . $user_name . '" maxlength="50" autocomplete="off" /> '; $output .= '<nobr>' . _YOUR_EMAIL . ': <input type="text" name="comment_user_email" id="comment_user_email" style="width:140px" value="' . $user_email . '" maxlength="70" autocomplete="off" /></nobr><br /><br />'; } else { $output .= draw_hidden_field('comment_user_name', $user_name, false); $output .= draw_hidden_field('comment_user_email', $user_email, false); } $output .= _COMMENT_TEXT . ':<br /> <textarea id="comment_text" name="comment_text" maxlength="' . $comment_length . '" style="width:96%" rows="5">' . stripcslashes($comment_text) . '</textarea><br /> ' . _CAN_USE_TAGS_MSG . ' <b>, <i>, <u>, <br> <br /><br />'; //'._IMAGE_VERIFICATION.':<br /> $output .= '</td> <td> </td> <td valign="top" width="180px" align="center">'; if ($image_verification == 'yes') { $output .= '<table border="0" cellspacing="0" cellpadding="0"> <tr> <td> <img style="padding:0px;margin:0px;" id="captcha_image" src="modules/captcha/securimage_show.php?sid=' . md5(uniqid(time())) . '" /> </td> <td> <img style="cursor:pointer;padding:0px;margin:0px;" id="captcha_image_reload" src="modules/captcha/images/refresh.gif" style="cursor:pointer;" onclick="document.getElementById(\'captcha_image\').src = \'modules/captcha/securimage_show.php?sid=\' + Math.random(); appSetFocus(\'frmComments_captcha_code\'); return false" title="' . _REFRESH . '" alt="' . _REFRESH . '" /><br /> <a href="modules/captcha/securimage_play.php"><img border="0" style="padding:0px; margin:0px;" id="captcha_image_play" src="modules/captcha/images/audio_icon.gif" title="' . _PLAY . '" alt="' . _PLAY . '" /></a> </td> </tr> <tr><td colspan="2" nowrap="nowrap" height="20px"></td></tr> <tr> <td colspan="2" align="center"> ' . _TYPE_CHARS . ' </td> </tr> <tr><td colspan="2" nowrap="nowrap" height="10px"></td></tr> <tr> <td colspan="2"> <input type="text" name="captcha_code" id="frmComments_captcha_code" style="width:175px" value="" maxlength="20" autocomplete="off" /> </td> </tr> </table>'; } $output .= '</td> </tr> </table> <input type="submit" ' . ($objLogin->IsLoggedInAsAdmin() ? 'disabled' : '') . ' class="form_button" name="btnSubmitPC" id="btnSubmitPC" value="' . _PUBLISH_YOUR_COMMENT . '"> </form> </div>'; if ($focus_field != '') { $output .= '<script type="text/javascript">appSetFocus("' . $focus_field . '");</script>'; } if ($draw) { echo $output; } else { return $output; } }
/** * Draws listings in category * @param $category_id * @param $draw */ public function DrawListings($category_id, $draw = true) { global $objLogin, $objSettings; $lang = Application::Get('lang'); $nl = "\n"; if (empty($lang)) { $lang = Languages::GetDefaultLang(); } $listings_locations = isset($_REQUEST['listings_locations']) ? prepare_input($_REQUEST['listings_locations']) : ''; $listings_sub_locations = isset($_REQUEST['listings_sub_locations']) ? prepare_input($_REQUEST['listings_sub_locations']) : ''; $listings_sort_by = isset($_REQUEST['listings_sort_by']) && $_REQUEST['listings_sort_by'] != '' ? prepare_input($_REQUEST['listings_sort_by']) : 'rating'; $listings_order_by = isset($_REQUEST['listings_order_by']) && $_REQUEST['listings_order_by'] != '' ? prepare_input($_REQUEST['listings_order_by']) : 'ASC'; $sort_by = ''; $order_by = ''; $output = ''; if ($listings_sort_by == 'name') { $sort_by = 'ld.business_name'; $order_by = $listings_order_by; } else { if ($listings_sort_by == 'date') { $sort_by = 'l.date_published'; $order_by = $listings_order_by; } else { if ($listings_sort_by == 'rating') { // rating according to advertising plans high rate = high advertising plan $sort_by = 'l.advertise_plan_id'; $order_by = ($listings_order_by == 'ASC' ? 'DESC' : 'ASC') . ', RAND()'; } else { $sort_by = 'l.priority_order'; $order_by = $listings_order_by; } } } if (!Application::Get('js_included', 'lytebox')) { $output .= '<!-- LyteBox v3.22 Author: Markus F. Hay Website: http://www.dolem.com/lytebox -->' . $nl; $output .= '<link rel="stylesheet" href="modules/lytebox/css/lytebox.css" type="text/css" media="screen" />' . $nl; $output .= '<script type="text/javascript" src="modules/lytebox/js/lytebox.js"></script>' . $nl; } // draw category description $category_info = Categories::GetCategoryInfo($category_id); if ($category_info['description'] != '') { $output .= draw_message($category_info['description'], false); } // draw result $sql_from = TABLE_LISTINGS . ' l INNER JOIN ' . TABLE_LISTINGS_DESCRIPTION . ' ld ON l.id = ld.listing_id INNER JOIN ' . TABLE_LISTINGS_LOCATIONS . ' ll ON l.listing_location_id = ll.id WHERE ' . (!empty($listings_locations) ? 'l.listing_location_id = \'' . $listings_locations . '\' AND ' : '') . ' ' . (!empty($listings_sub_locations) ? 'l.listing_sub_location_id = \'' . $listings_sub_locations . '\' AND ' : '') . ' ' . (!$objLogin->IsLoggedIn() ? 'l.access_level=\'public\' AND ' : '') . ' l.is_published = 1 AND ' . ($this->show_expired_listings != 'yes' ? ' ((l.finish_publishing = \'0000-00-00 00:00:00\') OR (l.finish_publishing > \'' . date('Y-m-d H:i:s') . '\')) AND ' : '') . ' ld.language_id = \'' . $lang . '\' ' . ($category_id != '' ? ' AND l.id IN (SELECT listing_id FROM ' . TABLE_LISTINGS_CATEGORIES . ' lc WHERE category_id = ' . (int) $category_id . ')' : '') . ' ORDER BY ' . $sort_by . ' ' . $order_by; // pagination prepare $page_size = ModulesSettings::Get('listings', 'listings_per_page'); $start_row = '0'; $total_pages = '1'; pagination_prepare($page_size, $sql_from, $start_row, $total_pages); $sql = 'SELECT l.id, l.image_file, l.image_file_thumb, l.priority_order, l.date_published, l.website_url, l.business_email, l.advertise_plan_id, ll.name as listing_location_name, ld.language_id, ld.business_name, ld.business_address, ld.business_description FROM ' . $sql_from . ' LIMIT ' . $start_row . ', ' . $page_size; $result = database_query($sql, DATA_AND_ROWS, ALL_ROWS); if ($result[1] > 0 || !empty($listings_locations)) { $output .= '<form id="frmCategoryView" action="index.php?page=category&cid=' . $category_id . '" method="post">'; $output .= draw_token_field(false); $output .= draw_hidden_field('p', '1', false); $output .= '<table width="98%" border="0" align="center">'; $output .= '<tr><th colspan="3" nowrap="nowrap" height="5px"></th></tr>'; $output .= '<tr><th colspan="2" align="' . Application::Get('defined_left') . '" valign="middle">'; $output .= ' ' . _FILTER_BY . ': '; $output .= ListingsLocations::DrawAllLocations(array('tag_name' => 'listings_locations', 'selected_value' => $listings_locations, 'javascript_event' => 'onchange="jQuery(\'#frmCategoryView\').submit();"'), false) . ' '; $output .= ListingsSubLocations::DrawAllSubLocations($listings_locations, array('tag_name' => 'listings_sub_locations', 'selected_value' => $listings_sub_locations, 'javascript_event' => 'onchange="jQuery(\'#frmCategoryView\').submit();"'), false); $output .= '</th>'; $output .= '<th colspan="2" align="' . Application::Get('defined_right') . '" valign="middle">'; $output .= _SORT_BY . ': <select name="listings_sort_by" onchange="jQuery(\'#frmCategoryView\').submit();"> <option value="rating" ' . ($listings_sort_by == 'rating' ? ' selected="selected"' : '') . '>' . _RATING . '</option> <option value="name" ' . ($listings_sort_by == 'name' ? ' selected="selected"' : '') . '>' . _NAME . '</option> <option value="date" ' . ($listings_sort_by == 'date' ? ' selected="selected"' : '') . '>' . _DATE_PUBLISHED . '</option> </select> <select name="listings_order_by" onchange="jQuery(\'#frmCategoryView\').submit();"> <option value="ASC" ' . ($listings_order_by == 'ASC' ? ' selected="selected"' : '') . '>' . _ASCENDING . '</option> <option value="DESC" ' . ($listings_order_by == 'DESC' ? ' selected="selected"' : '') . '>' . _DESCENDING . '</option> </select> </th> </tr> </table> </form>'; } if ($result[1] > 0) { $output .= '<table width="99%" border="0" align="center">'; $output .= '<tr><th colspan="2" nowrap="nowrap" height="5px"></th></tr> <tr> <th align="' . Application::Get('defined_left') . '"> ' . _LISTINGS . ' </th> <th align="center">' . _IMAGE . '</th> </tr>'; for ($i = 0; $i < $result[1]; $i++) { $image_file = $result[0][$i]['image_file'] != '' ? $result[0][$i]['image_file'] : 'no_image.png'; ///$result[0][$i]['advertise_plan_id'] > 1 && $image_file_thumb = $result[0][$i]['image_file_thumb'] != '' ? $result[0][$i]['image_file_thumb'] : 'no_image.png'; $output .= '<tr><td colspan="2" style="padding:7px;">' . draw_line('no_margin_line', IMAGE_DIRECTORY, false) . '</td></tr> <tr valign="top"> <td>'; $link_1 = prepare_link('listing', 'lid', $result[0][$i]['id'], '', $result[0][$i]['business_name'], '', _CLICK_TO_SEE_DESCR); $link_2 = prepare_link('listing', 'lid', $result[0][$i]['id'], '', _MORE_INFO, '', _CLICK_TO_SEE_DESCR); $output .= '<div class="listing_info">'; $output .= '<div class="header">' . $link_1 . '</div>'; $output .= '<div class="address">' . substr_by_word(strip_tags($result[0][$i]['business_address']), 300, true, Application::Get('lang')) . ' ' . $result[0][$i]['listing_location_name'] . '</div>'; $output .= '<div class="description">' . substr_by_word(strip_tags($result[0][$i]['business_description']), 180, true, Application::Get('lang')) . '</div>'; $output .= '<div class="links"> ' . $link_2 . ' ' . ($result[0][$i]['website_url'] != '' ? ' : <a href="' . $result[0][$i]['website_url'] . '" target="_new">' . _WEBSITE_URL . '</a>' : '') . ' ' . ($result[0][$i]['business_email'] != '' ? ' : <a href="mailto:' . $result[0][$i]['business_email'] . '">' . _EMAIL . '</a>' : '') . ' ' . ($result[0][$i]['date_published'] != '0000-00-00 00:00:00' ? '<div class="published">' . _PUBLISHED . ': ' . format_datetime($result[0][$i]['date_published'], get_datetime_format(false), _UNKNOWN) . '<div>' : '') . ' </div>'; $output .= '</div>'; $output .= ' </td> <td width="130px" align="center"> <div class="listing_icon">'; if ($image_file != 'no_image.png') { $output .= '<a href="images/listings/' . $image_file . '" rel="lyteshow_' . $result[0][$i]['id'] . '">'; } $output .= '<img class="listings_image' . ($image_file == 'no_image.png' ? ' no_hover' : '') . '" src="images/listings/' . $image_file_thumb . '" width="120px" height="90px" title="' . ($image_file != 'no_image.png' ? _CLICK_TO_INCREASE : '') . '" alt="" />'; if ($image_file != 'no_image.png') { $output .= '</a>'; } $output .= ' </div> </td> </tr>'; } // draw pagination links if ($total_pages > 1) { $output .= '<tr><td colspan="2" style="padding:7px;">' . draw_line('no_margin_line', IMAGE_DIRECTORY, false) . '</td></tr>'; } $output .= '<tr><td colspan="2">'; $output .= pagination_get_links($total_pages, ''); $output .= '</td></tr>'; $output .= '<tr><td colspan="2"> </td></tr>'; $output .= '</table>'; } else { // draw message only if this is a last-level empty category $categories = Categories::GetAllActive('c.parent_id = ' . (int) $category_id); if (!$categories[1]) { $output .= draw_message(_NO_LISTINGS_FOUND, false, true); } } if ($draw) { echo $output; } else { return $output; } }
/** * Draw Installation form */ public function DrawInstallationForm() { $output = '<table align="center" width="100%" border="0" cellspacing="0" cellpadding="3" class="main_text"> <tr valign="top"> <td width="45%"> <form action="' . APPHP_BASE . 'index.php?admin=mod_backup_installation" method="post"> ' . draw_hidden_field('submition_type', '1', false) . ' ' . draw_token_field(false) . ' <table align="center" width="100%" border="0" cellspacing="0" cellpadding="3" class="main_text"> <tr><td colspan="2"> </td></tr> <tr> <td align="' . Application::Get('defined_left') . '" colspan="2"><b>' . _BACKUP_YOUR_INSTALLATION . ': </b></td> </tr> <tr> <td align="' . Application::Get('defined_left') . '" width="1%"><input type="text" name="backup_file" value="' . date('M-d-Y') . '" size="24" maxlength="20" /></td> <td align="' . Application::Get('defined_left') . '"><input class="form_button" type="submit" name="submit" value="' . _BACKUP . '" /></td> </tr> </table> </form> </td> <td width="55%"> <table align="center" width="100%" border="0" cellspacing="0" cellpadding="3" class="main_text"> <tr><td colspan="2"> </td></tr> <tr> <td align="left" colspan="2"><b>' . _BACKUPS_EXISTING . ': </b></td> </tr> ' . $this->ShowPreviousBackups('delete', false) . ' </table> </td> </tr> </table>'; echo $output; }
/** * Draws login form on Front-End * @param $draw */ public static function DrawLoginFormBlock($draw = true) { global $objLogin; $username = ''; $password = ''; $remember_me_checked = ''; // check if remember me cookies exists if (ModulesSettings::Get('customers', 'remember_me_allow') == 'yes') { $objLogin->CheckRememberMe($username, $password); if (!empty($username) && !empty($password)) { $remember_me_checked = 'checked="checked"'; } } $output = draw_block_top(_AUTHENTICATION, '', 'maximized', false); $output .= '<form class="customer_login" action="index.php?customer=login" method="post"> ' . draw_hidden_field('submit_login', 'login', false) . ' ' . draw_hidden_field('type', 'customer', false) . ' ' . draw_token_field(false) . ' <table border="0" cellspacing="1" cellpadding="1"> <tr><td>' . _USERNAME . ':</td></tr> <tr><td><input type="text" style="width:130px" name="user_name" id="user_name" maxlength="50" autocomplete="off" value="' . $username . '" /></td></tr> <tr><td>' . _PASSWORD . ':</td></tr> <tr><td><input type="password" style="width:130px" name="password" id="password" maxlength="20" autocomplete="off" value="' . $password . '" /></td></tr> <tr><td valign="middle">'; $output .= '<input class="form_button" type="submit" name="submit" value="' . _BUTTON_LOGIN . '" /> '; if (ModulesSettings::Get('customers', 'remember_me_allow') == 'yes') { $output .= '<input class="form_checkbox" ' . $remember_me_checked . ' name="remember_me" value="1" type="checkbox" /> ' . _REMEMBER_ME . '<br>'; } $output .= '</td></tr> <tr><td></td></tr>'; if (ModulesSettings::Get('customers', 'allow_registration') == 'yes') { $output .= '<tr><td>' . prepare_permanent_link('index.php?customer=create_account', _CREATE_ACCOUNT, '', 'form_link') . '</td></tr>'; } if (ModulesSettings::Get('customers', 'allow_reset_passwords') == 'yes') { $output .= '<tr><td>' . prepare_permanent_link('index.php?customer=password_forgotten', _FORGOT_PASSWORD, '', 'form_link') . '</td></tr>'; } $output .= '</table> </form>'; $output .= draw_block_bottom(false); if ($draw) { echo $output; } else { return $output; } }
/** * Draws advanced search form * @param $draw */ public static function DrawAdvancedSearch($draw = true) { $keyword = isset($_POST['keyword']) ? trim(prepare_input($_POST['keyword'])) : ''; $keyword = str_replace('"', '"', $keyword); $keyword = str_replace("'", ''', $keyword); $search_in = Application::Get('search_in'); $sel_categories = isset($_POST['sel_categories']) ? (int) $_POST['sel_categories'] : ''; $sel_listings_locations = isset($_POST['sel_listings_locations']) ? prepare_input($_POST['sel_listings_locations']) : ''; $sel_listings_sub_locations = isset($_POST['sel_listings_sub_locations']) ? prepare_input($_POST['sel_listings_sub_locations']) : ''; $sel_view = isset($_POST['sel_view']) ? prepare_input($_POST['sel_view']) : ''; $sel_sortby = isset($_POST['sel_sortby']) ? prepare_input($_POST['sel_sortby']) : ''; $sel_orderby = isset($_POST['sel_orderby']) ? prepare_input($_POST['sel_orderby']) : ''; $chk_with_images = isset($_POST['chk_with_images']) ? prepare_input($_POST['chk_with_images']) : ''; // prepare categories array $objCategories = Categories::Instance(); $total_categories = $objCategories->GetAllExistingCategories(); $total_countries = Countries::GetAllCountries('priority_order DESC, name ASC'); $output = '<form style="margin:10px" id="frmAdvSearch" name="frmAdvSearch" action="index.php?page=search_advanced" method="post"> ' . draw_hidden_field('task', 'advanced_search', false) . ' ' . draw_hidden_field('p', '1', false) . ' ' . draw_hidden_field('search_in', 'listings') . ' ' . draw_token_field(false) . ' <input type="text" name="keyword" value="' . $keyword . '" placeholder="' . _SEARCH_KEYWORDS . '..."> <span>' . _IN . '</span> <select name="sel_categories">'; $output .= '<option value="">-- ' . _ALL . ' --</option>'; foreach ($total_categories as $key => $val) { if ($val['level'] == '1') { $category_name = $val['name']; } else { if ($val['level'] == '2') { $category_name = ' • ' . $val['name']; } else { if ($val['level'] == '3') { $category_name = ' :: ' . $val['name']; } } } $output .= '<option ' . ($sel_categories == $val['id'] ? 'selected="selected"' : '') . ' value="' . $val['id'] . '">' . $category_name . '</option>'; } $output .= '</select> '; $output .= ListingsLocations::DrawAllLocations(array('tag_name' => 'sel_listings_locations', 'selected_value' => $sel_listings_locations, 'javascript_event' => 'onchange="jQuery(\'#frmAdvSearch\').submit();"'), false) . ' '; $output .= ListingsSubLocations::DrawAllSubLocations($sel_listings_locations, array('tag_name' => 'sel_listings_sub_locations', 'selected_value' => $sel_listings_sub_locations), false); $output .= '<span style="float:right;"> <input value="' . _SEARCH . '" class="form_button" type="submit"> </span> <div style="padding-top:4px;margin-left:-3px;"> <table><tbody><tr> <td>' . _VIEW . ': <select name="sel_view"> <option value="0" ' . ($sel_view == '0' ? ' selected="selected"' : '') . '>-- ' . _ALL . ' --</option> <option value="1" ' . ($sel_view == '1' ? ' selected="selected"' : '') . '>' . _TODAY . '</option> <option value="2" ' . ($sel_view == '2' ? ' selected="selected"' : '') . '>' . _YESTERDAY . '</option> <option value="3" ' . ($sel_view == '3' ? ' selected="selected"' : '') . '>' . _LAST_7_DAYS . '</option> </select> </td> <td>' . _SORT_BY . ': <select name="sel_sortby"> <option value="0" ' . ($sel_sortby == '0' ? ' selected="selected"' : '') . '>' . _DATE . '</option> <option value="1" ' . ($sel_sortby == '1' ? ' selected="selected"' : '') . '>' . _VIEW . '</option> </select> </td> <td>' . _ORDER_BY . ': <select name="sel_orderby"> <option value="ASC" ' . ($sel_orderby == 'ASC' ? ' selected="selected"' : '') . '>' . _ASCENDING . '</option> <option value="DESC" ' . ($sel_orderby == 'DESC' ? ' selected="selected"' : '') . '>' . _DESCENDING . '</option> </select> </td> <td style="padding-top:4px;"><input name="chk_with_images" type="checkbox" ' . ($chk_with_images == '1' ? ' checked="checked"' : '') . ' value="1">' . _WITH_IMAGES_ONLY . '</td> </tr> </tbody> </table> </div> </form>'; if ($draw) { echo $output; } else { return $output; } }
// Draw title bar draw_title_bar(_RESEND_ACTIVATION_EMAIL); // Check if customer is logged in if (!$objLogin->IsLoggedIn() && ModulesSettings::Get('customers', 'allow_registration') == 'yes') { echo $msg; ?> <div class="pages_contents"> <form action="index.php?customer=resend_activation" method="post"> <?php draw_hidden_field('act', 'resend'); ?> <?php draw_hidden_field('type', 'customer'); ?> <?php draw_token_field(); ?> <table class="loginForm" width="96%" border="0"> <tr> <td colspan="2"> <?php echo '<p>' . _RESEND_ACTIVATION_EMAIL_MSG . '</p>'; ?> </td> </tr> <tr> <td width="15%" nowrap="nowrap"><?php echo _EMAIL_ADDRESS; ?> :</td>
/** * Draws all modules * return: html output */ public function DrawModules() { global $objLogin; $margin = 'margin:-97px 0px 0px -44px;'; $nl = "\n"; if ($this->modulesCount > 0) { $this->IncludeJSFunctions(); echo '<form name="frmMicroGrid_' . $this->tableName . '" id="frmMicroGrid_' . $this->tableName . '" action="' . $this->formActionURL . '" method="post">' . $nl; draw_hidden_field($this->uPrefix . 'mg_action', 'view'); echo $nl; draw_hidden_field('mg_rid', ''); echo $nl; draw_hidden_field('mg_sorting_fields', 'id'); echo $nl; draw_hidden_field('mg_sorting_types', ''); echo $nl; draw_hidden_field('mg_page', ''); echo $nl; draw_hidden_field('mg_operation', ''); echo $nl; draw_hidden_field('mg_operation_type', ''); echo $nl; draw_hidden_field('mg_operation_field', ''); echo $nl; draw_hidden_field('mg_search_status', ''); echo $nl; draw_hidden_field('mg_language_id', ''); echo $nl; draw_hidden_field('mg_operation_code', self::GetRandomString(20)); echo $nl; draw_token_field(); echo $nl; echo '<table width="100%" border="0" cellspacing="0" cellpadding="1">'; echo '<tr><td>'; $modules_output = ''; for ($i = 0; $i < $this->modules[1]; $i++) { if ($this->modules[0][$i]['is_system'] == '1') { if ($objLogin->IsLoggedInAs($this->modules[0][$i]['settings_access_by'])) { $modules_output .= '<div style="width:120px;float:' . Application::Get('defined_left') . ';text-align:center;margin:5px;"> <div><b>' . decode_text(constant($this->modules[0][$i]['name_const'])) . '</b></div> <div><img src="images/modules_icons/' . $this->modules[0][$i]['icon_file'] . '" title="' . @decode_text(constant($this->modules[0][$i]['description_const'])) . '" alt="" style="cursor:help;margin:2px;border:1px solid #dedede"></div> <div>' . ($this->modules[0][$i]['is_installed'] == 1 ? '<img src="images/success_sign.gif" style="position:absolute;' . $margin . '" alt="">' : '<img src="images/error_sign.gif" style="position:absolute;' . $margin . '" alt="">') . '</div> <div><a href="javascript:void(0);" onclick="javascript:__mgDoPostBack(\'' . $this->tableName . '\', \'edit\', \'' . $this->modules[0][$i]['id'] . '\');">[ ' . _EDIT_WORD . ' ]</a></div> </div>'; } } } if ($modules_output != '') { echo draw_sub_title_bar(_SYSTEM_MODULES, false); echo $modules_output; } echo '</td></tr><tr><td>'; $modules_output = ''; for ($i = 0; $i < $this->modules[1]; $i++) { if ($this->modules[0][$i]['is_system'] == '0') { if ($objLogin->IsLoggedInAs($this->modules[0][$i]['settings_access_by'])) { $modules_output .= '<div style="width:120px;float:' . Application::Get('defined_left') . ';text-align:center;margin:5px;"> <div><b>' . decode_text(constant($this->modules[0][$i]['name_const'])) . '</b></div> <div><img src="images/modules_icons/' . $this->modules[0][$i]['icon_file'] . '" title="' . @decode_text(constant($this->modules[0][$i]['description_const'])) . '" alt="" style="cursor:help;margin:2px;border:1px solid #dedede"></div> <div>' . ($this->modules[0][$i]['is_installed'] == 1 ? '<img src="images/success_sign.gif" style="position:absolute;' . $margin . '" alt="">' : '<img src="images/error_sign.gif" style="position:absolute;' . $margin . '" alt="">') . '</div> <div><a href="javascript:void(0);" onclick="javascript:__mgDoPostBack(\'' . $this->tableName . '\', \'edit\', \'' . $this->modules[0][$i]['id'] . '\');">[ ' . _EDIT_WORD . ' ]</a></div> </div>'; } } } if ($modules_output != '') { echo draw_sub_title_bar(_ADDITIONAL_MODULES, false); echo $modules_output; } echo '</td></tr>'; echo '</table>'; echo '</form>' . $nl; } }
public function DrawEditMode($rid = '0', $buttons = array('reset' => false, 'cancel' => true)) { $this->IncludeJSFunctions(); // load XML file global $objSettings; $allowed_placement = array(); if (@file_exists('templates/' . $objSettings->GetTemplate() . '/info.xml')) { $xml = simplexml_load_file('templates/' . $objSettings->GetTemplate() . '/info.xml'); if (isset($xml->menus->menu)) { foreach ($xml->menus->menu as $menu) { $allowed_placement[] = strtolower($menu) . ' side'; } } } $sorting_fields = self::GetParameter('sorting_fields'); $sorting_types = self::GetParameter('sorting_types'); $page = self::GetParameter('page'); $operation = self::GetParameter('operation'); $operation_type = self::GetParameter('operation_type'); $operation_field = self::GetParameter('operation_field'); $search_status = self::GetParameter('search_status'); $is_required = false; $nl = "\n"; echo $nl . '<form name="frmMicroGrid_' . $this->tableName . '" id="frmMicroGrid_' . $this->tableName . '" action="' . $this->formActionURL . '" method="post" enctype="multipart/form-data">' . $nl; draw_hidden_field('mg_action', 'update'); echo $nl; draw_hidden_field('mg_rid', $rid); echo $nl; draw_hidden_field('mg_sorting_fields', $sorting_fields); echo $nl; draw_hidden_field('mg_sorting_types', $sorting_types); echo $nl; draw_hidden_field('mg_page', $page); echo $nl; draw_hidden_field('mg_operation', ''); echo $nl; draw_hidden_field('mg_operation_type', ''); echo $nl; draw_hidden_field('mg_operation_field', ''); echo $nl; draw_hidden_field('mg_search_status', $search_status); echo $nl; draw_hidden_field('mg_language_id', $this->languageId); echo $nl; draw_token_field(); echo $nl; // save filter (search) data for view mode if ($this->isFilteringAllowed) { foreach ($this->arrFilteringFields as $key => $val) { if ($val['type'] == 'text') { $filter_field_value = $search_status == 'active' ? $filter_field_value = self::GetParameter('filter_by_' . $key, false) : ''; draw_hidden_field('filter_by_' . $key, $filter_field_value); echo $nl; } } } // prepare password fields foreach ($this->arrEditModeFields as $key => $val) { if (preg_match('/separator/i', $key) && is_array($val)) { foreach ($val as $v_key => $v_val) { if ($v_key != 'separator_info') { if ($v_val['type'] == 'password') { $password_field = $this->UncryptPasswordValue($v_key, $v_val); str_replace($v_key, $password_field, $this->arrEditModeFields); } } } } else { if ($val['type'] == 'password') { $password_field = $this->UncryptPasswordValue($key, $val); $this->EDIT_MODE_SQL = str_replace($this->tableName . '.' . $key, $password_field, $this->EDIT_MODE_SQL); } } } $this->EDIT_MODE_SQL = str_replace('_RID_', $rid, $this->EDIT_MODE_SQL); $result = database_query($this->EDIT_MODE_SQL, DATA_AND_ROWS); if ($this->debug) { $this->arrSQLs['select_edit_mode'] = $this->EDIT_MODE_SQL; } // draw hidden fields foreach ($this->arrEditModeFields as $key => $val) { if (preg_match('/separator/i', $key) && is_array($val)) { foreach ($val as $v_key => $v_val) { if ($v_key != 'separator_info') { // delete file/image if ($operation == 'remove' && $operation_field != '' && $v_key == $operation_field) { $this->RemoveFileImage($rid, $operation_field, $v_val['target'], $result[0][0][$v_key]); $result[0][0][$v_key] = ''; } if ($v_val['type'] == 'hidden') { draw_hidden_field($v_key, $result[0][0][$v_key]); echo $nl; } } } } else { // delete file/image if ($operation == 'remove' && $operation_field != '' && $key == $operation_field) { $this->RemoveFileImage($rid, $operation_field, $val['target'], $result[0][0][$key]); $result[0][0][$key] = ''; } if ($val['type'] == 'hidden') { if (isset($this->arrSettings[$result[0][0][$key]]['required']) && $this->arrSettings[$result[0][0][$key]]['required'] == '1') { $is_required = true; } draw_hidden_field($key, $result[0][0][$key]); echo $nl; } } } // draw Edit Form echo '<table width="100%" border="0" cellspacing="0" cellpadding="2" class="mgrid_table">' . $nl; echo '<tr><td colspan="2" height="5px" nowrap="nowrap"></td></tr>'; foreach ($this->arrEditModeFields as $key => $val) { if (preg_match('/separator/i', $key) && is_array($val)) { echo '</table><br />' . $nl; echo '<fieldset style="padding:5px;">' . $nl; echo '<legend>' . $val['separator_info']['legend'] . '</legend>' . $nl; echo '<table width="100%" border="0" cellspacing="0" cellpadding="2" class="mgrid_table">' . $nl; foreach ($val as $v_key => $v_val) { if ($v_key != 'separator_info') { echo '<tr>' . $nl; echo ' <td width="27%">' . $v_val['title'] . ($is_required ? ' <span class="required">*</span>' : '') . ':</td>' . $nl; if (isset($this->params[$v_key]) && $this->params[$v_key] !== '' && $v_val['type'] != 'checkbox') { echo ' <td style="padding-left:6px;">' . $this->DrawFieldByType('edit', $v_key, $v_val, $this->params, false) . '</td>' . $nl; } else { echo ' <td style="padding-left:6px;">' . $this->DrawFieldByType('edit', $v_key, $v_val, $result[0][0], false) . '</td>' . $nl; } echo '</tr>' . $nl; } } echo '</table>' . $nl; echo '</fieldset>' . $nl; echo '<table width="100%" border="0" cellspacing="0" cellpadding="2" class="mgrid_table">' . $nl; } else { if ($val['type'] != 'hidden') { echo '<tr>' . $nl; echo ' <td width="20%">' . $val['title'] . ($is_required && $key == 'settings_value' ? ' <span class="required">*</span>' : '') . ':</td>' . $nl; // prepare some settings depended on field type if ($key == 'settings_value') { $sql = 'SELECT key_display_type, key_display_source FROM ' . $this->tableName . ' WHERE ' . $this->primaryKey . '=' . $rid; if ($row = database_query($sql, DATA_ONLY, FIRST_ROW_ONLY)) { if ($row['key_display_type'] == 'enum') { $key_display_source = explode(',', $row['key_display_source']); $enum_source = array(); foreach ($key_display_source as $kds_key) { if (count($allowed_placement) > 0 && in_array($kds_key, array('left side', 'right side'))) { if (in_array($kds_key, $allowed_placement)) { $enum_source[$kds_key] = ucwords($kds_key); } } else { $enum_source[$kds_key] = ucwords($kds_key); } } $val['type'] = 'enum'; $val['source'] = $enum_source; } else { if ($row['key_display_type'] == 'yes/no') { $enum_source = array('no' => _NO, 'yes' => _YES); $val['type'] = 'enum'; $val['source'] = $enum_source; } else { if ($row['key_display_type'] == 'numeric') { $val['width'] = '50px'; } else { if ($row['key_display_type'] == 'text') { $val['type'] = 'textarea'; $val['width'] = '530px'; $val['height'] = '170px'; } else { if ($row['key_display_type'] == 'integer' || $row['key_display_type'] == 'positive integer' || $row['key_display_type'] == 'unsigned integer') { $val['width'] = '50px'; $val['maxlength'] = '5'; } else { if ($row['key_display_type'] == 'unsigned float') { $val['width'] = '50px'; $val['maxlength'] = '15'; } else { if ($row['key_display_type'] == 'html size') { $val['width'] = '100px'; $val['maxlength'] = '8'; } else { $val['width'] = '270px'; $val['maxlength'] = '255'; } } } } } } } } } if (isset($this->params[$key]) && $this->params[$key] !== '' && $val['type'] != 'checkbox') { echo ' <td>' . $this->DrawFieldByType('edit', $key, $val, $this->params, false) . '</td>' . $nl; } else { echo ' <td>' . $this->DrawFieldByType('edit', $key, $val, $result[0][0], false) . '</td>' . $nl; } echo '</tr>' . $nl; } } } echo '<tr><td colspan="2" height="5px" nowrap="nowrap"></td></tr>'; echo '<tr> <td colspan="2"> <input class="mgrid_button" type="button" name="subUpdateRecord" value="' . _BUTTON_UPDATE . '" onclick="javascript:__mgDoPostBack(\'' . $this->tableName . '\', \'update\');"> <input class="mgrid_button" type="button" name="btnCancel" value="' . _BUTTON_CANCEL . '" onclick="javascript:__mgDoPostBack(\'' . $this->tableName . '\', \'view\');"> </td> <tr>' . $nl; echo '</table><br />' . $nl; echo '</form>' . $nl; if ($this->errorField != '') { echo '<script type="text/javascript">__mgSetFocus(\'' . $this->errorField . '\');</script>'; } $this->DrawRunningTime(); $this->DrawErrors(); $this->DrawWarnings(); $this->DrawSQLs(); $this->DrawPostInfo(); }
/** * Draws Payment Form for Authorize.Net * @param $pp_params * @param $mode */ public static function DrawAuthorizeNetPaymentForm($pp_params, $mode = 'real') { $nl = "\n"; $output = ''; if ($mode == 'test') { $output = $nl . '<form action="index.php?page=payment_notify_autorize_net" method="post">'; $output .= $nl . draw_hidden_field('x_trans_id', 'TEST_' . get_random_string(8), false); $output .= $nl . draw_hidden_field('x_method', '1', false); $output .= $nl . draw_hidden_field('x_amount', round($pp_params['cart_total'], 2), false); $output .= $nl . draw_hidden_field('custom', $pp_params['order_number'], false); $output .= $nl . draw_token_field(false); $output .= $nl . _AUTHORIZE_NET_NOTICE . '<br /><br />'; $output .= $nl . '<table width="99%" border="0">'; $output .= $nl . '<tr>'; $output .= $nl . '<td>'; $output .= $nl . '<input type="image" style="border:0px" src="images/ppc_icons/btn_authorize_buynow.gif" title="' . _SUBMIT_PAYMENT . '" value="Go To Payment" name="btnSubmit" />'; $output .= $nl . ' - ' . _OR . ' - '; $output .= $nl . '<a href="javascript:void(0);" onclick="javascript:appGoTo(\'customer=advertise\')">' . _BUTTON_CANCEL . '</a>'; $output .= $nl . '</td>'; $output .= $nl . '</tr>'; $output .= $nl . '</table>'; $output .= $nl . '</form>'; } else { // <!-- Create the HTML form containing necessary SIM post values --> // <!-- Additional fields can be added here as outlined in the SIM integration guide at: http://developer.authorize.net --> //$url = 'https://test.authorize.net/gateway/transact.dll'; $url = 'https://secure.authorize.net/gateway/transact.dll'; $testMode = 'false'; // an invoice is generated using the date and time $invoice = date('YmdHis'); // a sequence number is randomly generated $sequence = rand(1, 1000); // a timestamp is generated $timeStamp = time(); // The following lines generate the SIM fingerprint. PHP versions 5.1.2 and // newer have the necessary hmac function built in. For older versions, it // will try to use the mhash library. if (phpversion() >= '5.1.2') { $fingerprint = hash_hmac('md5', $pp_params['api_login'] . '^' . $sequence . '^' . $timeStamp . '^' . round($pp_params['cart_total'], 2) . '^', $pp_params['transaction_key']); } else { $fingerprint = bin2hex(mhash(MHASH_MD5, $pp_params['api_login'] . '^' . $sequence . '^' . $timeStamp . '^' . round($pp_params['cart_total'], 2) . '^', $pp_params['transaction_key'])); } $output = $nl . '<form method="post" action="' . $url . '">'; $output .= $nl . draw_hidden_field('x_login', $pp_params['api_login'], false); $output .= $nl . draw_hidden_field('x_amount', round($pp_params['cart_total'], 2), false); $output .= $nl . draw_hidden_field('x_description', 'Rooms Reservation', false); $output .= $nl . draw_hidden_field('x_invoice_num', $invoice, false); $output .= $nl . draw_hidden_field('x_fp_sequence', $sequence, false); $output .= $nl . draw_hidden_field('x_fp_timestamp', $timeStamp, false); $output .= $nl . draw_hidden_field('x_fp_hash', $fingerprint, false); $output .= $nl . draw_hidden_field('x_test_request', $testMode, false); $output .= $nl . draw_hidden_field('x_relay_response', 'TRUE', false); $output .= $nl . draw_hidden_field('x_relay_url', APPHP_BASE . $pp_params['notify'], false); $output .= $nl . draw_hidden_field('x_show_form', 'PAYMENT_FORM', false); $output .= $nl . draw_hidden_field('custom', $pp_params['order_number'], false); $output .= $nl . draw_hidden_field('x_first_name', $pp_params['first_name'], false); $output .= $nl . draw_hidden_field('x_last_name', $pp_params['last_name'], false); $output .= $nl . draw_hidden_field('x_company', $pp_params['company'], false); $output .= $nl . draw_hidden_field('x_phone', $pp_params['phone'], false); $output .= $nl . draw_hidden_field('x_fax', $pp_params['fax'], false); $output .= $nl . draw_hidden_field('x_email', $pp_params['email'], false); $output .= $nl . draw_hidden_field('x_address', $pp_params['address1'] . ' ' . $pp_params['address2'], false); $output .= $nl . draw_hidden_field('x_city', $pp_params['city'], false); $output .= $nl . draw_hidden_field('x_zip', $pp_params['zip'], false); $output .= $nl . draw_hidden_field('x_country', $pp_params['country'], false); $output .= $nl . draw_hidden_field('x_state', $pp_params['state'], false); $output .= $nl . _AUTHORIZE_NET_NOTICE . '<br /><br />'; $output .= $nl . '<input type="image" style="border:0px" src="images/ppc_icons/btn_authorize_buynow.gif" title="' . _SUBMIT_PAYMENT . '" value="Go To Payment" name="btnSubmit" />'; $output .= $nl . ' - ' . _OR . ' - '; $output .= $nl . '<a href="javascript:void(0);" onclick="javascript:appGoTo(\'customer=advertise\')">' . _BUTTON_CANCEL . '</a>'; $output .= $nl . '</form>'; } return $output; }
/** * Draws Edit Form * @param $key * @param $draw */ public function DrawEditForm($key = '0', $draw = true) { $total_languages = Languages::GetAllLanguages(); $key_value = $key_text = ''; $default_lang_name = 'English'; $default_lang_abbr = 'en'; $lang_to_dir = Languages::GetLanguageDirection($this->languageId); $default_lang_text = ''; $align_left = Application::Get('lang_dir') == 'ltr' ? 'left' : 'right'; $align_right = Application::Get('lang_dir') == 'ltr' ? 'right' : 'left'; $output = ''; $sql = 'SELECT * FROM ' . TABLE_VOCABULARY . ' WHERE id = ' . (int) $key; if ($row = database_query($sql, DATA_ONLY, FIRST_ROW_ONLY)) { $key_value = $row['key_value']; $key_text = $row['key_text']; $this->currentKey = $key_value; } $sql = 'SELECT * FROM ' . TABLE_LANGUAGES . ' WHERE is_default = 1'; if ($row = database_query($sql, DATA_ONLY, FIRST_ROW_ONLY)) { $default_lang_name = $row['lang_name']; $default_lang_abbr = $row['abbreviation']; $sql = 'SELECT * FROM ' . TABLE_VOCABULARY . ' WHERE key_value = \'' . $this->currentKey . '\' AND language_id = \'' . $default_lang_abbr . '\''; if ($row = database_query($sql, DATA_ONLY, FIRST_ROW_ONLY)) { $default_lang_text = strip_tags($row['key_text'], '<b><i><u><br>'); } } if ($default_lang_abbr != $this->languageId) { $output .= '<script type="text/javascript"> google.load("language", "1"); function TranslateText(response){ if(response.data){ jQuery("#txt_message").html("' . _COMPLETED . '!"); jQuery("#txt_key_value").val(response.data.translations[0].translatedText); jQuery("#btnTranslate").attr("disabled", false); }else{ //response.error.message jQuery("#txt_message").html("This feature is only available for Google paid accounts! Please check you have a valid API Key."); } } function GoAndTranslate(){'; // Block all operations in demo mode if (strtolower(SITE_MODE) == 'demo') { $output .= 'alert(\'' . _OPERATION_BLOCKED . '\'); return false; '; } else { $output .= '// grabbing the text to translate var YOUR_API_KEY = ""; var text = jQuery("#txt_key_value").val(); if(text.indexOf(" ") <= 0) text = text.toLowerCase(); jQuery("#btnTranslate").attr("disabled", true); jQuery("#txt_message").html(""); var newScript = document.createElement("script"); newScript.type = "text/javascript"; // WARNING: be aware that YOUR-API-KEY inside html is viewable by all your users. // Restrict your key to designated domains or use a proxy to hide your key // to avoid misuage by other party. var source = "https://www.googleapis.com/language/translate/v2?key="+YOUR_API_KEY+"&source=' . $default_lang_abbr . '&target=' . $this->languageId . '&callback=TranslateText&q=" + text; newScript.src = source; // When we add this script to the head, the request is sent off. document.getElementsByTagName("head")[0].appendChild(newScript);'; } $output .= '} </script>'; } $output .= '<form action="index.php?admin=vocabulary" method="post">'; $output .= draw_hidden_field('submition_type', '1', false); $output .= draw_hidden_field('key', $key, false); $output .= draw_hidden_field('filter_by', $this->filterBy, false); $output .= draw_hidden_field('language_id', $this->languageId, false); $output .= draw_token_field(false); $output .= '<table align="center" width="99%" border="0" cellspacing="0" cellpadding="3" class="main_text"> <tr valign="top"> <td><b>' . _EDIT_WORD . '</b></td> <td><div id="txt_message" style="color:#00a600"></div></td> <td width="20px" nowrap="nowrap"></td> <td align="' . $align_right . '">' . draw_languages_box('language_id', $total_languages[0], 'abbreviation', 'lang_name', $this->languageId, '', 'disabled="disabled"', false) . '</td> </tr> <tr valign="top"> <td align="' . $align_right . '" width="90px">' . _KEY . ':</td> <td align="' . $align_left . '" colspan="2"> ' . $key_value . ' ' . draw_hidden_field('txt_key', $key_value, false) . ' </td> <td></td> </tr>'; $output .= '<tr valign="top"> <td align="' . $align_right . '">' . _VALUE . ' <span style="color:#c13a3a">*</span>:</td> <td align="' . $align_left . '"> <textarea dir="' . $lang_to_dir . '" style="width:100%;height:60px;overflow:auto;padding:3px;" name="txt_key_value" id="txt_key_value" maxlength="4096">' . decode_text($key_text) . '</textarea> </td> <td></td> <td align="right" width="240px">'; if ($default_lang_abbr != $this->languageId) { $output .= '<nobr> ' . $default_lang_name . ' » ' . strtoupper($this->languageId) . ' <input class="form_button" type="button" id="btnTranslate" name="submit" style="width:150px" onclick="GoAndTranslate()" value="' . _TRANSLATE_VIA_GOOGLE . '" /> <input class="form_button" type="reset" name="btnReset" title="' . _RESET . '" value="R" /> </nobr><br /><br />'; } $output .= '<input class="form_button" type="submit" name="submit" value="' . decode_text(_BUTTON_UPDATE) . '"> <input class="form_button" type="button" onclick="appGoTo(\'admin=vocabulary' . $this->langIdByUrl . $this->filterByUrl . '\')" value="' . decode_text(_BUTTON_CANCEL) . '"> </td> </tr>'; if ($default_lang_abbr != $this->languageId) { $output .= '<tr valign="top"> <td align="' . $align_right . '" width="110px">' . $default_lang_name . ':</td> <td align="' . $align_left . '">' . $default_lang_text . '</td> <td colspan="2"></td> </tr>'; } $output .= '<tr align="right"><td colspan="4"></td></tr> </table> </form>'; if ($draw) { echo $output; } else { return $output; } }
/** * Draws registration form * @param $news_id * @param $event_title * @param $draw */ public function DrawRegistrationForm($news_id = '0', $event_title = '', $draw = true) { if (!$news_id) { return ''; } global $objSettings, $objLogin; $lang = Application::Get('lang'); $focus_element = 'first_name'; // post fields $task = isset($_POST['task']) ? prepare_input($_POST['task']) : ''; $event_id = isset($_POST['event_id']) ? (int) $_POST['event_id'] : '0'; $first_name = isset($_POST['first_name']) ? prepare_input($_POST['first_name']) : ''; $last_name = isset($_POST['last_name']) ? prepare_input($_POST['last_name']) : ''; $email = isset($_POST['email']) ? prepare_input($_POST['email']) : ''; $phone = isset($_POST['phone']) ? prepare_input($_POST['phone']) : ''; $message = isset($_POST['message']) ? substr(prepare_input($_POST['message']), 0, 2048) : ''; $captcha_code = isset($_POST['captcha_code']) ? prepare_input($_POST['captcha_code']) : ''; $admin_email = $objSettings->GetParameter('admin_email'); $msg = ''; if ($task == 'register_to_event') { include_once 'modules/captcha/securimage.php'; $objImg = new Securimage(); if ($first_name == '') { $msg = draw_important_message(_FIRST_NAME_EMPTY_ALERT, false); $focus_element = 'first_name'; } else { if ($last_name == '') { $msg = draw_important_message(_LAST_NAME_EMPTY_ALERT, false); $focus_element = 'last_name'; } else { if ($email == '') { $msg = draw_important_message(_EMAIL_EMPTY_ALERT, false); $focus_element = 'email'; } else { if ($email != '' && !check_email_address($email)) { $msg = draw_important_message(_EMAIL_VALID_ALERT, false); $focus_element = 'email'; } else { if ($phone == '') { $msg = draw_important_message(str_replace('_FIELD_', _PHONE, _FIELD_CANNOT_BE_EMPTY), false); $focus_element = 'phone'; } else { if (!$objImg->check($captcha_code)) { $msg = draw_important_message(_WRONG_CODE_ALERT, false); $focus_element = 'captcha_code'; } else { $sql = 'SELECT * FROM ' . TABLE_EVENTS_REGISTERED . ' WHERE event_id = \'' . (int) $event_id . '\' AND email = \'' . $email . '\''; if (database_query($sql, ROWS_ONLY, FIRST_ROW_ONLY) > 0) { $msg = draw_important_message(_EVENT_USER_ALREADY_REGISTERED, false); } } } } } } } // deny all operations in demo version if (strtolower(SITE_MODE) == 'demo') { $msg = draw_important_message(_OPERATION_BLOCKED, false); } if ($msg == '') { if ($objLogin->IpAddressBlocked(get_current_ip())) { $msg = draw_important_message(_IP_ADDRESS_BLOCKED, false); } else { if ($objLogin->EmailBlocked($email)) { $msg = draw_important_message(_EMAIL_BLOCKED, false); } else { $sql = 'INSERT INTO ' . TABLE_EVENTS_REGISTERED . ' (id, event_id, first_name, last_name, email, phone, message, date_registered) VALUES (NULL, ' . (int) $event_id . ', \'' . encode_text($first_name) . '\', \'' . encode_text($last_name) . '\', \'' . encode_text($email) . '\', \'' . encode_text($phone) . '\', \'' . encode_text($message) . '\', \'' . @date('Y-m-d H:i:s') . '\')'; if (database_void_query($sql)) { $msg = draw_success_message(_EVENT_REGISTRATION_COMPLETED, false); //////////////////////////////////////////////////////////// send_email($email, $admin_email, 'events_new_registration', array('{FIRST NAME}' => $first_name, '{LAST NAME}' => $last_name, '{EVENT}' => '<b>' . $event_title . '</b>'), '', $admin_email, 'Events - new user was registered (admin copy)'); //////////////////////////////////////////////////////////// $first_name = $last_name = $email = $phone = $message = ''; } else { ///echo mysql_error(); $msg = draw_important_message(_TRY_LATER, false); } } } } } $output = ' ' . ($msg != '' ? $msg : '') . '<br /> <fieldset style="border:1px solid #cccccc;padding-left:10px;margin:0px 12px 12px 12px;"> <legend><b>' . _REGISTRATION_FORM . '</b></legend> <form method="post" name="frmEventRegistration" id="frmEventRegistration"> ' . draw_hidden_field('task', 'register_to_event', false) . ' ' . draw_hidden_field('event_id', $news_id, false) . ' ' . draw_token_field(false); $output .= ' <table cellspacing="1" cellpadding="2" border="0" width="100%"> <tbody> <tr> <td width="25%" align="' . Application::Get('defined_right') . '">' . _FIRST_NAME . ':</td> <td><span class="mandatory_star">*</span></td> <td nowrap="nowrap" align="' . Application::Get('defined_left') . '"><input type="text" id="first_name" name="first_name" size="34" maxlength="32" value="' . decode_text($first_name) . '" autocomplete="off" /></td> </tr> <tr> <td align="' . Application::Get('defined_right') . '">' . _LAST_NAME . ':</td> <td><span class="mandatory_star">*</span></td> <td nowrap="nowrap" align="' . Application::Get('defined_left') . '"><input type="text" id="last_name" name="last_name" size="34" maxlength="32" value="' . decode_text($last_name) . '" autocomplete="off" /></td> </tr> <tr> <td align="' . Application::Get('defined_right') . '">' . _EMAIL_ADDRESS . ':</td> <td><span class="mandatory_star">*</span></td> <td nowrap="nowrap" align="' . Application::Get('defined_left') . '"><input type="text" id="email" name="email" size="34" maxlength="70" value="' . decode_text($email) . '" autocomplete="off" /></td> </tr> <tr> <td align="' . Application::Get('defined_right') . '">' . _PHONE . ':</td> <td><span class="mandatory_star">*</span></td> <td nowrap="nowrap" align="' . Application::Get('defined_left') . '"><input type="text" id="phone" name="phone" size="22" maxlength="32" value="' . decode_text($phone) . '" autocomplete="off" /></td> </tr> <tr valign="top"> <td align="' . Application::Get('defined_right') . '">' . _MESSAGE . ':</td> <td></td> <td nowrap="nowrap" align="' . Application::Get('defined_left') . '"> <textarea id="message" name="message" style="width:390px;" rows="4" maxlength="2048">' . $message . '</textarea> </td> </tr> <tr> <td colspan="2"></td> <td colspan="2">'; $output .= '<table border="0" cellspacing="2" cellpadding="2"> <tr> <td> <img id="captcha_image" src="modules/captcha/securimage_show.php?sid=' . md5(uniqid(time())) . '" /> </td> <td> <img style="cursor:pointer; padding:0px; margin:0px;" id="captcha_image_reload" src="modules/captcha/images/refresh.gif" style="cursor:pointer;" onclick="document.getElementById(\'captcha_image\').src = \'modules/captcha/securimage_show.php?sid=\' + Math.random(); appSetFocus(\'captcha_code\'); return false" title="' . _REFRESH . '" alt="' . _REFRESH . '" /><br /> <a href="modules/captcha/securimage_play.php"><img border="0" style="padding:0px; margin:0px;" id="captcha_image_play" src="modules/captcha/images/audio_icon.gif" title="' . _PLAY . '" alt="' . _PLAY . '" /></a> </td> <td> ' . _TYPE_CHARS . '<br /> <input type="text" name="captcha_code" id="captcha_code" style="width:175px;margin-top:5px;" value="" maxlength="20" autocomplete="off" /> </td> </tr> </table>'; $output .= '</td> </tr> <tr><td height="20" colspan="3"> </td></tr> <tr> <td colspan="3" align="center"> <input type="submit" class="form_button" name="btnSubmitPD" id="btnSubmitPD" value=" ' . _SEND . ' "> </td> </tr> <tr><td colspan="3"> </td></tr> </table> </form> </form> </fieldset>'; if ($focus_element != '') { $output .= '<script type="text/javascript">appSetFocus(\'' . $focus_element . '\');</script>'; } if ($draw) { echo $output; } else { return $output; } }
/** * Draws mass mail form * $param $draw */ public function DrawMassMailForm($draw = true) { global $objSettings; $template_subject = ''; $template_content = ''; $result = database_query('SELECT COUNT(*) as cnt FROM ' . $this->TABLE_NAME . ' WHERE is_active = 1 AND email_notifications = 1 AND email != \'\'', DATA_ONLY, FIRST_ROW_ONLY); $members_emails_count = isset($result['cnt']) ? $result['cnt'] : 0; $result = database_query('SELECT COUNT(*) as cnt FROM ' . TABLE_ACCOUNTS . ' WHERE is_active = 1 AND email != \'\'', DATA_ONLY, FIRST_ROW_ONLY); $admins_emails_count = isset($result['cnt']) ? $result['cnt'] : 0; $emails_count = $members_emails_count + $admins_emails_count; $result = database_query('SELECT COUNT(*) as cnt FROM ' . TABLE_NEWS_SUBSCRIBED . ' WHERE email != \'\'', DATA_ONLY, FIRST_ROW_ONLY); $newsletter_subscribers_count = isset($result['cnt']) ? $result['cnt'] : 0; $send_copy_to_admin = '1'; $email_from = $objSettings->GetParameter('admin_email'); $template_code = isset($_GET['template_code']) ? prepare_input($_GET['template_code']) : ''; $duration = isset($_POST['duration']) ? (int) $_POST['duration'] : '5'; $members_module_installed = Modules::IsModuleInstalled($this->MODULE_NAME); // load appropriate email template if ($template_code != '') { $template = $this->GetTemplate($template_code, Application::Get('lang')); $template_subject = $template['template_subject']; $template_content = $template['template_content']; } if ($this->error == true) { $template_code = isset($_POST['template_name']) ? prepare_input($_POST['template_name']) : ''; $template_subject = isset($_POST['subject']) ? prepare_input($_POST['subject']) : ''; $template_content = isset($_POST['message']) ? prepare_input($_POST['message']) : ''; } $output = '<script type="text/javascript"> function duration_OnChange(val){ var el_package_size = (document.getElementById(\'package_size\')) ? document.getElementById(\'package_size\') : null; if(val == \'\' && el_package_size){ el_package_size.selectedIndex = 0; el_package_size.disabled = \'disabled\'; }else{ el_package_size.disabled = \'\'; } } function email_to_OnChange(val){ var el_send_copy_to_admin = (document.getElementById(\'send_copy_to_admin\')) ? document.getElementById(\'send_copy_to_admin\') : null; if(val == \'admins\' && el_send_copy_to_admin){ el_send_copy_to_admin.disabled = \'disabled\'; }else{ el_send_copy_to_admin.disabled = \'\'; } } function OnSubmit_Check(){ var email_to = (document.getElementById(\'email_to\')) ? document.getElementById(\'email_to\').value : \'\'; var email_from = (document.getElementById(\'email_from\')) ? document.getElementById(\'email_from\').value : \'\'; var subject = (document.getElementById(\'subject\')) ? document.getElementById(\'subject\').value : \'\'; var message = (document.getElementById(\'message\')) ? document.getElementById(\'message\').value : \'\'; if(email_to == \'\'){ alert(\'' . str_replace('_FIELD_', _EMAIL_TO, _FIELD_CANNOT_BE_EMPTY) . '\'); document.getElementById(\'email_to\').focus(); return false; }else if(email_from == \'\'){ alert(\'' . str_replace('_FIELD_', _EMAIL_FROM, _FIELD_CANNOT_BE_EMPTY) . '\'); document.getElementById(\'email_from\').focus(); return false; }else if(email_from != \'\' && !appIsEmail(email_from)){ alert(\'' . str_replace('_FIELD_', _EMAIL_FROM, _FIELD_MUST_BE_EMAIL) . '\'); document.getElementById(\'email_from\').focus(); return false; }else if(subject == \'\'){ alert(\'' . str_replace('_FIELD_', _SUBJECT, _FIELD_CANNOT_BE_EMPTY) . '\'); document.getElementById(\'subject\').focus(); return false; }else if(message == \'\'){ alert(\'' . str_replace('_FIELD_', _MESSAGE, _FIELD_CANNOT_BE_EMPTY) . '\'); document.getElementById(\'message\').focus(); return false; }else if(email_to == \'all\'){ if(!confirm(\'' . _PERFORM_OPERATION_COMMON_ALERT . '\')){ return false; } } return true; } </script>'; $output .= '<form action="index.php?admin=mass_mail" method="post" style="margin:0px;"> ' . draw_hidden_field('task', 'send', false) . ' ' . draw_hidden_field('email_random_code', get_random_string(10), false) . ' ' . draw_token_field(false) . ' <table border="0" cellspacing="10"> <tr> <td align="left" valign="top"> <fieldset style="height:410px;"> <legend><b>' . _FORM . ':</b></legend> <table width="97%" align="center" border="0" cellspacing="5"> <tr> <td align="right" nowrap="nowrap"> <label>' . _EMAIL_TEMPLATES . ':</label><br> ' . prepare_permanent_link('index.php?admin=email_templates', '[ ' . _MANAGE_TEMPLATES . ' ]', '', '') . ' </td> <td></td> <td> <table cellpadding="0" cellspacing="0"> <tr valign="middle"> <td> <select name="template_name" id="template_name" style="margin-bottom:3px;" onchange="javascript:appGoTo(\'admin=mass_mail&template_code=\'+this.value)"> <option value="">-- ' . _NO_TEMPLATE . ' --</option>'; $templates = $this->GetAllTemplates('is_system_template=0'); for ($i = 0; $i < $templates[1]; $i++) { $output .= '<option'; $output .= $templates[0][$i]['is_system_template'] == '1' ? ' style="background-color:#ffffcc;color:#000055"' : ''; $output .= $template_code == $templates[0][$i]['template_code'] ? ' selected="selected"' : ''; $output .= ' value="' . encode_text($templates[0][$i]['template_code']) . '">' . $templates[0][$i]['template_name'] . '</option>'; } $output .= ' </select> </td> </tr> </table> </td> </tr> <tr> <td align="right" nowrap="nowrap"><label>' . _EMAIL_TO . ':</label></td> <td><span class="mandatory_star">*</span></td> <td> <select name="email_to" id="email_to" style="margin-bottom:3px;" onchange="email_to_OnChange(this.value)"> <option value="">-- ' . _SELECT . ' --</option> <option value="test" style="background-color:#ffffcc;color:#000055">' . _TEST_EMAIL . ' (' . $email_from . ')</option>'; if (Modules::IsModuleInstalled('news')) { $output .= '<option value="newsletter_subscribers" style="background-color:#ffccff;color:#000055">' . _NEWSLETTER_SUBSCRIBERS . ' (' . $newsletter_subscribers_count . ')</option>'; } if ($members_module_installed) { $output .= '<optgroup label="' . $this->MEMBERS_NAME . '">'; $output .= '<option value="members|all">' . _ALL . ' (' . $members_emails_count . ')</option>'; if (self::$PROJECT == 'ShoppingCart' || self::$PROJECT == 'BusinessDirectory' || self::$PROJECT == 'HotelSite') { $arrMembersGroups = CustomerGroups::GetAllGroupsByCustomers(); } else { if (self::$PROJECT == 'MedicalAppointment') { $arrMembersGroups = PatientGroups::GetAllGroupsByPatiens(); } else { $arrMembersGroups = UserGroups::GetAllGroupsByUsers(); } } $member_groups_emails_count = 0; if ($arrMembersGroups[1] > 0) { foreach ($arrMembersGroups[0] as $key => $val) { if ($val[$this->MODULE_NAME . '_count']) { $output .= '<option value="members|' . $val['id'] . '">' . $val['name'] . ' (' . $val[$this->MODULE_NAME . '_count'] . ')</option>'; $member_groups_emails_count += $val[$this->MODULE_NAME . '_count']; } } } $member_non_groups_emails = $members_emails_count - $member_groups_emails_count; $output .= '<option value="members|uncategorized">' . _UNCATEGORIZED . ' (' . $member_non_groups_emails . ')</option>'; $output .= '</optgroup>'; } $output .= '<option value="admins">' . _ADMINS . ' (' . $admins_emails_count . ')</option>'; if ($members_module_installed) { $output .= '<option value="all">' . $this->ADMINS_MEMBERS_NAME . ' (' . $emails_count . ')</option>'; } $output .= '</select> </td> </tr> <tr> <td align="right" nowrap="nowrap"><label for="email">' . _EMAIL_FROM . ':</label></td> <td><span class="mandatory_star">*</span></td> <td> <input type="text" name="email_from" style="width:210px" id="email_from" value="' . decode_text($email_from) . '" maxlength="70" /> </td> </tr> <tr valign="top"> <td align="right" nowrap="nowrap"><label>' . _SUBJECT . ':</label></td> <td><span class="mandatory_star">*</span></td> <td> <input type="text" style="width:410px" name="subject" id="subject" value="' . decode_text($template_subject) . '" maxlength="255" /> </td> </tr> <tr valign="top"> <td align="right" nowrap="nowrap"><label>' . _MESSAGE . ':</label></td> <td><span class="mandatory_star">*</span></td> <td> <textarea style="width:465px;margin-right:10px;" rows="10" name="message" id="message">' . $template_content . '</textarea> </td> </tr>'; $output .= '<tr valign="middle"> <td colspan="2"></td> <td><img src="images/question_mark.png" alt="">' . _MASS_MAIL_ALERT . '</td> </tr>'; $output .= '<tr><td colspan="3" nowrap style="height:6px;"></td></tr> <tr> <td align="right" nowrap="nowrap"><a href="javascript:void(0);" onclick="appPopupWindow(\'mail_preview.html\',\'message\')">[ ' . _PREVIEW . ' ]</a></td> <td></td> <td> <div style="float:left"><input type="checkbox" class="form_checkbox" name="send_copy_to_admin" id="send_copy_to_admin" ' . ($send_copy_to_admin == '1' ? 'checked="checked"' : '') . ' value="1"> <label for="send_copy_to_admin">' . _SEND_COPY_TO_ADMIN . '</label></div> <div style="float:right"><input class="form_button" type="submit" name="btnSubmit" value="' . _SEND . '" onclick="return OnSubmit_Check();"> </div> </td> </tr> </table> </fieldset> </td> <td align="left" valign="top"> <fieldset style="padding-' . Application::Get('defined_right') . ':10px;"> <legend>' . _PREDEFINED_CONSTANTS . ':</legend> <ul> <li>{FIRST NAME} <br><span style="color:a0a0a0">' . _PC_FIRST_NAME_TEXT . '</span></li> <li>{LAST NAME} <br><span style="color:a0a0a0">' . _PC_LAST_NAME_TEXT . '</span></li> <li>{USER NAME} <br><span style="color:a0a0a0">' . _PC_USER_NAME_TEXT . '</span></li> <li>{USER EMAIL} <br><span style="color:a0a0a0">' . _PC_USER_EMAIL_TEXT . '</span></li> <li>{BASE URL} <br><span style="color:a0a0a0">' . _PC_WEB_SITE_BASED_URL_TEXT . '</span></li> <li>{WEB SITE} <br><span style="color:a0a0a0">' . _PC_WEB_SITE_URL_TEXT . '</span></li> <li>{YEAR} <br><span style="color:a0a0a0">' . _PC_YEAR_TEXT . '</span></li> </ul> </fieldset> </td> </tr> </table> </form>'; if ($draw) { echo $output; } else { return $output; } }
/** * Draws all active plans * @param $draw */ public static function DrawPlans($draw = true) { $output = ''; $arr_durations = self::PrepareDurationsArray(); $default_payment_system = isset($_GET['payment_type']) ? $_GET['payment_type'] : ModulesSettings::Get('payments', 'default_payment_system'); $payment_type_online = ModulesSettings::Get('payments', 'payment_method_online'); $payment_type_paypal = ModulesSettings::Get('payments', 'payment_method_paypal'); $payment_type_2co = ModulesSettings::Get('payments', 'payment_method_2co'); $payment_type_authorize = ModulesSettings::Get('payments', 'payment_method_authorize'); $payment_type_cnt = ($payment_type_online === 'yes') + ($payment_type_paypal === 'yes') + ($payment_type_2co === 'yes') + ($payment_type_authorize === 'yes'); $exclude_free_plans = true; //($default_payment_system != 'online') ? true : false; $inquiry_field_visible = Modules::IsModuleInstalled('inquiries') == 'yes' ? true : false; $ratings_field_visible = Modules::IsModuleInstalled('ratings') == 'yes' ? true : false; $sql = 'SELECT ap.*, apd.name, apd.description FROM ' . TABLE_ADVERTISE_PLANS . ' ap LEFT OUTER JOIN ' . TABLE_ADVERTISE_PLANS_DESCRIPTION . ' apd ON ap.id = apd.advertise_plan_id AND apd.language_id = \'' . Application::Get('lang') . '\' WHERE 1=1 ORDER BY ap.id ASC'; //'.(($exclude_free_plans) ? ' AND ap.price != 0' : '' ).' $result = database_query($sql, DATA_AND_ROWS, ALL_ROWS); if ($result[1] > 0) { $output .= '<form name="frmAdvertiseForm" id="frmAdvertiseForm" action="index.php?customer=advertise_prepayment" method="post">'; $output .= draw_hidden_field('task', 'do_order', false); $output .= draw_token_field(false); $output .= '<div class="advertise_plans_container">'; $output .= '<table style="margin:7px 16px 0px 16px">'; $output .= '<tr><td>' . _CURRENCY . ':</td><td>' . Currencies::GetCurrenciesDDL(false) . '</td></tr>'; if ($payment_type_cnt >= 1) { ///onchange="appGoToPage(\'index.php?customer=advertise\',\'&payment_type=\'+this.value)" $output .= '<tr><td>' . _PAYMENT_TYPE . ': </td><td> <select name="payment_type" id="payment_type">'; if ($payment_type_online == 'yes') { $output .= '<option value="online" ' . ($default_payment_system == 'online' ? 'selected="selected"' : '') . '>' . _ONLINE_ORDER . '</option>'; } if ($payment_type_paypal == 'yes') { $output .= '<option value="paypal" ' . ($default_payment_system == 'paypal' ? 'selected="selected"' : '') . '>' . _PAYPAL . '</option>'; } if ($payment_type_2co == 'yes') { $output .= '<option value="2co" ' . ($default_payment_system == '2co' ? 'selected="selected"' : '') . '>2CO</option>'; } if ($payment_type_authorize == 'yes') { $output .= '<option value="authorize" ' . ($default_payment_system == 'authorize' ? 'selected="selected"' : '') . '>Authorize.Net</option>'; } $output .= '</select></td></tr>'; } else { $output .= '<tr><td colspan="2">'; $output .= draw_important_message(_NO_PAYMENT_METHODS_ALERT, false); $output .= '</td></tr>'; } $output .= '</table>'; $active_ind = '-1'; $output .= '<div class="plans_wrapper">'; $output .= '<h2>' . _SELECT_PLAN . '</h2>'; for ($i = 0; $i < $result[1]; $i++) { if ($result[0][$i]['price'] != 0 && $active_ind == '-1') { $active_ind = $i; } $duration = isset($arr_durations[$result[0][$i]['duration']]) ? $arr_durations[$result[0][$i]['duration']] : ''; $no_text = '<span class=no>' . _NO . '</span>'; $yes_text = '<span class=yes>' . _YES . '</span>'; $output .= ' <div class="item ' . ($i == $active_ind ? 'active' : ($result[0][$i]['price'] == 0 ? 'free' : '')) . '" id="item_' . $i . '"> <h3>' . $result[0][$i]['name'] . '</h3> <div class="item_text" title="' . _CLICK_TO_SELECT . '"> <label for="plan_' . $result[0][$i]['id'] . '"> ' . _DURATION . ': <b>' . $duration . '</b><br /> ' . _LISTINGS . ': <b>' . $result[0][$i]['listings_count'] . '</b><br /> ' . _CATEGORIES . ': <b>' . $result[0][$i]['categories_count'] . '</b><br /> ' . _KEYWORDS . ': <b>' . $result[0][$i]['keywords_count'] . '</b><br /> ' . _NAME . ': <b>' . ($result[0][$i]['business_name'] ? $yes_text : $no_text) . '</b><br /> ' . _DESCRIPTION . ': <b>' . ($result[0][$i]['business_description'] ? $yes_text : $no_text) . '</b><br /> ' . _LOGO . ': <b>' . ($result[0][$i]['logo'] ? $yes_text : $no_text) . '</b><br /> ' . _IMAGES . ': <b>' . $result[0][$i]['images_count'] . '</b><br /> ' . _VIDEO . ': <b>' . ($result[0][$i]['video_link'] ? $yes_text : $no_text) . '</b><br /> ' . _PHONE . ': <b>' . ($result[0][$i]['phone'] ? $yes_text : $no_text) . '</b><br /> ' . _ADDRESS . ': <b>' . ($result[0][$i]['address'] ? $yes_text : $no_text) . '</b><br /> ' . _MAP . ': <b>' . ($result[0][$i]['map'] ? $yes_text : $no_text) . '</b><br /> ' . ($inquiry_field_visible ? _INQUIRY_BUTTON . ': <b>' . ($result[0][$i]['inquiry_button'] ? $yes_text : $no_text) . '</b><br />' : '') . ' ' . ($inquiry_field_visible ? _INQUIRIES . '/' . _MONTH . ': <b>' . ($result[0][$i]['inquiries_count'] == '-1' ? '<span title="' . _UNLIMITED . '">∞</span>' : $result[0][$i]['inquiries_count']) . '</b><br />' : '') . ' ' . ($ratings_field_visible ? _RATING . ': <b>' . ($result[0][$i]['rating_button'] ? $yes_text : $no_text) . '</b><br />' : '') . ' ' . _PRICE . ': <b>' . Currencies::PriceFormat($result[0][$i]['price'] * Application::Get('currency_rate')) . '</b><br /> <div class="item_description">' . $result[0][$i]['description'] . '</div> </label> </div> <div class="item_radio">'; if ($result[0][$i]['price'] != 0) { $output .= '<input ' . ($i == $active_ind ? 'checked="checked"' : '') . ' type="radio" name="plan_id" id="plan_' . $result[0][$i]['id'] . '" value="' . $result[0][$i]['id'] . '" onclick="appSelectBlock(\'' . $i . '\');">'; } $output .= '</div> </div>'; } $output .= '</div>'; if ($payment_type_cnt >= 1) { $output .= '<div class="plan_button"><input type="submit" class="form_button" name="btnSubmit" value="' . _SUBMIT . '" /></div>'; } $output .= '</div>'; $output .= '</form><br /><br />'; } else { $output .= _NO_RECORDS_FOUND; } if ($draw) { echo $output; } else { $output; } }
public function DrawDetailsMode($rid = '0', $buttons = array('back' => true)) { $this->IncludeJSFunctions(); $this->curRecordId = $rid; $this->BeforeDetailsRecord(); $sorting_fields = self::GetParameter('sorting_fields'); $sorting_types = self::GetParameter('sorting_types'); $page = self::GetParameter('page'); $operation = self::GetParameter('operation'); $operation_type = self::GetParameter('operation_type'); $operation_field = self::GetParameter('operation_field'); $search_status = self::GetParameter('search_status'); $nl = "\n"; echo $nl . '<form name="frmMicroGrid_' . $this->tableName . '" id="frmMicroGrid_' . $this->tableName . '" action="' . $this->formActionURL . '" method="post" enctype="multipart/form-data">' . $nl; draw_hidden_field('mg_prefix', $this->uPrefix); echo $nl; draw_hidden_field('mg_action', 'details'); echo $nl; draw_hidden_field('mg_rid', $this->curRecordId); echo $nl; draw_hidden_field('mg_sorting_fields', $sorting_fields); echo $nl; draw_hidden_field('mg_sorting_types', $sorting_types); echo $nl; draw_hidden_field('mg_page', $page); echo $nl; // to prevent re-sorting on back to view mode $operation = '' draw_hidden_field('mg_operation', ''); echo $nl; draw_hidden_field('mg_operation_type', $operation_type); echo $nl; draw_hidden_field('mg_operation_field', $operation_field); echo $nl; draw_hidden_field('mg_search_status', $search_status); echo $nl; draw_hidden_field('mg_language_id', $this->languageId); echo $nl; draw_token_field(); echo $nl; // save filter (search) data for view mode if ($this->isFilteringAllowed) { foreach ($this->arrFilteringFields as $key => $val) { //if($val['type'] == 'text'){ $filter_field_value = $search_status == 'active' ? self::GetParameter('filter_by_' . $val['table'] . $val['field'], false) : ''; draw_hidden_field('filter_by_' . $val['table'] . $val['field'], $filter_field_value); echo $nl; //} } } // 1. prepare password fields foreach ($this->arrDetailsModeFields as $key => $val) { if (preg_match('/separator/i', $key) && is_array($val)) { foreach ($val as $v_key => $v_val) { if ($v_key != 'separator_info') { // prepare password if (isset($v_val['type']) && ($v_val['type'] == 'password' || $this->IsSecureField($key, $v_val))) { $password_field = $this->UncryptValue($v_key, $v_val); $this->DETAILS_MODE_SQL = str_replace($this->tableName . '.' . $v_key, $password_field, $this->DETAILS_MODE_SQL); } } } } else { // prepare password if (isset($val['type']) && ($val['type'] == 'password' || $this->IsSecureField($key, $val))) { $password_field = $this->UncryptValue($key, $val); $this->DETAILS_MODE_SQL = str_replace($this->tableName . '.' . $key, $password_field, $this->DETAILS_MODE_SQL); } } } // get result for detailed row $this->DETAILS_MODE_SQL = str_replace('_RID_', $this->curRecordId, $this->DETAILS_MODE_SQL); if ($this->debug) { $start_time = $this->GetFormattedMicrotime(); } $this->result = database_query($this->DETAILS_MODE_SQL, DATA_AND_ROWS); if ($this->debug) { $finish_time = $this->GetFormattedMicrotime(); } if ($this->debug) { $this->arrSQLs['select_details_mode'] = '<i>Retrieve Detail Mode Record</i> | T: ' . round((double) $finish_time - (double) $start_time, 4) . ' sec. <br>' . $this->DETAILS_MODE_SQL; } if (!$this->result[1]) { if ($this->debug) { echo $this->DETAILS_MODE_SQL . '<br>' . mysql_error(); } else { echo _WRONG_PARAMETER_PASSED; } return false; } //---------------------------------------------------------------------- // perform operations before drawing Details Mode $this->BeforeDetailsRecord(); // draw Details Form echo '<table width="100%" border="0" cellspacing="2" cellpadding="2" class="mgrid_table">' . $nl; if ($this->allowTopButtons) { $this->DrawDetailsModeButtons($buttons); } foreach ($this->arrDetailsModeFields as $key => $val) { if (preg_match('/separator/i', $key) && is_array($val)) { echo '</table><br>' . $nl; echo '<fieldset style="padding:5px;margin-left:5px;margin-right:10px;">' . $nl; $columns = isset($val['separator_info']['columns']) ? (int) $val['separator_info']['columns'] : 0; if (isset($val['separator_info']['legend'])) { echo '<legend>' . $val['separator_info']['legend'] . '</legend>' . $nl; } echo '<table width="100%" border="0" cellspacing="0" cellpadding="2" class="mgrid_table">' . $nl; $row_count = 0; foreach ($val as $v_key => $v_val) { if (!$this->IsVisible($v_val)) { continue; } if ($v_key != 'separator_info') { if ($columns && $row_count % $columns == 0) { if ($row_count) { echo '</tr>' . $nl; } echo '<tr id="mg_row_' . $v_key . '">' . $nl; } else { if (!$columns) { echo '<tr id="mg_row_' . $v_key . '">' . $nl; } } echo ' <td width="27%">' . $v_val['title'] . ':</td>' . $nl; echo ' <td style="padding-left:6px;">' . $this->DrawFieldByType('details', $v_key, $v_val, $this->result[0][0], false) . '</td>' . $nl; if (!$columns) { echo '</tr>' . $nl; } $row_count++; } } echo '</table>' . $nl; echo '</fieldset>' . $nl; echo '<table width="100%" border="0" cellspacing="0" cellpadding="2" class="mgrid_table">' . $nl; } else { if (!$this->IsVisible($val)) { continue; } if ($val['type'] != 'hidden') { echo '<tr id="mg_row_' . $key . '">' . $nl; echo ' <td width="25%">' . ucfirst($val['title']) . ':</td>' . $nl; echo ' <td>' . $this->DrawFieldByType('details', $key, $val, $this->result[0][0], false) . '</td>' . $nl; echo '</tr>' . $nl; } } } $this->DrawDetailsModeButtons($buttons); echo '</table><br>' . $nl; echo '</form>' . $nl; $this->AfterDetailsMode(); $this->DrawVersionInfo(); $this->DrawRunningTime(); $this->DrawErrors(); $this->DrawWarnings(); $this->DrawSQLs(); $this->DrawPostInfo(); }
/** * @project ApPHP Business Directory * @copyright (c) 2011 ApPHP * @author ApPHP <*****@*****.**> * @license http://www.gnu.org/licenses/ */ // *** Make sure the file isn't accessed directly defined('APPHP_EXEC') or die('Restricted Access'); //-------------------------------------------------------------------------- if (!$objLogin->IsLoggedIn() && ModulesSettings::Get('customers', 'allow_registration') == 'yes') { draw_title_bar(_REGISTRATION_CONFIRMATION); echo $msg; echo '<div class="pages_contents">'; if (!$confirmed) { echo '<br /> <form action="index.php?customer=confirm_registration" method="post" name="frmConfirmCode" id="frmConfirmCode"> ' . draw_token_field(false) . ' ' . draw_hidden_field('task', 'post_submission', false) . ' ' . _ENTER_CONFIRMATION_CODE . ': <input type="text" name="c" id="c" value="" size="27" maxlength="25" /><br /><br /> <input class="form_button" type="submit" name="btnSubmit" id="btnSubmit" value="Submit"> </form> <script type="text/javascript">appSetFocus("c")</script>'; } echo '</div>'; } else { draw_title_bar(prepare_breadcrumbs(array(_CUSTOMER => '', _REGISTRATION_CONFIRMATION => ''))); draw_important_message(_NOT_AUTHORIZED); }
/** * Draws the login links and logout form */ public function DrawLoginLinks() { if (Application::Get('preview') == 'yes') { return ''; } $menu_index = '0'; $text_align = Application::Get('lang_dir') == 'ltr' ? 'text-align:left;' : 'text-align:right;padding-right:15px;'; // --------------------------------------------------------------------- // MAIN ADMIN LINKS if ($this->IsLoggedInAsAdmin()) { draw_block_top(_MENUS . ': [ <a id="lnk_all_open" href="javascript:void(0);" onclick="javascript:toggle_menus(1)">' . _OPEN . '</a> | <a id="lnk_all_close" href="javascript:void(0);" onclick="javascript:toggle_menus(0)">' . _CLOSE . '</a> ]'); draw_block_bottom(); draw_block_top(_GENERAL, $menu_index++, 'maximized'); echo '<ul>'; echo '<li>' . $this->PrepareLink('home', _HOME) . '</li>'; if ($this->IsLoggedInAs('owner', 'mainadmin')) { echo '<li>' . $this->PrepareLink('settings', _SETTINGS) . '</li>'; } echo '<li>' . $this->PrepareLink('ban_list', _BAN_LIST) . '</li>'; if ($this->IsLoggedInAs('owner', 'mainadmin')) { echo '<li>' . $this->PrepareLink('countries_management', _COUNTRIES) . '</li>'; } echo '<li>' . prepare_permanent_link('index.php?preview=yes', _PREVIEW . ' <img src="images/external_link.gif" alt="" />') . '</li>'; echo '</ul>'; draw_block_bottom(); draw_block_top(_ACCOUNTS_MANAGEMENT, $menu_index++); echo '<div class="menu_category">'; echo '<ul>'; echo '<li>' . $this->PrepareLink('my_account', _MY_ACCOUNT) . '</li>'; if (Modules::IsModuleInstalled('customers') && $this->IsLoggedInAs('owner', 'mainadmin')) { echo '<li>' . $this->PrepareLink('statistics', _STATISTICS) . '</li>'; } if ($this->IsLoggedInAs('owner')) { echo '<li>' . $this->PrepareLink('roles_management', _ROLES_AND_PRIVILEGES, '', '', array('role_privileges_management')) . '</li>'; } echo '</ul>'; if ($this->IsLoggedInAs('owner', 'mainadmin')) { echo '<label>' . _ADMINS_MANAGEMENT . '</label>'; echo '<ul>'; echo '<li>' . $this->PrepareLink('admins_management', _ADMINS) . '</li>'; echo '</ul>'; } if (Modules::IsModuleInstalled('customers') && $this->IsLoggedInAs('owner', 'mainadmin')) { echo '<label>' . _CUSTOMERS_MANAGEMENT . '</label>'; echo '<ul>'; echo '<li>' . $this->PrepareLink('mod_customers_groups', _CUSTOMER_GROUPS) . '</li>'; echo '<li>' . $this->PrepareLink('mod_customers_management', _CUSTOMERS) . '</li>'; echo '</ul>'; } echo '</div>'; draw_block_bottom(); if ($this->IsLoggedInAs('owner', 'mainadmin')) { draw_block_top(_LISTINGS_MANAGEMENT, $menu_index++); echo '<div class="menu_category">'; if ($this->IsLoggedInAs('owner', 'mainadmin')) { echo '<label>' . _SETTINGS . '</label>'; echo '<ul>'; echo '<li>' . $this->PrepareLink('mod_listings_settings', _LISTINGS_SETTINGS) . '</li>'; echo '<li>' . $this->PrepareLink('mod_listings_locations', _LOCATIONS, '', '', array('mod_listings_sub_locations')) . '</li>'; if (Modules::IsModuleInstalled('inquiries')) { echo '<li>' . $this->PrepareLink('mod_listings_integration', _INTEGRATION) . '</li>'; } echo '</ul>'; } echo '<label>' . _LISTINGS . '</label>'; echo '<ul>'; echo '<li>' . $this->PrepareLink('mod_categories', _CATEGORIES) . '</li>'; echo '<li>' . $this->PrepareLink('mod_listings_management', _LISTINGS, '', '', array('mod_listings_categories')) . '</li>'; echo '</ul>'; echo '</div>'; draw_block_bottom(); } if (Modules::IsModuleInstalled('payments')) { draw_block_top(_PAYMENTS, $menu_index++); echo '<ul>'; if ($this->IsLoggedInAs('owner', 'mainadmin')) { echo '<li>' . $this->PrepareLink('mod_payments_currencies', _CURRENCIES) . '</li>'; echo '<li>' . $this->PrepareLink('mod_payments_advertise_plans', _ADVERTISE_PLANS) . '</li>'; echo '<li>' . $this->PrepareLink('mod_payments_orders', _ORDERS) . '</li>'; } echo '<li>' . $this->PrepareLink('mod_payments_statistics', _STATISTICS) . '</li>'; echo '</ul>'; draw_block_bottom(); } if ($this->HasPrivileges('add_menus') || $this->HasPrivileges('edit_menus') || $this->HasPrivileges('add_pages') || $this->HasPrivileges('edit_pages')) { draw_block_top(_MENUS_AND_PAGES, $menu_index++); echo '<div class="menu_category">'; if ($this->HasPrivileges('add_menus') || $this->HasPrivileges('edit_menus')) { echo '<label>' . _MENU_MANAGEMENT . '</label>'; echo '<ul>'; if ($this->HasPrivileges('add_menus')) { echo '<li>' . $this->PrepareLink('menus_add', _ADD_NEW_MENU) . '</li>'; } echo '<li>' . $this->PrepareLink('menus', _EDIT_MENUS, '', '', array('menus_edit')) . '</li>'; echo '</ul>'; } if ($this->HasPrivileges('add_pages') || $this->HasPrivileges('edit_pages')) { echo '<label>' . _PAGE_MANAGEMENT . '</label>'; echo '<ul>'; if ($this->HasPrivileges('add_pages')) { echo '<li>' . $this->PrepareLink('pages_add', _PAGE_ADD_NEW) . '</li>'; } if ($this->HasPrivileges('edit_pages')) { echo '<li>' . $this->PrepareLink('pages_edit', _PAGE_EDIT_HOME, 'type=home') . '</li>'; } echo '<li>' . $this->PrepareLink('pages', _PAGE_EDIT_PAGES, 'type=general') . '</li>'; if ($this->HasPrivileges('edit_pages')) { echo '<li>' . $this->PrepareLink('pages', _PAGE_EDIT_SYS_PAGES, 'type=system') . '</li>'; } if ($this->HasPrivileges('edit_pages')) { echo '<li>' . $this->PrepareLink('pages_trash', _TRASH) . '</li>'; } echo '</ul>'; } echo '</div>'; draw_block_bottom(); } draw_block_top(_LANGUAGES_SETTINGS, $menu_index++); echo '<ul>'; if ($this->IsLoggedInAs('owner', 'mainadmin')) { echo '<li>' . $this->PrepareLink('languages', _LANGUAGES, '', '', array('languages_add', 'languages_edit')) . '</li>'; } echo '<li>' . $this->PrepareLink('vocabulary', _VOCABULARY, 'filter_by=A') . '</li>'; echo '</ul>'; draw_block_bottom(); if ($this->IsLoggedInAs('owner', 'mainadmin')) { draw_block_top(_MASS_MAIL_AND_TEMPLATES, $menu_index++); echo '<ul>'; if ($this->IsLoggedInAs('owner', 'mainadmin')) { echo '<li>' . $this->PrepareLink('email_templates', _EMAIL_TEMPLATES) . '</li>'; } if ($this->IsLoggedInAs('owner', 'mainadmin')) { echo '<li>' . $this->PrepareLink('mass_mail', _MASS_MAIL) . '</li>'; } echo '</ul>'; draw_block_bottom(); } // MODULES $sql = 'SELECT * FROM ' . TABLE_MODULES . ' WHERE is_installed = 1 AND is_system = 0 ORDER BY priority_order ASC'; $modules = database_query($sql, DATA_AND_ROWS, ALL_ROWS); $modules_output = ''; for ($i = 0; $i < $modules[1]; $i++) { $output = ''; if ($modules[0][$i]['settings_access_by'] == '' || $modules[0][$i]['settings_access_by'] != '' && $this->IsLoggedInAs($modules[0][$i]['settings_access_by'])) { if ($modules[0][$i]['settings_const'] != '') { $output .= '<li>' . $this->PrepareLink($modules[0][$i]['settings_page'], constant($modules[0][$i]['settings_const'])) . '</li>'; } } if ($modules[0][$i]['management_access_by'] == '' || $modules[0][$i]['management_access_by'] != '' && $this->IsLoggedInAs($modules[0][$i]['management_access_by'])) { $management_pages = explode(',', $modules[0][$i]['management_page']); $management_consts = explode(',', $modules[0][$i]['management_const']); $management_pages_total = count($management_pages); for ($j = 0; $j < $management_pages_total; $j++) { if (isset($management_pages[$j]) && isset($management_consts[$j]) && $management_consts[$j] != '') { $output .= '<li>' . $this->PrepareLink($management_pages[$j], constant($management_consts[$j])) . '</li>'; } } } if ($output) { $modules_output .= '<label>' . constant($modules[0][$i]['name_const']) . '</label>'; $modules_output .= '<ul>' . $output . '</ul>'; } } if (!empty($modules_output)) { draw_block_top(_MODULES, $menu_index++); if ($this->IsLoggedInAs('owner', 'mainadmin')) { echo '<ul>'; echo '<li>' . $this->PrepareLink('modules', _MODULES_MANAGEMENT) . '</li>'; echo '</ul>'; } echo '<div class="menu_category">' . $modules_output . '</div>'; draw_block_bottom(); } } // --------------------------------------------------------------------- // CUSTOMER LINKS if ($this->IsLoggedInAsCustomer()) { draw_block_top(_MY_ACCOUNT); echo '<ul>'; echo '<li>' . prepare_permanent_link('index.php?page=home', _HOME, '', Application::Get('page') == 'home' && Application::Get('customer') == '' ? 'active' : '') . '</li>'; echo '<li>' . $this->PrepareLink('home', _DASHBOARD) . '</li>'; echo '<li>' . $this->PrepareLink('my_account', _EDIT_MY_ACCOUNT) . '</li>'; echo '<li>' . $this->PrepareLink('my_listings', _MY_LISTINGS, '', '', array('listings_categories')) . '</li>'; if (Modules::IsModuleInstalled('payments') && ModulesSettings::Get('payments', 'is_active') == 'yes') { echo '<li>' . $this->PrepareLink('advertise', _ADVERTISE, '', '', array('advertise_prepayment', 'order_proccess')) . '</li>'; echo '<li>' . $this->PrepareLink('my_orders', _MY_ORDERS) . '</li>'; } if (Modules::IsModuleInstalled('inquiries')) { echo '<li>' . $this->PrepareLink('inquiries', _INQUIRIES) . '</li>'; } echo '</ul>'; draw_block_bottom(); } // Logout if ($this->IsLoggedIn()) { draw_block_top_empty(); echo '<form action="index.php" method="post"> ' . draw_hidden_field('submit_logout', 'logout', false) . ' ' . draw_token_field(false) . ' <input class="form_button" type="submit" name="btnLogout" value="' . _BUTTON_LOGOUT . '" /> </form>'; draw_block_bottom(); echo '<br />'; } $this->activeMenuCount = $menu_index; }
/** * Draws Contact Us form * @param $draw */ public function DrawContactUsForm($draw = true) { global $objSettings, $objSiteDescription, $objLogin; $align_left = Application::Get('defined_left'); $align_right = Application::Get('defined_right'); if (!Modules::IsModuleInstalled('contact_us')) { return ''; } $output = ''; $from_email = $objSettings->GetParameter('admin_email'); $admin_email = ModulesSettings::Get('contact_us', 'email'); $delay_length = ModulesSettings::Get('contact_us', 'delay_length'); $is_send_delay = ModulesSettings::Get('contact_us', 'is_send_delay'); $image_verification = ModulesSettings::Get('contact_us', 'image_verification_allow'); $focus_element = ''; // post fields $task = isset($_POST['task']) ? prepare_input($_POST['task']) : ''; $first_name = isset($_POST['first_name']) ? prepare_input($_POST['first_name']) : ''; $last_name = isset($_POST['last_name']) ? prepare_input($_POST['last_name']) : ''; $email = isset($_POST['email']) ? prepare_input($_POST['email']) : ''; $phone = isset($_POST['phone']) ? prepare_input($_POST['phone']) : ''; $subject = isset($_POST['subject']) ? prepare_input($_POST['subject']) : ''; $message = isset($_POST['message']) ? prepare_input($_POST['message']) : ''; $captcha_code = isset($_POST['captcha_code']) ? prepare_input($_POST['captcha_code']) : ''; $msg = ''; $contact_mail_sent = (bool) Session::Get('contact_mail_sent'); $contact_mail_sent_time = Session::Get('contact_mail_sent_time'); if ($image_verification == 'yes') { include_once 'modules/captcha/securimage.php'; $objImg = new Securimage(); } if ($task == 'contact') { $time_elapsed = time_diff(date('Y-m-d H:i:s'), $contact_mail_sent_time); if ($contact_mail_sent && $is_send_delay == 'yes' && $time_elapsed < $delay_length) { $msg = draw_message(str_replace('_WAIT_', $delay_length - $time_elapsed, _CONTACT_US_ALREADY_SENT), false); } else { if ($first_name == '') { $msg = draw_important_message(_FIRST_NAME_EMPTY_ALERT, false); $focus_element = 'first_name'; } else { if ($last_name == '') { $msg = draw_important_message(_LAST_NAME_EMPTY_ALERT, false); $focus_element = 'last_name'; } else { if ($email == '') { $msg = draw_important_message(_EMAIL_EMPTY_ALERT, false); $focus_element = 'email'; } else { if ($email != '' && !check_email_address($email)) { $msg = draw_important_message(_EMAIL_VALID_ALERT, false); $focus_element = 'email'; } else { if ($subject == '') { $msg = draw_important_message(_SUBJECT_EMPTY_ALERT, false); $focus_element = 'subject'; #}else if($phone == ''){ # $msg = draw_important_message(str_replace('_FIELD_', _PHONE, _FIELD_CANNOT_BE_EMPTY), false); # $focus_element = 'phone'; } else { if ($message == '') { $msg = draw_important_message(_MESSAGE_EMPTY_ALERT, false); $focus_element = 'message'; } else { if (strlen($message) > 1024) { $msg = draw_important_message(str_replace(array('_FIELD_', '_LENGTH_'), array('<b>' . _MESSAGE . '</b>', 1024), _FIELD_LENGTH_EXCEEDED), false); $focus_element = 'message'; } else { if ($image_verification == 'yes' && !$objImg->check($captcha_code)) { $msg = draw_important_message(_WRONG_CODE_ALERT, false); $focus_element = 'captcha_code'; } } } } } } } } // deny all operations in demo version if (strtolower(SITE_MODE) == 'demo') { $msg = draw_important_message(_OPERATION_BLOCKED, false); } if ($msg == '') { //////////////////////////////////////////////////////////// send_email_wo_template($admin_email, $from_email, 'Question from visitor (via Contact Us - ' . $objSiteDescription->GetParameter('header_text') . ')', _FIRST_NAME . ': ' . str_replace('\\', '', $first_name) . '<br />' . _LAST_NAME . ': ' . str_replace('\\', '', $last_name) . '<br />' . _EMAIL_ADDRESS . ': ' . str_replace('\\', '', $email) . '<br />' . _PHONE . ': ' . str_replace('\\', '', $phone) . '<br />' . _SUBJECT . ': ' . str_replace('\\', '', $subject) . '<br />' . _MESSAGE . ': ' . str_replace('\\', '', $message)); //////////////////////////////////////////////////////////// $msg = draw_success_message(_CONTACT_US_EMAIL_SENT, false); Session::Set('contact_mail_sent', true); Session::Set('contact_mail_sent_time', date('Y-m-d H:i:s')); $first_name = $last_name = $email = $phone = $subject = $message = ''; } } } $output .= ($msg != '' ? $msg . '<br />' : '') . ' <form method="post" name="frmContactUs" id="frmContactUs"> ' . draw_hidden_field('task', 'contact', false) . ' ' . draw_token_field(false) . ' <table class="tblContactUs" border="0" width="99%"> <tbody> <tr> <td width="25%" align="' . $align_right . '">' . _FIRST_NAME . ':</td> <td><span class="mandatory_star">*</span></td> <td nowrap="nowrap" align="' . $align_left . '"><input type="text" id="first_name" name="first_name" size="34" maxlength="40" value="' . decode_text($first_name) . '" autocomplete="off" /></td> </tr> <tr> <td align="' . $align_right . '">' . _LAST_NAME . ':</td> <td><span class="mandatory_star">*</span></td> <td nowrap="nowrap" align="' . $align_left . '"><input type="text" id="last_name" name="last_name" size="34" maxlength="40" value="' . decode_text($last_name) . '" autocomplete="off" /></td> </tr> <tr> <td align="' . $align_right . '">' . _EMAIL_ADDRESS . ':</td> <td><span class="mandatory_star">*</span></td> <td nowrap="nowrap" align="' . $align_left . '"><input type="text" id="email" name="email" size="34" maxlength="70" value="' . decode_text($email) . '" autocomplete="off" /></td> </tr> <tr> <td align="' . $align_right . '">' . _PHONE . ':</td> <td></td> <td nowrap="nowrap" align="' . $align_left . '"><input type="text" id="phone" name="phone" size="22" maxlength="40" value="' . decode_text($phone) . '" autocomplete="off" /></td> </tr> <tr> <td align="' . $align_right . '">' . _SUBJECT . ':</td> <td><span class="mandatory_star">*</span></td> <td nowrap="nowrap" align="' . $align_left . '"><input type="text" id="subject" name="subject" style="width:385px;" maxlength="128" value="' . decode_text($subject) . '" autocomplete="off" /></td> </tr> <tr valign="top"> <td align="' . $align_right . '">' . _MESSAGE . ':</td> <td><span class="mandatory_star">*</span></td> <td nowrap="nowrap" align="' . $align_left . '"> <textarea id="message" name="message" style="width:385px;" maxlength="1024" rows="8">' . $message . '</textarea> </td> </tr> <tr> <td colspan="2"></td> <td>'; if ($image_verification == 'yes') { $output .= '<table border="0"> <tr> <td> <img id="captcha_image" src="' . APPHP_BASE . 'modules/captcha/securimage_show.php?sid=' . md5(uniqid(time())) . '" /> </td> <td width="30px" align="center"> <img style="cursor:pointer; padding:0px; margin:0px;" id="captcha_image_reload" src="modules/captcha/images/refresh.gif" style="cursor:pointer;" onclick="document.getElementById(\'captcha_image\').src = \'modules/captcha/securimage_show.php?sid=\' + Math.random(); appSetFocus(\'captcha_code\'); return false;" title="' . _REFRESH . '" alt="' . _REFRESH . '" /><br /> <a href="modules/captcha/securimage_play.php"><img border="0" style="padding:0px; margin:0px;" id="captcha_image_play" src="modules/captcha/images/audio_icon.gif" title="' . _PLAY . '" alt="' . _PLAY . '" /></a> </td> <td align="left"> ' . _TYPE_CHARS . '<br /> <input type="text" name="captcha_code" id="captcha_code" style="width:175px;margin-top:5px;" value="" maxlength="20" autocomplete="off" /> </td> </tr> </table>'; } $output .= '</td> </tr> <tr><td height="25" nowrap colspan="3"></td></tr> <tr> <td colspan="3" align="center"> <input type="submit" ' . ($objLogin->IsLoggedInAsAdmin() ? 'disabled' : '') . ' class="form_button" name="btnSubmitPD" id="btnSubmitPD" value="' . _SEND . '" /> </td> </tr> <tr><td height="25" nowrap colspan="3"></td></tr> </table> </form>'; if ($focus_element != '') { $output .= '<script type="text/javascript">appSetFocus(\'' . $focus_element . '\');</script>'; } if ($draw) { echo $output; } else { return $output; } }