Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>GISR - Hub</title>
- <link rel='stylesheet' id='google.fonts-css' href='http://fonts.googleapis.com/css?family=PT+Sans%7CPT+Sans%7CPT+Sans%7CPT+Sans%7CPT+Sans%7CPT+Sans&subset=cyrillic%2Clatin&ver=4.1.5' type='text/css' media='all' />
- <link rel='stylesheet' id='twentytwelve-fonts-css' href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700&subset=latin,latin-ext' type='text/css' media='all' />
- <link rel='stylesheet' id='twentytwelve-style-css' href='http://ratesustainability.org/wp-content/themes/gisr/style.css?ver=4.1.5' type='text/css' media='all' />
- <!--[if lt IE 9]>
- <link rel='stylesheet' id='twentytwelve-ie-css' href='http://ratesustainability.org/wp-content/themes/twentytwelve/css/ie.css?ver=20121010' type='text/css' media='all' />
- <![endif]-->
- <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>theme/css/kickstart.css" media="all" />
- <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>theme/css/style.css" media="all" />
- <!-- These scripts need to be loaded in header because of file dependencies
- <!-- jQuery -->
- <script type="text/javascript" src="<?php echo base_url(); ?>theme/js/jquery-1.11.3.min.js" type="text/javascript"></script>
- <script src="<?php echo base_url(); ?>theme/js/jquery_ui_min_1.11.4.js" type="text/javascript"></script>
- <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
- <!-- jQuery Confirm -->
- <script src="<?php echo base_url('theme/js/jquery_confirm/jquery-confirm.min.js'); ?>" type="text/javascript"></script>
- <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>theme/css/jquery_confirm/jquery-confirm.min.css" />
- <!-- jQuery BlockUI -->
- <script src="<?php echo base_url('theme/js/jquery_blockui.js'); ?>" type="text/javascript"></script>
- <!-- Auto logout -->
- <script type="text/javascript">
- var gisr_index_page = "<?php print base_url() . index_page(); ?>";
- </script>
- <script type="text/javascript" src="<?php echo base_url(); ?>theme/js/logout_timer.js"></script>
- <!-- Google Analytics -->
- <script>
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
- ga('create', 'UA-43802807-1', 'ratesustainability.org');
- ga('send', 'pageview');
- </script>
- <style type="text/css">
- /* jQuery alerts css (bootstrap) */
- .col-md-4 {
- float:left;
- width:33.33333333%;
- position:relative;
- min-height:1px;
- padding-right:15px;
- padding-left:15px;
- }
- .col-md-offset-4 {
- margin-left:33.33333333%;
- }
- .btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da;}
- .btn-info.focus, .btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85;}
- .btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc;}
- .btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a;}
- .btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19;}
- .btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925;}
- .remove {
- float: right;
- }
- .remove:hover {
- color: #F00;
- }
- .member_bm_item:hover {
- color: #2d9ed8;
- }
- </style>
- <?php
- // Load member login script
- $this->load->view('front_member_login');
- ?>
- </head>
- <body>
- <?php
- // Load header wrapper
- $this->load->view('pages/header_wrapper');
- ?>
- <div class="report-body" style="padding: .5em 0;">
- <div style="max-width: 52%; margin: 0 auto;">
- <div style="text-align:center;">
- <h4>User Profile Page</h4>
- </div>
- <?php
- // If this user is logged in
- if(isset($user['id'])) {
- echo '<p style="text-align:center;">Welcome, '.$user['first_name'].' '.$user['last_name'].'</p>';
- ?>
- <div id="user_profile_left_column" style="float:left;width:15%;border-right:1px solid #ccc;">
- <a id="show_user_profile" href="">Profile</a><br>
- <a id="show_user_bookmarks" href="">Bookmarks</a><br>
- <a id="show_user_alerts" href="">Notifications</a>
- <div style="margin-top:20px;"></div>
- <button class="member_profile_logout" type="button">Logout</button><br>
- </div>
- <div id="user_profile_right_column" style="float:left;width:75%;margin-left:5%;">
- <div id="user_profile" style="min-height:300px;">
- <h6 style="margin-top:0px;">Profile Information</h6>
- <table>
- <tbody style="display:block;">
- <tr>
- <td><strong>First Name:</strong></td>
- <td><?php echo $user['first_name']; ?></td>
- </tr>
- <tr>
- <td><strong>Last Name:</strong></td>
- <td><?php echo $user['last_name']; ?></td>
- </tr>
- <tr>
- <td><strong>Email:</strong></td>
- <td><?php echo $user['email']; ?></td>
- </tr>
- <tr>
- <td><strong>Password:</strong></td>
- <td><a href="" id="member_change_password">Change Password</a></td>
- </tr>
- <tr>
- <td><strong>Company Name:</strong></td>
- <td><?php echo $user['comp_name']; ?></td>
- </tr>
- <tr>
- <td><strong>Job Title:</strong></td>
- <td><?php echo $user['job_title']; ?></td>
- </tr>
- <tr>
- <td><strong>Date Joined:</strong></td>
- <td><?php echo $user['created_on']; ?></td>
- </tr>
- </tbody>
- </table>
- </div>
- <div id="user_bookmarks" style="display:none;min-height:300px;">
- <?php
- // Get user table
- $user_id = $user['id'];
- $user_sql = "SELECT * FROM admin_table WHERE user_id = '$user_id'";
- $user_query = $this->Comman_crud->custom_query($user_sql);
- $user_table = $user_query[0];
- ?>
- <h6 style="margin-top:0px;">Saved Bookmarks</h6>
- <div id="accordion">
- <h3>Bookmarked Company Profiles</h3>
- <div>
- <?php
- // Check bookmarks from user table
- if(isset($user_table->bm_comps) && !empty($user_table->bm_comps)) {
- // Unserialize array
- $array = unserialize($user_table->bm_comps);
- // Loop array to show each company
- if(is_array($array) && !empty($array)) {
- echo '<table><tbody>';
- foreach ($array as $k => $v) {
- $sql = "SELECT * FROM company_profile WHERE company_id = '$v'";
- $query = $this->Comman_crud->custom_query($sql);
- $result = $query[0];
- echo '<tr>';
- echo '<td><a href="'.base_url().index_page().'search/at-a-glance-company/'.$result->company_id.'" class="member_bm_item">'.$result->firm_name.'</a></td>';
- echo '<td><a href="" class="remove_bm_comp remove" id="'.$result->company_id.'">Remove</a></td>';
- echo '</tr>';
- }
- echo '</tbody></table>';
- }
- else {
- echo 'No bookmarks found.';
- }
- }
- else {
- echo 'No bookmarks found.';
- }
- ?>
- </div>
- <h3>Bookmarked Product Profiles</h3>
- <div>
- <?php
- // Check bookmarks from user table
- if(isset($user_table->bm_prods) && !empty($user_table->bm_prods)) {
- // Unserialize array
- $array = unserialize($user_table->bm_prods);
- // Loop array to show each company
- if(is_array($array) && !empty($array)) {
- echo '<table><tbody>';
- foreach ($array as $k => $v) {
- // Split company id / product id
- $split = explode('/', $v);
- $comp_id = $split[0];
- $prod_id = $split[1];
- $sql = "SELECT * FROM product_profile WHERE company_id = '$comp_id' AND product_id = '$prod_id'";
- $query = $this->Comman_crud->custom_query($sql);
- $result = $query[0];
- echo '<tr>';
- echo '<td><a href="'.base_url().index_page().'search/at-a-glance-product/'.$result->company_id.'/'.$result->product_id.'" class="member_bm_item">'.$result->product_name.'</a></td>';
- echo '<td><a href="" class="remove_bm_prod remove" id="'.$result->company_id.'/'.$result->product_id.'">Remove</a></td>';
- echo '</tr>';
- }
- echo '</tbody></table>';
- }
- else {
- echo 'No bookmarks found.';
- }
- }
- else {
- echo 'No bookmarks found.';
- }
- ?>
- </div>
- <h3>Bookmarked Company Comparisons</h3>
- <div>
- <?php
- // Check bookmarks from user table
- if(isset($user_table->bm_comps_compare) && !empty($user_table->bm_comps_compare)) {
- // Unserialize array
- $array = unserialize($user_table->bm_comps_compare);
- // Loop array to show each company
- if(is_array($array) && !empty($array)) {
- echo '<table><tbody>';
- foreach ($array as $k => $v) {
- // Remove brackets from string
- $strip_v = str_replace('[', '', str_replace(']', '', $v));
- $explode = explode(',', $strip_v);
- $comps = '';
- foreach ($explode as $key => $value) {
- $sql_comp = "SELECT * FROM company_profile WHERE company_id = '$value'";
- $query_comp = $this->Comman_crud->custom_query($sql_comp);
- $comp = $query_comp[0];
- $comps .= $comp->firm_name.'<br />';
- }
- $comps = trim($comps);
- echo '<tr>';
- echo '<td><a href="'.base_url().index_page().'search/advanced_search_compare/owners/'.$v.'" class="member_bm_item">'.$comps.'</a></td>';
- echo '<td><a href="" class="remove_bm_comp_compare remove" id="'.$v.'">Remove</a></td>';
- echo '</tr>';
- }
- echo '</tbody></table>';
- }
- else {
- echo 'No bookmarks found.';
- }
- }
- else {
- echo 'No bookmarks found.';
- }
- ?>
- </div>
- <h3>Bookmarked Product Comparisons</h3>
- <div>
- <?php
- // Check bookmarks from user table
- if(isset($user_table->bm_prods_compare) && !empty($user_table->bm_prods_compare)) {
- // Unserialize array
- $array = unserialize($user_table->bm_prods_compare);
- // Loop array to show each company
- if(is_array($array) && !empty($array)) {
- echo '<table><tbody>';
- foreach ($array as $k => $v) {
- // Remove brackets from string
- $strip_v = str_replace('[', '', str_replace(']', '', $v));
- $explode = explode(',', $strip_v);
- $prods = '';
- foreach ($explode as $key => $value) {
- $ex_val = explode('-', $value);
- $comp_id = $ex_val[0];
- $prod_id = $ex_val[1];
- $sql_prod = "SELECT * FROM product_profile WHERE product_id = '$prod_id' AND company_id = '$comp_id'";
- $query_prod = $this->Comman_crud->custom_query($sql_prod);
- $prod = $query_prod[0];
- $prods .= $prod->product_name.'<br />';
- }
- $prods = trim($prods);
- echo '<tr>';
- echo '<td><a href="'.base_url().index_page().'search/advanced_search_compare/products/'.$v.'" class="member_bm_item">'.$prods.'</a></td>';
- echo '<td><a href="" class="remove_bm_prod_compare remove" id="'.$v.'">Remove</a></td>';
- echo '</tr>';
- }
- echo '</tbody></table>';
- }
- else {
- echo 'No bookmarks found.';
- }
- }
- else {
- echo 'No bookmarks found.';
- }
- ?>
- </div>
- <h3>Bookmarked Advanced Searches</h3>
- <div>
- <?php
- // Check bookmarks from user table
- if(isset($user_table->bm_adv_search) && !empty($user_table->bm_adv_search)) {
- // Unserialize array
- $array = unserialize($user_table->bm_adv_search);
- // Loop array to show each company
- if(is_array($array) && !empty($array)) {
- echo '<table><tbody>';
- foreach ($array as $k => $v) {
- $search_name = isset($v['search_name']) ? $v['search_name'] : '<em>[no search name exists]</em>';
- echo '<tr>';
- echo '<td><a href="'.base_url() . index_page().'search/advanced_search?filter='.htmlentities(serialize($v)).'" class="member_bm_item">'.$search_name.'</a></td>';
- echo '<td><a href="" class="remove_adv_search remove" id="'.htmlentities(serialize($v)).'">Remove</a></td>';
- echo '</tr>';
- }
- echo '</tbody></table>';
- }
- else {
- echo 'No bookmarks found.';
- }
- }
- else {
- echo 'No bookmarks found.';
- }
- ?>
- </div>
- </div>
- </div>
- <div id="user_alerts" style="display:none;min-height:300px;">
- <?php
- // Get user alerts
- $alerts = @unserialize($user_table->user_alerts);
- $alert_comps = isset($alerts['comp_alerts']) && $alerts['comp_alerts'] == 'Y' ? 'checked="checked"' : '';
- $alert_prods = isset($alerts['prod_alerts']) && $alerts['prod_alerts'] == 'Y' ? 'checked="checked"' : '';
- $alert_adv_search = isset($alerts['adv_search_alerts']) && $alerts['adv_search_alerts'] == 'Y' ? 'checked="checked"' : '';
- ?>
- <h6 style="margin-top:0px;">Notifications</h6>
- <p>Subscribe to new companies, products and advanced searchs.</p><br>
- <table style="display:block;">
- <tbody>
- <tr>
- <td><input type="checkbox" id="subscribe_new_comps" <?php echo $alert_comps; ?> /></td>
- <td>New Company Additions</td>
- </tr>
- <tr>
- <td><input type="checkbox" id="subscribe_new_prods" <?php echo $alert_prods; ?> /></td>
- <td>New Product Additions</td>
- </tr>
- <tr>
- <td><input type="checkbox" id="subscribe_new_adv_search" <?php echo $alert_adv_search; ?> /></td>
- <td>New Advanced Search Matches</td>
- </tr>
- </tbody>
- </table>
- <br>
- <button type="button" id="submit_user_alerts">Save</button>
- </div>
- </div>
- <div style="clear:both;margin-bottom:20px;"></div>
- <?php
- }
- else {
- echo 'This page is reserved for members only. Please login to continue.';
- }
- ?>
- </div>
- </div>
- <div class="report-footer">
- <table>
- <tr>
- <td valign="top" style="text-align: center; border-bottom: 0;"><img src="http://ratesustainability.org/wp-content/uploads/2015/03/GISRfooter.jpg" width="1034" height="75"></td>
- </tr>
- <tr>
- <td style="text-align: center; width: 100%;" valign="top" class="footer">All content ©2014 GISR. All Rights Reserved.</td>
- </tr>
- </table>
- </div>
- <script type="text/javascript">
- jQuery(document).ready(function($) {
- var confirm_change_pass = '';
- // Profile page logout button
- $('.member_profile_logout').click(function() {
- window.location = "<?php echo base_url() . index_page() ?>login/logout/front";
- });
- // Click user info boxes
- $('#show_user_profile').click(function(e) {
- e.preventDefault();
- $('#user_bookmarks').hide();
- $('#user_alerts').hide();
- $('#user_profile').show();
- resize_div_height();
- });
- $('#show_user_bookmarks').click(function(e) {
- e.preventDefault();
- $('#user_profile').hide();
- $('#user_alerts').hide();
- $('#user_bookmarks').show();
- // Set accordian bookmarks
- $( "#accordion" ).accordion();
- resize_div_height();
- });
- $('#show_user_alerts').click(function(e) {
- e.preventDefault();
- $('#user_profile').hide();
- $('#user_bookmarks').hide();
- $('#user_alerts').show();
- resize_div_height();
- });
- // Resize column heights
- resize_div_height();
- function resize_div_height() {
- // Get right column height
- right_height = $('#user_profile_right_column').height();
- // Set left column height
- $('#user_profile_left_column').height(right_height);
- }
- // Change password
- $('#member_change_password').click(function(e) {
- e.preventDefault();
- // Set form data
- $content =
- '<div id="change_pass_div">' +
- '<p>Please use the form below to change the account password. Once completed; the account will be logged out automatically. Please login again with the new password to continue.</p>' +
- 'Original Password:<br>' +
- '<input type="password" id="change_pass_orig" /><br><br>' +
- 'New Password:<br>' +
- '<input type="password" id="change_pass_new" /><br><br>' +
- 'Confirm New Password:<br>' +
- '<input type="password" id="change_pass_new_confirm" /><br><br>' +
- '</div>'
- ;
- // Show confirm form
- confirm_change_pass = $.confirm({
- title: 'Change Password',
- content: $content,
- columnClass: 'col-md-4 col-md-offset-4',
- confirmButtonClass: 'btn-info',
- confirmButton: 'Change',
- cancelButtonClass: 'btn-danger',
- confirm: function() {
- // Get form password values
- pass_orig = this.$b.find('#change_pass_orig').val();
- pass_new = this.$b.find('#change_pass_new').val();
- pass_new_confirm = this.$b.find('#change_pass_new_confirm').val();
- // Check if any fields are blank
- if(pass_orig == '') {
- $.alert({
- title: 'Original Password Blank',
- content: 'The Original Password field is required.',
- columnClass: 'col-md-4 col-md-offset-4',
- confirmButtonClass: 'btn-danger'
- });
- return false;
- }
- if(pass_new == '') {
- $.alert({
- title: 'New Password Blank',
- content: 'The New Password field is required.',
- columnClass: 'col-md-4 col-md-offset-4',
- confirmButtonClass: 'btn-danger'
- });
- return false;
- }
- if(pass_new_confirm == '') {
- $.alert({
- title: 'Confirm New Password Blank',
- content: 'The Confirm New Password field is required.',
- columnClass: 'col-md-4 col-md-offset-4',
- confirmButtonClass: 'btn-danger'
- });
- return false;
- }
- // Ensure new password and confirm new password match
- if(pass_new !== pass_new_confirm) {
- $.alert({
- title: 'Password Mismatch',
- content: 'The New Password and Confirm New Password fields must match.',
- columnClass: 'col-md-4 col-md-offset-4',
- confirmButtonClass: 'btn-danger'
- });
- return false;
- }
- // Run ajax to check old password
- $.ajax({
- type: "POST",
- url: '<?php echo base_url() . index_page(); ?>member_profile/user_change_password',
- data: {pass_orig: pass_orig, pass_new: pass_new},
- success: function(data){
- // If orig passwords is incorrect
- if(data.status == 'incorrect_orig_pass') {
- $.alert({
- title: 'Incorrect Password',
- content: 'The Original Password does not match this user account. Please try again; or logout and request a password reset.',
- columnClass: 'col-md-4 col-md-offset-4',
- confirmButtonClass: 'btn-danger'
- });
- }
- // If this password was changed successfully
- if(data.status == 'success') {
- // Close password change dialog
- confirm_change_pass.close();
- // Redirect user to logout
- window.location.href = '<?php echo base_url() . index_page(); ?>login/logout/front';
- }
- }
- });
- return false;
- }
- });
- });
- // Remove bookmarked company
- $('.remove_bm_comp').click(function(e) {
- e.preventDefault();
- var $this = $(this);
- // Get company id
- comp_id = $(this).attr('id');
- $.ajax({
- type: "POST",
- url: '<?php echo base_url() . index_page(); ?>ajax/bookmark_company_remove',
- data: {comp_id: comp_id},
- success: function(data){
- if(data.remove_message == 'success') {
- // Remove table row from results
- $($this).parent().parent().remove();
- }
- }
- });
- });
- // Remove bookmarked product
- $('.remove_bm_prod').click(function(e) {
- e.preventDefault();
- var $this = $(this);
- // Get company id
- this_id = $(this).attr('id');
- split_id = this_id.split('/');
- comp_id = split_id[0];
- prod_id = split_id[1];
- $.ajax({
- type: "POST",
- url: '<?php echo base_url() . index_page(); ?>ajax/bookmark_product_remove',
- data: {comp_id: comp_id, prod_id: prod_id},
- success: function(data){
- if(data.remove_message == 'success') {
- // Remove table row from results
- $($this).parent().parent().remove();
- }
- }
- });
- });
- // Remove bookmarked company comparison
- $('.remove_bm_comp_compare').click(function(e) {
- e.preventDefault();
- var $this = $(this);
- // Get company id
- comp_array = $(this).attr('id');
- $.ajax({
- type: "POST",
- url: '<?php echo base_url() . index_page(); ?>ajax/bookmark_company_compare_remove',
- data: {comp_array: comp_array},
- success: function(data){
- if(data.remove_message == 'success') {
- // Remove table row from results
- $($this).parent().parent().remove();
- }
- }
- });
- });
- // Remove bookmarked product comparison
- $('.remove_bm_prod_compare').click(function(e) {
- e.preventDefault();
- var $this = $(this);
- // Get company id
- prod_array = $(this).attr('id');
- $.ajax({
- type: "POST",
- url: '<?php echo base_url() . index_page(); ?>ajax/bookmark_product_compare_remove',
- data: {prod_array: prod_array},
- success: function(data){
- if(data.remove_message == 'success') {
- // Remove table row from results
- $($this).parent().parent().remove();
- }
- }
- });
- });
- // Remove bookmarked advanced search
- $('.remove_adv_search').click(function(e) {
- e.preventDefault();
- var $this = $(this);
- // Get search id
- search_array = $(this).attr('id');
- $.ajax({
- type: "POST",
- url: '<?php echo base_url() . index_page(); ?>ajax/bookmark_adv_search_remove',
- data: {search_array: search_array},
- success: function(data){
- if(data.remove_message == 'success') {
- // Remove table row from results
- $($this).parent().parent().remove();
- }
- }
- });
- });
- // Submit user alerts
- $('#submit_user_alerts').click(function() {
- // Get form checkbox values
- comp_alerts = ($('#subscribe_new_comps').is(':checked')) ? 'Y' : 'N';
- prod_alerts = ($('#subscribe_new_prods').is(':checked')) ? 'Y' : 'N';
- adv_search_alerts = ($('#subscribe_new_adv_search').is(':checked')) ? 'Y' : 'N';
- $.ajax({
- type: "POST",
- url: '<?php echo base_url() . index_page(); ?>member_profile/save_alerts',
- data: {comp_alerts: comp_alerts, prod_alerts: prod_alerts, adv_search_alerts: adv_search_alerts},
- success: function(data){
- if(data.message == 'success') {
- $.alert({
- title: 'Alerts Saved',
- content: 'The alerts have been saved successfully.',
- columnClass: 'col-md-4 col-md-offset-4',
- confirmButtonClass: 'btn-info'
- });
- return false;
- }
- }
- });
- });
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement