b_city = \'' . encode_text($b_city) . '\', b_zipcode = \'' . encode_text($b_zipcode) . '\', b_country = \'' . encode_text($b_country) . '\', b_state = \'' . encode_text($b_state) . '\', phone = \'' . encode_text($phone) . '\', fax = \'' . encode_text($fax) . '\', email = \'' . encode_text($email) . '\', url = \'' . encode_text($url) . '\', ' . ($user_password1 != '' && $user_password2 != '' ? $user_password . ',' : '') . ' preferred_language = \'' . $selLanguages . '\', notification_status_changed = IF(email_notifications <> \'' . $send_updates . '\', \'' . date('Y-m-d H:i:s') . '\', notification_status_changed), email_notifications = \'' . $send_updates . '\' WHERE id = ' . (int) $objLogin->GetLoggedID(); if (database_void_query($sql) > 0) { $objLogin->UpdateLoggedEmail($email); $objLogin->UpdateLoggedFirstName(encode_text($first_name)); $objLogin->UpdateLoggedLastName(encode_text($last_name)); $msg = draw_success_message(_ACCOUNT_WAS_UPDATED, false); } else { $msg = draw_important_message(_UPDATING_ACCOUNT_ERROR, false); } } } $objCustomers = new Customers(); $customer_info = $objCustomers->GetInfoByID($objLogin->GetLoggedID()); $total_groups = CustomerGroups::GetAllGroups(); $arr_groups = array(); foreach ($total_groups[0] as $key => $val) { $arr_groups[$val['id']] = $val['name']; } }
/** * Sends mass mail */ public function SendMassMail() { global $objSettings; $template_name = isset($_POST['template_name']) ? prepare_input($_POST['template_name']) : ''; $email_from = isset($_POST['email_from']) ? prepare_input($_POST['email_from']) : ''; $email_to_req = isset($_POST['email_to']) ? prepare_input($_POST['email_to']) : ''; $subject = isset($_POST['subject']) ? prepare_input($_POST['subject']) : ''; $message = isset($_POST['message']) ? prepare_input($_POST['message']) : ''; $package_size = isset($_POST['package_size']) ? prepare_input($_POST['package_size']) : ''; $duration = isset($_POST['duration']) ? (int) $_POST['duration'] : '5'; $send_copy_to_admin = isset($_POST['send_copy_to_admin']) ? prepare_input($_POST['send_copy_to_admin']) : ''; $admin_email = $objSettings->GetParameter('admin_email'); $email_session_code = Session::Get('email_random_code'); $email_post_code = isset($_POST['email_random_code']) ? prepare_input($_POST['email_random_code']) : ''; $msg = ''; $emails_total = '0'; $emails_sent = '0'; if (strtolower(SITE_MODE) == 'demo') { draw_important_message(_OPERATION_BLOCKED); return false; } if ($email_post_code != '' && $email_session_code == $email_post_code) { $this->error = true; draw_message(_OPERATION_WAS_ALREADY_COMPLETED); return false; } // handle emails sending if ($subject != '' && $message != '') { $message = str_ireplace('{YEAR}', date('Y'), $message); $message = str_ireplace('{WEB SITE}', $_SERVER['SERVER_NAME'], $message); $message = str_ireplace('{BASE URL}', APPHP_BASE, $message); $email_to_parts = explode('|', $email_to_req); $email_to = isset($email_to_parts[0]) ? $email_to_parts[0] : ''; $email_to_subtype = isset($email_to_parts[1]) ? $email_to_parts[1] : ''; if ($email_to_subtype == 'all') { $member_where_clause = ''; } else { if ($email_to_subtype == 'uncategorized') { $member_where_clause = 'group_id=0 AND'; } else { if ($email_to_subtype != '') { $member_where_clause = 'group_id=' . $email_to_subtype . ' AND'; } else { $member_where_clause = ''; } } } if ($email_to == 'test') { $emails_total = '1'; if (send_email_wo_template($admin_email, $admin_email, $subject, $message)) { $emails_sent = '1'; } } else { $result = database_query('SELECT COUNT(*) as cnt FROM ' . $this->TABLE_NAME . ' WHERE is_active = 1 AND ' . $member_where_clause . ' email_notifications = 1 AND email != \'\'', DATA_ONLY, FIRST_ROW_ONLY); $members_emails_total = $result['cnt']; $result = database_query('SELECT COUNT(*) as cnt FROM ' . TABLE_ACCOUNTS . ' WHERE is_active = 1 AND email != \'\'', DATA_ONLY, FIRST_ROW_ONLY); $admins_emails_total = $result['cnt']; $result = database_query('SELECT COUNT(*) as cnt FROM ' . TABLE_NEWS_SUBSCRIBED . ' WHERE email != \'\'', DATA_ONLY, FIRST_ROW_ONLY); $newsletter_email_total = $result['cnt']; if ($email_to == 'members') { $emails_total = $members_emails_total; } else { if ($email_to == 'admins') { $emails_total = $admins_emails_total; } else { if ($email_to == 'all') { $emails_total = $members_emails_total + $admins_emails_total; } else { if ($email_to == 'newsletter_subscribers') { $emails_total = $newsletter_email_total; } } } } if ($email_to == 'members' || $email_to == 'all') { $sql = 'SELECT id, first_name, last_name, email, user_name FROM ' . $this->TABLE_NAME . ' WHERE is_active = 1 AND ' . $member_where_clause . ' email_notifications = 1 AND email != \'\' ORDER BY id ASC'; $result = database_query($sql, DATA_AND_ROWS, ALL_ROWS); for ($i = 0; $i < $result[1]; $i++) { $body_middle = str_ireplace('{FIRST NAME}', $result[0][$i]['first_name'], $message); $body_middle = str_ireplace('{LAST NAME}', $result[0][$i]['last_name'], $body_middle); $body_middle = str_ireplace('{USER NAME}', $result[0][$i]['user_name'], $body_middle); $body_middle = str_ireplace('{USER EMAIL}', $result[0][$i]['email'], $body_middle); if (send_email_wo_template($result[0][$i]['email'], $admin_email, $subject, $body_middle)) { $emails_sent++; } } } if ($email_to == 'admins' || $email_to == 'all') { $sql = 'SELECT id, first_name, last_name, email, user_name FROM ' . TABLE_ACCOUNTS . ' WHERE is_active = 1 AND email != \'\' ORDER BY id ASC'; $result = database_query($sql, DATA_AND_ROWS, ALL_ROWS); for ($i = 0; $i < $result[1]; $i++) { $body_middle = str_ireplace('{FIRST NAME}', $result[0][$i]['first_name'], $message); $body_middle = str_ireplace('{LAST NAME}', $result[0][$i]['last_name'], $body_middle); $body_middle = str_ireplace('{USER NAME}', $result[0][$i]['user_name'], $body_middle); $body_middle = str_ireplace('{USER EMAIL}', $result[0][$i]['email'], $body_middle); if (send_email_wo_template($result[0][$i]['email'], $admin_email, $subject, $body_middle)) { $emails_sent++; } } } if ($email_to == 'newsletter_subscribers') { $sql = 'SELECT email FROM ' . TABLE_NEWS_SUBSCRIBED . ' WHERE email != \'\' ORDER BY id ASC'; $result = database_query($sql, DATA_AND_ROWS, ALL_ROWS); for ($i = 0; $i < $result[1]; $i++) { $body_middle = $message; if (send_email_wo_template($result[0][$i]['email'], $admin_email, $subject, $body_middle)) { $emails_sent++; } } } if ($send_copy_to_admin == '1') { send_email_wo_template($admin_email, $admin_email, $subject . ' (admin copy)', $message); } } if ($emails_sent) { Session::Set('email_random_code', $email_post_code); $msg = str_replace('_SENT_', $emails_sent, _EMAILS_SUCCESSFULLY_SENT); $msg = str_replace('_TOTAL_', $emails_total, $msg); $this->error = false; draw_success_message($msg); } else { $this->error = true; draw_important_message(_EMAILS_SENT_ERROR); } } else { draw_important_message(_EMAIL_FIELDS_EMPTY_ALERT); } }
* @project ApPHP Business Directory * @copyright (c) 2012 ApPHP * @author ApPHP <*****@*****.**> * @license http://www.gnu.org/licenses/ */ // *** Make sure the file isn't accessed directly defined('APPHP_EXEC') or die('Restricted Access'); //-------------------------------------------------------------------------- $act = isset($_POST['act']) ? prepare_input($_POST['act']) : ''; $password_sent = (bool) Session::Get('activation_email_resent'); $email = isset($_POST['email']) ? prepare_input($_POST['email']) : ''; $msg = ''; if ($act == 'resend') { if (!$password_sent) { if (Customers::Reactivate($email)) { $msg = draw_success_message(str_replace('_EMAIL_', $email, _ACTIVATION_EMAIL_WAS_SENT), false); Session::Set('activation_email_resent', true); } else { $msg = draw_important_message(Customers::GetStaticError(), false); } } else { $msg = draw_message(_ACTIVATION_EMAIL_ALREADY_SENT, false); } } // 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">
/** * Draws article comments * @param $article_id * @param $draw */ public function DrawArticleComments($article_id = '', $draw = true) { if (!$article_id) { return ''; } global $objLogin; $delete_pending_time = ModulesSettings::Get('comments', 'delete_pending_time'); $user_type = ModulesSettings::Get('comments', 'user_type'); $comment_length = ModulesSettings::Get('comments', 'comment_length'); $image_verification = ModulesSettings::Get('comments', 'image_verification_allow'); $comments_on_page = ModulesSettings::Get('comments', 'page_size'); $is_published = ModulesSettings::Get('comments', 'pre_moderation_allow') == 'yes' ? '0' : '1'; if ($image_verification == 'yes') { include_once 'modules/captcha/securimage.php'; $objImg = new Securimage(); } //echo '<pre>'; //print_r($_SERVER); //echo '</pre>'; $task = isset($_POST['task']) ? prepare_input($_POST['task']) : ''; $comment_id = isset($_POST['comment_id']) ? (int) $_POST['comment_id'] : ''; $init_state = 'closed'; $user_id = isset($_POST['user_id']) ? (int) $_POST['user_id'] : ''; $user_name = isset($_POST['comment_user_name']) ? prepare_input($_POST['comment_user_name']) : ''; $user_email = isset($_POST['comment_user_email']) ? prepare_input($_POST['comment_user_email']) : ''; $comment_text = isset($_POST['comment_text']) ? prepare_input($_POST['comment_text']) : ''; $captcha_code = isset($_POST['captcha_code']) ? prepare_input($_POST['captcha_code']) : ''; $msg = ''; $task_completed = false; $focus_field = ''; $current_page = isset($_GET['p']) ? abs((int) $_GET['p']) : '1'; if ($task == 'publish_comment') { $init_state = 'opened'; if ($user_name == '') { $msg = draw_important_message(_USERNAME_EMPTY_ALERT, false); $focus_field = 'comment_user_name'; } else { if (!check_email_address($user_email) && !$objLogin->IsLoggedInAs($this->user_type_name)) { $msg = draw_important_message(_EMAIL_IS_WRONG, false); $focus_field = 'comment_user_email'; } else { if ($comment_text == '') { $msg = draw_important_message(_MESSAGE_EMPTY_ALERT, false); $focus_field = 'comment_text'; } else { if ($comment_text != '' && strlen($comment_text) > $comment_length) { $msg = draw_important_message(str_replace('_LENGTH_', $comment_length, _COMMENT_LENGTH_ALERT), false); $focus_field = 'comment_text'; } else { if ($image_verification == 'yes' && !$objImg->check($captcha_code)) { $msg = draw_important_message(_WRONG_CODE_ALERT, false); $focus_field = 'captcha_code'; } else { // Block operation in demo mode if (strtolower(SITE_MODE) == 'demo') { $msg = draw_important_message(_OPERATION_BLOCKED, false); } else { if ($objLogin->IpAddressBlocked(get_current_ip())) { $msg = draw_important_message(_IP_ADDRESS_BLOCKED, false); } else { if ($objLogin->EmailBlocked($user_email)) { $msg = draw_important_message(_EMAIL_BLOCKED, false); } else { $sql = 'INSERT INTO ' . TABLE_COMMENTS . '( id, article_id, user_id, user_name, user_email, comment_text, date_created, date_published, is_published )VALUES( NULL, ' . (int) $article_id . ', ' . (int) $user_id . ', \'' . encode_text($user_name) . '\', \'' . encode_text($user_email) . '\', \'' . encode_text(strip_tags($comment_text, '<b><i><u><br>')) . '\', \'' . date('Y-m-d H:i:s') . '\', \'' . ($is_published == '1' ? date('Y-m-d H:i:s') : '0000-00-00 00:00:00') . '\', \'' . $is_published . '\' )'; if (database_void_query($sql)) { if ($is_published == '1') { $msg = draw_success_message(_COMMENT_POSTED_SUCCESS, false); } else { $msg = draw_success_message(_COMMENT_SUBMITTED_SUCCESS, false); } $task_completed = true; } else { $msg = draw_important_message(_TRY_LATER, false); } } } } } } } } } } else { if ($task == 'delete_comment') { $init_state = 'opened'; $sql = 'DELETE FROM ' . $this->tableName . ' WHERE TIMESTAMPDIFF(MINUTE, date_published, \'' . date('Y-m-d H:i:s') . '\') < ' . $delete_pending_time . ' AND id = ' . (int) $comment_id; if (database_void_query($sql)) { $msg = draw_success_message(_COMMENT_DELETED_SUCCESS, false); } else { $msg = draw_important_message(_TRY_LATER, false); } } } // -------- pagination $total_comments = 0; $page_size = $comments_on_page; $sql = 'SELECT COUNT(*) as cnt FROM ' . TABLE_COMMENTS . ' WHERE is_published = 1 AND article_id = ' . (int) $article_id; $comments_result = database_query($sql, DATA_ONLY, FIRST_ROW_ONLY); $total_comments = $comments_result['cnt']; $total_pages = (int) ($total_comments / $page_size); if ($current_page > $total_pages + 1) { $current_page = 1; } if ($total_comments % $page_size != 0) { $total_pages++; } if ($task_completed) { $current_page = $total_pages; } if (!is_numeric($current_page) || (int) $current_page <= 0) { $current_page = 1; } $start_row = ($current_page - 1) * $page_size; if (isset($_GET['p'])) { $init_state = 'opened'; } // -------- $sql = 'SELECT * FROM ' . TABLE_COMMENTS . ' WHERE article_id = ' . (int) $article_id . ' AND is_published = 1 ORDER BY date_published ASC LIMIT ' . $start_row . ', ' . $page_size; $result = database_query($sql, DATA_AND_ROWS); $output = '<script type="text/javascript">function deleteComment(cid) { if(confirm(\'' . _PERFORM_OPERATION_COMMON_ALERT . '\')){ jQuery(\'#comment_task\').val(\'delete_comment\'); jQuery(\'#comment_id\').val(cid); jQuery(\'#frmComments\').submit(); return true; } return false; } </script>'; $output .= '<div id="commentsLink"><a href="javascript:void(0);" onclick="javascript:jQuery(\'#commentsWrapper\').slideToggle(\'fast\');">' . str_replace('_COUNT_', $total_comments, _COMMENTS_LINK) . '</a><br /><br /></div>'; $output .= '<div id="commentsWrapper" style="display:' . ($init_state == 'opened' ? '' : 'none') . ';">'; $output .= '<div id="commentsPublished">'; if ($result[1] > 0) { for ($i = 0; $i < $result[1]; $i++) { $output .= '<div class="comment">'; $output .= '<div class="comment_user_name"><b>' . $result[0][$i]['user_name'] . '</b> ' . _SAID . '...</div>'; $output .= '<div class="comment_test">' . $result[0][$i]['comment_text'] . '</div>'; $output .= '<div class="comment_date">'; if ($result[0][$i]['user_id'] == $objLogin->GetLoggedID() && floor(time_diff(date('Y-m-d H:i:s'), $result[0][$i]['date_published']) / 60) < $delete_pending_time) { $output .= '<img src="images/published_x.gif" alt="" style="cursor:pointer;margin-bottom:-3px;margin-right:3px;" onclick="deleteComment(\'' . $result[0][$i]['id'] . '\');">'; } $output .= '<i>' . _PUBLISHED . ': ' . format_datetime($result[0][$i]['date_published']) . '</i></div>'; $output .= '</div>'; } // draw pagination links if ($total_pages > 1) { $output .= '<div class="paging">'; for ($page_ind = 1; $page_ind <= $total_pages; $page_ind++) { $output .= prepare_permanent_link('index.php?page=' . Application::Get('page') . '&pid=' . Application::Get('page_id') . '&p=' . $page_ind, $page_ind == $current_page ? '<b>[' . $page_ind . ']</b>' : $page_ind, '', 'paging_link') . ' '; } $output .= '</div>'; } } else { $output .= '<div class="comment">'; $output .= '<b>' . _NO_COMMENTS_YET . '</b><br /><br />'; $output .= '</div>'; } $output .= '</div>'; $output .= $msg != '' ? $msg . '<br />' : ''; if ($user_type == 'registered' && !$objLogin->IsLoggedInAs($this->user_type_name)) { $output .= draw_message(_POST_COM_REGISTERED_ALERT, false); } else { $output .= $this->DrawCommentsForm($article_id, $image_verification, $focus_field, $task_completed, false); } $output .= '</div>'; if ($draw) { echo $output; } else { return $output; } }
* @license http://www.gnu.org/licenses/ */ // *** Make sure the file isn't accessed directly defined('APPHP_EXEC') or die('Restricted Access'); //-------------------------------------------------------------------------- if ($objLogin->IsLoggedInAs('owner') && Modules::IsModuleInstalled('backup')) { $submition_type = isset($_POST['submition_type']) ? prepare_input($_POST['submition_type']) : ''; $backup_file = isset($_POST['backup_file']) ? prepare_input($_POST['backup_file']) : ''; $st = isset($_GET['st']) ? prepare_input($_GET['st']) : ''; $fname = isset($_GET['fname']) ? prepare_input($_GET['fname']) : ''; $msg = ''; $objBackup = new Backup(); if ($st == 'restore') { // restore previouse backup if ($objBackup->RestoreBackup($fname)) { $msg = draw_success_message(str_replace('_FILE_NAME_', $fname, _BACKUP_WAS_RESTORED), false); } else { $msg = draw_important_message($objBackup->error, false); } } else { $msg = draw_message(_BACKUP_RESTORE_NOTE, false); } // draw title bar and message draw_title_bar(prepare_breadcrumbs(array(_MODULES => '', _BACKUP => '', _BACKUP_RESTORE => '')), prepare_permanent_link('index.php?admin=mod_backup_installation', _BACKUP_INSTALLATION)); echo $msg; draw_content_start(); $objBackup->DrawRestoreForm(); draw_content_end(); } else { draw_title_bar(_ADMIN); draw_important_message(_NOT_AUTHORIZED);
<?php /** * @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 (Modules::IsModuleInstalled('inquiries')) { draw_title_bar(_SEND_INQUIRY); draw_success_message(_INQUIRY_SENT_SUCCESS_MSG); echo '<br>'; } else { draw_title_bar(_PAGE); draw_important_message(_NOT_AUTHORIZED); }
if (isset($_POST['access_level'])) { $params['access_level'] = prepare_input($_POST['access_level']); } if (isset($_POST['page_title'])) { $params['page_title'] = prepare_input($_POST['page_title']); } if (isset($_POST['page_text'])) { $params['page_text'] = prepare_input($_POST['page_text'], false, 'low'); } if (isset($_POST['menu_link'])) { $params['menu_link'] = prepare_input($_POST['menu_link']); } $params['menu_id'] = isset($_POST['menu_id']) ? prepare_input($_POST['menu_id']) : '0'; $params['page_key'] = create_seo_url(prepare_input($_POST['page_title'])); $params['language_id'] = isset($_POST['language_id']) ? prepare_input($_POST['language_id']) : ''; $params['finish_publishing'] = isset($_POST['finish_publishing']) && check_date($_POST['finish_publishing']) ? prepare_input($_POST['finish_publishing']) : '0000-00-00'; if ($objPage->PageUpdate($params)) { $msg = draw_success_message(_PAGE_SAVED, false); ///if(Application::Get('page_id') != 'home'){ ///$objSession->SetMessage('notice', $msg); ///header('location: index.php?admin=pages'.((Application::Get('type') != '') ? '&type='.Application::Get('type'): '').'&mg_language_id='.$params['language_id']); ///exit; ///} } else { $msg = draw_important_message($objPage->error, false); } } if ($msg == '') { $msg = draw_message(_ALERT_REQUIRED_FILEDS, false); } }
} else { if ($reg_confirmation == 'by admin') { $email_template = 'new_account_created_confirm_by_admin'; } else { $email_template = 'new_account_created'; } } send_email($email, $objSettings->GetParameter('admin_email'), $email_template, array('{FIRST NAME}' => $first_name, '{LAST NAME}' => $last_name, '{USER NAME}' => $user_name, '{USER PASSWORD}' => $user_password1, '{WEB SITE}' => $_SERVER['SERVER_NAME'], '{REGISTRATION CODE}' => $registration_code, '{BASE URL}' => APPHP_BASE, '{YEAR}' => date('Y'))); if ($admin_alert_new_registration == 'yes') { send_email($objSettings->GetParameter('admin_email'), $objSettings->GetParameter('admin_email'), 'new_account_created_notify_admin', array('{FIRST NAME}' => $first_name, '{LAST NAME}' => $last_name, '{USER NAME}' => $user_name, '{USER EMAIL}' => $email, '{WEB SITE}' => $_SERVER['SERVER_NAME'], '{BASE URL}' => APPHP_BASE, '{YEAR}' => date('Y'))); } //////////////////////////////////////////////////////////// if ($reg_confirmation == 'by email') { $msg = draw_success_message(_ACCOUNT_CREATED_CONF_BY_EMAIL_MSG, false); $msg .= '<br />' . draw_message(_ACCOUT_CREATED_CONF_LINK, false); } else { if ($reg_confirmation == 'by admin') { $msg = draw_success_message(_ACCOUNT_CREATED_CONF_BY_ADMIN_MSG, false); $msg .= '<br />' . draw_message(_ACCOUT_CREATED_CONF_LINK, false); } else { $msg = draw_success_message(_ACCOUNT_CREATED_NON_CONFIRM_MSG, false); $msg .= '<br />' . draw_message(_ACCOUNT_CREATED_NON_CONFIRM_LINK, false); } } $account_created = true; } else { $msg = draw_important_message(_CREATING_ACCOUNT_ERROR, false); } } } }
/** * 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; } }
} else { if ($action == 'invoice') { $mode = 'invoice'; } else { if ($action == 'send_invoice') { if ($objOrders->SendInvoice($rid)) { $msg = draw_success_message(_INVOICE_SENT_SUCCESS, false); } else { $msg = draw_important_message($objOrders->error, false); } $mode = "view"; $title_action = "Send Invoice"; } else { if ($action == 'clean_credit_card') { if ($objOrders->CleanCreditCardInfo($rid)) { $msg = draw_success_message(_OPERATION_COMMON_COMPLETED, false); } else { $msg = draw_important_message($objOrders->error, false); } $mode = 'view'; $title_action = 'Clean'; } } } } } } } } } }
$order_number = isset($_POST['order_number']) ? prepare_input($_POST['order_number']) : ''; if ($payment_method == 'paypal') { $title_desc = _PAYPAL_ORDER; } else { if ($payment_method == '2co') { $title_desc = _2CO_ORDER; } else { if ($payment_method == 'authorize') { $title_desc = _AUTHORIZE_NET_ORDER; } else { $title_desc = _ONLINE_ORDER; } } } draw_title_bar(prepare_breadcrumbs(array(_MY_ACCOUNT => '', _CHECKOUT => '', $title_desc => '')), prepare_permanent_link('index.php?customer=advertise', _BUTTON_BACK)); // test mode alert if (ModulesSettings::Get('payments', 'mode') == 'TEST MODE') { draw_message(_TEST_MODE_ALERT_SHORT, true, true); } if ($task == "place_order") { if (AdvertisePlans::PlaceOrder($order_number, $cc_params)) { draw_success_message(_ORDER_PLACED_MSG); } else { draw_important_message(AdvertisePlans::$message); } } else { draw_important_message(_WRONG_PARAMETER_PASSED); } } else { draw_important_message(_NOT_AUTHORIZED); }
* @license http://www.gnu.org/licenses/ */ // *** Make sure the file isn't accessed directly defined('APPHP_EXEC') or die('Restricted Access'); //-------------------------------------------------------------------------- if ($objLogin->IsLoggedInAsAdmin() && $objLogin->HasPrivileges('edit_menus')) { $act = isset($_POST['act']) ? prepare_input($_POST['act']) : ''; $mid = isset($_REQUEST['mid']) ? prepare_input($_REQUEST['mid']) : ''; $menu = new Menu($mid); $msg = ''; // edit new menu catagory if ($act == 'edit') { $params = array(); $params['name'] = isset($_POST['name']) ? prepare_input($_POST['name']) : ''; $params['menu_placement'] = isset($_POST['menu_placement']) ? prepare_input($_POST['menu_placement']) : ''; $params['order'] = isset($_POST['order']) ? prepare_input($_POST['order']) : ''; $params['language_id'] = isset($_POST['language_id']) ? prepare_input($_POST['language_id']) : ''; $params['access_level'] = isset($_POST['access_level']) ? prepare_input($_POST['access_level']) : ''; if ($menu->MenuUpdate($params)) { $msg = draw_success_message(_MENU_SAVED, false); $objSession->SetMessage('notice', $msg); header('location: index.php?admin=menus&language_id=' . $params['language_id']); exit; } else { $msg = draw_important_message($menu->error, false); } } if ($msg == '') { $msg = draw_message(_ALERT_REQUIRED_FILEDS, false); } }
* @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->IsLoggedInAsCustomer()) { $submit = isset($_POST['submit']) ? prepare_input($_POST['submit']) : ''; $msg = ''; $account_deleted = false; if ($submit == 'remove') { if (strtolower(SITE_MODE) == 'demo') { $msg = draw_important_message(_OPERATION_BLOCKED, false); } else { if ($objLogin->RemoveAccount()) { $msg = draw_success_message(_ACCOUNT_WAS_DELETED, false); $account_deleted = true; //////////////////////////////////////////////////////////////// send_email($objLogin->GetLoggedEmail(), $objSettings->GetParameter('admin_email'), 'account_deleted_by_user', array('{USER NAME}' => $objLogin->GetLoggedName()), $objLogin->GetPreferredLang()); //////////////////////////////////////////////////////////// $objSession->EndSession(); } else { $msg = draw_important_message(_DELETING_ACCOUNT_ERROR, false); } } } draw_title_bar(prepare_breadcrumbs(array(_MY_ACCOUNT => '', _REMOVE_ACCOUNT => ''))); ?> <form action="index.php" method="post" id="frmLogout" style="display:inline; margin-top:0px; padding-top:0px;"> <?php draw_hidden_field('submit_logout', 'logout');
} } } } } } } } else { $msg = draw_important_message(str_replace('_COUNT_', $maximum_inquiries, _MAXIMUM_ALLOWED_INQUIRIES_PER_SESSION), false); } } else { if ($act == 'location_reload') { // currently do nothing } else { if ($act == 'inquiry_sent') { $msg = draw_success_message(_INQUIRY_SENT_SUCCESS_MSG, false); } } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Inquiry Form</title> <link href="<?php echo $host; ?> templates/default/css/style.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="<?php
*/ // *** Make sure the file isn't accessed directly defined('APPHP_EXEC') or die('Restricted Access'); //-------------------------------------------------------------------------- if ($objLogin->IsLoggedInAsAdmin() && $objLogin->HasPrivileges('add_menus')) { $act = isset($_POST['act']) ? prepare_input($_POST['act']) : ''; $mid = isset($_POST['mid']) ? prepare_input($_POST['mid']) : ''; $language_id = isset($_POST['language_id']) ? prepare_input($_POST['language_id']) : Languages::GetDefaultLang(); $menu = new Menu($mid); $msg = ''; // add new menu catagory if ($act == 'add') { $params = array(); $params['name'] = isset($_POST['name']) ? prepare_input($_POST['name']) : ''; $params['menu_placement'] = isset($_POST['menu_placement']) ? prepare_input($_POST['menu_placement']) : ''; $params['order'] = isset($_POST['order']) ? prepare_input($_POST['order']) : ''; $params['language_id'] = isset($_POST['language_id']) ? prepare_input($_POST['language_id']) : ''; $params['access_level'] = isset($_POST['access_level']) ? prepare_input($_POST['access_level']) : ''; if ($menu->MenuCreate($params)) { $msg = draw_success_message(_MENU_CREATED, false); $objSession->SetMessage('notice', $msg); header('location: index.php?admin=menus'); exit; } else { $msg = draw_important_message($menu->error, false); } } if ($msg == '') { $msg = draw_message(_ALERT_REQUIRED_FILEDS, false); } }
$dir = isset($_GET['dir']) ? prepare_input($_GET['dir']) : ''; $language_id = isset($_REQUEST['language_id']) && $_REQUEST['language_id'] != '' ? prepare_input($_REQUEST['language_id']) : Languages::GetDefaultLang(); $msg = ''; $objMenu = new Menu($mid); if ($act == 'delete' && $objLogin->HasPrivileges('delete_menus')) { // delete menu action if ($objMenu->MenuDelete($mid, $mo)) { $msg = draw_success_message(_MENU_DELETED, false); } else { $msg = draw_important_message($objMenu->error, false); } } else { if ($act == 'move' && $objLogin->HasPrivileges('edit_menus')) { // move menu action if ($objMenu->MenuMove($mid, $dir, $mo)) { $msg = draw_success_message(_MENU_ORDER_CHANGED, false); } else { $msg = draw_important_message($objMenu->error, false); } } } // Start main content $all_menus = array(); $all_menus = Menu::GetAll(' menu_order ASC', TABLE_MENUS, '', $language_id); $total_languages = Languages::GetAllActive(); draw_title_bar(prepare_breadcrumbs(array(_MENUS_AND_PAGES => '', _MENU_MANAGEMENT => '', _EDIT_MENUS => ''))); if ($objSession->IsMessage('notice')) { echo $objSession->GetMessage('notice'); } echo $msg; draw_content_start();
*/ // *** Make sure the file isn't accessed directly defined('APPHP_EXEC') or die('Restricted Access'); //-------------------------------------------------------------------------- $act = isset($_POST['act']) ? prepare_input($_POST['act']) : ''; $password_sent = (bool) Session::Get('password_sent'); $email = isset($_POST['email']) ? prepare_input($_POST['email']) : ''; $msg = ''; if ($act == 'send') { if (!check_email_address($email)) { $msg = draw_important_message(_EMAIL_IS_WRONG, false); } else { if (!$password_sent) { $objAdmin = new Admins($objSession->GetSessionVariable('session_account_id')); if ($objAdmin->SendPassword($email)) { $msg = draw_success_message(_PASSWORD_SUCCESSFULLY_SENT, false); Session::Set('password_sent', true); } else { $msg = draw_important_message($objAdmin->error, false); } } else { $msg = draw_message(_PASSWORD_ALREADY_SENT, false); } } } // Draw title bar draw_title_bar(prepare_breadcrumbs(array(_ADMIN => '', _PASSWORD_FORGOTTEN => ''))); // Check if user is logged in if (!$objLogin->IsLoggedIn()) { echo $msg; ?>
$draw_vocabulary = false; draw_content_end(); } else { if ($submition_type == '1') { // update vocabulary key if (!$objVocabulary->IsKeyUpdated()) { $msg = draw_important_message($objVocabulary->error, false); draw_content_start(); $objVocabulary->DrawEditForm($key); draw_content_end(); } } else { if ($submition_type == '2') { // rewrite vocabulary if ($objVocabulary->RewriteVocabularyFile($all_languages)) { $msg = draw_success_message(_VOC_UPDATED, false); } else { $msg = draw_important_message($objVocabulary->error, false); } draw_content_start(); $objVocabulary->DrawRewriteButton(); draw_content_end(); } else { draw_content_start(); $objVocabulary->DrawRewriteButton(); draw_content_end(); } } } } }
/** * Change Parameter * @param $param_val */ public function ChangeLang($param_val) { // deny all operations in demo version if (strtolower(SITE_MODE) == 'demo') { return draw_important_message(_OPERATION_BLOCKED, false); } global $objLogin; if (!empty($param_val)) { $sql = 'UPDATE ' . TABLE_ACCOUNTS . ' SET preferred_language = ' . quote_text(encode_text($param_val)) . ' WHERE id = ' . (int) $this->account_id; if (database_void_query($sql)) { $this->preferred_language = $param_val; $objLogin->SetPreferredLang($param_val); return draw_success_message(_SETTINGS_SAVED, false); } else { return draw_important_message(_TRY_LATER, false); } } else { return draw_important_message(str_replace('_FIELD_', _PREFERRED_LANGUAGE, _FIELD_CANNOT_BE_EMPTY), false); } }
$task = isset($_REQUEST['task']) ? prepare_input($_REQUEST['task']) : ''; $focus_field = ''; draw_title_bar(_SUBSCRIBE_TO_NEWSLETTER); if (Modules::IsModuleInstalled('news')) { $objNews = News::Instance(); if ($task == 'subscribe') { if ($objNews->ProcessSubscription($email)) { draw_success_message(_NEWSLETTER_SUBSCRIBE_SUCCESS); } else { draw_important_message($objNews->error); $focus_field = 'subscribe_email'; } } else { if ($task == 'unsubscribe') { if ($objNews->ProcessUnsubscription($email)) { draw_success_message(_NEWSLETTER_UNSUBSCRIBE_SUCCESS); } else { draw_important_message($objNews->error); $focus_field = 'unsubscribe_email'; } } else { if ($task == 'pre_subscribe') { draw_message(_NEWSLETTER_PRE_SUBSCRIBE_ALERT); $focus_field = 'subscribe_email'; } else { if ($task == 'pre_unsubscribe') { draw_message(_NEWSLETTER_PRE_UNSUBSCRIBE_ALERT); $focus_field = 'unsubscribe_email'; } } }
$params['tag_keywords'] = prepare_input($_POST['tag_keywords']); } if (isset($_POST['tag_description'])) { $params['tag_description'] = prepare_input($_POST['tag_description']); } if (isset($_POST['page_title'])) { $params['page_title'] = prepare_input($_POST['page_title']); } if (isset($_POST['page_text'])) { $params['page_text'] = prepare_input($_POST['page_text'], false, 'low'); } if (isset($_POST['menu_link'])) { $params['menu_link'] = prepare_input($_POST['menu_link']); } $params['menu_id'] = isset($_POST['menu_id']) ? prepare_input($_POST['menu_id']) : '0'; $params['page_key'] = create_seo_url(prepare_input($_POST['page_title'])); $params['language_id'] = isset($_POST['language_id']) ? prepare_input($_POST['language_id']) : ''; $params['finish_publishing'] = isset($_POST['finish_publishing']) && check_date($_POST['finish_publishing']) ? prepare_input($_POST['finish_publishing']) : '0000-00-00'; if ($objPage->PageCreate($params, $copy_to_other_langs)) { $msg = draw_success_message(_PAGE_CREATED, false); $objSession->SetMessage('notice', $msg); header('location: index.php?admin=pages' . (Application::Get('type') != '' ? '&type=' . Application::Get('type') : '') . '&mg_language_id=' . $params['language_id']); exit; } else { $msg = draw_important_message($objPage->error, false); } } if ($msg == '') { $msg = draw_message(_ALERT_REQUIRED_FILEDS, false); } }
<?php /** * @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->IsLoggedInAsAdmin()) { $act = !empty($_REQUEST['act']) ? prepare_input($_REQUEST['act']) : ''; $key = !empty($_REQUEST['key']) ? prepare_input($_REQUEST['key']) : ''; $submition_type = !empty($_POST['submition_type']) ? prepare_input($_POST['submition_type']) : ''; $txt_key = !empty($_POST['txt_key']) ? prepare_input($_POST['txt_key'], false, 'low') : ''; $txt_key_value = !empty($_POST['txt_key_value']) ? prepare_input($_POST['txt_key_value'], false, 'low') : ''; $language_id = !empty($_POST['language_id']) ? prepare_input($_POST['language_id']) : ''; $all_languages = isset($_POST['all_languages']) ? true : false; $msg = ''; $objVocabulary = new Vocabulary(); if ($submition_type == '1') { if ($objVocabulary->UpdateKey($txt_key, $txt_key_value)) { $objVocabulary->RewriteVocabularyFile(false); $objSession->SetMessage('notice', draw_success_message(_VOC_KEY_UPDATED, false)); header('location: index.php?admin=vocabulary&key=' . $key . $objVocabulary->GetFilterURL() . $objVocabulary->GetLanguageURL()); exit; } } }
$language_id = isset($_REQUEST['language_id']) && $_REQUEST['language_id'] != '' ? prepare_input($_REQUEST['language_id']) : Languages::GetDefaultLang(); $pid = isset($_GET['pid']) ? (int) $_GET['pid'] : ''; $msg = ''; $objPage = new Pages($pid); // do delete action if ($act == 'delete') { if ($objPage->PageDelete() && $objLogin->HasPrivileges('delete_pages')) { $msg = draw_success_message(_PAGE_DELETED, false); } else { $msg = draw_important_message($objPage->error, false); } // do restore action } else { if ($act == 'restore' && $objLogin->HasPrivileges('edit_pages')) { if ($objPage->PageRestore()) { $msg = draw_success_message(_PAGE_RESTORED, false); } else { $msg = draw_important_message($objPage->error, false); } } } // start main content $all_pages = array(); $all_pages = Pages::GetAll($language_id, 'removed'); $total_languages = Languages::GetAllActive(); draw_title_bar(prepare_breadcrumbs(array(_MENUS_AND_PAGES => '', _PAGE_MANAGEMENT => '', _TRASH_PAGES => ''))); if ($objSession->IsMessage('notice')) { echo $objSession->GetMessage('notice'); } echo $msg; ?>
$mode = 'view'; $msg = ''; $objModules = new Modules(); if ($action == 'add') { $mode = 'view'; } else { if ($action == 'create') { $mode = 'view'; } else { if ($action == 'edit') { $mode = 'edit'; } else { if ($action == 'update') { if ($objModules->UpdateRecord($rid)) { $mst_text = $objModules->error != '' ? $objModules->error : _UPDATING_OPERATION_COMPLETED; $msg = draw_success_message($mst_text, false); $mode = 'view'; } else { $msg = draw_important_message($objModules->error, false); $mode = 'edit'; } } else { if ($action == 'delete') { $mode = 'view'; } else { if ($action == 'details') { $mode = 'view'; } else { if ($action == 'cancel_add') { $mode = 'view'; } else {
$msg = draw_important_message($objCustomers->error, false); } $mode = 'view'; } else { if ($action == 'details') { $mode = 'details'; } else { if ($action == 'cancel_add') { $mode = 'view'; } else { if ($action == 'cancel_edit') { $mode = 'view'; } else { if ($action == 'reactivate') { if (Customers::Reactivate($email)) { $msg = draw_success_message(_EMAIL_SUCCESSFULLY_SENT, false); } else { $msg = draw_important_message(Customers::GetStaticError(), false); } $mode = 'view'; } } } } } } } } } // Start main content draw_title_bar(prepare_breadcrumbs(array(_ACCOUNTS => '', _CUSTOMERS_MANAGEMENT => '', _CUSTOMERS => '', ucfirst($action) => '')));
<?php // *** Make sure the file isn't accessed directly defined('APPHP_EXEC') or die('Restricted Access'); //-------------------------------------------------------------------------- if (Modules::IsModuleInstalled('payments') && ModulesSettings::Get('payments', 'is_active') == 'yes') { draw_title_bar(prepare_breadcrumbs(array(_MY_ACCOUNT => '', _ADVERTISE => '', _ORDER_COMPLETED => ''))); draw_content_start(); draw_success_message(_ORDER_WAS_COMPLETED_MSG); draw_content_end(); } else { draw_important_message(_NOT_AUTHORIZED); }
$msg = draw_important_message(_TEMPLATE_IS_EMPTY, false); } } else { if ($submition_type == 'site_info') { $params_ranks = array(); $params_ranks['alexa_rank'] = number_format((double) $objSettings->CheckAlexaRank($http_host)); $params_ranks['google_rank'] = (int) $objSettings->CheckGoogleRank($http_host); if ($objSettings->UpdateFields($params_ranks) == true) { $msg = draw_success_message(_CHANGES_WERE_SAVED, false); } else { $msg = draw_important_message($objSettings->error, false); } } else { if ($submition_type == 'cron_settings') { if ($objSettings->UpdateFields($params_cron) == true) { $msg = draw_success_message(_CHANGES_WERE_SAVED, false); } else { $msg = draw_important_message($objSettings->error, false); } } } } } } } } } } } $template = $objSettings->GetTemplate(); if (strtolower(SITE_MODE) != 'demo' && $submition_type == 'general' || $submition_type == 'visual_settings' || $submition_type == 'meta_tags') {
defined('APPHP_EXEC') or die('Restricted Access'); //-------------------------------------------------------------------------- if (!$objLogin->IsLoggedIn() && ModulesSettings::Get('customers', 'allow_registration') == 'yes') { $code = isset($_REQUEST['c']) ? prepare_input($_REQUEST['c']) : ''; $task = isset($_POST['task']) ? prepare_input($_POST['task']) : ''; $msg = ''; $confirmed = false; if ($code != '') { $sql = 'SELECT * FROM ' . TABLE_CUSTOMERS . ' WHERE registration_code = \'' . encode_text($code) . '\' AND is_active = 0'; $result = database_query($sql, DATA_AND_ROWS, FIRST_ROW_ONLY); if ($result[1] > 0) { $sql = 'UPDATE ' . TABLE_CUSTOMERS . ' SET is_active = 1, registration_code = \'\' WHERE registration_code = \'' . encode_text($code) . '\' AND is_active = 0'; database_void_query($sql); $msg = draw_success_message(_CONFIRMED_SUCCESS_MSG, false); $confirmed = true; $msg .= '<script type="text/javascript">setTimeout(\'appGoTo("customer=login")\', 15000);</script>'; } else { if (strlen($code) == 20) { $confirmed = true; $msg = draw_message(_CONFIRMED_ALREADY_MSG, false); } else { $msg = draw_important_message(_WRONG_CONFIRMATION_CODE, false); } } } else { if ($task == 'post_submission') { $msg = draw_important_message(str_replace('_FIELD_', _CONFIRMATION_CODE, _FIELD_CANNOT_BE_EMPTY), false); } }
} else { if ($action == 'edit') { $mode = 'edit'; } else { if ($action == 'update') { if ($objGallery->UpdateRecord($rid)) { $msg = draw_success_message(_UPDATING_OPERATION_COMPLETED, false); $mode = 'view'; } else { $msg = draw_important_message($objGallery->error, false); $mode = 'edit'; } } else { if ($action == 'delete') { if ($objGallery->DeleteRecord($rid)) { $msg = draw_success_message(_DELETING_OPERATION_COMPLETED, false); } else { $msg = draw_important_message($objGallery->error, false); } $mode = 'view'; } else { if ($action == 'details') { $mode = 'details'; } else { if ($action == 'cancel_add') { $mode = 'view'; } else { if ($action == 'cancel_edit') { $mode = 'view'; } }
/** * 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; } }