Exemplo n.º 1
0
/**
 *  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>&nbsp;&nbsp;
			
			' . _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>&nbsp;&nbsp;';
    $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;
}
Exemplo n.º 2
0
* @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() && $objLogin->HasPrivileges('add_menus')) {
    draw_title_bar(prepare_breadcrumbs(array(_MENUS_AND_PAGES => '', _MENU_MANAGEMENT => '', _MENU_ADD => '')));
    echo $msg;
    draw_content_start();
    ?>
	<form name='frmAddMenu' method='post'>
		<?php 
    draw_hidden_field('act', 'add');
    ?>
		<?php 
    draw_token_field();
    ?>
		
		<table width="100%" border="0" cellspacing="1" cellpadding="2" class="main_text">
		<tr>
			<td width="20%"><?php 
    echo _MENU_NAME;
    ?>
 <span class="required">*</span>:</td>
			<td><input class="form_text" name="name" id="frmAddMenu_name" value="" size="40" maxlength="30"></td>
		</tr>
		<tr>
			<td><?php 
Exemplo n.º 3
0
        $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">
	<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 
Exemplo n.º 4
0
    /**
     *	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();">&nbsp;&nbsp;</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;
        }
    }
Exemplo n.º 5
0
 /**
  *	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;
     }
 }
Exemplo n.º 6
0
    /**
     * 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 .= '&nbsp;' . _FILTER_BY . ': ';
            $output .= ListingsLocations::DrawAllLocations(array('tag_name' => 'listings_locations', 'selected_value' => $listings_locations, 'javascript_event' => 'onchange="jQuery(\'#frmCategoryView\').submit();"'), false) . ' &nbsp;';
            $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>&nbsp;
					<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') . '">&nbsp; ' . _LISTINGS . ' &nbsp;</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">&nbsp;</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;
        }
    }
Exemplo n.º 7
0
    /**
     * 	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">&nbsp;</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">&nbsp;</td></tr>
				<tr>
					<td align="left" colspan="2"><b>' . _BACKUPS_EXISTING . ': </b></td>		
				</tr>
				' . $this->ShowPreviousBackups('delete', false) . '
				</table>			
			</td>
		</tr>
		</table>';
        echo $output;
    }
Exemplo n.º 8
0
/**
* @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);
}
Exemplo n.º 9
0
	<tr>
		<td style="padding-left:0px;" colspan="2"><input class="form_button" type="submit" name="submit" value="<?php 
    echo _BUTTON_CHANGE;
    ?>
"></td>
	</tr>
	<tr><td colspan="2">&nbsp;</td></tr>	
	</table>	
	</form>

	<?php 
    draw_sub_title_bar(_CHANGE_YOUR_PASSWORD);
    ?>
	<form action="index.php?admin=my_account" method="post">
	<?php 
    draw_hidden_field('submit_type', '3');
    ?>
	<?php 
    draw_token_field();
    ?>
	<table width="100%" border="0" cellspacing="0" cellpadding="2" class="main_text">
	<tr>
		<td width="150px">&nbsp;<?php 
    echo _PASSWORD;
    ?>
 <span class="required">*</span>:</td>
		<td width="405px"><input class="form_text" name="password_one" type="password" size="25" maxlength="15"></td>
	</tr>
	<tr>
		<td>&nbsp;<?php 
    echo _RETYPE_PASSWORD;
Exemplo n.º 10
0
					<ul>
						<li>Google Rank: <b><i>' . (int) $objSettings->GetParameter('google_rank') . '</i></b></li>
						<li>Alexa Rank: <b><i>' . $objSettings->GetParameter('alexa_rank') . '</i></b></li>
					</ul>
				</td>
			</tr>
			<tr valign="top">
				<td><input class="form_button" type="submit" name="submit" value="' . _BUTTON_UPDATE . '"></td>
			</tr>
			</table>
		</form>';
                            } else {
                                if ($tabid == '1_8') {
                                    $tab_content_8 = '<form action="index.php?admin=settings" method="post">
			' . draw_hidden_field('submition_type', 'cron_settings', false) . '
			' . draw_hidden_field('tabid', $tabid, false) . '
			' . draw_token_field(false) . '

			<table width="99%" border="0" cellspacing="5" cellpadding="5" class="main_text">
			<tr valign="top">
				<td width="90px">' . _RUN_CRON . ':</td>
				<td width="140px">
					<input class="form_radio" type="radio" name="cron_type" id="cron_type_batch" ' . ($params_cron['cron_type'] == 'batch' ? 'checked="checked"' : '') . ' value="batch" onclick="appHideElement(\'cron_run_period_row\')" /> <label for="cron_type_batch">Batch</label><br />
					<input class="form_radio" type="radio" name="cron_type" id="cron_type_non_batch" ' . ($params_cron['cron_type'] == 'non-batch' ? 'checked="checked"' : '') . ' value="non-batch" onclick="appShowElement(\'cron_run_period_row\')" /> <label for="cron_type_non_batch">Non-batch</label><br />
					<input class="form_radio" type="radio" name="cron_type" id="cron_type_stop" ' . ($params_cron['cron_type'] == 'stop' ? 'checked="checked"' : '') . ' value="stop" onclick="appHideElement(\'cron_run_period_row\')" /> <label for="cron_type_stop">' . _STOP . '</label><br />
				</td>
				<td rowspan="3" style="border-left:1px solid #d1d2d3;padding:2px 18px 2px 18px">
					' . _CRONJOB_NOTICE . '<br /><br />' . _CRONJOB_HTACCESS_BLOCK . '
<pre>
&lt;Files "cron.php"&gt;
Order Deny,Allow
Exemplo n.º 11
0
    /**
     * Draws advanced search form
     * 		@param $draw
     */
    public static function DrawAdvancedSearch($draw = true)
    {
        $keyword = isset($_POST['keyword']) ? trim(prepare_input($_POST['keyword'])) : '';
        $keyword = str_replace('"', '&#034;', $keyword);
        $keyword = str_replace("'", '&#039;', $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 = '&nbsp;&nbsp;&bull; ' . $val['name'];
                } else {
                    if ($val['level'] == '3') {
                        $category_name = '&nbsp;&nbsp;&nbsp;&nbsp;:: ' . $val['name'];
                    }
                }
            }
            $output .= '<option ' . ($sel_categories == $val['id'] ? 'selected="selected"' : '') . ' value="' . $val['id'] . '">' . $category_name . '</option>';
        }
        $output .= '</select>&nbsp;';
        $output .= ListingsLocations::DrawAllLocations(array('tag_name' => 'sel_listings_locations', 'selected_value' => $sel_listings_locations, 'javascript_event' => 'onchange="jQuery(\'#frmAdvSearch\').submit();"'), false) . ' &nbsp;';
        $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>&nbsp;
			</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>&nbsp;
			</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>&nbsp;
			</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;
        }
    }
Exemplo n.º 12
0
	<?php 
    echo $msg == '' ? $msg_default : $msg;
    ?>
	
	<div class="pages_contents">
		<p style='padding-left:3px;'>
			<?php 
    echo _ALERT_REQUIRED_FILEDS;
    ?>
						
		</p>						
		
		<form action="index.php?customer=my_account" method="post" name="frmEditAccount" id="frmEditAccount">
			<?php 
    draw_hidden_field('task', 'update');
    ?>
			<?php 
    draw_token_field();
    ?>
			
			<table cellspacing="1" cellpadding="2" width="100%">
			<tbody>
			
			<tr><td colspan="3"><b><?php 
    echo _PERSONAL_DETAILS;
    ?>
</b><hr size="1" noshade="noshade" /></td></tr>	
			<tr>
				<td width="38%" align="right"><?php 
    echo _FIRST_NAME;
Exemplo n.º 13
0
						<td nowrap>
							<input type="radio" class="form_radio" name="is_published" id="is_published_yes" <?php 
        echo $objPage->GetParameter('is_published') == '1' ? 'checked="checked"' : '';
        ?>
 value="1" /> <label for="is_published_yes"><?php 
        echo _YES;
        ?>
</label>
						</td>
					</tr>
				<?php 
    } else {
        ?>
					<tr>
						<td colspan="3"><?php 
        draw_hidden_field('is_published', '1', true, 'is_published');
        ?>
</td>
					</tr>
				<?php 
    }
    ?>
				
				<tr><td colspan="3" nowrap="nowrap" height="3px"></td></tr>				
				<tr>
					<td><?php 
    echo _LANGUAGE;
    ?>
 <span class="required">*</span>:</td>
					<td colspan="2">
						<?php 
Exemplo n.º 14
0
	<script type="text/javascript">
		function Language_OnChange(val){
			appGoTo('admin=pages_add', '&language_id='+val);
		}	
		function Cancel(){
			appGoTo('admin=pages');
		}
	</script>

	<form name='frmPage' method='post'>
		<?php 
    draw_hidden_field('act', 'add');
    ?>
		<?php 
    draw_hidden_field('meta_tags_status', 'closed', true, 'meta_tags_status');
    ?>
		<?php 
    draw_token_field();
    ?>
		
		<table id="tblEditPage" width="100%" border="0" cellspacing="4" cellpadding="4">
		<tr>
			<td valign="top" style="border:1px solid #dedede">
				<table width="100%" border="0" cellspacing="0" cellpadding="2" class="main_text">
				<tr>
					<td width="160px"></td>
					<td width="490px"></td>
				</tr>
				<tr>
					<td><?php 
Exemplo n.º 15
0
    /**
     *	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;
        }
    }
Exemplo n.º 16
0
    /**
     *	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">&nbsp;</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">&nbsp;</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;
        }
    }
Exemplo n.º 17
0
    /**
     * 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 . '">&infin;</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;
        }
    }
Exemplo n.º 18
0
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
if ($objLogin->IsLoggedInAsAdmin() && $objLogin->HasPrivileges('edit_menus')) {
    draw_title_bar(prepare_breadcrumbs(array(_MENUS_AND_PAGES => '', _MENU_MANAGEMENT => '', _MENU_EDIT => '')));
    echo $msg;
    draw_content_start();
    ?>
	<form name="frmEditMenu" method="post" action="index.php?admin=menus_edit">
		<?php 
    draw_hidden_field('act', 'edit');
    ?>
		<?php 
    draw_hidden_field('mid', $mid);
    ?>
		<?php 
    draw_hidden_field('language_id', $menu->GetParameter('language_id'));
    ?>
		<?php 
    draw_token_field();
    ?>
		
		<table width="100%" border="0" cellspacing="0" cellpadding="2" class="main_text">
		<tr>
			<td><?php 
    echo _MENU_NAME;
    ?>
 <span class="required">*</span>:</td>
			<td><input class="form_text" name="name" value="<?php 
    echo $menu->GetName();
    ?>
" size="40" maxlength="30"></td>
Exemplo n.º 19
0
    /**
     * 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;
        }
    }
Exemplo n.º 20
0
    /**
     * 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 . ' &raquo; ' . strtoupper($this->languageId) . ' &nbsp;
							<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) . '">&nbsp;&nbsp;
					  <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;
        }
    }
Exemplo n.º 21
0
	<?php 
        echo $msg;
        ?>
        
	<div class='pages_contents'>
		
		<p style='padding-left:3px;'>
			<?php 
        echo _ALERT_REQUIRED_FILEDS;
        ?>
		</p>		
				
		<form action="index.php?customer=create_account" method="post" name="frmRegistration" id="frmRegistration">
			<?php 
        draw_hidden_field('act', 'create');
        ?>
			<?php 
        draw_token_field();
        ?>
			
			<table cellspacing="1" cellpadding="2" width="100%">
			<tbody>
			
			<tr><td colspan="3"><b><?php 
        echo _PERSONAL_DETAILS;
        ?>
</b><hr size="1" noshade="noshade" /></td></tr>	
			<tr>
				<td width="38%" align="<?php 
        echo Application::Get('defined_right');
Exemplo n.º 22
0
 /**
  *	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 . '&nbsp; - ' . _OR . ' - &nbsp;';
         $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 . '&nbsp; - ' . _OR . ' - &nbsp;';
         $output .= $nl . '<a href="javascript:void(0);" onclick="javascript:appGoTo(\'customer=advertise\')">' . _BUTTON_CANCEL . '</a>';
         $output .= $nl . '</form>';
     }
     return $output;
 }
Exemplo n.º 23
0
    /**
     *	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" />&nbsp;';
            $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 . ' &lt;b&gt;, &lt;i&gt;, &lt;u&gt;, &lt;br&gt; <br /><br />';
        //'._IMAGE_VERIFICATION.':<br />
        $output .= '</td>
				<td>&nbsp;</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;
        }
    }
Exemplo n.º 24
0
/**
 * Outputs a form hidden field containing the session name and ID if SID is not empty
 *
 * @access public
 */
function draw_hidden_session_id_field()
{
    global $osC_Session;
    if ($osC_Session->hasStarted() && !_empty(SID)) {
        return draw_hidden_field($osC_Session->getName(), $osC_Session->getID());
    }
}
Exemplo n.º 25
0
    </ul>
    <form name="frmLogout" id="frmLogout" style="padding:0px;margin:0px;" action="index.php" method="post">
    <p>
        <?php 
echo $footer_text = $objSiteDescription->DrawFooter(false);
?>
        <?php 
if (!empty($footer_text)) {
    echo '&nbsp;' . draw_divider(false) . '&nbsp;';
}
?>
        <?php 
if ($objLogin->IsLoggedIn()) {
    ?>
            <?php 
    draw_hidden_field('submit_logout', 'logout');
    ?>
            <a class="main_link" href="javascript:appFormSubmit('frmLogout');"><?php 
    echo _BUTTON_LOGOUT;
    ?>
</a>
        <?php 
} else {
    ?>
            <?php 
    echo prepare_permanent_link('index.php?admin=login', _ADMIN_LOGIN, '', 'main_link');
    ?>
        <?php 
}
?>
    </p>
Exemplo n.º 26
0
    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();
    }
Exemplo n.º 27
0
    /**
     * Draw field by type
     *		@param $field_name
     *		@param $field_array - ['field'] => array(''.....)
     *		@param $params
     *		@param $draw
     *		@param $language_dir
     */
    public function DrawFieldByType($mode, $field_name, $field_array = array(), $params = array(), $draw = true, $language_dir = 'ltr')
    {
        if ($field_name == '') {
            return false;
        }
        $output = '';
        $nl = "\n";
        //print_r($field_array);
        $direction = $language_dir == 'rtl' || $language_dir == 'ltr' ? ' dir="' . $language_dir . '"' : '';
        $rid = isset($params[$this->primaryKey]) ? $params[$this->primaryKey] : '';
        $field_type = isset($field_array['type']) ? $field_array['type'] : '';
        $source = isset($field_array['source']) ? $field_array['source'] : '';
        $default_option = isset($field_array['default_option']) && $field_array['default_option'] !== '' ? $field_array['default_option'] : '-- ' . _SELECT . ' --';
        $readonly = isset($field_array['readonly']) && $field_array['readonly'] === true ? true : false;
        $default = isset($field_array['default']) ? $field_array['default'] : '';
        $true_value = isset($field_array['true_value']) ? $field_array['true_value'] : '1';
        $width = isset($field_array['width']) ? $field_array['width'] : '';
        $height = isset($field_array['height']) ? $field_array['height'] : '';
        $image_width = isset($field_array['image_width']) ? $field_array['image_width'] : '120px';
        $image_height = isset($field_array['image_height']) ? $field_array['image_height'] : '90px';
        $show_seconds = isset($field_array['show_seconds']) ? $field_array['show_seconds'] : true;
        $minutes_step = isset($field_array['minutes_step']) ? (int) $field_array['minutes_step'] : 1;
        $maxlength = isset($field_array['maxlength']) ? $field_array['maxlength'] : '';
        $editor_type = isset($field_array['editor_type']) ? $field_array['editor_type'] : '';
        $no_image = isset($field_array['no_image']) ? $field_array['no_image'] : '';
        $required = isset($field_array['required']) ? $field_array['required'] : false;
        $pre_html = isset($field_array['pre_html']) ? $field_array['pre_html'] : '';
        $post_html = isset($field_array['post_html']) ? $field_array['post_html'] : '';
        $format = isset($field_array['format']) ? $field_array['format'] : '';
        $format_parameter = isset($field_array['format_parameter']) ? $field_array['format_parameter'] : '';
        $tooltip = isset($field_array['tooltip']) ? $field_array['tooltip'] : '';
        $min_year = isset($field_array['min_year']) ? $field_array['min_year'] : '90';
        $max_year = isset($field_array['max_year']) ? $field_array['max_year'] : '10';
        $href = isset($field_array['href']) ? $field_array['href'] : '#';
        $target = isset($field_array['target']) ? $field_array['target'] : '';
        $javascript_event = isset($field_array['javascript_event']) ? $field_array['javascript_event'] : '';
        $visible = isset($field_array['visible']) && $field_array['visible'] !== '' ? $field_array['visible'] : true;
        $autocomplete = isset($field_array['autocomplete']) ? $field_array['autocomplete'] : '';
        $cryptography = isset($field_array['cryptography']) ? $field_array['cryptography'] : false;
        $cryptography_type = isset($field_array['cryptography_type']) ? $field_array['cryptography_type'] : '';
        $username_generator = isset($field_array['username_generator']) ? $field_array['username_generator'] : false;
        $password_generator = isset($field_array['password_generator']) ? $field_array['password_generator'] : false;
        $view_type = isset($field_array['view_type']) ? $field_array['view_type'] : '';
        $multi_select = isset($field_array['multi_select']) ? $field_array['multi_select'] : '';
        $atr_readonly = $readonly ? ' readonly="readonly"' : '';
        $atr_disabled = $readonly ? ' disabled="disabled"' : '';
        $css_disabled = $readonly ? ' mgrid_disabled' : '';
        $attr_maxlength = $maxlength != '' ? ' maxlength="' . intval($maxlength) . '"' : '';
        $autocomplete = $autocomplete == 'off' ? ' autocomplete="off"' : '';
        $field_value = isset($params[$field_name]) ? $params[$field_name] : '';
        if ($mode == 'add' && $field_value == '') {
            $field_value = $default;
        }
        if ($this->isHtmlEncoding) {
            $field_value = $this->GetDataDecoded($field_value);
        }
        if ($mode == 'view') {
            $this->OnItemCreated_ViewMode($field_name, $field_value);
            // View Mode
            switch ($field_type) {
                case 'link':
                    $target_str = $target != '' ? ' target="' . $target . '"' : '';
                    $href_str = $href;
                    $title = '';
                    if ($maxlength != '' && $this->IsInteger($maxlength)) {
                        $this->PrepareSubString($field_value, $title, $maxlength);
                    } else {
                        if ($tooltip != '') {
                            $title = $tooltip;
                        }
                    }
                    if (preg_match_all('/{.*?}/i', $href, $matches)) {
                        foreach ($matches[0] as $key => $val) {
                            $val = trim($val, '{}');
                            if (isset($params[$val])) {
                                $href_str = str_replace('{' . $val . '}', $params[$val], $href_str);
                            }
                        }
                    }
                    $output = '<a href="' . $href_str . '"' . $target_str . ' title="' . strip_tags($title) . '">' . $field_value . '</a>';
                    break;
                case 'enum':
                    if (is_array($source)) {
                        if (isset($source[$field_value])) {
                            $output = $source[$field_value];
                            break;
                        }
                    }
                    break;
                case 'image':
                    if ($field_value == '' && $no_image != '') {
                        $field_value = $no_image;
                    }
                    $output = '<img src="' . $target . $field_value . '" title="' . $field_value . '" alt="" width="' . $image_width . '" height="' . $image_height . '">';
                    break;
                default:
                case 'label':
                    $title = '';
                    $field_value = $this->FormatFieldValue($field_value, $format, $format_parameter);
                    if ($maxlength != '' && $this->IsInteger($maxlength)) {
                        $this->PrepareSubString($field_value, $title, $maxlength);
                    } else {
                        if ($tooltip != '') {
                            $title = $tooltip;
                        }
                    }
                    $output = $pre_html . '<label class="mgrid_label" title="' . $this->GetDataDecoded(strip_tags($title)) . '">' . $this->GetDataDecodedText($field_value) . '</label>' . $post_html;
                    break;
            }
        } else {
            if ($mode == 'details') {
                $this->OnItemCreated_DetailsMode($field_name, $field_value);
            }
            // Add/Edit/Detail Modes
            switch ($field_type) {
                case 'checkbox':
                    $checked = '';
                    $rid = self::GetParameter('rid');
                    if ($mode == 'add') {
                        if (empty($rid) && $default == $true_value) {
                            // opens page first time
                            $checked = ' checked="checked"';
                        } else {
                            if ($field_value == '1') {
                                $checked = ' checked="checked"';
                            }
                        }
                    } else {
                        if ($field_value == '1') {
                            $checked = ' checked="checked"';
                        }
                    }
                    if ($readonly) {
                        $output = '<input type="checkbox" name="' . $field_name . '" id="' . $field_name . '" class="mgrid_checkbox" value="1"' . $checked . $atr_disabled . '>';
                        $output .= draw_hidden_field($field_name, '1', false, $field_name);
                    } else {
                        $output = '<input type="checkbox" name="' . $field_name . '" id="' . $field_name . '" class="mgrid_checkbox" value="1"' . $checked . '>';
                    }
                    $output .= $post_html;
                    break;
                case 'date':
                case 'datetime':
                case 'time':
                    if ($mode != 'details') {
                        $lang = array();
                        $lang['months'][1] = defined('_JANUARY') ? _JANUARY : 'January';
                        $lang['months'][2] = defined('_FEBRUARY') ? _FEBRUARY : 'February';
                        $lang['months'][3] = defined('_MARCH') ? _MARCH : 'March';
                        $lang['months'][4] = defined('_APRIL') ? _APRIL : 'April';
                        $lang['months'][5] = defined('_MAY') ? _MAY : 'May';
                        $lang['months'][6] = defined('_JUNE') ? _JUNE : 'June';
                        $lang['months'][7] = defined('_JULY') ? _JULY : 'July';
                        $lang['months'][8] = defined('_AUGUST') ? _AUGUST : 'August';
                        $lang['months'][9] = defined('_SEPTEMBER') ? _SEPTEMBER : 'September';
                        $lang['months'][10] = defined('_OCTOBER') ? _OCTOBER : 'October';
                        $lang['months'][11] = defined('_NOVEMBER') ? _NOVEMBER : 'November';
                        $lang['months'][12] = defined('_DECEMBER') ? _DECEMBER : 'December';
                        $show_link = true;
                        $meridiem = '';
                        if ($field_type == 'datetime') {
                            $datetime_format = 'Y-m-d H:i:s';
                            $datetime_empty_value = '0000-00-00 00:00:00';
                            if ($minutes_step != '1') {
                                $show_link = false;
                            }
                        } else {
                            if ($field_type == 'time') {
                                if ($format_parameter == 'am/pm') {
                                    $datetime_format = $show_seconds ? 'g:i:s A' : 'g:i A';
                                } else {
                                    $datetime_format = $show_seconds ? 'H:i:s' : 'H:i';
                                }
                                $datetime_empty_value = '00:00:00';
                                if ($minutes_step != '1') {
                                    $show_link = false;
                                }
                            } else {
                                $datetime_format = 'Y-m-d';
                                if (!empty($format_parameter)) {
                                    if (strtolower($format_parameter) == 'm-d-y') {
                                        $datetime_format = 'm-d-Y';
                                    } else {
                                        if (strtolower($format_parameter) == 'd-m-y') {
                                            $datetime_format = 'd-m-Y';
                                        }
                                    }
                                }
                                $datetime_empty_value = '0000-00-00';
                            }
                        }
                        $date_datetime_format = @date($datetime_format);
                        $year = substr($field_value, 0, 4);
                        $month = substr($field_value, 5, 2);
                        $day = substr($field_value, 8, 2);
                        if ($field_type == 'datetime') {
                            $hour = substr($field_value, 11, 2);
                            $minute = substr($field_value, 14, 2);
                            $second = substr($field_value, 17, 2);
                        } else {
                            if ($field_type == 'time') {
                                $hour = substr($field_value, 0, 2);
                                $minute = substr($field_value, 3, 2);
                                $second = $show_seconds ? substr($field_value, 6, 2) : '00';
                                if ($format_parameter == 'am/pm') {
                                    $meridiem = '';
                                    if ($hour == '0') {
                                        $hour = 12;
                                        $meridiem = 'am';
                                    } else {
                                        if ($hour < '12') {
                                            $meridiem = 'am';
                                        } else {
                                            if ($hour == '12') {
                                                $meridiem = 'pm';
                                            } else {
                                                $hour -= 12;
                                                if ($hour > 10) {
                                                    $hour = '0' . (int) $hour;
                                                }
                                                $meridiem = 'pm';
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        $arr_ret_date = array();
                        if ($field_type == 'datetime' || $field_type == 'date') {
                            $arr_ret_date['y'] = '<select' . $atr_disabled . ' name="' . $field_name . '__nc_year" id="' . $field_name . '__nc_year" onChange="setCalendarDate(\'frmMicroGrid_' . $this->tableName . '\', \'' . $field_name . '\', \'' . $datetime_format . '\')"><option value="">' . _YEAR . '</option>';
                            for ($i = @date('Y') - $min_year; $i <= @date('Y') + $max_year; $i++) {
                                $arr_ret_date['y'] .= '<option value="' . $i . '"' . ($year == $i ? ' selected="selected"' : '') . '>' . $i . '</option>';
                            }
                            $arr_ret_date['y'] .= '</select>';
                            $arr_ret_date['m'] = '<select' . $atr_disabled . ' name="' . $field_name . '__nc_month" id="' . $field_name . '__nc_month" onChange="setCalendarDate(\'frmMicroGrid_' . $this->tableName . '\', \'' . $field_name . '\', \'' . $datetime_format . '\')"><option value="">' . _MONTH . '</option>';
                            for ($i = 1; $i <= 12; $i++) {
                                $arr_ret_date['m'] .= '<option value="' . ($i < 10 ? '0' . $i : $i) . '"' . ($month == $i ? ' selected="selected"' : '') . '>' . $lang['months'][$i] . '</option>';
                            }
                            $arr_ret_date['m'] .= '</select>';
                            $arr_ret_date['d'] = '<select' . $atr_disabled . ' name="' . $field_name . '__nc_day" id="' . $field_name . '__nc_day" onChange="setCalendarDate(\'frmMicroGrid_' . $this->tableName . '\', \'' . $field_name . '\', \'' . $datetime_format . '\')"><option value="">' . _DAY . '</option>';
                            for ($i = 1; $i <= 31; $i++) {
                                $arr_ret_date['d'] .= '<option value="' . ($i < 10 ? '0' . $i : $i) . '"' . ($day == $i ? ' selected="selected"' : '') . '>' . ($i < 10 ? '0' . $i : $i) . '</option>';
                            }
                            $arr_ret_date['d'] .= '</select>';
                            $output = $arr_ret_date[strtolower(substr($datetime_format, 0, 1))];
                            $output .= $arr_ret_date[strtolower(substr($datetime_format, 2, 1))];
                            $output .= $arr_ret_date[strtolower(substr($datetime_format, 4, 1))];
                        }
                        if ($field_type == 'datetime' || $field_type == 'time') {
                            if ($field_type == 'datetime') {
                                $output .= ' : ';
                            }
                            if ($format_parameter == 'am/pm') {
                                $output .= '<select' . $atr_disabled . ' name="' . $field_name . '__nc_hour" id="' . $field_name . '__nc_hour" onChange="setCalendarDate(\'frmMicroGrid_' . $this->tableName . '\', \'' . $field_name . '\', \'' . $datetime_format . '\')">';
                                for ($i = 1; $i <= 12; $i++) {
                                    $output .= '<option value="' . ($i < 10 ? '0' . $i : $i) . '"' . ($hour == $i ? ' selected="selected"' : '') . '>' . ($i < 10 ? '0' . $i : $i) . '</option>';
                                }
                                $output .= '</select>';
                                $output .= '<select' . $atr_disabled . ' name="' . $field_name . '__nc_minute" id="' . $field_name . '__nc_minute" onChange="setCalendarDate(\'frmMicroGrid_' . $this->tableName . '\', \'' . $field_name . '\', \'' . $datetime_format . '\')">';
                                for ($i = 0; $i <= 59; $i = $i + $minutes_step) {
                                    $output .= '<option value="' . ($i < 10 ? '0' . $i : $i) . '"' . ($minute == $i ? ' selected="selected"' : '') . '>' . ($i < 10 ? '0' . $i : $i) . '</option>';
                                }
                                $output .= '</select>';
                                $output .= '<select' . $atr_disabled . ' name="' . $field_name . '__nc_meridiem" id="' . $field_name . '__nc_meridiem" onChange="setCalendarDate(\'frmMicroGrid_' . $this->tableName . '\', \'' . $field_name . '\', \'' . $datetime_format . '\')"><option value="am" ' . ($meridiem == 'am' ? 'selected="selected"' : '') . '>AM</option><option value="pm" ' . ($meridiem == 'pm' ? 'selected="selected"' : '') . '>PM</option></select>';
                            } else {
                                $output .= '<select' . $atr_disabled . ' name="' . $field_name . '__nc_hour" id="' . $field_name . '__nc_hour" onChange="setCalendarDate(\'frmMicroGrid_' . $this->tableName . '\', \'' . $field_name . '\', \'' . $datetime_format . '\')"><option value="00">' . _HOUR . '</option>';
                                for ($i = 0; $i <= 23; $i++) {
                                    $output .= '<option value="' . ($i < 10 ? '0' . $i : $i) . '"' . ($hour == $i ? ' selected="selected"' : '') . '>' . ($i < 10 ? '0' . $i : $i) . '</option>';
                                }
                                $output .= '</select>';
                                $output .= '<select' . $atr_disabled . ' name="' . $field_name . '__nc_minute" id="' . $field_name . '__nc_minute" onChange="setCalendarDate(\'frmMicroGrid_' . $this->tableName . '\', \'' . $field_name . '\', \'' . $datetime_format . '\')"><option value="00">' . _MIN . '</option>';
                                for ($i = 0; $i <= 59; $i = $i + $minutes_step) {
                                    $output .= '<option value="' . ($i < 10 ? '0' . $i : $i) . '"' . ($minute == $i ? ' selected="selected"' : '') . '>' . ($i < 10 ? '0' . $i : $i) . '</option>';
                                }
                                $output .= '</select>';
                            }
                            if ($show_seconds) {
                                $output .= '<select' . $atr_disabled . ' name="' . $field_name . '__nc_second" id="' . $field_name . '__nc_second" onChange="setCalendarDate(\'frmMicroGrid_' . $this->tableName . '\', \'' . $field_name . '\', \'' . $datetime_format . '\')"><option value="">' . _SEC . '</option>';
                                for ($i = 0; $i <= 59; $i++) {
                                    $output .= '<option value="' . ($i < 10 ? '0' . $i : $i) . '"' . ($second == $i ? ' selected="selected"' : '') . '>' . ($i < 10 ? '0' . $i : $i) . '</option>';
                                }
                                $output .= '</select>';
                            }
                        }
                        if (!$readonly) {
                            if ($show_link) {
                                $output .= ' <a href="javascript:void(\'date|set\');" onclick="setCalendarDate(\'frmMicroGrid_' . $this->tableName . '\', \'' . $field_name . '\', \'' . $datetime_format . '\', \'' . @date($datetime_format) . '\', \'' . (@date('Y') - $min_year) . '\', false)">[ ' . $date_datetime_format . ' ]</a>';
                            }
                            if (!$required) {
                                $output .= ' <a href="javascript:void(\'date|reset\');" onclick="setCalendarDate(\'frmMicroGrid_' . $this->tableName . '\', \'' . $field_name . '\', \'' . $datetime_format . '\', \'' . $datetime_empty_value . '\', \'1\', false)">[ ' . _RESET . ' ]</a>';
                            }
                        }
                        $output .= '<input style="width:0px;border:0px;margin:0px;padding:0px;" type="text" name="' . $field_name . '" id="' . $field_name . '" value="' . $field_value . '">';
                    } else {
                        if ($field_value != '' && !preg_match('/0000-00-00/', $field_value)) {
                            if (empty($format_parameter)) {
                                $format_parameter = $format == 'datetime' ? 'Y-m-d H:i:s' : 'Y-m-d';
                            }
                            $field_value = date($format_parameter, strtotime($field_value));
                        } else {
                            $field_value = '';
                        }
                        $output = '<label class="mgrid_label">' . $this->GetDataDecoded($field_value) . '</label>';
                    }
                    break;
                case 'file':
                case 'image':
                    if (strtolower(SITE_MODE) == 'demo') {
                        $atr_readonly = ' disabled="disabled"';
                    }
                    if ($mode == 'edit' || $mode == 'details') {
                        if ($mode == 'edit') {
                            if ($field_value != '') {
                                $filesize = number_format(@filesize($target . $field_value) / 1024, 1) . ' Kb';
                                $output = $field_type == 'file' ? $field_value : '<img src="' . $target . $field_value . '" title="' . $field_value . ' (' . $filesize . ')" alt="" width="' . $image_width . '" height="' . $image_height . '">';
                                if ($required) {
                                    $output .= draw_hidden_field($field_name, $field_value, false, $field_name);
                                }
                                if (strtolower(SITE_MODE) != 'demo' && !$readonly) {
                                    $output .= '<br><a href="' . $this->formActionURL . '&mg_prefix=' . $this->uPrefix . '&mg_action=edit&mg_rid=' . $rid . '&mg_operation=remove&mg_operation_field=' . $field_name . '">[' . _DELETE_WORD . ']</a>';
                                }
                            } else {
                                $output = '<input type="file" name="' . $field_name . '" id="' . $field_name . '" class="mgrid_file" ' . $atr_readonly . '>';
                            }
                        } else {
                            if ($mode == 'details') {
                                if ($field_value == '' && $no_image != '') {
                                    $field_value = $no_image;
                                }
                                $output = $field_type == 'file' ? $field_value : '<img src="' . $target . $field_value . '" title="' . $field_value . '" alt="" width="' . $image_width . '" height="' . $image_height . '">';
                            }
                        }
                    } else {
                        $output = '<input type="file" name="' . $field_name . '" id="' . $field_name . '" class="mgrid_file" ' . $atr_readonly . '>';
                    }
                    break;
                case 'enum':
                    if (is_array($source)) {
                        if ($mode == 'add' || $mode == 'edit') {
                            if ($view_type == 'checkboxes') {
                                $output = '';
                                $params_edit = $mode == 'edit' ? @unserialize($field_value) : array();
                                $checkboxes_count = 1;
                                foreach ($source as $key => $val) {
                                    if ($mode == 'edit') {
                                        $checked = is_array($params_edit) && in_array($key, $params_edit) ? 'checked="checked"' : '';
                                    } else {
                                        $checked = isset($params[$field_name]) && is_array($params[$field_name]) && in_array($key, $params[$field_name]) ? 'checked="checked"' : '';
                                    }
                                    $output .= '<div style="float:' . Application::Get('defined_left') . ';width:220px;"><input type="checkbox" name="' . $field_name . '[]" id="' . $field_name . $checkboxes_count . '" value="' . $key . '" ' . $checked . '/> <label for="' . $field_name . $checkboxes_count . '">' . $val . '</label></div>';
                                    $checkboxes_count++;
                                }
                                $output .= '<input type="hidden" name="' . $field_name . '[]" value="-placeholder-" />';
                                /* add placeholder for checkboxes */
                            } else {
                                if ($view_type == 'label') {
                                    if (isset($source[$field_value])) {
                                        $output = $source[$field_value];
                                    }
                                } else {
                                    $output_start = '<select class="mgrid_select" name="' . $field_name . '" id="' . $field_name . '" ' . ($javascript_event != '' ? ' ' . $javascript_event : '') . ' style="' . ($width != '' ? 'width:' . $width . ';' : '') . '" ' . ($readonly ? 'disabled="disabled"' : '') . '>';
                                    $output_options = '';
                                    if ($default_option) {
                                        $output_options .= '<option value="">' . $default_option . '</option>';
                                    }
                                    foreach ($source as $key => $val) {
                                        $output_options .= '<option value="' . $key . '" ';
                                        $output_options .= $field_value == $key ? 'selected="selected" ' : '';
                                        $output_options .= '>' . $val . '</option>';
                                    }
                                    $output = $output_start . $output_options . '</select>';
                                }
                            }
                        } else {
                            if ($view_type == 'checkboxes') {
                                $params_details = @unserialize($field_value);
                                foreach ($source as $key => $val) {
                                    $checked = is_array($params_details) && in_array($key, $params_details) ? '<span class="green">+</span> ' : '';
                                    $output .= '<div style="float:' . Application::Get('defined_left') . ';width:190px;"><label>' . $checked . ($checked ? $val : '<span class="lightgray">&#8226; ' . $val . '</span>') . '</label></div>';
                                }
                            } else {
                                if (isset($source[$field_value])) {
                                    $output = $source[$field_value];
                                }
                            }
                        }
                    }
                    $output .= $post_html;
                    break;
                case 'label':
                    $title = '';
                    $field_value = $this->FormatFieldValue($field_value, $format, $format_parameter);
                    if ($maxlength != '' && $this->IsInteger($maxlength)) {
                        $this->PrepareSubString($field_value, $title, $maxlength);
                    }
                    $output = $pre_html . '<label class="mgrid_label mgrid_wrapword" title="' . strip_tags($title) . '">' . $this->GetDataDecoded($field_value) . '</label>' . $post_html;
                    break;
                case 'html':
                    if ($mode == 'details') {
                        $output = $pre_html . $this->GetDataDecodedText($field_value) . $post_html;
                    }
                    break;
                case 'object':
                    if (!preg_match('/youtube/i', $field_value)) {
                        $output = '<object width="' . $width . '" height="' . $height . '">
								   <param name="movie" value="' . $field_value . '">
								   <embed src="' . $field_value . '" width="' . $width . '" height="' . $height . '"></embed>
								   </object>';
                    } else {
                        $output = $field_value;
                    }
                    break;
                case 'password':
                    if ($mode == 'add' || $mode == 'edit') {
                        if ($cryptography && strtolower($cryptography_type) == 'md5') {
                            $field_value = '';
                        }
                        if ($password_generator && $mode == 'add') {
                            $post_html_temp = ' &nbsp;<a href="javascript:__mgGenerateRandom(\'password\', \'random-password\')" id="link-password">[ ' . _GENERATE . ' ]</a>';
                            $post_html_temp .= ' &nbsp;<span id="random-password-div" style="display:none;"><a href="javascript:void(0);" onclick="__mgUseThisPassword(\'' . $field_name . '\')" id="link-confirm-password">[ ' . _USE_THIS_PASSWORD . ' ]</a> <label id="random-password" style="background-color:#f4f4f4;font-size:14px;margin:0 5px;"></label></span>';
                            $post_html .= $post_html_temp . $post_html;
                        }
                        $output = '<input type="password" class="mgrid_text" name="' . $field_name . '" id="' . $field_name . '" style="' . ($width != '' ? 'width:' . $width . ';' : '') . '" value="' . $this->GetDataDecoded($field_value) . '" ' . $atr_readonly . $attr_maxlength . '>' . $post_html;
                    } else {
                        $output = '<label class="mgrid_label">*****</label>';
                    }
                    break;
                case 'textarea':
                    $output = '';
                    if ($editor_type == 'wysiwyg') {
                        $wysiwyg_state = isset($_COOKIE['wysiwyg_' . $field_name . '_mode']) ? $_COOKIE['wysiwyg_' . $field_name . '_mode'] : '0';
                        $output .= '<script type="text/javascript">';
                        $output .= '__mgAddListener(document, \'load\', function() { toggleEditor(\'' . $wysiwyg_state . '\',\'' . $field_name . '\',\'' . $height . '\'); }, false);' . $nl;
                        $output .= '__mgAddListener(this, \'load\', function() { toggleEditor(\'' . $wysiwyg_state . '\',\'' . $field_name . '\',\'' . $height . '\'); }, false);' . $nl;
                        $output .= '</script>';
                        $output .= '[ <a id="lnk_0_' . $field_name . '" style="display:none;" href="javascript:toggleEditor(\'0\',\'' . $field_name . '\');" title="Switch to Simple Mode">' . _SIMPLE . '</a><a id="lnk_1_' . $field_name . '" href="javascript:toggleEditor(\'1\',\'' . $field_name . '\');" title="Switch to Advanced Mode">' . _ADVANCED . '</a> ]<br>';
                    }
                    $output .= $pre_html . '<textarea class="mgrid_textarea" name="' . $field_name . '" id="' . $field_name . '" style="' . ($width != '' ? 'width:' . $width . ';' : ' rows="7"') . ($height != '' ? 'height:' . $height . ';' : ' cols="60"') . '" ' . $atr_disabled . $direction . $attr_maxlength . '>' . $this->GetDataDecodedText($field_value) . '</textarea>' . $post_html;
                    break;
                default:
                case 'textbox':
                    if ($username_generator && $mode == 'add') {
                        $post_html .= ' &nbsp;<a href="javascript:__mgGenerateRandom(\'username\', \'' . $field_name . '\')" id="link-username">[ ' . _GENERATE . ' ]</a>' . $post_html;
                    }
                    $output = $pre_html . '<input class="mgrid_text' . $css_disabled . '" name="' . $field_name . '" id="' . $field_name . '"  style="' . ($width != '' ? 'width:' . $width . ';' : '') . ($visible == false ? 'display:none;' : '') . '" value="' . $this->GetDataDecoded($field_value) . '" ' . $atr_readonly . $attr_maxlength . $direction . $autocomplete . ' />' . $post_html;
                    break;
            }
        }
        if ($draw) {
            echo $output;
        } else {
            return $output;
        }
    }
Exemplo n.º 28
0
            }
        } 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;
    ?>
	<div class="pages_contents">
	<form action="index.php?admin=password_forgotten" method="post">
		<?php 
    draw_hidden_field('act', 'send');
    ?>
		<?php 
    draw_token_field();
    ?>
		
		<table class="loginForm" width="99%" border="0">
		<tr>
			<td colspan="2">
				<?php 
    echo '<p>' . _PASSWORD_RECOVERY_MSG . '</p>';
    ?>
			</td>
		</tr>
		<tr>
			<td width="12%" nowrap='nowrap'><?php 
Exemplo n.º 29
0
    /**
     * 	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) . '
				  &nbsp;&nbsp;<input class="form_button" type="submit" name="btnLogout" value="' . _BUTTON_LOGOUT . '" />&nbsp;&nbsp;
				  </form>';
            draw_block_bottom();
            echo '<br />';
        }
        $this->activeMenuCount = $menu_index;
    }
Exemplo n.º 30
0
    ?>
	<form action="index.php" method="post" id="frmLogout" style="display:inline; margin-top:0px; padding-top:0px;">
		<?php 
    draw_hidden_field('submit_logout', 'logout');
    ?>
		<?php 
    draw_token_field();
    ?>
	</form>
		
	<form action="index.php?customer=remove_account" method="post" name="frmProfile" onsubmit="return confirm('<?php 
    echo _REMOVE_ACCOUNT_ALERT;
    ?>
');">
		<?php 
    draw_hidden_field('submit', 'remove');
    ?>
		<?php 
    draw_token_field();
    ?>
		<br />
		<?php 
    echo $msg;
    if ($account_deleted) {
        echo '<script type="text/javascript">setTimeout(function(){appFormSubmit("frmLogout")}, 5000);</script>';
    } else {
        draw_message(_REMOVE_ACCOUNT_WARNING);
    }
    ?>
		<?php 
    if (!$account_deleted) {