function make_theme_list()
{
    $themes = list_info_dir('../inc/themes', 'theme');
    $current_theme = get_setting_value("theme_dir_name");
    for ($n = 0; $n < count($themes); $n++) {
        $theme = $themes[$n];
        $dirname = $theme[1];
        $attrs = $theme[0];
        $name = $attrs['Name'];
        if ($dirname == $current_theme) {
            $spid = " id=\"curr-theme-box\"";
        } else {
            $spid = '';
        }
        $onclick = "onclick=\"Settings.setTheme('{$dirname}');return false;\"";
        echo "<div class=\"theme-icon action-link\" {$onclick} {$spid}>";
        echo "<a href=\"set-theme.php?dirname={$dirname}\" title=\"{$attrs['Comment']}\" class=\"action-link\" {$onclick}>";
        echo "<img src=\"../inc/themes/{$dirname}/{$attrs['Icon']}\" alt=\"{$name}\" width=\"160px\" height=\"160px\" class=\"theme-image\" />";
        echo "</a>";
        if ($dirname == $current_theme) {
            echo "<img src=\"inc/images/ok32.png\" alt=\"current theme\" title=\"Planetoid is currently using this theme.\" id=\"curr-theme\" />";
        } else {
            echo "<a href=\"set-theme.php?dirname={$dirname}\" title=\"{$attrs['Comment']}\" class=\"action-link\" {$onclick}><img src=\"inc/images/set-theme.png\" alt=\"current theme\" title=\"Select this theme.\" class=\"set-theme\" /></a>";
        }
        echo "<span>{$name} {$attrs['Version']}<br/><small>by <a href=\"{$attrs['AuthorURL']}\" target=\"_blank\">{$attrs['Author']}</a></small></span>";
        echo "</div>";
    }
    echo "<br style=\"clear:both\"/>";
}
Esempio n. 2
0
 function resetpassword()
 {
     $data = array();
     if (isset($_POST['resetpasswordbttn'])) {
         $this->form_validation->set_rules('username', 'Username', 'trim|required|xss_clean');
         $this->form_validation->set_error_delimiters('<p class="has-error"><label class="control-label">', '</label></p>');
         if ($this->form_validation->run()) {
             $username = $this->input->post('username');
             $userdata = $this->users_model->select_email($username);
             $rows = $userdata->num_rows();
             if ($rows == 1) {
                 $userdetails = $userdata->row();
                 $firstname = $userdetails->first_name;
                 $email = $userdetails->user_email;
                 $password_token = $this->create_guid();
                 $password_details = array('password' => sha1($password_token));
                 $this->users_model->resetpassword($username, $password_details);
                 //send the password reset email
                 $to = $email;
                 $subject = 'Password Reset Information';
                 $company_name = get_setting_value('companyname') != '' ? get_setting_value('companyname') : "Classic Invoicer";
                 $message = '<h2>Hello ' . ucfirst($firstname) . ', </h2>';
                 $message .= '<p>As you requested, your password has now been reset. Your new login details are as follows:</p>';
                 $message .= '<p> Password : '******'</p>';
                 $message .= '<p>NB : Remember to change this password to a more convinient one.</p>';
                 $message .= '<p>Best Regards.</p>';
                 $message .= '<p>Webmaster</p>';
                 $message .= '<hr/>';
                 $message .= '<p style="font-size:8px; color:#969AB3">Please do not reply to this message; it was sent from an unmonitored email address. This message is a service email related to your use of classic invoice. For general inquiries or to request support with your account, please contact us for Support.</p>';
                 $config['mailtype'] = 'html';
                 $this->load->library("email");
                 $this->email->initialize($config);
                 $this->email->set_newline("\r\n");
                 $this->email->from("noreply@classicinvoicer", $company_name->company_name);
                 $this->email->to($to);
                 $this->email->subject($subject);
                 $this->email->message($message);
                 if ($this->email->send()) {
                     $this->session->set_flashdata('success', 'Password reset successful, check your inbox for instructions !!');
                     redirect('login');
                 }
             } else {
                 $this->session->set_flashdata('error', 'Username does not exist !!');
                 redirect('login/resetpassword');
             }
         }
     }
     $this->load->view('login/resetpassword');
 }
Esempio n. 3
0
        }
        if (!strlen($login_errors)) {
            user_login($user_login, $user_password, "", 0, "", false, $login_errors);
        }
    }
    if (!$login_errors) {
        // make redirect to original page after successful login/logout operations
        header("Location: " . $return_page);
        exit;
    }
}
if (get_session("session_user_id")) {
    $user_info = get_session("session_user_info");
    $user_login = get_setting_value($user_info, "nickname", "");
    if (!$user_login) {
        $user_login = get_setting_value($user_info, "login", "");
    }
    $t->set_var("user_login", $user_login);
    $t->set_var("user_name", get_session("session_user_name"));
    $t->set_var("login_action", "logout");
    $t->set_var("login_form", "");
    $t->parse($block_prefix . "logout_form", false);
} else {
    $t->set_var("user_login", htmlspecialchars($user_login));
    $t->set_var("login_action", "login");
    $t->set_var("logout_form", "");
    $t->parse($block_prefix . "login_form", false);
}
$t->set_var("user_name", get_session("session_user_name"));
$user_login_name = "<b>" . htmlspecialchars($user_login) . "</b>";
$t->set_var("LOGIN_AS_NAME", str_replace("{user_name}", $user_login_name, LOGIN_AS_MSG));
         exit;
     } else {
         $html_template = get_setting_value($block, "html_template", "block_categories_chained_menu.html");
         $t->set_file("block_body", $html_template);
         $t->set_var("products_href", get_custom_friendly_url("products.php"));
         foreach ($categories as $category_id => $category_name) {
             $t->set_var("category_id", $category_id);
             $t->set_var("category_name", htmlspecialchars($category_name));
             $t->parse("category_option");
         }
         $block_parsed = true;
         $t->parse("block_body", false);
     }
 } else {
     // list type
     $html_template = get_setting_value($block, "html_template", "block_categories_list.html");
     $t->set_file("block_body", $html_template);
     $t->set_var("categories_rows", "");
     $t->set_var("categories", "");
     $active_category_path = "0";
     $not = false;
     if ($categories_type == 4) {
         // Tree-type structure
         $sql = " SELECT category_path ";
         $sql .= " FROM " . $table_prefix . "categories ";
         $sql .= " WHERE category_id=" . $db->tosql($category_id, INTEGER);
         $db->query($sql);
         if ($db->next_record()) {
             $active_category_path = $db->f("category_path");
             $active_category_path .= $category_id;
         }
     header("Cache-Control: private", false);
     header("Content-Type: application/octet-stream");
     header("Content-Disposition: attachment; filename=" . $google_base_filename);
     header("Content-Transfer-Encoding: binary");
 }
 // output XML header
 write_to("<?xml version='1.0' encoding='" . $google_base_encoding . "'?>" . $eol . "<rss version='2.0' xmlns:" . $schema_type . "='http://base.google.com/ns/1.0'>" . $eol . "<channel>" . $eol, true);
 if (strlen($google_base_title)) {
     $google_base_title = htmlspecialchars(charset_conv($google_base_title));
     $google_base_title = strlen($google_base_title) < 70 ? $google_base_title : substr($google_base_title, 0, 66) . "...";
     write_to("\t<title>" . $google_base_title . "</title>" . $eol);
 }
 if (strlen($google_base_description)) {
     write_to("\t<description>" . htmlspecialchars(charset_conv($google_base_description)) . "</description> " . $eol);
 }
 write_to("\t<link>" . get_setting_value($settings, "site_url") . "</link>" . $eol);
 $data_sql = $sql . $sql_tables . $where . $group_by . $order_by;
 //echo $data_sql;
 for ($page_number = 1; $page_number <= $total_pages; $page_number++) {
     $items_ids = array();
     $items_types = array();
     $items_categories = array();
     // get all products ids and check their google types
     $db->RecordsPerPage = $records_per_page;
     $db->PageNumber = $page_number;
     $db->query($data_sql);
     while ($db->next_record()) {
         $item_id = $db->f("item_id");
         $item_type = $db->f("i_gb_type");
         if (!strlen($item_type)) {
             $item_type = $db->f("it_gb_type");
$sql = " SELECT   i.item_id, i.item_type_id, i.item_name, i.a_title, i.friendly_url, i.short_description, i.small_image, i.small_image_alt, ";
$sql .= " i.buying_price, i." . $price_field . ", i." . $properties_field . ", i." . $sales_field . ", i.is_sales, i.tax_id, i.tax_free, ";
$sql .= " i.buying_price, i." . $price_field . ", i." . $properties_field . ", i." . $sales_field . ", i.is_sales, i.tax_id, i.tax_free, ";
$sql .= " i.use_stock_level, i.stock_level, st_in.shipping_time_desc AS in_stock_message, st_out.shipping_time_desc AS out_stock_message ";
$sql .= $new_product_sql;
$sql .= " FROM (((";
$sql .= $table_prefix . "items i ";
$sql .= $related_type_join;
$sql .= " LEFT JOIN " . $table_prefix . "shipping_times st_in ON i.shipping_in_stock=st_in.shipping_time_id) ";
$sql .= " LEFT JOIN " . $table_prefix . "shipping_times st_out ON i.shipping_out_stock=st_out.shipping_time_id) ";
$sql .= " WHERE i.item_id IN (" . $db->tosql($items_ids, INTEGERS_LIST) . ")";
$sql .= " AND " . $related_type_where;
$sql .= $related_type_order;
$db->query($sql);
$t->set_var("ri_rows", "");
$ri_columns = get_setting_value($vars, $related_columns_param, 1);
$t->set_var("ri_column", 100 / $ri_columns . "%");
$ri_number = 0;
while ($db->next_record()) {
    $ri_number++;
    $item_id = $db->f("item_id");
    $item_type_id = $db->f("item_type_id");
    $item_name = get_translation($db->f("item_name"));
    $a_title = get_translation($db->f("a_title"));
    $friendly_url = $db->f("friendly_url");
    $short_description = get_translation($db->f("short_description"));
    if ($php_in_short_desc) {
        eval_php_code($short_description);
    }
    if ($friendly_urls && $friendly_url) {
        $details_url = $friendly_url . $friendly_extension;
Esempio n. 7
0
?>
 (mobile edition)</title><style>body { color:#fff;background:#0d0d08;font-size:13px; } a {color: #fffbe0 } hr { width:30%;background:#c0c0c0; }</style></head><body><h1><a href="<?php 
echo get_home_link();
?>
" style="color:#ffff9b"><?php 
echo get_title();
?>
</a></h1>
<?php 
$articles = list_articles();
if ($page > count($articles) - 20) {
    $page = 1;
}
$page_start = ($page - 1) * 10;
$page_end = $page_start + 10;
$max_posts = get_setting_value("posts_num");
if ($max_posts == 0) {
    $max_posts = count($articles);
}
if ($page_end > $max_posts) {
    $page_start = 0;
    $page_end = 10;
}
$navigation = '<p style="text-align:center">';
if ($page > 1) {
    $navigation .= "<a href=\"index.php?p=" . ($page - 1) . "\">&laquo; Previous</a> | <a href=\"index.php?p=1\">Home</a> |";
}
if ($page_end < count($articles)) {
    $navigation .= "<a href=\"index.php?p=" . ($page + 1) . "\">Next &raquo;</a>";
}
$navigation .= '</p>';
Esempio n. 8
0
    $pdf->MultiCell(20, 1, "Status Perkawinan", 0, 'L', 0, 0, '', '', true);
    $pdf->MultiCell(10, 1, ": {$ktp->status_nikah}", 0, 'L', 0, 1, '', '', true);
    $pdf->MultiCell(20, 1, 'Pekerjaan', 0, 'L', 0, 0, '', '', true);
    $pdf->MultiCell(20, 1, ": {$ktp->pekerjaan}", 0, 'L', 0, 1, '', '', true);
    $pdf->MultiCell(20, 1, "Kewarganegaraan", 0, 'L', 0, 0, '', '', true);
    $pdf->MultiCell(10, 1, ": {$ktp->wni}", 0, 'L', 0, 1, '', '', true);
    $dm = strftime(date('d-m', $dob));
    $year = strftime(date('Y'));
    $year = (int) $year;
    $year += 5;
    $pdf->MultiCell(20, 1, "Berlaku Hingga", 0, 'L', 0, 0, '', '', true);
    $pdf->MultiCell(15, 1, ": {$dm}-{$year}", 0, 'L', 0, 0, '', '', true);
    $pdf->Cell(20);
    $pdf->Cell(0, 1, "TULUNGAGUNG, " . strftime(date('m-F-Y')), 0, 1, 'C', 0, '', 0);
    $pdf->Cell(55);
    $pdf->Cell(0, 1, 'an. BUPATI TULUNGAGUNG', 0, 1, 'C', 0, '', 0);
    $pdf->Cell(55);
    $pdf->Cell(0, 1, 'KEPALA DINAS', 0, 1, 'C', 0, '', 0);
    $pdf->Cell(55);
    $pdf->Cell(0, 3, 'KEPENDUDUKAN DAN CATATAN SIPIL', 0, 1, 'C', 0, '', 0);
    // add foto image
    $pdf->Ln(5);
    $pdf->Cell(55);
    $pdf->Cell(0, 1, get_setting_value("kepala_capil"), 0, 1, 'C', 0, '', 0);
    $pdf->Image("../../statics/images/foto/{$ktp->photo}", 70, 15, 20, 25, '', '', 'C', true);
    $pdf->lastPage();
    $pdf->Output('ktp.pdf', 'I');
}
?>

Esempio n. 9
0
function is_new_product($new_product_date = false)
{
    global $settings, $table_prefix, $db;
    $new_product_enable = get_setting_value($settings, "new_product_enable", 0);
    if (!$new_product_enable) {
        return false;
    }
    if (!$new_product_date) {
        return false;
    }
    $new_date = strtotime($new_product_date);
    $new_product_range = get_setting_value($settings, "new_product_range", 0);
    switch ($new_product_range) {
        case 0:
            // last week
            $limit_date = strtotime("-7 days");
            break;
        case 1:
            // last month
            $limit_date = strtotime("-30 days");
            break;
        case 2:
            // last x days
            $new_product_x_days = get_setting_value($settings, "new_product_x_days", 0);
            $limit_date = strtotime("-" . $new_product_x_days . " days");
            break;
        case 3:
            // from date
            $new_product_from_date = get_setting_value($settings, "new_product_from_date", "");
            $limit_date = strtotime($new_product_from_date);
            break;
    }
    return $limit_date < $new_date;
}
$r->set_value("delivery_company_id", get_translation(get_db_value("SELECT company_name FROM " . $table_prefix . "companies WHERE company_id=" . $db->tosql($r->get_value("delivery_company_id"), INTEGER, true, false))));
$r->set_value("delivery_state_id", get_translation(get_db_value("SELECT state_name FROM " . $table_prefix . "states WHERE state_id=" . $db->tosql($r->get_value("delivery_state_id"), INTEGER))));
$r->set_value("delivery_country_id", get_translation(get_db_value("SELECT country_name FROM " . $table_prefix . "countries WHERE country_id=" . $db->tosql($r->get_value("delivery_country_id"), INTEGER))));
$r->set_value("cc_type", get_db_value("SELECT credit_card_name FROM " . $table_prefix . "credit_cards WHERE credit_card_id=" . $db->tosql($r->get_value("cc_type"), INTEGER)));
$r->set_parameters();
if ($personal_number > 0 || $personal_properties) {
    $t->parse("personal", false);
}
if ($delivery_number > 0 || $delivery_properties) {
    $t->parse("delivery", false);
}
if (trim($payment_info)) {
    $payment_number++;
    $t->set_block("payment_info", $payment_info);
    $t->parse("payment_info", false);
    $t->global_parse("payment_info_block", false, false, true);
} else {
    $t->set_var("payment_info_block", "");
}
if ($payment_number > 0 || $payment_properties) {
    $t->sparse("payment", false);
}
$intro_text = get_setting_value($order_confirmation, "intro_text", "");
$intro_text = get_translation(trim($intro_text));
$intro_text = get_currency_message($intro_text, $currency);
if ($intro_text) {
    $t->set_var("intro_text", $intro_text);
    $t->parse("intro_block", false);
}
$block_parsed = true;
$t->parse("block_body", false);
Esempio n. 11
0
                 $super_image = "image_show.php?item_id=" . $item_id . "&type=super&vc=" . md5($super_image);
             }
         }
         $super_image = htmlspecialchars($super_image);
         $t->set_var("src_sup", $super_image);
         $t->sparse("super_image", false);
     } else {
         $t->set_var("src_sup", $big_image);
     }
     $t->parse("big_image", false);
     $meta_OG_image = $big_image;
     //Customization by Vital - Open Graph image
 } else {
     $t->set_var("big_image", "");
 }
 $open_large_image = get_setting_value($settings, "open_large_image", 0);
 $super_image = $db->f("super_image");
 if (strlen($super_image)) {
     if (preg_match("/^http(s)?:\\/\\//", $super_image)) {
         $image_size = "";
     } else {
         $image_size = @getimagesize($super_image);
         if ($watermark_super_image || $restrict_products_images) {
             $super_image = "image_show.php?item_id=" . $item_id . "&type=super&vc=" . md5($super_image);
         }
     }
     $src = htmlspecialchars($super_image);
     if (is_array($image_size)) {
         $width = $image_size[0];
         $height = $image_size[1];
     } else {
Esempio n. 12
0
function running_time()
{
    return date('jS F Y.', get_setting_value('install_time'));
}
<?php

include_once "./includes/products_functions.php";
$erase_tags = true;
$user_id = get_session("session_user_id");
$user_info = get_session("session_user_info");
$user_type_id = get_setting_value($user_info, "user_type_id", "");
$friendly_urls = get_setting_value($settings, "friendly_urls", 0);
$friendly_extension = get_setting_value($settings, "friendly_extension", "");
$html_template = get_setting_value($block, "html_template", "block_products_breadcrumb.html");
$t->set_file("block_body", $html_template);
$manf = get_param("manf");
$user = get_param("user");
$item_id = get_param("item_id");
$category_id = get_param("category_id");
$search_category_id = get_param("search_category_id");
$breadcrumbs_tree_array = array();
if (strlen($search_category_id)) {
    $category_id = $search_category_id;
}
if (!strlen($category_id) && strlen($item_id)) {
    $category_id = VA_Products::get_category_id($item_id);
    //Customization by Vital
    $session_category_id = get_session("category_id");
    if ($session_category_id && get_db_value("SELECT COUNT(*) FROM " . $table_prefix . "items_categories where item_id=" . $db->tosql($item_id, INTEGER) . " AND category_id=" . $session_category_id)) {
        $category_id = $session_category_id;
    }
    //END customization
}
$t->set_var("index_href", get_custom_friendly_url("index.php"));
if ($category_id) {
Esempio n. 14
0
    $admin_order_call_url = $admin_secure_url . "admin_order_call.php";
} else {
    $admin_order_call_url = $admin_site_url . "admin_order_call.php";
}
$permissions = get_permissions();
//BEGIN product privileges changes
$products_categories_perm = get_setting_value($permissions, "products_categories", 0);
$products_settings_perm = get_setting_value($permissions, "products_settings", 0);
$product_types_perm = get_setting_value($permissions, "product_types", 0);
$manufacturers_perm = get_setting_value($permissions, "manufacturers", 0);
$features_groups_perm = get_setting_value($permissions, "features_groups", 0);
$products_reviews_perm = get_setting_value($permissions, "products_reviews", 0);
$products_report_perm = get_setting_value($permissions, "product_report", 0);
$shipping_methods_perm = get_setting_value($permissions, "shipping_methods", 0);
$shipping_times_perm = get_setting_value($permissions, "shipping_times", 0);
$shipping_rules_perm = get_setting_value($permissions, "shipping_rules", 0);
$downloadable_products_perm = get_setting_value($permissions, "downloadable_products", 0);
$coupons_perm_perm = get_setting_value($permissions, "coupons", 0);
$saved_types_perm = get_setting_value($permissions, "saved_types", 0);
$advanced_search_perm = get_setting_value($permissions, "advanced_search", 0);
//END product privileges changes
// CMS permissions
$layouts_perm = get_setting_value($permissions, "layouts", 0);
$filemanager_perm = get_setting_value($permissions, "filemanager", 0);
$polls_perm = get_setting_value($permissions, "polls", 0);
$filters_perm = get_setting_value($permissions, "filters", 0);
$custom_blocks_perm = get_setting_value($permissions, "custom_blocks", 0);
$web_pages_perm = get_setting_value($permissions, "web_pages", 0);
$custom_friendly_urls_perm = get_setting_value($permissions, "custom_friendly_urls", 0);
$banners_perm = get_setting_value($permissions, "banners", 0);
Esempio n. 15
0
        }
        $user_name = $db->f("name");
        if (!strlen($user_name)) {
            $user_name = $db->f("first_name") . " " . $db->f("last_name");
        }
        $order_placed_date = $db->f("order_placed_date", DATETIME);
        $order_placed_date = va_date($datetime_show_format, $order_placed_date);
        if (get_setting_value($order_info, "show_delivery_country_id", 0) == 1) {
            $country_id = $db->f("delivery_country_id");
            $state_id = $db->f("delivery_state_id");
        } elseif (get_setting_value($order_info, "show_country_id", 0) == 1) {
            $country_id = $db->f("country_id");
            $state_id = $db->f("state_id");
        } else {
            $country_id = $settings["country_id"];
            $state_id = get_setting_value($settings, "state_id", "");
        }
        $status_name = get_translation($db->f("status_name"));
        $admin_order_url = $admin_order->get_url();
        $remote_address = $db->f("remote_address");
        $site_name = $db->f("site_name");
        $orders[] = array($order_id, $order_total, $user_name, $order_placed_date, $status_name, $country_id, $state_id, $admin_order_url, $remote_address, $order_currency, $site_name);
    } while ($db->next_record());
}
$colspan = 9;
if ($sitelist) {
    $colspan++;
}
$t->set_var("colspan", $colspan);
if (sizeof($orders) > 0) {
    $order_index = 0;
Esempio n. 16
0
        if (sms_send_allowed($t->get_var("user_sms_recipient"))) {
            sms_send($t->get_var("user_sms_recipient"), $t->get_var("user_sms_message"), $t->get_var("user_sms_originator"));
        }
    }
    $sql = " UPDATE " . $table_prefix . "orders SET is_placed=1 ";
    $sql .= " WHERE order_id=" . $db->tosql($order_id, INTEGER);
    $db->query($sql);
}
set_session("session_order_sent", $order_id);
set_session("session_cc_number", "");
set_session("session_cc_number_first", "");
set_session("session_cc_number_last", "");
set_session("session_cc_code", "");
// Begin google analytics ecommerce
$google_analytics = get_setting_value($settings, "google_analytics", 0);
$google_tracking_code = get_setting_value($settings, "google_tracking_code", "");
if ($paid_status && $google_analytics && $google_tracking_code) {
    $t->set_var("google_order_id", $order_id);
    $t->set_var("google_affiliation", str_replace("\"", "\\\"", htmlspecialchars($affiliate_code)));
    $t->set_var("google_total", $order_total);
    $t->set_var("google_tax", $tax_total);
    $t->set_var("google_shipping", $shipping_cost);
    $t->set_var("google_city", str_replace("\"", "\\\"", htmlspecialchars($delivery_city)));
    $t->set_var("google_state", str_replace("\"", "\\\"", htmlspecialchars($variables["delivery_state"])));
    $t->set_var("google_country", str_replace("\"", "\\\"", htmlspecialchars($variables["delivery_country"])));
    $dbh = new VA_SQL();
    $dbh->DBType = $db_type;
    $dbh->DBDatabase = $db_name;
    $dbh->DBHost = $db_host;
    $dbh->DBPort = $db_port;
    $dbh->DBUser = $db_user;
Esempio n. 17
0
     }
     // check if any coupons can be added or removed
     check_coupons();
     header("Location: " . get_custom_friendly_url("basket.php") . "?rp=" . urlencode(get_custom_friendly_url("user_wishlist.php")));
     exit;
 } else {
     if ($operation == "delete") {
         // delete an item
         $cart_item_id = get_param("cart_item_id");
         $sql = " DELETE FROM " . $table_prefix . "saved_items ";
         $sql .= " WHERE cart_item_id=" . $db->tosql($cart_item_id, INTEGER);
         $sql .= " AND user_id=" . $db->tosql($_COOKIE['wishlist_user_id'], INTEGER);
         $db->query($sql);
     }
 }
 $html_template = get_setting_value($block, "html_template", "block_user_wishlist.html");
 $t->set_file("block_body", $html_template);
 $t->set_var("user_wishlist_href", get_custom_friendly_url("user_wishlist.php"));
 $t->set_var("cart_retrieve_href", get_custom_friendly_url("cart_retrieve.php"));
 $t->set_var("user_home_href", get_custom_friendly_url("user_home.php"));
 $t->set_var("wishlist_message", "<p>Here is a list of the items you have selected.</p>Your wishlist is saved on this browser on this computer only. If you want to see your wishlist from another computer please <a href=\"./user_login.php?return_page=" . urlencode($site_url . get_custom_friendly_url('user_wishlist.php')) . "\">login to save it</a>.<br /><br />");
 $s = new VA_Sorter($settings["templates_dir"], "sorter_img.html", get_custom_friendly_url("user_wishlist.php"));
 $s->set_parameters(false, true, true, false);
 $s->set_default_sorting(6, "desc");
 $s->set_sorter(PROD_NAME_MSG, "sorter_item_name", "1", "si.item_name");
 $s->set_sorter(PRICE_MSG, "sorter_price", "2", "si.price");
 $s->set_sorter(QTY_MSG, "sorter_quantity", "3", "si.quantity");
 $s->set_sorter(WISHLIST_BOUGHT_MSG, "sorter_quantity_bought", "4", "si.quantity_bought");
 $s->set_sorter(TYPE_MSG, "sorter_type", "5", "st.type_name");
 $s->set_sorter(CART_SAVED_DATE_COLUMN, "sorter_date", "6", "si.date_added");
 $n = new VA_Navigator($settings["templates_dir"], "navigator.html", get_custom_friendly_url("user_wishlist.php"));
Esempio n. 18
0
$pdf->Write(1, strtoupper($penduduk->ayah) . " dan " . strtoupper($penduduk->ibu), '', 0, 'L', true);
$pdf->Ln(20);
$tanggal_pembuatan = strtotime($penduduk->tanggal_pembuatan);
$pdf->Cell(100);
$pdf->MultiCell(100, 1, "Kutipan ini dikeluarkan....di Tulungagung......", 0, 'L', 0, 1, '', '', true);
$pdf->Cell(100);
$pdf->MultiCell(100, 1, "pada tanggal ....." . strftime(date('d F', $tanggal_pembuatan)) . ".......", 0, 'L', 0, 1, '', '', true);
$pdf->Cell(100);
$pdf->MultiCell(100, 1, "....tahun " . strftime(date('Y', $tanggal_pembuatan)) . " ......", 0, 'L', 0, 1, '', '', true);
$pdf->Cell(100);
$pdf->MultiCell(100, 1, "Kepala DINAS KEPENDUDUKAN DAN CATATAN SIPIL", 0, 'L', 0, 1, '', '', true);
$pdf->Cell(100);
$pdf->MultiCell(100, 1, ".....KABUPATEN TULUNGAGUNG.....", 0, 'C', 0, 1, '', '', true);
$pdf->Ln(15);
$pdf->Cell(100);
$pdf->MultiCell(100, 1, strtoupper(get_setting_value("kepala_capil")), 0, 'C', 0, 1, '', '', true);
$pdf->Output("akta_kelahiran.pdf", "I");
class AktaLoader
{
    public $no_akta;
    public $nik;
    public $tempat_lahir;
    public $tanggal_lahir;
    public $jenis_kelamin;
    public $wni;
    public $nama;
    public $ayah;
    public $ibu;
    public $tanggal_pembuatan;
    public $id;
    public function __construct($id)
                    if (pgp_test()) {
                        $tmp_admin_emails = explode(',', $mail_to);
                        foreach ($tmp_admin_emails as $tmp_admin_email) {
                            $admin_message = pgp_encrypt($admin_message, $tmp_admin_email);
                            if ($admin_message) {
                                va_mail($tmp_admin_email, $t->get_var("admin_subject"), $admin_message, $email_headers);
                            }
                        }
                    }
                } else {
                    va_mail($mail_to, $t->get_var("admin_subject"), $admin_message, $email_headers);
                }
            }
            if ($admin_sms) {
                $admin_sms_recipient = get_setting_value($cc_info, "admin_sms_recipient", "");
                $admin_sms_originator = get_setting_value($cc_info, "admin_sms_originator", "");
                $t->set_block("admin_sms_recipient", $admin_sms_recipient);
                $t->set_block("admin_sms_originator", $admin_sms_originator);
                $t->set_block("admin_sms_message", $admin_sms_message);
                $t->set_var("basket", $items_text);
                $t->set_var("items", $items_text);
                $t->parse("admin_sms_recipient", false);
                $t->parse("admin_sms_originator", false);
                $t->parse("admin_sms_message", false);
                sms_send($t->get_var("admin_sms_recipient"), $t->get_var("admin_sms_message"), $t->get_var("admin_sms_originator"));
            }
        }
        header("Location: " . $return_page);
        exit;
    }
} else {
Esempio n. 20
0
        }
        if ($r->get_value("subscription_id")) {
            $t->parse("current_subscription", false);
        }
        if (is_array($expiry_date) || $r->get_value("subscription_id")) {
            $t->parse("subscription_title", false);
        }
    } else {
        $t->parse("subscription_title", false);
        $t->parse("subscription_options", false);
    }
}
if (strlen($user_id) && strlen(trim(get_setting_value($user_profile, "intro_text_registered")))) {
    $t->set_var("intro_text", get_translation($user_profile["intro_text_registered"]));
    $t->parse("intro_block", false);
} elseif (!strlen($user_id) && strlen(trim(get_setting_value($user_profile, "intro_text_new")))) {
    $t->set_var("intro_text", get_translation($user_profile["intro_text_new"]));
    $t->parse("intro_block", false);
}
$block_parsed = true;
$t->parse("block_body", false);
function update_user_properties()
{
    global $r, $pp, $db, $table_prefix;
    $user_id = $r->get_value("user_id");
    foreach ($pp as $id => $data) {
        $property_id = $data["property_id"];
        $param_name = "pp_" . $property_id;
        if ($r->parameter_exists($param_name)) {
            $values = array();
            if ($r->get_property_value($param_name, CONTROL_TYPE) == CHECKBOXLIST) {
Esempio n. 21
0
    $sql = "SELECT manufacturer_name, friendly_url FROM " . $table_prefix . "manufacturers WHERE manufacturer_id=" . $db->tosql($manf, INTEGER);
    $db->query($sql);
    if ($db->next_record()) {
        $manufacturer_name = $db->f("manufacturer_name");
        $manf_friendly_url = $db->f("friendly_url");
        if (!$page_friendly_url && $manf_friendly_url) {
            $page_friendly_url = $manf_friendly_url;
            $page_friendly_params[] = "manf";
            friendly_url_redirect($page_friendly_url, $page_friendly_params);
        }
        $current_category = $manufacturer_name;
        $list_template = "block_products_list.html";
        $auto_meta_title = $current_category;
    }
} else {
    $category_path = "0";
    $current_category = PRODUCTS_TITLE;
    $list_template = "block_products_list.html";
    $auto_meta_title = $current_category;
}
//Customization by Vital - canonical URL
$friendly_extension = get_setting_value($settings, "friendly_extension", "");
if ($page_friendly_url) {
    $canonical_url = $page_friendly_url . $friendly_extension;
} else {
    $canonical_url = "wall-stencils.html";
}
//END customization
// check individual page layout settings
$cms_ps_id = check_category_layout($cms_page_code, $category_path, $category_id);
include_once "./includes/page_layout.php";
Esempio n. 22
0
<?php

check_user_security("my_orders");
$orders_currency = get_setting_value($settings, "orders_currency", 0);
$html_template = get_setting_value($block, "html_template", "block_user_orders.html");
$t->set_file("block_body", $html_template);
$t->set_var("user_orders_href", get_custom_friendly_url("user_orders.php"));
$t->set_var("user_order_href", get_custom_friendly_url("user_order.php"));
$t->set_var("user_home_href", get_custom_friendly_url("user_home.php"));
$t->set_var("user_order_payment_href", get_custom_friendly_url("user_order_payment.php"));
$t->set_var("user_invoice_pdf_href", get_custom_friendly_url("user_invoice_pdf.php"));
$t->set_var("user_invoice_html_href", get_custom_friendly_url("user_invoice_html.php"));
$s = new VA_Sorter($settings["templates_dir"], "sorter_img.html", get_custom_friendly_url("user_orders.php"));
$s->set_default_sorting(1, "desc");
$s->set_sorter(ORDER_NUMBER_COLUMN, "sorter_id", "1", "order_id");
$s->set_sorter(ORDER_ADDED_COLUMN, "sorter_date", "2", "order_placed_date");
$s->set_sorter(STATUS_MSG, "sorter_status", "3", "order_status");
$s->set_sorter(ORDER_TOTAL_COLUMN, "sorter_total", "4", "order_total");
$n = new VA_Navigator($settings["templates_dir"], "navigator.html", get_custom_friendly_url("user_orders.php"));
// set up variables for navigator
$sql = " SELECT COUNT(*) FROM " . $table_prefix . "orders o ";
$sql .= " WHERE o.user_id=" . $db->tosql(get_session("session_user_id"), INTEGER);
if (isset($site_id)) {
    $sql .= " AND o.site_id=" . $db->tosql($site_id, INTEGER, true, false);
} else {
    $sql .= " AND o.site_id=1";
}
$db->query($sql);
$db->next_record();
$total_records = $db->f(0);
$records_per_page = 25;
include_once "./admin_header.php";
$t->set_var("admin_href", "admin.php");
$t->set_var("admin_items_list_href", "admin_items_list.php");
$t->set_var("admin_products_settings_href", "admin_products_settings.php");
$t->set_var("admin_upload_href", "admin_upload.php");
$t->set_var("admin_select_href", "admin_select.php");
$t->set_var("admin_tax_rates_href", "admin_tax_rates.php");
$t->set_var("admin_column_code_href", "admin_column_code.php");
$t->set_var("hide_add_message", str_replace("{button_name}", ADD_TO_CART_MSG, HIDE_BUTTON_MSG));
$t->set_var("hide_view_message", str_replace("{button_name}", VIEW_CART_MSG, HIDE_BUTTON_MSG));
$t->set_var("hide_goto_message", str_replace("{button_name}", GOTO_CHECKOUT_MSG, HIDE_BUTTON_MSG));
$t->set_var("hide_wish_message", str_replace("{button_name}", ADD_TO_WISHLIST_MSG, HIDE_BUTTON_MSG));
$t->set_var("hide_shipping_message", str_replace("{button_name}", SHIPPING_CALCULATOR_MSG, HIDE_BUTTON_MSG));
$t->set_var("date_edit_format", join("", $date_edit_format));
$full_image_url = get_setting_value($settings, "full_image_url", 0);
$site_url_path = get_setting_value($settings, "site_url", "");
if ($full_image_url) {
    $t->set_var("site_url", $site_url_path);
} else {
    $t->set_var("site_url", "");
}
$r = new VA_Record($table_prefix . "global_settings");
// load data to listbox
$countries = get_db_values("SELECT country_id,country_name FROM " . $table_prefix . "countries ORDER BY country_order ", array(array("", "")));
$admin_templates_dir_values = get_db_values("SELECT layout_id,layout_name FROM " . $table_prefix . "layouts", "");
$records_per_page = array(array(5, 5), array(10, 10), array(15, 15), array(20, 20), array(25, 25), array(50, 50), array(75, 75), array(100, 100));
$product_controls = array(array("NONE", NONE_MSG), array("LABEL", LABEL_MSG), array("LISTBOX", LISTBOX_MSG), array("TEXTBOX", TEXTBOX_MSG));
$controls = array(array("NONE", NONE_MSG), array("LISTBOX", LISTBOX_MSG), array("TEXTBOX", TEXTBOX_MSG));
$yes_no = array(array(1, YES_MSG), array(0, NO_MSG));
$confirm_add = array(array(0, ADD_TO_CART_WITHOUT_CONFIRM_MSG), array(1, ADD_TO_CART_SHOW_JS_CONFIRM_MSG));
$basket_actions = array(array(0, REMAIN_ON_THE_SAME_PAGE_MSG), array(1, GOTO_BASKET_PAGE_MSG), array(2, GOTO_CHECKOUT_PAGE_MSG), array(3, USE_AJAX_TO_ADD_PRODUCTS_MSG));
Esempio n. 24
0
                }
            } else {
                $avatar = 'inc/images/no-avatar.png';
            }
        } else {
            $avatar = "http://www.gravatar.com/avatar.php?size=50&amp;gravatar_id=" . bin2hex(md5(trim($_POST['email']), true));
        }
        sql_query("INSERT INTO feeds VALUES (" . sql_autoid('feeds') . "," . "'" . sql_escape($_POST['url']) . "'," . "'" . sql_escape($_POST['email']) . "'," . "'{$avatar}'," . "0," . "'" . date('Y-m-d') . "');");
        sql_query("INSERT INTO users VALUES (" . sql_autoid('users') . "," . "'" . sql_escape($_POST['email']) . "'," . "'" . md5($_POST['pass']) . "'," . "'" . sql_escape($_POST['name']) . "'," . "'feed_owner');");
        sleep(1);
        refresh_cache();
        if (!sql_query) {
            $error = "An error occured. Try again later.";
        } else {
            $msg = "Your submission has been saved, you will be notified about when (if) your feed will be approved.";
            $to_notifiy = get_setting_value('reg_notifiy');
            if ($to_notifiy == 'on') {
                $admin_mail = sql_query("SELECT email FROM users WHERE role_level='admin';");
                $admin_mail = $admin_mail['email'];
                $mail_cont = nl2br("Someone has submited feed on <a href=\"" . get_home_link() . "\">" . get_title() . "</a> with following details:\n\t\t\t\t\t\n\t\t\t\t\tFeed URL: {$_POST['url']}\n\t\t\t\t\tSubmitters email: <a href=\"mailto:{$_POST['email']}\">{$_POST['email']}</a>\n\t\t\t\t\t---\n\t\t\t\t\tPowered by <a href=\"http://planetoid-project.org\">Planetoid</a>" . PLANETOID_VERSION . " - Generated on " . date('r'));
                mail($admin_mail, "Planetoid adminstration", $mail_cont, "From: Planetoid <*****@*****.**> \r\n" . "Content-Type: text/html; charset=UTF-8\r\n" . "X-Mailer: PHP/" . phpversion());
            }
        }
        // 			sql_close();
    } else {
        header("Location: {$_POST['r_to']}");
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Esempio n. 25
0
function add_custom_pages_to_site_map_tree($site_map_custom_pages)
{
    global $db, $table_prefix, $site_id, $settings;
    global $site_map_tree, $total_records;
    if (!$site_map_custom_pages) {
        return;
    }
    $user_id = get_session("session_user_id");
    $user_type_id = get_session("session_user_type_id");
    $friendly_urls = get_setting_value($settings, "friendly_urls");
    $friendly_extension = get_setting_value($settings, "friendly_extension");
    $sql = " SELECT p.page_id, p.page_code, p.page_title, p.page_url, p.friendly_url FROM ";
    if (isset($site_id)) {
        $sql .= "(";
    }
    if (strlen($user_id)) {
        $sql .= "(";
    }
    $sql .= $table_prefix . "pages p ";
    if (isset($site_id)) {
        $sql .= " LEFT JOIN " . $table_prefix . "pages_sites s ON (s.page_id=p.page_id AND p.sites_all=0)) ";
    }
    if (strlen($user_id)) {
        $sql .= " LEFT JOIN " . $table_prefix . "pages_user_types ut ON (ut.page_id=p.page_id AND p.user_types_all=0)) ";
    }
    $sql .= " WHERE p.is_showing=1 AND p.is_site_map=1 ";
    if (isset($site_id)) {
        $sql .= " AND (p.sites_all=1 OR s.site_id=" . $db->tosql($site_id, INTEGER, true, false) . ") ";
    } else {
        $sql .= " AND p.sites_all=1";
    }
    if (strlen($user_id)) {
        $sql .= " AND (p.user_types_all=1 OR ut.user_type_id=" . $db->tosql($user_type_id, INTEGER) . ") ";
    } else {
        $sql .= " AND p.user_types_all=1 ";
    }
    $sql .= " ORDER BY p.page_order, p.page_title ";
    $db->query($sql);
    while ($db->next_record()) {
        $item_id = $db->f('page_id');
        $item_name = $db->f('page_title');
        if ($db->f("friendly_url") && $friendly_urls) {
            $item_url = $db->f("friendly_url") . $friendly_extension;
        } elseif ($db->f('page_url')) {
            $item_url = $db->f("page_url");
        } else {
            $item_url = "page.php?page=" . $db->f("page_code");
        }
        $site_map_tree["custom_page_" . $item_id] = array(SITEMAP_TITLE_INDEX => $item_name, SITEMAP_URL_INDEX => $item_url);
        $total_records++;
    }
}
Esempio n. 26
0
 // update total views for article
 $articles_viewed = get_session("session_articles_viewed");
 if (!isset($articles_viewed[$article_id])) {
     $sql = " UPDATE " . $table_prefix . "articles SET total_views=" . $db->tosql($total_views + 1, INTEGER);
     $sql .= " WHERE article_id=" . $db->tosql($article_id, INTEGER);
     $db->query($sql);
     $articles_viewed[$article_id] = true;
     set_session("session_articles_viewed", $articles_viewed);
 }
 $t->parse("article_item");
 $t->set_var("no_article_item", "");
 if ($allowed_rate) {
     // get articles reviews settings
     $articles_reviews_settings = get_settings("articles_reviews");
     $reviews_allowed_view = get_setting_value($articles_reviews_settings, "allowed_view", 0);
     $reviews_allowed_post = get_setting_value($articles_reviews_settings, "allowed_post", 0);
     if ($reviews_allowed_view == 1 || $reviews_allowed_view == 2 && strlen($user_id) || $reviews_allowed_post == 1 || $reviews_allowed_post == 2 && strlen($user_id)) {
         // count reviews
         $sql = " SELECT COUNT(*) FROM " . $table_prefix . "articles_reviews WHERE approved=1 AND article_id=" . $db->tosql($article_id, INTEGER);
         $total_votes = get_db_value($sql);
         if ($total_votes) {
             // parse summary statistic
             $t->set_var("total_votes", $total_votes);
             $sql = " SELECT COUNT(*) FROM " . $table_prefix . "articles_reviews WHERE approved=1 AND rating <> 0 AND article_id=" . $db->tosql($article_id, INTEGER);
             $total_rating_votes = get_db_value($sql);
             $average_rating_float = 0;
             if ($total_rating_votes) {
                 $sql = " SELECT SUM(rating) FROM " . $table_prefix . "articles_reviews WHERE approved=1 AND rating <> 0 AND article_id=" . $db->tosql($article_id, INTEGER);
                 $average_rating_float = round(get_db_value($sql) / $total_rating_votes, 2);
             }
             $average_rating = round($average_rating_float, 0);
Esempio n. 27
0
        $t->set_var("frame_code", $frames[$frame_id]["html_after_block"]);
        $t->copy_var("frame_code", $tag_name, true);
    }
}
// close frames
foreach ($frames as $frame_id => $frame) {
    $tag_name = $frames[$frame_id]["tag_name"];
    $t->set_var("frame_code", $frames[$frame_id]["html_frame_end"]);
    $t->copy_var("frame_code", $tag_name, true);
}
// check if auto data has to be applied
if (!strlen($meta_title)) {
    if (isset($auto_meta_title) && strlen($auto_meta_title)) {
        $meta_title = $auto_meta_title;
    } else {
        $meta_title = get_setting_value($settings, "site_name");
    }
}
if (!strlen($meta_description) && isset($auto_meta_description)) {
    $meta_description = $auto_meta_description;
}
// set some meta data
$t->set_var("meta_title", get_translation($meta_title));
if ($meta_keywords) {
    set_head_tag("meta", array("name" => "keywords", "content" => get_translation($meta_keywords)), "name", 1);
}
if ($meta_description) {
    set_head_tag("meta", array("name" => "description", "content" => get_translation(get_meta_desc($meta_description))), "name", 1);
}
if (!isset($canonical_url) || !strlen($canonical_url)) {
    $canonical_url = "";
Esempio n. 28
0
$pdf->MultiCell(40, 1, "Dikeluarkan Tanggal", 0, 'L', 0, 0);
$current_date = strftime(date('d F Y'));
$pdf->MultiCell(60, 1, " {$current_date}", 1, 'C', 0, 0);
$pdf->Cell(40);
$pdf->MultiCell(40, 1, "Kepala Keluarga", 0, 'L', 0, 0);
$pdf->Cell(40);
$pdf->MultiCell(60, 1, "Tulungagung, {$current_date}", 0, 'C', 0, 1);
$pdf->Cell(200);
$pdf->MultiCell(100, 1, "Kepala Dinas Kependudukan Dan Catatan Sipil", 0, 'C', 0, 1);
$pdf->Cell(230);
$pdf->MultiCell(50, 1, "Kabupaten Tulungagung", 0, 'C', 0, 1);
$pdf->Ln(8);
$pdf->Cell(140);
$pdf->MultiCell(30, 1, "{$kk->kepala_keluarga}", 0, 'C', 0, 0);
$pdf->Cell(60);
$pdf->MultiCell(40, 1, get_setting_value("kepala_capil"), 0, 'C', 0, 1);
$pdf->Output("kk.pdf", "I");
class KKLoader
{
    public $_kode_keluarga;
    public $_alamat_id;
    public $_no_formulir;
    public $_keluarga_id;
    public $kepala_keluarga = "";
    public $alamat;
    public $rt;
    public $rw;
    public $kelurahan;
    public $kecamatan;
    public $kodepos;
    public $penduduks = array();
Esempio n. 29
0
    }
    ?>
</span>
						&#8210;
						<a href="check-updates.php?r_to=<?php 
    echo $curr_page;
    ?>
" class="action-link" onclick="checkUpdates('#update-result'); return false;">Check for updates</a>
					</small>
					<br/>
					This Planetoid installation has been running since <?php 
    echo running_time();
    ?>
<br/>
					<?php 
    if (get_setting_value('pcron') == 'true') {
        ?>
					Last cache refresh was on <?php 
        echo last_refresh('r');
        ?>
					<?php 
    } else {
        ?>
					Ups! <a href="../cron.php?to=admin/planet.php">Cache cron haven't been started yet!</a>
					<?php 
    }
    ?>
<br/>
					Using SimplePie <?php 
    require_once '../inc/simplepie/simplepie.inc';
    echo simplepie_version();
 if ($desc_image == 3) {
     $image = $db->f("image_large");
     $image_alt = get_translation($db->f("image_large_alt"));
 } elseif ($desc_image == 2) {
     $image = $db->f("image");
     $image_alt = get_translation($db->f("image_alt"));
 }
 if (!strlen($image)) {
     $image_exists = false;
 } elseif (!image_exists($image)) {
     $image_exists = false;
 } else {
     $image_exists = true;
 }
 if (strlen($description) || $image_exists) {
     $html_template = get_setting_value($block, "html_template", "block_category_description.html");
     $t->set_file("block_body", $html_template);
     if ($image_exists) {
         if (preg_match("/^http\\:\\/\\//", $image)) {
             $image_size = "";
         } else {
             $image_size = @GetImageSize($image);
             if (isset($restrict_categories_images) && $restrict_categories_images) {
                 $image = "image_show.php?category_id=" . $category_id . "&type=large";
             }
         }
         if (!strlen($image_alt)) {
             $image_alt = $category_name;
         }
         $t->set_var("alt", htmlspecialchars($image_alt));
         $t->set_var("src", htmlspecialchars($image));