/**
 * function to get all Patronage Points details for a User
 * [Params]
 * $user_id = user
 * $user_ppoints_id = to get a specific point data (leave empty to pull all data instead)
 * $fetch_total_only = set as `true` to get total count only, instead of full data set from user_petronage_points table
*/
function get_ppoints($user_id, $user_ppoints_id = '', $fetch_total_only = false)
{
    if ($user_id <= 0) {
        return false;
    }
    if ($fetch_total_only != false) {
        $sql_1 = "SELECT total_patronage_points FROM user_info WHERE user_id='{$user_id}'";
        $upp_res = @mysql_exec($sql_1, 'single');
        if (!is_array($upp_res) || count($upp_res) < 0) {
            return false;
        }
        return (int) @$upp_res['total_patronage_points'];
    } else {
        $sql_1 = "SELECT * FROM user_petronage_points WHERE user_id='{$user_id}' ";
        if ($user_ppoints_id > 0) {
            $sql_1 .= " AND id='{$user_ppoints_id}'";
        }
        $sql_1 .= " ORDER BY received_on DESC";
        $upp_res = @format_str(@mysql_exec($sql_1));
        //var_dump("<pre>", $upp_res);
        if (!is_array($upp_res) || count($upp_res) < 0) {
            return false;
        }
        return $upp_res;
    }
}
Exemplo n.º 2
0
function get_home_voices()
{
    $home_voices = array();
    $sql_1 = "SELECT uv.*, u.profile_pic\n    FROM user_voices uv\n    LEFT JOIN users u ON u.id=uv.user_id\n\n    WHERE uv.is_blocked='0'\n    ORDER BY RAND()\n    LIMIT 20\n    ";
    $home_voices = @format_str(@mysql_exec($sql_1));
    return $home_voices;
}
function get_member_info($member_id, $user_id)
{
    if ($member_id <= 0) {
        return false;
    }
    #/ All Fields
    $fetch_fields = array('package_id', 'email_add', 'screen_name', 'profile_pic', 'first_name', 'middle_name', 'last_name', 'company_name', 'identify_by', 'joined_on', 'country_code', 'state', 'city', 'address_ln_1', 'address_ln_2', 'zip', 'phone_number');
    #/ Get user_permission
    $user_permissions = array();
    $sql_1 = "SELECT fields_perm FROM user_permissions WHERE user_id='{$member_id}'";
    $up_ar = @format_str(@mysql_exec($sql_1, 'single'));
    if (is_array($up_ar) && array_key_exists('fields_perm', $up_ar)) {
        $user_permissions = @explode(',', @$up_ar['fields_perm']);
    }
    #/ Filter fields based on permissions
    if ($member_id != $user_id) {
        if (!empty($user_permissions)) {
            $fetch_fields = array_diff($fetch_fields, $user_permissions);
        }
    }
    $fetch_fields_str = implode(',', $fetch_fields);
    //var_dump("<pre>", $user_permissions, $fetch_fields, $fetch_fields_str); die();
    if (empty($fetch_fields_str)) {
        return false;
    }
    #/ Get Member's Info
    $fetch_fields_str = str_replace('country_code', 'ui.country_code', $fetch_fields_str);
    $sql_2 = "SELECT u.id as user_id,\n    {$fetch_fields_str},\n    (CASE\n    WHEN identify_by='screen_name' THEN screen_name\n    WHEN identify_by='full_name' THEN CONCAT(first_name, ' ', middle_name, ' ', last_name)\n    WHEN identify_by='company_name' THEN company_name\n    ELSE 'Member'\n    END) AS user_ident,\n    c.country_name,\n    st.state_name\n\n    FROM users u\n    LEFT JOIN user_info ui ON ui.user_id=u.id\n    LEFT JOIN countries c USING(country_code)\n    LEFT JOIN states st ON st.state_code=ui.state\n\n    WHERE u.id='{$member_id}'\n    AND u.is_blocked='0'\n    ";
    $members_ar = @format_str(@mysql_exec($sql_2, 'single'));
    //var_dump("<pre>", $members_ar); die();
    return array($members_ar, $user_permissions);
}
function update_permissions($au_id, $permissions)
{
    if (!is_array($permissions) || count($permissions) == 0) {
        return false;
    }
    $sql_1 = "DELETE FROM admin_permissions WHERE admin_users_id='{$au_id}'";
    $res = mysql_exec($sql_1, 'save');
    //var_dump($res, mysql_error()); die();
    insert_permissions($au_id, $permissions);
}
Exemplo n.º 5
0
function cust_order_status()
{
    $sql_1 = "SELECT\n\n    DISTINCT order_status,\n    COUNT(*) AS t_os\n\n    FROM cust_orders\n\n    GROUP BY order_status\n    ORDER BY t_os DESC\n    LIMIT 10\n    ";
    $ret = '';
    $result = @mysql_exec($sql_1);
    if (count($result) > 0) {
        $ret = @format_str($result);
        #/ Set Gradient
        $ret = color_pie_chart($ret);
    }
    return $ret;
}
function get_package_info($pk_id, $get_benefits = false)
{
    if (empty($pk_id)) {
        return false;
    }
    $sql_part = '';
    if ($get_benefits != false) {
        $sql_part = "";
    }
    $sql_1 = "SELECT title, cost, is_basic, is_recursive, recursive_cost\n    FROM membership_packages mp\n    WHERE is_active='1'\n    AND id='{$pk_id}'\n    ";
    $package_info = @format_str(@mysql_exec($sql_1));
    return $package_info;
}
Exemplo n.º 7
0
 /**
  * returns LIMITS - to be used in sql query
  **/
 function query_limits()
 {
     ## Set Limits
     $this->start = $this->GET['page'] * $this->lim;
     ##--
     ## Calculate Total
     if (!isset($this->GET['tot'])) {
         $r2 = mysql_exec($this->query);
         $this->tot = count($r2);
     } else {
         $this->tot = $this->GET['tot'];
     }
     ##--
     return " LIMIT {$this->start}, {$this->lim}";
 }
function get_media($pg_media)
{
    $pg_media_csv = '';
    if (@(!empty($pg_media)) && @is_array($pg_media)) {
        $pg_media_csv = "'" . implode("','", $pg_media) . "'";
    }
    if (empty($pg_media_csv)) {
        return false;
    }
    $sql_1 = "SELECT * FROM site_media WHERE placement_tag IN ({$pg_media_csv})";
    $media = @mysql_exec($sql_1);
    //var_dump("<pre>", $sql_1, $media); die();
    if (is_array($media) && count($media) > 0) {
        $media = cb89($media, 'placement_tag');
        //var_dump("<pre>", $media); die();
        return $media;
    }
    return false;
}
function process_signup_3($POST, $FILES, $user_id)
{
    global $seo_tag, $consts;
    if ($user_id > 0) {
        ##/ Process Profile Pic
        include_once '../includes/resize_images.php';
        $up_path = "user_files/prof/{$user_id}/";
        if (!is_dir($up_path)) {
            mkdir($up_path, 0705, true);
        }
        $sql_prt = $profile_pic = '';
        if (is_uploaded_file(@$_FILES['profile_pic']['tmp_name'])) {
            $copy_data = array(0 => array('i_part' => '_th', 'size_w' => 35, 'size_h' => 35));
            $profile_pic = upload_img_rs('profile_pic', 250, 250, $up_path, 'Profile Pic', '', 250, 'CUSA_MSG_GLOBAL', false, $copy_data);
            if ($profile_pic != '') {
                $sql_prt .= ", profile_pic='{$profile_pic}'";
            }
        }
        //die('x');
        #
        #/save users
        $sql_users = "UPDATE users SET\n        screen_name='{$POST['screen_name']}', identify_by='{$POST['identify_by']}' {$sql_prt}\n        WHERE id = '{$user_id}'";
        @mysql_exec($sql_users, 'save');
        #/save user_info
        $sql_user_info = "UPDATE user_info SET\n        country_code = '{$POST['country_code']}', state = '{$POST['state']}', city = '{$POST['city']}',\n    \taddress_ln_1 = '{$POST['address_ln_1']}', address_ln_2 = '{$POST['address_ln_2']}',\n    \tzip = '{$POST['zip']}', phone_number = '{$POST['phone_number']}'\n        WHERE user_id = '{$user_id}'";
        @mysql_exec($sql_user_info, 'save');
        //die('x');
        $_SESSION['signup_success'] = '2';
        $_SESSION['signup_stage'] = 'signup-details';
        reset_attempt_counts();
        redirect_me('signup-details/success');
    } else {
        $_SESSION["CUSA_MSG_GLOBAL"] = array(false, 'Unable to process your request at this moment! Please try again later.');
        redirect_me($seo_tag);
    }
}
Exemplo n.º 10
0
/**
 * Get all Recursive Relationship into select field options
 *
 * @param $f1 = root/parent id
 * @param $table_name = name of the table
 * @param $dir = direction of breadcrumbs
*/
function get_options($f1, $table_name, $dir = 'left')
{
    $frm = '';
    $breadcr = '&laquo;&laquo;';
    if ($dir == 'right') {
        $breadcr = '&raquo;&raquo;';
    }
    $sql = "select id, parent_id, title from {$table_name} where parent_id='{$f1}' order by sort_order";
    //echo $sql;
    $res = mysql_exec($sql);
    if ($res !== false) {
        foreach ($res as $k => $v) {
            if ($v['parent_id'] != 0) {
                $frm .= '<option value="' . $v['id'] . '">' . get_uppers($v['id'], $table_name, 'right') . '</option>';
            }
            $t1 = get_options($v['id'], $table_name, $dir);
            if (!empty($t1) && $t1 != '0') {
                $frm .= $t1;
            }
        }
        //end foreach....
    }
    return $frm;
}
Exemplo n.º 11
0
        break;
    case 'paid_on':
        $orderby = '7';
        break;
}
#/ Fill select-options
$pss_opts = '';
$payment_ss = @format_str(@mysql_exec("SELECT DISTINCT payment_status FROM user_payments GROUP BY payment_status ORDER BY payment_status"));
if (is_array($payment_ss) && count($payment_ss) > 0) {
    foreach ($payment_ss as $cat_v) {
        $pss_opts .= "<option value='{$cat_v['payment_status']}'>{$cat_v['payment_status']}</option>";
    }
}
#/ Fill select-options
$gw_opts = '';
$gateway_ss = @format_str(@mysql_exec("SELECT DISTINCT gateway_name FROM user_payments GROUP BY gateway_name ORDER BY gateway_name"));
if (is_array($gateway_ss) && count($gateway_ss) > 0) {
    foreach ($gateway_ss as $cat_v) {
        $gw_opts .= "<option value='{$cat_v['gateway_name']}'>{$cat_v['gateway_name']}</option>";
    }
}
?>

    <tr>
        <th width="2%" nowrap>&nbsp;</th>

        <th valign="top" width="12%" nowrap><a href="<?php 
echo rebuildurl(array("orderby" => 1, "orderdi" => $orderby == 1 && $orderdi == "ASC" ? "DESC" : "ASC"));
?>
">
            Payment Invoice
} else {
    $param2 = '?';
}
$vc_id = (int) getgpcvar("vc_id", "G");
$cur_page = cur_page();
/////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
#### Get record if EDIT Mode
$empt = $empt_2 = $total = array();
$vote_list = '';
if ($vc_id && empty($empt)) {
    $query = sprintf("SELECT vv.*, uv.question_text, u.email_add\n    FROM user_voices uv\n    RIGHT JOIN voices_votes vv ON vv.voice_id=uv.id\n    LEFT JOIN users u ON u.id=vv.user_id\n    WHERE voice_id='%d'\n    ORDER BY voted_on DESC", $vc_id);
    /*$token  = mysql_query($query, $cn1); //or die(mysql_error($cn1));
    	$empt  =  @mysql_fetch_assoc($token);
        $empt2 = $empt;*/
    $empt = mysql_exec($query);
    if ($empt == false || empty($empt)) {
        die("Record Not Found !");
    }
    foreach ($empt as $empt_v) {
        //var_dump($empt_v, '<br /><br />');
        $vote_txt = ucwords(str_replace('_', ' ', $empt_v['vote_value']));
        if (!array_key_exists($empt_v['vote_value'], $total)) {
            $total[$empt_v['vote_value']] = array('title' => $vote_txt, 'count' => 1);
        } else {
            $total[$empt_v['vote_value']]['count']++;
        }
        $user = $empt_v['email_add'];
        if (empty($user)) {
            $user = '******';
        }
        <div style="width:130px; float:left;">Key:</div>
        <div style="float:left;"><input type="text" id="action_key" name="action_key" maxlength="50" disabled="" value="<?php 
echo format_str(@$empt['action_key']);
?>
" style="width:150px; border:1px solid #000261;" />
        <span class="submsg">&nbsp;&nbsp;for code</span>
        </div>

        <div style="clear:both; height:10px;"></div>

        <div style="width:130px; float:left;">Category:</div>
        <div style="float:left;">
            <?php 
$sql_cats = "SELECT DISTINCT category FROM patronage_points_config ORDER BY category";
$categories = mysql_exec($sql_cats);
?>
            <select id="category" name="category" style="width:160px; border:1px solid #000261;">
            <?php 
if (@count($categories) > 0) {
    foreach ($categories as $cat_v) {
        echo "<option value=\"{$cat_v['category']}\">{$cat_v['category']}</option>";
    }
}
?>
            </select>
            <?php 
if (isset($empt['category'])) {
    echo "<script>document.getElementById('category').value='{$empt['category']}';</script>";
}
?>
Exemplo n.º 14
0
        <div style="width:130px; float:left;">Setting / Value2:</div>
        <div style="float:left;"><input type="text" id="content_settings" name="content_settings" maxlength="150" value="<?php 
echo format_str(@$empt['content_settings']);
?>
" style="width:250px; border:1px solid #000261;" />
        <span class="submsg">&nbsp;&nbsp;for technical values only (will not be displayed) / please dont alter this</span><br /><br />
        </div>

        <div style="clear:both; height:15px;"></div>

        <div style="width:130px; float:left;">Category:</div>
        <div style="float:left;">
            <?php 
$sql_cats = "SELECT DISTINCT m_cat FROM site_misc_data ORDER BY m_cat";
$m_cats = mysql_exec($sql_cats);
?>
            <span class="submsg">for reference and grouping only / will not be displayed</span><br /><br />
            <div id="m_cat_select">
                <select id="m_cat_sel" name="m_cat" onchange="toggle_cat(this, 'm_cat_field');">
                <option value="-">-Please Select-</option>
                <option value="other">{New Value}</option>
                <?php 
if (@count($m_cats) > 0) {
    foreach ($m_cats as $m_catv) {
        echo "<option value=\"{$m_catv['m_cat']}\">{$m_catv['m_cat']}</option>";
    }
}
?>
                </select>
                <span style="color:#CC0000;">&nbsp;&nbsp;*</span>
Exemplo n.º 15
0
<script>
$(document).ready(function(){
   var body_ht = parseInt($('.section-main').outerHeight())+parseInt($('.mar-page').outerHeight());
   $('#mask_1').css('height', (body_ht+90)+'px');
});
</script>


<?php 
    #/ get needed site_media
    $sm_array = array('main_logo');
    $site_media_main = get_site_media($sm_array);
    //var_dump("<pre>", $site_media_main); die();
    #/ get other needed info
    $site_contact_info = @cb89(@mysql_exec("SELECT * FROM site_contact_info"), 'c_key');
    //var_dump("<pre>", $site_contact_info); die();
    ?>

<div class="header">
    <div class="container">
        <?php 
    $site_top_logo = @$site_media_main['main_logo'];
    ?>
        <div class="logo"><a href="<?php 
    echo DOC_ROOT;
    ?>
"><img src="<?php 
    echo DOC_ROOT;
    ?>
assets/images_2/media/<?php 
         #-
         //die(mysql_error());
         $_SESSION["CUSA_ADMIN_MSG_GLOBAL"] = array(true, 'The Admin User data successfully Updated');
         reset_attempt_counts();
         redirect_me("{$consts['DOC_ROOT_ADMIN']}admin_users_opp.php{$param2}&au_id={$au_id}", true);
         ////////////////-------
     } else {
         ////////////////-------
         #/ encrypt password
         include_once '../../includes/func_enc.php';
         $new_pass = (string) $_POST['new_pass'];
         $new_password = md5_encrypt($new_pass);
         ###/ Updating Database
         #/ admin_users
         $sql_admin_users = "insert into admin_users\n        \t(email_add, first_name, last_name, is_active, pass_w, added_on)\n        \tvalues('{$_POST['email_add']}', '{$_POST['first_name']}', '{$_POST['last_name']}', '{$is_active}', '{$new_password}', now())";
         mysql_exec($sql_admin_users, 'save');
         $au_id = mysql_insert_id();
         if ($au_id > 0) {
             #/ admin_permissions
             insert_permissions($au_id, $permissions);
         }
         #-
         $_SESSION["CUSA_ADMIN_MSG_GLOBAL"] = array(true, 'The Admin User added successfully into the system.');
         reset_attempt_counts();
         redirect_me("{$consts['DOC_ROOT_ADMIN']}admin_users_opp.php{$param2}&au_id={$au_id}", true);
     }
     //end Add ..
 } else {
     $fv_msg = 'Please clear the following Error(s):<br /><br />- ';
     $fv_msg_ar = array();
     foreach ($fv_errors as $fv_k => $fv_v) {
Exemplo n.º 17
0
    case 'cat_id':
        $orderby = '3';
        break;
    case 'sp.is_active':
        $orderby = '4';
        break;
    case 'popup_only':
        $orderby = '5';
        break;
    case 'sp.id':
        $orderby = '6';
        break;
}
###/ Fill select-options
$cat_opts = '';
$cats = @format_str(@mysql_exec("SELECT * FROM page_categories ORDER BY title"));
if (is_array($cats) && count($cats) > 0) {
    foreach ($cats as $cat_v) {
        $cat_opts .= "<option value='{$cat_v['id']}'>{$cat_v['title']}</option>";
    }
}
#-
?>

    <tr>
        <th width="3%" nowrap>&nbsp;</th>

        <th valign="top" width="23%" nowrap><a href="<?php 
echo rebuildurl(array("orderby" => 1, "orderdi" => $orderby == 1 && $orderdi == "ASC" ? "DESC" : "ASC"));
?>
">
Exemplo n.º 18
0
        $orderby = '2';
        break;
    case 'question_text':
        $orderby = '3';
        break;
    case 'votes_count':
        $orderby = '4';
        break;
    case 'added_on':
        $orderby = '5';
        break;
}
#/ Get Categories
##/ Fill select-options
$cat_opts = '';
$cats = @format_str(@mysql_exec("SELECT DISTINCT category, id FROM voice_categories GROUP BY category ORDER BY category"));
$cats_x = cb89($cats, 'id');
if (is_array($cats) && count($cats) > 0) {
    foreach ($cats as $cat_v) {
        $cat_opts .= "<option value='{$cat_v['id']}'>{$cat_v['category']}</option>";
    }
}
?>

    <tr>
        <th width="2%" nowrap>&nbsp;</th>

        <th valign="top" width="36%" nowrap><a href="<?php 
echo rebuildurl(array("orderby" => 3, "orderdi" => $orderby == 3 && $orderdi == "ASC" ? "DESC" : "ASC"));
?>
">
$user_permissions = @$member_info_ar[1];
//var_dump("<pre>", $user_permissions); die();
#/ Permission Images
$public = "{$consts['DOC_ROOT']}assets/images/secure_public.png";
$private = "{$consts['DOC_ROOT']}assets/images/secure_private.png";
#/ Current Profile Pic
$prof_pic = DOC_ROOT . "assets/images/ep.png";
if (array_key_exists('profile_pic', $member_info)) {
    if (!@empty($member_info['profile_pic'])) {
        $prof_pic = DOC_ROOT . "user_files/prof/{$member_id}/{$member_info['profile_pic']}";
    }
}
$prof_pic_th = @substr_replace($prof_pic, '_th.', @strrpos($prof_pic, '.'), 1);
#/ Country & State
$countries = @format_str(@mysql_exec("SELECT * FROM countries ORDER BY country_name"));
$states = @format_str(@mysql_exec("SELECT * FROM states WHERE country_code='US' ORDER BY state_name"));
#/ Data to be placed
$empt = $member_info;
$empt_p = $user_permissions;
if (isset($_POST['email_add'])) {
    $empt = $_POST;
    $empt_p = $_POST['user_perm'];
}
//var_dump("<pre>", $empt_p); die();
/////////////////////////////////////////////////////////////////////
#/ Fill pg_meta
$pg_meta = array('page_title' => "Profile Update");
$page_heading = $pg_meta['page_title'];
$load_validation = true;
include_once "includes/header.php";
include_once '../includes/upload_btn_front.php';
Exemplo n.º 20
0
    case 'placement_tag':
        $orderby = '1';
        break;
    case 'alt_text':
        $orderby = '2';
        break;
    case 'm_cat':
        $orderby = '3';
        break;
    case 'added_on':
        $orderby = '4';
        break;
}
##/ Fill select-options
$cat_opts = '';
$cats = @format_str(@mysql_exec("SELECT DISTINCT m_cat FROM site_media ORDER BY m_cat"));
if (is_array($cats) && count($cats) > 0) {
    foreach ($cats as $cat_v) {
        $cat_opts .= "<option value='{$cat_v['m_cat']}'>{$cat_v['m_cat']}</option>";
    }
}
#-
?>

    <tr>
        <th width="4%" nowrap>&nbsp;</th>

        <th valign="top" width="30%" nowrap><a href="<?php 
echo rebuildurl(array("orderby" => 1, "orderdi" => $orderby == 1 && $orderdi == "ASC" ? "DESC" : "ASC"));
?>
">
Exemplo n.º 21
0
if (!isset($seo_tag_id) || empty($seo_tag_id)) {
    exit;
}
include_once 'includes/session_ajax.php';
#/ Check Caller
if (!isset($_SERVER['HTTP_REFERER'])) {
    exit;
}
$allowed = array('localhost', 'www.collaborateusa.com', 'collaborateusa.com', 'new.collaborateusa.com', 'cusa-local');
if (!in_array($_SERVER['SERVER_NAME'], $allowed)) {
    exit;
}
#/ Check User
$user_id = (int) @$_SESSION["CUSA_Main_usr_id"];
if ($user_id <= 0) {
    exit;
}
$_POST = format_str($_POST);
$_GET = format_str($_GET);
$notif_id = (int) @$_GET['ni'];
if ($notif_id <= 0) {
    exit;
}
/////////////////////////////////////////////////////////////////////////
$sql_1 = "UPDATE user_notifications SET is_read='1' WHERE id='{$notif_id}' AND user_id='{$user_id}'";
$res = @mysql_exec($sql_1, 'save');
//var_dump($res);
if ($res == 'true') {
    echo '1';
}
         $show_form = false;
     }
     #/ Check if account is blocked
     if ($ver_res['is_blocked'] == 1) {
         $fv_errors[] = array("Your Account has <b>BLOCKED</b> by the Admin! Consequently, you will NOT be able to Signin to your Account.");
         unset($_SESSION['resend_chk']);
         $show_form = false;
     }
 }
 if (!is_array($fv_errors) || empty($fv_errors) || count($fv_errors) <= 0) {
     #/delete from acc_verifications
     $sql_av = "DELETE FROM acc_verifications WHERE user_id='{$u_id}' AND verification_str='{$verification_str}'";
     @mysql_exec($sql_av, 'save');
     #/update users
     $sql_users = "UPDATE users SET account_activated='1' WHERE id='{$u_id}'";
     @mysql_exec($sql_users, 'save');
     #/ Get user info
     $user_info = $ver_res;
     if (is_array($user_info) && array_key_exists('email_add', $user_info)) {
         include_once '../includes/email_templates.php';
         include_once '../includes/send_mail.php';
         #/ Send Welcome Email to User
         $subject = "Welcome to collaborateUSA.com | Account Activated Successfully";
         $heading = "Account Successfully Activated | Welcome to collaborateUSA.com";
         $insert_bdy = '';
         if ($user_info['screen_name'] == '') {
             $insert_bdy = "<u>Do Note</u>: You are required to setup your <b>Profile Info</b> including your Screen Name (if you have not done that already).<br /><br />";
         }
         $body_in = welcome_new_user($user_info, $insert_bdy);
         send_mail($user_info['email_add'], $subject, $heading, $body_in);
         #/ redirect
Exemplo n.º 23
0
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
///////////////////////////////////////////////////////////////////
##/ Integrate Generic HEader
#/ get Page Info
$page_info = @mysql_exec("SELECT * FROM site_pages WHERE seo_tag_id='11'", 'single');
#/ Fill pg_meta
if (isset($title) && !empty($title)) {
    $page_title = $title;
} else {
    $page_title = format_str(@$page_info['title']);
}
$pg_meta = array('page_title' => $page_title, 'meta_keywords' => format_str(@$page_info['meta_keywords']), 'meta_descr' => format_str(@$page_info['meta_descr']));
$page_heading = format_str(@$page_info['page_heading']);
require_once CONTEXT_DOCUMENT_ROOT . '/includes/header.php';
///////////////////////////////////////////////////////////////////
$config = c_get_config();
?>

<link rel="stylesheet" type="text/css" media="all" href="<?php 
echo c_get_assets_url();
?>
css/style.css" />
<?php 
/*<link rel="stylesheet" type="text/css" media="all" href="<?php echo c_get_assets_url(); ?>css/header_footer.css" />*/
?>

<?php 
     $is_active = (int) @$_POST['is_active'];
     if ($pc_id > 0) {
         ###/ Updating Database
         #/ page_categories
         $sql_page_categories = "UPDATE page_categories SET title='{$_POST['title']}',\n            is_active='{$is_active}' WHERE id='{$pc_id}'";
         mysql_exec($sql_page_categories, 'save');
         #-
         $_SESSION["CUSA_ADMIN_MSG_GLOBAL"] = array(true, 'The Category data has been successfully Updated');
         redirect_me("{$consts['DOC_ROOT_ADMIN']}{$cur_page}{$param2}&pc_id={$pc_id}", true);
         ////////////////-------
     } else {
         ////////////////-------
         ###/ insert into Database
         #/ page_categories
         $sql_page_categories = "insert into page_categories (title, is_active)\n        \tvalues('{$_POST['title']}', '{$is_active}')";
         mysql_exec($sql_page_categories, 'save');
         $pc_id = mysql_insert_id();
         #-
         $_SESSION["CUSA_ADMIN_MSG_GLOBAL"] = array(true, 'The Category data has been successfully Added into the system');
         redirect_me("{$consts['DOC_ROOT_ADMIN']}{$cur_page}{$param2}&pc_id={$pc_id}", true);
     }
     //end Add ..
 } else {
     $fv_msg = 'Please clear the following Error(s):<br /><br />- ';
     $fv_msg_ar = array();
     foreach ($fv_errors as $fv_k => $fv_v) {
         $fv_msg_ar = array_merge($fv_msg_ar, $fv_v);
     }
     $fv_msg .= @implode('<br />- ', $fv_msg_ar);
     //var_dump($fv_msg); die();
     $_SESSION["CUSA_ADMIN_MSG_GLOBAL"] = array(false, $fv_msg);
Exemplo n.º 25
0
    case 'package_id':
        $orderby = '4';
        break;
    case 'account_activated':
        $orderby = '5';
        break;
    case 'is_blocked':
        $orderby = '6';
        break;
    case 'joined_on':
        $orderby = '7';
        break;
}
#/ Fill select-options
$package_opts = '';
$packages = @format_str(@mysql_exec("SELECT * FROM membership_packages ORDER BY title"));
$packages_lst = cb89($packages, 'id');
if (is_array($packages) && count($packages) > 0) {
    foreach ($packages as $cat_v) {
        $cat_v['cost'] = (double) $cat_v['cost'];
        $cost_dv = number_format($cat_v['cost'], 2);
        $package_opts .= "<option value='{$cat_v['id']}'>{$cat_v['title']}" . ($cat_v['cost'] > 0 ? " (\${$cost_dv})" : '') . "</option>";
    }
}
?>

    <tr>
        <th width="2%" nowrap>&nbsp;</th>

        <th valign="top" width="20%" nowrap><a href="<?php 
echo rebuildurl(array("orderby" => 1, "orderdi" => $orderby == 1 && $orderdi == "ASC" ? "DESC" : "ASC"));
Exemplo n.º 26
0
<?php

if (!isset($seo_tag_id) || empty($seo_tag_id)) {
    redirect_me('404');
}
include_once '../includes/model_home.php';
#/ get Page Info
$page_info = @mysql_exec("SELECT * FROM site_pages WHERE seo_tag_id='{$seo_tag_id}' AND is_active='1'", 'single');
if (!is_array($page_info)) {
    redirect_me('404');
}
//var_dump("<pre>", $seo_tag_id, $page_info); die();
$user_idc = (int) @$_SESSION['CUSA_Main_usr_id'];
#/ get needed site_media
$sm_array = array('free_membership_highlight');
$site_media = get_site_media($sm_array);
//var_dump("<pre>", $site_media); die();
#/ get site_misc_data
$smd = array('website_functions_copy', 'home_sliders', 'why_collaborate_copy', 'learn_functions', 'home_vide');
//'home_video' when live
$site_misc_data = get_site_misc_data($smd);
//var_dump("<pre>", $site_misc_data); die();
#/ Packages
$home_packages = false;
if ($user_idc <= 0) {
    $home_packages = get_home_packages();
    //var_dump("<pre>", $home_packages); die();
}
#/ Home Voices
$home_voices = get_home_voices();
//var_dump("<pre>", $home_voices); die();
        exit;
    } else {
        $fv_msg = 'Please clear the following Error(s):<br /><br />- ';
        $fv_msg_ar = array();
        foreach ($fv_errors as $fv_k => $fv_v) {
            $fv_msg_ar = array_merge($fv_msg_ar, $fv_v);
        }
        $fv_msg .= @implode('<br />- ', $fv_msg_ar);
        $_SESSION["CUSA_MSG_GLOBAL"] = array(false, $fv_msg);
        update_attempt_counts();
    }
}
//end if form post..
/////////////////////////////////////////////////////////////////////
if ($success == false) {
    $secret_questions = @format_str(@mysql_exec("SELECT * FROM secret_questions ORDER BY question"));
}
$category_msg = "Please use the form below to <b>Update</b> your Account Password at collaborateUSA.com.";
#/ Fill pg_meta
$pg_meta = array('page_title' => "Password Update");
$page_heading = $pg_meta['page_title'];
$head_msg = "Update Account Password at collaborateUSA.com";
$load_validation = true;
include_once "includes/header.php";
/////////////////////////////////////////////////////////////////////
?>
<link type="text/css" rel="stylesheet" href="<?php 
echo DOC_ROOT;
?>
assets/css/form.css" />
Exemplo n.º 28
0
 $form_v = new Valitron\Validator($_POST);
 $rules = ['required' => [['email_add'], ['pass_w']], 'lengthMax' => [['email_add', 150], ['pass_w', 20]], 'email' => [['email_add']]];
 $form_v->labels(array('email_add' => 'Email Address', 'pass_w' => 'Password'));
 $form_v->rules($rules);
 $form_v->validate();
 $fv_errors = $form_v->errors();
 //var_dump("<pre>", $_POST, $fv_errors); die();
 #-
 ##/ Find User Info
 if (!is_array($fv_errors) || empty($fv_errors) || count($fv_errors) <= 0) {
     include_once '../includes/func_enc.php';
     $pass_w = @md5_encrypt($_POST['pass_w']);
     #/ Match User
     $sql_1 = "SELECT *, US.id as user_id\n        FROM users US\n        LEFT JOIN user_info UI ON US.id = UI.user_id\n        WHERE email_add='{$_POST['email_add']}' AND pass_w='{$pass_w}'";
     //die($sql_1);
     $chk_usr = @mysql_exec($sql_1, 'single');
     if (empty($chk_usr) || !is_array($chk_usr)) {
         $fv_errors[] = array("Unable to <b>Authenticate</b> your given info! Please try again.<br />- If you dont have an Account setup here yet, please <b>Register</b> for an Account instead.");
     } else {
         #/ Check if account is not activated
         if ($chk_usr['account_activated'] == 0) {
             $fv_errors[] = array("Your Account has <b>NOT been ACTIVATED</b> yet!<br />- Please follow the <b>Account Activation email</b> sent to you at the time of Signup in order to activate your Account first.");
             $fv_errors[] = array("If you have lost that email, please <a href=\"{$consts['DOC_ROOT']}account-confirm/resend\" style='font-weight:bold; color:red'>Click Here</a> to <b>RESEND</b> the Activation Email.");
             $show_form = false;
             $_SESSION['resend_chk'] = true;
             //allow Resend Form to be visible
         }
         #/ Check if account is blocked
         if ($chk_usr['is_blocked'] == 1) {
             $fv_errors[] = array("Your Account has <b>BLOCKED</b> by the Admin! Consequently, you will NOT be able to Access your Account.");
             $show_form = false;
 ##/ Validate Fields
 include_once '../../includes/form_validator.php';
 $form_v = new Valitron\Validator($_POST);
 $rules = ['required' => [['title'], ['c_value']], 'lengthMax' => [['title', 100], ['c_value', 50]]];
 $form_v->labels(array('title' => 'Title', 'c_value' => 'Value'));
 $form_v->rules($rules);
 $form_v->validate();
 $fv_errors = $form_v->errors();
 //var_dump("<pre>", $_POST, $fv_errors); die();
 #-
 if (!is_array($fv_errors) || empty($fv_errors) || count($fv_errors) <= 0) {
     if ($conf_id > 0) {
         ###/ Updating Database
         #/ system_config
         $sql_tb1 = "UPDATE system_config SET title='{$_POST['title']}', c_value='{$_POST['c_value']}'\n            WHERE id='{$conf_id}'";
         mysql_exec($sql_tb1, 'save');
         #-
         $_SESSION["CUSA_ADMIN_MSG_GLOBAL"] = array(true, 'The Site data has been successfully Updated');
         redirect_me("{$consts['DOC_ROOT_ADMIN']}{$cur_page}{$param2}&conf_id={$conf_id}", true);
         ////////////////-------
     } else {
     }
     //end Add ..
 } else {
     $fv_msg = 'Please clear the following Error(s):<br /><br />- ';
     $fv_msg_ar = array();
     foreach ($fv_errors as $fv_k => $fv_v) {
         $fv_msg_ar = array_merge($fv_msg_ar, $fv_v);
     }
     $fv_msg .= @implode('<br />- ', $fv_msg_ar);
     $_SESSION["CUSA_ADMIN_MSG_GLOBAL"] = array(false, $fv_msg);
 //var_dump("<pre>", $_POST, $fv_errors); die();
 #-
 #/ Check Captcha Code
 if (empty($_SESSION['cap_code']) || empty($_POST['vercode']) || $_SESSION['cap_code'] != $_POST['vercode']) {
     $fv_errors[] = array('The Verification Code you entered does not match the one given in the image! Please try again.');
 }
 #/ Check if Email Add exists
 if (!is_array($fv_errors) || empty($fv_errors) || count($fv_errors) <= 0) {
     $chk_user = mysql_exec("SELECT email_add FROM users WHERE email_add='{$_POST['email_add']}'", 'single');
     if (!empty($chk_user)) {
         $fv_errors[] = array('This Email Address is already used, please try a different one!');
     }
 }
 #/ Check if Package
 if (!is_array($fv_errors) || empty($fv_errors) || count($fv_errors) <= 0) {
     $chk_pkg = mysql_exec("SELECT * FROM membership_packages WHERE id='{$_POST['package_id']}' AND is_active='1'", 'single');
     if (empty($chk_pkg)) {
         $fv_errors[] = array('The Membership Package you selected cannot be purchased at this moment, please try a different one!');
     }
 }
 ##/ Process
 if (!is_array($fv_errors) || empty($fv_errors) || count($fv_errors) <= 0) {
     #/ Determine Direction to move
     $chk_pkg = @format_str($chk_pkg);
     $chk_pkg['cost'] = (double) $chk_pkg['cost'];
     $package_type = 'free';
     if ($chk_pkg['cost'] > 0) {
         $package_type = 'paid';
     }
     //var_dump($chk_pkg['cost'], $package_type); die();
     #/ make a copy of submission