function write($message, $type) { global $day_month_names; if (is_array($day_month_names)) { error_log(xos_date_format(STORE_PARSE_DATE_TIME_FORMAT) . ' [' . $type . '] ' . $message . "\n", 3, STORE_PAGE_PARSE_TIME_LOG); } }
function xos_order_status_email_date_long($raw_date) { if ($raw_date == '0000-00-00 00:00:00' || $raw_date == '') { return false; } $year = (int) substr($raw_date, 0, 4); $month = (int) substr($raw_date, 5, 2); $day = (int) substr($raw_date, 8, 2); $hour = (int) substr($raw_date, 11, 2); $minute = (int) substr($raw_date, 14, 2); $second = (int) substr($raw_date, 17, 2); return xos_date_format('%A %d %B, %Y', mktime($hour, $minute, $second, $month, $day, $year)); }
} else { $showuser = function_exists('posix_getpwuid') ? true : false; $contents = array(); $dir = dir($_SESSION['current_path']); while ($file = $dir->read()) { if ($file != '.' && $file != 'CVS' && ($file != '..' || $_SESSION['current_path'] != $dir_fs_document_root)) { $file_size = number_format(filesize($_SESSION['current_path'] . '/' . $file)) . ' bytes'; $permissions = xos_get_file_permissions(fileperms($_SESSION['current_path'] . '/' . $file)); $is_image = in_array(strtolower(substr($file, -4)), array('.gif', '.jpg', '.png', '.ico', '.svg')) || strtolower(substr($file, -5)) == '.jpeg' ? true : false; if ($showuser) { $user = @posix_getpwuid(fileowner($_SESSION['current_path'] . '/' . $file)); $group = @posix_getgrgid(filegroup($_SESSION['current_path'] . '/' . $file)); } else { $user = $group = array(); } $contents[] = array('name' => $file, 'is_dir' => is_dir($_SESSION['current_path'] . '/' . $file), 'is_image' => $is_image, 'last_modified' => xos_date_format(DATE_TIME_FORMAT, filemtime($_SESSION['current_path'] . '/' . $file)), 'size' => $file_size, 'image_data' => $is_image ? @getimagesize($_SESSION['current_path'] . '/' . $file) : array(), 'permissions' => $permissions, 'user' => $user['name'], 'group' => $group['name']); } } function xos_cmp($a, $b) { return strcmp(($a['is_dir'] ? 'D' : 'F') . $a['name'], ($b['is_dir'] ? 'D' : 'F') . $b['name']); } usort($contents, 'xos_cmp'); $folders_and_files_array = array(); for ($i = 0, $n = sizeof($contents); $i < $n; $i++) { if ((!isset($_GET['info']) || isset($_GET['info']) && $_GET['info'] == $contents[$i]['name']) && !isset($fInfo) && $action != 'upload' && $action != 'new_folder') { $fInfo = new objectInfo($contents[$i]); } if ($contents[$i]['name'] == '..') { $goto_link = substr($_SESSION['current_path'], 0, strrpos($_SESSION['current_path'], '/')); } else {
if (SEND_EXTRA_ORDER_EMAILS_TO != '') { $send_extra_order_emails_to = SEND_EXTRA_ORDER_EMAILS_TO; $decoded_send_extra_order_emails_to = html_entity_decode($send_extra_order_emails_to, ENT_QUOTES, 'UTF-8'); $recipients = explode(',', $decoded_send_extra_order_emails_to); for ($i = 0, $n = count($recipients); $i < $n; $i++) { $address = ''; $name = ''; $pieces = explode('<', $recipients[$i]); if (count($pieces) == 2) { $address = trim($pieces[1], " >"); $name = trim($pieces[0]); } elseif (count($pieces) == 1) { $pos = stripos($pieces[0], '@'); $address = $pos ? trim($pieces[0], " >") : ''; } $email_to_other_people = new mailer($name, $address, sprintf(EMAIL_TEXT_SUBJECT_OTHER, $insert_id, xos_date_format(DATE_FORMAT_SHORT)), $output_order_email_html, $output_order_email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SHOP_LOGO); if (!$email_to_other_people->send()) { $messageStack->add_session('header', sprintf(ERROR_PHPMAILER, $email_to_other_people->ErrorInfo)); } } } } // load the after_process function from the payment modules $payment_modules->after_process(); $_SESSION['cart']->reset(true); // unregister session variables used during checkout unset($_SESSION['sendto']); unset($_SESSION['billto']); unset($_SESSION['shipping']); unset($_SESSION['payment']); unset($_SESSION['comments']);
// // XOS-Shop is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with XOS-Shop. If not, see <http://www.gnu.org/licenses/>. //------------------------------------------------------------------------------ // this file is based on: // osCommerce, Open Source E-Commerce Solutions // http://www.oscommerce.com // Copyright (c) 2003 osCommerce // filename: counter.php // // Released under the GNU General Public License //////////////////////////////////////////////////////////////////////////////// $counter_query = xos_db_query("select startdate, counter from " . TABLE_COUNTER); if (!xos_db_num_rows($counter_query)) { $date_now = date('Ymd'); xos_db_query("insert into " . TABLE_COUNTER . " (startdate, counter) values ('" . $date_now . "', '1')"); $counter_startdate = $date_now; $counter_now = 1; } else { $counter = xos_db_fetch_array($counter_query); $counter_startdate = $counter['startdate']; $counter_now = $counter['counter'] + 1; xos_db_query("update " . TABLE_COUNTER . " set counter = '" . $counter_now . "'"); } $counter_startdate_formatted = xos_date_format(DATE_FORMAT_LONG, mktime(0, 0, 0, substr($counter_startdate, 4, 2), substr($counter_startdate, -2), substr($counter_startdate, 0, 4)));
} elseif (!$oldaction == 'new') { // for action=voucheredit $coupon_finishdate = preg_split("/[-]/", date('Y-m-d', strtotime($coupon['coupon_expire_date']))); } else { // error is being displayed $coupon_finishdate = preg_split("/[-]/", date('Y-m-d', mktime(0, 0, 0, $_POST['coupon_finishdate_month'],$_POST['coupon_finishdate_day'] ,$_POST['coupon_finishdate_year'] ))); } 'input_coupon_startdate' => xos_draw_date_selector('coupon_startdate', mktime(0,0,0, $coupon_startdate[1], $coupon_startdate[2], $coupon_startdate[0])), 'input_coupon_finishdate' => xos_draw_date_selector('coupon_finishdate', mktime(0,0,0, $coupon_finishdate[1], $coupon_finishdate[2], $coupon_finishdate[0])), */ $languages = xos_get_languages(); $coupon_content_array = array(); for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { $language_id = $languages[$i]['id']; $coupon_content_array[] = array('languages_image' => xos_image(DIR_WS_CATALOG_IMAGES . 'catalog/templates/' . DEFAULT_TPL . '/' . $languages[$i]['directory'] . '/' . $languages[$i]['image'], $languages[$i]['name']), 'input_coupon_name' => xos_draw_input_field('coupon_name[' . $languages[$i]['id'] . ']', $coupon_name[$language_id]), 'textarea_coupon_desc' => xos_draw_textarea_field('coupon_desc[' . $languages[$i]['id'] . ']', '24', '3', $coupon_desc[$language_id])); } $smarty->assign(array('new' => true, 'form_begin' => xos_draw_form('coupon', FILENAME_COUPON_ADMIN, 'action=update&oldaction=' . ($oldaction == 'voucheredit' ? $oldaction : $action) . '&cid=' . $_GET['cid'], 'post', 'enctype="multipart/form-data"'), 'radio_coupon_status_Y' => xos_draw_radio_field('coupon_status', 'Y', $in_status), 'radio_coupon_status_N' => xos_draw_radio_field('coupon_status', 'N', $out_status), 'input_coupon_amount' => xos_draw_input_field('coupon_amount', $coupon_amount), 'input_coupon_min_order' => xos_draw_input_field('coupon_min_order', $coupon_min_order), 'checkbox_coupon_free_ship' => xos_draw_checkbox_field('coupon_free_ship', $coupon_free_ship), 'input_coupon_code' => xos_draw_input_field('coupon_code', $coupon_code), 'input_coupon_uses_coupon' => xos_draw_input_field('coupon_uses_coupon', $coupon_uses_coupon), 'input_coupon_uses_user' => xos_draw_input_field('coupon_uses_user', $coupon_uses_user), 'input_coupon_products' => xos_draw_input_field('coupon_products', $coupon_products), 'input_coupon_categories' => xos_draw_input_field('coupon_categories', $coupon_categories), 'input_coupon_startdate' => xos_draw_input_field('coupon_startdate', xos_date_format(DATE_FORMAT_SHORT), 'id="coupon_startdate" style="background: #ffffcc;" size ="10"'), 'input_coupon_finishdate' => xos_draw_input_field('coupon_finishdate', xos_date_format(DATE_FORMAT_SHORT, mktime(0, 0, 0, date("m"), date("d"), date("Y") + 1)), 'id="coupon_finishdate" style="background: #ffffcc;" size ="10"'), 'link_filename_coupon_admin' => xos_href_link(FILENAME_COUPON_ADMIN), 'hidden_field_date_created' => xos_draw_hidden_field('date_created', $date_created), 'coupon_content' => $coupon_content_array, 'form_end' => '</form>')); break; default: if ($_GET['status'] == 'Y' || $_GET['status'] == 'N') { $cc_query_raw = "select coupon_active, coupon_id, coupon_code, coupon_amount, coupon_minimum_order, coupon_type, coupon_start_date,coupon_expire_date,uses_per_user,uses_per_coupon,restrict_to_products, restrict_to_categories, date_created,date_modified from " . TABLE_COUPONS . " where coupon_active='" . xos_db_input($_GET['status']) . "' and coupon_type != 'G'"; } else { $cc_query_raw = "select coupon_active, coupon_id, coupon_code, coupon_amount, coupon_minimum_order, coupon_type, coupon_start_date,coupon_expire_date,uses_per_user,uses_per_coupon,restrict_to_products, restrict_to_categories, date_created,date_modified from " . TABLE_COUPONS . " where coupon_type != 'G'"; } $cc_split = new splitPageResults($_GET['page'], MAX_DISPLAY_RESULTS, $cc_query_raw, $cc_query_numrows); $cc_query = xos_db_query($cc_query_raw); $cc_list_array = array(); while ($cc_list = xos_db_fetch_array($cc_query)) { $redeem_query = xos_db_query("select redeem_date from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . $cc_list['coupon_id'] . "'"); if ($_GET['status'] == 'R' && xos_db_num_rows($redeem_query) == 0) { continue; }
function xos_datetime_short($raw_datetime) { if ($raw_datetime == '0000-00-00 00:00:00' || $raw_datetime == '') { return false; } $year = (int) substr($raw_datetime, 0, 4); $month = (int) substr($raw_datetime, 5, 2); $day = (int) substr($raw_datetime, 8, 2); $hour = (int) substr($raw_datetime, 11, 2); $minute = (int) substr($raw_datetime, 14, 2); $second = (int) substr($raw_datetime, 17, 2); return xos_date_format(DATE_TIME_FORMAT, mktime($hour, $minute, $second, $month, $day, $year)); }
function xos_banner_graph_daily($banner_id) { global $banner; $year = isset($_GET['year']) ? $_GET['year'] : date('Y'); $month = isset($_GET['month']) ? $_GET['month'] : date('n'); $days = date('t', mktime(0, 0, 0, $month)) + 1; $stats = array(); for ($i = 1; $i < $days; $i++) { $names[] = $i; $values[] = '0'; $dvalues[] = '0'; } $banner_stats_query = xos_db_query("select dayofmonth(banners_history_date) as banner_day, banners_shown as value, banners_clicked as dvalue from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . $banner_id . "' and month(banners_history_date) = '" . $month . "' and year(banners_history_date) = '" . $year . "'"); while ($banner_stats = xos_db_fetch_array($banner_stats_query)) { $names[$banner_stats['banner_day'] - 1] = $banner_stats['banner_day']; $values[$banner_stats['banner_day'] - 1] = $banner_stats['value'] ? $banner_stats['value'] : '0'; $dvalues[$banner_stats['banner_day'] - 1] = $banner_stats['dvalue'] ? $banner_stats['dvalue'] : '0'; } $largest = @max($values); $bars = array(); $dbars = array(); for ($i = 0, $n = sizeof($values); $i < $n; $i++) { $bars[$i] = DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/graph_hbar_blue.gif'; $dbars[$i] = DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/graph_hbar_red.gif'; } $graph_vals = @array('vlabel' => TEXT_BANNERS_DATA, 'hlabel' => sprintf(TEXT_BANNERS_DAILY_STATISTICS, $banner['banners_title'], xos_date_format('%B', mktime(0, 0, 0, $month)), $year), 'type' => '3', 'cellpadding' => '', 'cellspacing' => '1', 'border' => '', 'width' => '', 'vfcolor' => '#ffffff', 'hfcolor' => '#ffffff', 'vbgcolor' => '#81a2b6', 'hbgcolor' => '#81a2b6', 'vfstyle' => 'Verdana, Arial, Helvetica', 'hfstyle' => 'Verdana, Arial, Helvetica', 'scale' => 100 / $largest, 'namebgcolor' => '#f3f5fe', 'valuebgcolor' => '#f3f5fe', 'namefcolor' => '', 'valuefcolor' => '#0000d0', 'namefstyle' => 'Verdana, Arial, Helvetica', 'valuefstyle' => '', 'doublefcolor' => '#ff7339'); return html_graph($names, $values, $bars, $graph_vals, $dvalues, $dbars); }
$messageStack->add('header', ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE, 'error'); } } else { $messageStack->add('header', ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST, 'error'); } } $banner_query = xos_db_query("select banners_title from " . TABLE_BANNERS_CONTENT . " where banners_id = '" . (int) $_GET['bID'] . "' and language_id = '" . (int) $_SESSION['used_lng_id'] . "'"); $banner = xos_db_fetch_array($banner_query); $years_array = array(); $years_query = xos_db_query("select distinct year(banners_history_date) as banner_year from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . (int) $_GET['bID'] . "'"); while ($years = xos_db_fetch_array($years_query)) { $years_array[] = array('id' => $years['banner_year'], 'text' => $years['banner_year']); } $months_array = array(); for ($i = 1; $i < 13; $i++) { $months_array[] = array('id' => $i, 'text' => xos_date_format('%B', mktime(0, 0, 0, $i))); } $type_array = array(array('id' => 'daily', 'text' => STATISTICS_TYPE_DAILY), array('id' => 'monthly', 'text' => STATISTICS_TYPE_MONTHLY), array('id' => 'yearly', 'text' => STATISTICS_TYPE_YEARLY)); require DIR_WS_INCLUDES . 'html_header.php'; require DIR_WS_INCLUDES . 'header.php'; require DIR_WS_INCLUDES . 'column_left.php'; require DIR_WS_INCLUDES . 'footer.php'; $smarty->assign(array('link_filename_banner_manager' => xos_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $_GET['bID']), 'form_begin' => xos_draw_form('year', FILENAME_BANNER_STATISTICS, '', 'get'), 'pull_down_type' => xos_draw_pull_down_menu('type', $type_array, xos_not_null($type) ? $type : 'daily', 'onchange="this.form.submit();"'), 'pull_down_year' => xos_draw_pull_down_menu('year', $years_array, isset($_GET['year']) ? $_GET['year'] : date('Y'), 'onchange="this.form.submit();"'), 'pull_down_month' => xos_draw_pull_down_menu('month', $months_array, isset($_GET['month']) ? $_GET['month'] : date('n'), 'onchange="this.form.submit();"'), 'hidden_field_page' => xos_draw_hidden_field('page', $_GET['page']), 'hidden_field_bid' => xos_draw_hidden_field('bID', $_GET['bID']))); if (SESSID) { $smarty->assign('hidden_field_session', xos_draw_hidden_field(xos_session_name(), xos_session_id())); } $smarty->assign('form_end', '</form>'); switch ($type) { case 'yearly': break; case 'monthly':
// osCommerce, Open Source E-Commerce Solutions // http://www.oscommerce.com // Copyright (c) 2002 osCommerce // filename: banner_monthly.php // // Released under the GNU General Public License //////////////////////////////////////////////////////////////////////////////// include DIR_WS_CLASSES . 'phplot.php'; $year = $_GET['year'] ? $_GET['year'] : date('Y'); $stats = array(); for ($i = 1; $i < 13; $i++) { $stats[] = array(utf8_decode(xos_date_format('%b', mktime(0, 0, 0, $i))), '0', '0'); } $banner_stats_query = xos_db_query("select month(banners_history_date) as banner_month, sum(banners_shown) as value, sum(banners_clicked) as dvalue from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . $banner_id . "' and year(banners_history_date) = '" . $year . "' group by banner_month"); while ($banner_stats = xos_db_fetch_array($banner_stats_query)) { $stats[$banner_stats['banner_month'] - 1] = array(utf8_decode(xos_date_format('%b', mktime(0, 0, 0, $banner_stats['banner_month']))), $banner_stats['value'] ? $banner_stats['value'] : '0', $banner_stats['dvalue'] ? $banner_stats['dvalue'] : '0'); } $graph = new PHPlot(600, 350, 'images/graphs/banner_monthly-' . $banner_id . '.' . $banner_extension); $graph->SetFileFormat($banner_extension); $graph->SetIsInline(1); $graph->SetPrintImage(0); $graph->SetSkipBottomTick(1); $graph->SetDrawYGrid(1); $graph->SetPrecisionY(0); $graph->SetPlotType('lines'); $graph->SetPlotBorderType('left'); $graph->SetTitleFontSize('4'); $graph->SetTitle(utf8_decode(sprintf(TEXT_BANNERS_MONTHLY_STATISTICS, $banner['banners_title'], $year))); $graph->SetBackgroundColor('white'); $graph->SetVertTickPosition('plotleft'); $graph->SetDataValues($stats);
function confirmation() { global $order; for ($i = 1; $i < 13; $i++) { $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => xos_date_format('%B', mktime(0, 0, 0, $i, 1, 2000))); } $today = getdate(); for ($i = $today['year']; $i < $today['year'] + 10; $i++) { $expires_year[] = array('id' => xos_date_format('%y', mktime(0, 0, 0, 1, 1, $i)), 'text' => xos_date_format('%Y', mktime(0, 0, 0, 1, 1, $i))); } $confirmation = array('fields' => array(array('title' => '<label for="cc_owner">' . MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_OWNER . '</label>', 'field' => xos_draw_input_field('cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'], 'id="cc_owner"')), array('title' => '<label for="cc_number_nh-dns">' . MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_NUMBER . '</label>', 'field' => xos_draw_input_field('cc_number_nh-dns', '', 'id="cc_number_nh-dns"')), array('title' => '<label for="cc_expires_month">' . MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES . '</label>', 'field' => xos_draw_pull_down_menu('cc_expires_month', $expires_month, '', 'id="cc_expires_month"') . '<span style="position:absolute; left:-1000px; top:-1000px; width:0; height:0; overflow:hidden; display:inline;"><label for="cc_expires_year">' . MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES . '</label></span> ' . xos_draw_pull_down_menu('cc_expires_year', $expires_year, '', 'id="cc_expires_year"')))); return $confirmation; }
} else { $site_trail->add($name['products_name'], xos_href_link(FILENAME_PRODUCT_INFO, 'c=' . $cPath . '&p=' . $_GET['p'])); } } } // initialize the message stack for output messages require DIR_WS_CLASSES . 'message_stack.php'; $messageStack = new messageStack(); require DIR_WS_CLASSES . 'template_integration.php'; $templateIntegration = new templateIntegration(); $templateIntegration->buildBlocks(); // check for active product categories in Level 0 $check_is_shop_query = xos_db_query("select count(*) as count from " . TABLE_CATEGORIES_OR_PAGES . " where parent_id = '0' and is_page = 'false' and categories_or_pages_status = '1'"); $check_is_shop = xos_db_fetch_array($check_is_shop_query); $is_shop = false; if ($check_is_shop['count'] > 0) { $is_shop = true; } // set which precautions should be checked define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'true'); define('WARN_SESSION_AUTO_START', 'true'); define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true'); $smarty->caching = 0; $smarty->cache_lifetime = -1; $smarty->compile_check = constant(COMPILE_CHECK); $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'general'); $smarty->configLoad('templates/' . SELECTED_TPL . '/includes/configuration/config.conf'); $smarty->loadFilter('output', 'set_internal_link'); // $smarty->loadFilter('output','trimwhitespace'); $smarty->assign(array('nl' => "\n", 'is_shop' => $is_shop, 'page_info' => $page_info, 'request_type' => $request_type, 'link_filename_popup_content_6' => STATUS_POPUP_CONTENT_6 == '1' ? xos_href_link(FILENAME_POPUP_CONTENT, 'co=6', $request_type) : '', 'end_tags' => DISPLAY_PAGE_PARSE_TIME == 'true' && STORE_PAGE_PARSE_TIME == 'true' ? $templateIntegration->getBlocks('footer_scripts') : $templateIntegration->getBlocks('footer_scripts') . "</body>\n</html>", 'date_format_long' => xos_date_format(DATE_FORMAT_LONG), 'languages_path' => DIR_WS_CATALOG . DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/' . $_SESSION['language'] . '/', 'buttons_path' => DIR_WS_CATALOG . DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/' . $_SESSION['language'] . '/buttons/', 'images_path' => DIR_WS_CATALOG . DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/'));
function confirmation() { global $order; if (MODULE_PAYMENT_PSIGATE_INPUT_MODE == 'Local') { $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type, 'fields' => array(array('title' => MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_OWNER, 'field' => $order->billing['firstname'] . ' ' . $order->billing['lastname']), array('title' => MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_NUMBER, 'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', strlen($this->cc_card_number) - 8) . substr($this->cc_card_number, -4)), array('title' => MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_EXPIRES, 'field' => xos_date_format('%B, %Y', mktime(0, 0, 0, $_POST['psigate_cc_expires_month'], 1, '20' . $_POST['psigate_cc_expires_year']))))); return $confirmation; } else { return false; } }
require DIR_WS_INCLUDES . 'boxes.php'; require DIR_WS_INCLUDES . 'header.php'; require DIR_WS_INCLUDES . 'footer.php'; if ($messageStack->size('create_account') > 0) { $smarty->assign('message_stack', $messageStack->output('create_account')); $smarty->assign('message_stack_error', $messageStack->output('create_account', 'error')); $smarty->assign('message_stack_warning', $messageStack->output('create_account', 'warning')); $smarty->assign('message_stack_success', $messageStack->output('create_account', 'success')); } if (ACCOUNT_GENDER == 'true') { $smarty->assign(array('account_gender' => true, 'input_gender' => xos_draw_radio_field('gender', 'm', '', 'id="gender_m"') . '<label class="control-label" for="gender_m"> ' . MALE . ' </label>' . xos_draw_radio_field('gender', 'f', '', 'id="gender_f"') . '<label class="control-label" for="gender_f"> ' . FEMALE . ' </label>' . (xos_not_null(ENTRY_GENDER_TEXT) ? '<span class="input-requirement">' . ENTRY_GENDER_TEXT . '</span>' : ''))); } if (ACCOUNT_DOB == 'true') { $years = array(); $years_array = array(); $year = xos_date_format('%Y'); $years = range((int) ($year - 9), (int) ($year - 110)); rsort($years, SORT_NUMERIC); // sort($years, SORT_NUMERIC); $years_array[] = array('id' => '', 'text' => DATE_OF_BIRTH_ENTRY_TEXT_YEAR); while (list($key, $value) = each($years)) { $years_array[] = array('id' => $value, 'text' => $value); } $days_array = array(); $days_array[] = array('id' => '', 'text' => DATE_OF_BIRTH_ENTRY_TEXT_DAY); for ($i = 1; $i <= 31; $i++) { $days_array[] = array('id' => sprintf('%02d', $i), 'text' => sprintf('%02d', $i)); } $months_array = array(); $months_array[] = array('id' => '', 'text' => DATE_OF_BIRTH_ENTRY_TEXT_MONTH); for ($i = 1; $i <= 12; $i++) {
// Released under the GNU General Public License //////////////////////////////////////////////////////////////////////////////// include DIR_WS_CLASSES . 'phplot.php'; $year = $_GET['year'] ? $_GET['year'] : date('Y'); $month = $_GET['month'] ? $_GET['month'] : date('n'); $days = date('t', mktime(0, 0, 0, $month)) + 1; $stats = array(); for ($i = 1; $i < $days; $i++) { $stats[] = array($i, '0', '0'); } $banner_stats_query = xos_db_query("select dayofmonth(banners_history_date) as banner_day, banners_shown as value, banners_clicked as dvalue from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . $banner_id . "' and month(banners_history_date) = '" . $month . "' and year(banners_history_date) = '" . $year . "'"); while ($banner_stats = xos_db_fetch_array($banner_stats_query)) { $stats[$banner_stats['banner_day'] - 1] = array($banner_stats['banner_day'], $banner_stats['value'] ? $banner_stats['value'] : '0', $banner_stats['dvalue'] ? $banner_stats['dvalue'] : '0'); } $graph = new PHPlot(600, 350, 'images/graphs/banner_daily-' . $banner_id . '.' . $banner_extension); $graph->SetFileFormat($banner_extension); $graph->SetIsInline(1); $graph->SetPrintImage(0); $graph->SetSkipBottomTick(1); $graph->SetDrawYGrid(1); $graph->SetPrecisionY(0); $graph->SetPlotType('lines'); $graph->SetPlotBorderType('left'); $graph->SetTitleFontSize('4'); $graph->SetTitle(utf8_decode(sprintf(TEXT_BANNERS_DAILY_STATISTICS, $banner['banners_title'], xos_date_format('%B', mktime(0, 0, 0, $month)), $year))); $graph->SetBackgroundColor('white'); $graph->SetVertTickPosition('plotleft'); $graph->SetDataValues($stats); $graph->SetDataColors(array('blue', 'red'), array('blue', 'red')); $graph->DrawGraph(); $graph->PrintImage();