<div class="vasplusfile_adds"><span><?php 
//echo _clang(CHANGE_PHOTO);
?>
</span><input type="file" name="imagefile" id="photo" style="opacity: 0; z-index: 9999; width: 90px; cursor:pointer; padding: 5px; position: absolute; left: -13px; bottom: 0px;" />
    <input type="hidden" name="do" value="upload"/>
  </div>
  </form>-->
                        <!--<div id='view'></div>-->
                    </div>
                    <div class="profile_detail">
                        <div class="username"><?php 
echo $user[0]['username'];
?>
</div>
                        <?php 
$type_of_membership = get_type_of_membership_txt($user[0]['type_of_membership']);
?>
                        <span><?php 
echo _clang(LOGGED_AS);
?>
 <?php 
echo $type_of_membership;
?>
 
                            <?php 
//echo "show->".show_go_premium_link();
if (show_go_premium_link() == true) {
    ?>
                                <a href="<?php 
    echo site_url('premium-account');
    ?>
Example #2
0
 public function success()
 {
     $this->load->model("invoice_model");
     $this->load->helper('email');
     //load email library
     $this->load->library('email');
     //        echo '<pre>'; print_r($_REQUEST); die;
     $id = $_POST['item_number'];
     $get_primary_email = $this->invoice_model->getPrimaryEmail($id);
     $usermail = $get_primary_email[0]['email'];
     $payment_date = date('Y-m-d H:i:s', strtotime($_POST['payment_date']));
     $data = array("status" => $_POST['payment_status'], "payment_date" => $payment_date, "txn_id" => $_POST["txn_id"]);
     if ($this->invoice_model->update_invoice_by_item_number($id, $data) == true) {
         $get_payment_type = $this->invoice_model->get_invoice_by_field(array("item_number"), array($id));
         $getmemebership_type = get_gopremium_price($get_payment_type[0]['payment_type']);
         $this->user_model->update_user($get_payment_type[0]['user_id'], array("type_of_membership" => $getmemebership_type['type_of_membership']));
         if ($this->session->userdata('is_logged_in')) {
             $this->session->unset_userdata(array('type_of_membership' => ''));
             $session = array('type_of_membership' => $getmemebership_type['type_of_membership']);
             //bhushan changes
             if (valid_email($usermail)) {
                 // compose email
                 $get_admin_detail = get_admin_detail();
                 //common helper function for admin detail
                 $this->email->from($get_admin_detail['email']);
                 $this->email->to($usermail);
                 $this->email->set_mailtype("html");
                 $this->email->subject('Account upgrade confirmation');
                 $session_lang = $this->session->userdata('language_shortcode');
                 $type_membership = get_type_of_membership_txt($session['type_of_membership']);
                 $user_name = $_POST['first_name'];
                 $replace = array('{upgrade_username}', '{type_of_membership}');
                 $with = array("{$user_name}", "{$type_membership}");
                 $email_template_content = $this->email_template_model->get_email_template_by_id(7);
                 if (isset($email_template_content[0]['description_' . $session_lang]) && !empty($email_template_content[0]['description_' . $session_lang])) {
                     $template_content = $email_template_content[0]['description_' . $session_lang];
                     $message = str_replace($replace, $with, $template_content);
                     $content = "<html><body><div style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;'>{$message}</div></body></html>";
                     $this->email->message($content);
                 } else {
                     $template_content = $email_template_content[0]['description_en'];
                     $message = str_replace($replace, $with, $template_content);
                     $content = "<html><body><div style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;'>{$message}</div></body></html>";
                     $this->email->message($content);
                 }
                 //echo "<pre>";print_r($session['type_of_membership']);
                 if (!$this->email->send()) {
                     //                    show_error($this->email->print_debugger());
                     $msgadd = "<strong>" . _clang(EMAIL_NOT_SENT) . " </strong>";
                     //.$this->email->print_debugger();
                     $data['flash_message'] = TRUE;
                     $this->session->set_flashdata('flash_class', 'alert-error');
                     $this->session->set_flashdata('flash_message', $msgadd);
                     redirect("home");
                 }
                 $this->session->set_userdata($session);
             } else {
                 if ($redirect == 'home') {
                     $this->session->set_flashdata('validation_error_messages', validation_errors());
                     redirect('home');
                 }
             }
             //end changes
         }
         $this->session->set_flashdata('flash_class', 'alert-success');
         $this->session->set_flashdata('flash_message', '<strong>' . _clang(WELL_DONE) . '</strong> ' . _clang(YOUR_PAYMENT_COMPLETE) . '');
         redirect("home");
     }
 }
 function cancle_account()
 {
     $redirect_to_home = FALSE;
     $user_id = $this->session->userdata("user_id");
     $type_of_membership = $this->session->userdata("type_of_membership");
     $answer = $this->input->post('ans');
     if ($answer == 'tell_us') {
         $answer = $this->input->post('tell_us');
     }
     $user_data = $this->user_model->get_user_by_id($user_id);
     $user_data = $this->user_model->get_user_by_id($user_id);
     if ($type_of_membership == 'FREE') {
         //Delete user
         $this->user_model->delete_user($user_id);
         //$this->session->set_flashdata('flash_mynl_tab', 'tab_4');
         //Delete all schedule
         $this->schedule_model->delete_schedule_with_userid($user_id);
         //delete all subscribe
         $this->subscribe_model->delete_subscribe_with_userid($user_id);
         //delete Newsletter review with process
         $get_newsletter_ids = $this->newsletter_model->get_newsletter_review('', '', '', '', '', '', array("join_user_id"), array($user_id), '');
         $this->newsletter_model->delete_newsletter_review_with_userid($user_id);
         for ($i = 0; $i < count($get_newsletter_ids); $i++) {
             $avg_rate = get_average_rate($get_newsletter_ids[$i]['join_newsletter_id']);
             $rate = array("ratings" => $avg_rate["avg_round"]);
             //add average rate
             $this->newsletter_model->update_newsletter($get_newsletter_ids[$i]['join_newsletter_id'], $rate);
         }
         $this->load->helper('email');
         //load email library
         $this->load->library('email');
         //read parameters from $_POST using input class
         // check is email addrress valid or no
         //First mail to user
         $user_email = $user_data[0]['primary_email'];
         $get_admin_detail = get_admin_detail();
         if (valid_email($user_email)) {
             // compose email
             //common helper function for admin detail
             $this->email->from($get_admin_detail['email'], $get_admin_detail['name']);
             $this->email->to($user_email);
             $this->email->set_mailtype("html");
             $this->email->subject('Your Free Account has been cancled from knewdog!');
             $free_cancle_username = $user_data[0]['username'];
             //bhushan changes
             $session_lang = $this->session->userdata('language_shortcode');
             $replace = array('{free_cancle_username}');
             $with = array("{$free_cancle_username}");
             $email_template_content_free_account = $this->email_template_model->get_email_template_by_id(8);
             if (isset($email_template_content_free_account[0]['description_' . $session_lang]) && !empty($email_template_content_free_account[0]['description_' . $session_lang])) {
                 $cancellation_email_content_for_free = $email_template_content_free_account[0]['description_' . $session_lang];
                 $message = str_replace($replace, $with, $cancellation_email_content_for_free);
                 $utf = "utf-8";
                 $content = "<html><meta charset='" . $utf . "'><body><div style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;'>{$message}</div></body></html>";
                 $this->email->message($content);
             } else {
                 $cancellation_email_content_for_free = $email_template_content_free_account[0]['description_en'];
                 $message = str_replace($replace, $with, $cancellation_email_content_for_free);
                 $content = "<html><meta charset='" . $utf . "'><body><div style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;'>{$message}</div></body></html>";
                 $this->email->message($content);
             }
             //end changes
             //							$message = $this->load->view('mail_templates/cancle_account_mail', $mail_data,true);
             //						  	$this->email->message($message);
             // try send mail ant if not able print debug
             $this->email->send();
         }
         $admin_email = $get_admin_detail['email'];
         if (valid_email($admin_email)) {
             // compose email
             $this->email->from($get_admin_detail['email'], $get_admin_detail['name']);
             $this->email->to($admin_email);
             $this->email->set_mailtype("html");
             $this->email->subject('One Account has been cancled from knewdog!');
             $mail_data['free_admin_cancle_account_type'] = get_type_of_membership_txt($type_of_membership);
             $mail_data['free_admin_cancle_answer'] = $answer;
             $mail_data['free_admin_cancle_user_email'] = $user_email;
             $mail_data['free_admin_cancle_username'] = $user_data[0]['username'];
             //bhushan changes
             $session_lang = $this->session->userdata('language_shortcode');
             $replace = array('{free_admin_cancle_account_type}', '{free_admin_cancle_answer}', '{free_admin_cancle_username}', '{free_admin_cancle_user_email}');
             $with = array("{$mail_data['free_admin_cancle_account_type']}", "{$mail_data['free_admin_cancle_answer']}", "{$mail_data['free_admin_cancle_username']}", "{$mail_data['free_admin_cancle_user_email']}");
             $email_template_content_cancle_admin = $this->email_template_model->get_email_template_by_id(9);
             if (isset($email_template_content_cancle_admin[0]['description_' . $session_lang]) && !empty($email_template_content_cancle_admin[0]['description_' . $session_lang])) {
                 $cancle_mail_free_account_admin = $email_template_content_cancle_admin[0]['description_' . $session_lang];
                 $message = str_replace($replace, $with, $cancle_mail_free_account_admin);
                 $utf = "utf-8";
                 $content = "<html><meta charset='" . $utf . "'><body><div style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;'>{$message}</div></body></html>";
                 $this->email->message($content);
             } else {
                 $cancle_mail_free_account_admin = $email_template_content_cancle_admin[0]['description_en'];
                 $message = str_replace($replace, $with, $cancle_mail_free_account_admin);
                 $content = "<html><meta charset='" . $utf . "'><body><div style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;'>{$message}</div></body></html>";
                 $this->email->message($content);
             }
             //end changes
             // try send mail ant if not able print debug
             $this->email->send();
         }
         //Delete additional email
         $this->additional_email_model->delete_additional_email_by_userid($user_id);
         //Delete Invoice
         //$this->invoice_model->delete_invoice_by_userid($user_id);
         //Loged out
         if ($this->session->userdata('is_logged_in')) {
             $reuired_sessiondata = array('session_id' => $this->session->userdata('session_id'), 'ip_address' => $this->session->userdata('ip_address'), 'user_agent' => $this->session->userdata('user_agent'), 'last_activity' => $this->session->userdata('last_activity'), 'language_shortcode' => $this->session->userdata('language_shortcode'));
             $array_items = array('username' => '', 'user_id' => '', 'type_of_membership' => '', 'is_logged_in' => false);
             $this->session->unset_userdata($array_items);
             //$this->session->sess_destroy();
             //set session required
             $this->session->set_userdata($reuired_sessiondata);
             $this->session->set_flashdata('flash_message', '<strong>' . _clang(WELL_DONE_YOUR_PROFILE) . '</strong>');
             $this->session->set_flashdata('flash_class', 'alert-success');
             $redirect_to_home = true;
             // redirect('home');
         }
     } else {
         if ($type_of_membership == 'PRE1') {
             $array = array("type_of_membership" => 'FREE');
             if (@$this->user_model->update_user($user_id, $array) == TRUE) {
                 $this->session->set_flashdata('flash_message', '<strong>' . _clang(YOUR_PROFILE_RESET_TO) . '</strong>');
                 $this->session->set_flashdata('flash_class', 'alert-success');
                 $this->session->set_flashdata('flash_mynl_tab', 'tab_4');
                 //Delete all schedule
                 //$this->schedule_model->delete_schedule_with_userid($user_id);
                 //delete all subscribe
                 //$this->subscribe_model->delete_subscribe_with_userid($user_id);
                 //Moved to free user
                 if ($this->session->userdata('is_logged_in')) {
                     $this->session->unset_userdata(array('type_of_membership' => ''));
                     $session = array('type_of_membership' => 'FREE');
                     //$this->session->set_userdata($session);
                 }
             } else {
                 $this->session->set_flashdata('flash_message', '<strong>' . _clang(OOPS_SOMETHING_WENT_WRONG) . '</strong>');
                 $this->session->set_flashdata('flash_class', 'alert-error');
                 $this->session->set_flashdata('flash_mynl_tab', 'tab_4');
             }
         } else {
             if ($type_of_membership == 'PRE2') {
                 $array = array("type_of_membership" => 'FREE');
                 if (@$this->user_model->update_user($user_id, $array) == TRUE) {
                     $this->session->set_flashdata('flash_message', '<strong>' . _clang(YOUR_PROFILE_RESET_TO) . '</strong>');
                     $this->session->set_flashdata('flash_class', 'alert-success');
                     $this->session->set_flashdata('flash_mynl_tab', 'tab_4');
                     //Delete all schedule
                     //$this->schedule_model->delete_schedule_with_userid($user_id);
                     //delete all subscribe
                     //$this->subscribe_model->delete_subscribe_with_userid($user_id);
                     //Moved to free user
                     if ($this->session->userdata('is_logged_in')) {
                         $this->session->unset_userdata(array('type_of_membership' => ''));
                         $session = array('type_of_membership' => 'FREE');
                         $this->session->set_userdata($session);
                     }
                 } else {
                     $this->session->set_flashdata('flash_message', '<strong>' . _clang(OOPS_SOMETHING_WENT_WRONG) . '</strong>');
                     $this->session->set_flashdata('flash_class', 'alert-error');
                     $this->session->set_flashdata('flash_mynl_tab', 'tab_4');
                 }
             }
         }
     }
     //Sending mail
     if ($type_of_membership != 'FREE') {
         $this->load->helper('email');
         //load email library
         $this->load->library('email');
         //read parameters from $_POST using input class
         // check is email addrress valid or no
         //First mail to user
         $email = $user_data[0]['primary_email'];
         if (valid_email($email)) {
             // compose email
             //                $get_admin_detail =
             //                        get_admin_detail(); //common helper function for admin detail
             $this->email->from($get_admin_detail['email'], $get_admin_detail['name']);
             $this->email->to($email);
             $this->email->set_mailtype("html");
             $this->email->subject('Your Account has been cancled from knewdog!');
             /* $message = '<style>p{margin-bottom:2px;}</style>
                <p>Your Password : '******'</p>
                <p>Thanks,<br/>KnewDog Team.</p>'; */
             $invoice_data = $this->invoice_model->get_invoice_custome_query("select * from invoice where user_id = '" . $user_id . "' and payment_type like '" . $type_of_membership . "%' and date_to > curdate()");
             $end_of_subscription = $invoice_data[0]["date_to"];
             $start_of_subsription = $invoice_data[0]["date_from"];
             $invoice_amount = $invoice_data[0]['amount'] * $invoice_data[0]['quantity'];
             $mail_data['cancle_amount'] = round(return_calculation($end_of_subscription, $start_of_subsription, $invoice_amount), 2);
             $mail_data['account_type'] = get_type_of_membership_txt($type_of_membership);
             $mail_data['cancle_username'] = $user_data[0]['username'];
             //bhushan changes
             $session_lang = $this->session->userdata('language_shortcode');
             $replace = array('{account_type}', '{cancle_username}', '{cancle_amount}');
             $with = array("{$mail_data['account_type']}", "{$mail_data['cancle_username']}", "{$mail_data['cancle_amount']}");
             $email_template_content = $this->email_template_model->get_email_template_by_id(4);
             if (isset($email_template_content[0]['description_' . $session_lang]) && !empty($email_template_content[0]['description_' . $session_lang])) {
                 $cancellation_email_content = $email_template_content[0]['description_' . $session_lang];
                 $message = str_replace($replace, $with, $cancellation_email_content);
                 $utf = "utf-8";
                 $content = "<html><meta charset='" . $utf . "'><body><div style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;'>{$message}</div></body></html>";
                 $this->email->message($content);
             } else {
                 $cancellation_email_content = $email_template_content[0]['description_en'];
                 $message = str_replace($replace, $with, $cancellation_email_content);
                 $content = "<html><meta charset='" . $utf . "'><body><div style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;'>{$message}</div></body></html>";
                 $this->email->message($content);
             }
             //end changes
             //							$message = $this->load->view('mail_templates/cancle_account_mail', $mail_data,true);
             //						  	$this->email->message($message);
             // try send mail ant if not able print debug
             $this->email->send();
         }
         //second mail to admin
         $get_admin_detail = get_admin_detail();
         //common helper function for admin detail
         $email = $get_admin_detail['email'];
         if (valid_email($email)) {
             // compose email
             $this->email->from($get_admin_detail['email'], $get_admin_detail['name']);
             $this->email->to($email);
             $this->email->set_mailtype("html");
             $this->email->subject('One Account has been cancled from knewdog!');
             $mail_data['account_type'] = get_type_of_membership_txt($type_of_membership);
             $mail_data['answer'] = $answer;
             $mail_data['user'] = $user_data[0]['username'];
             $mail_data['user_email'] = $user_data[0]['primary_email'];
             //$type_of_membership = $user_data[0]['type_of_membership'];
             //echo "select * from invoice where user_id = '".$user_id."' and payment_type like '".$type_of_membership."%' and date_to > curdate()";
             $invoice_data = $this->invoice_model->get_invoice_custome_query("select * from invoice where user_id = '" . $user_id . "' and payment_type like '" . $type_of_membership . "%' and date_to > curdate()");
             $end_of_subscription = $invoice_data[0]["date_to"];
             $start_of_subsription = $invoice_data[0]["date_from"];
             $invoice_amount = $invoice_data[0]['amount'] * $invoice_data[0]['quantity'];
             $mail_data['amount'] = round(return_calculation($end_of_subscription, $start_of_subsription, $invoice_amount), 2);
             //bhushan changes
             $session_lang = $this->session->userdata('language_shortcode');
             $replace = array('{c_admin_account_type}', '{answer}', '{user}', '{user_email}', '{amount}');
             $with = array("{$mail_data['account_type']}", "{$mail_data['answer']}", "{$mail_data['user']}", "{$mail_data['user_email']}", "{$mail_data['amount']}");
             $email_template_content = $this->email_template_model->get_email_template_by_id(5);
             if (isset($email_template_content[0]['description_' . $session_lang]) && !empty($email_template_content[0]['description_' . $session_lang])) {
                 $cancle_mail_account_admin = $email_template_content[0]['description_' . $session_lang];
                 $message = str_replace($replace, $with, $cancle_mail_account_admin);
                 $utf = "utf-8";
                 $content = "<html><meta charset='" . $utf . "'><body><div style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;'>{$message}</div></body></html>";
                 $this->email->message($content);
             } else {
                 $cancle_mail_account_admin = $email_template_content[0]['description_en'];
                 $message = str_replace($replace, $with, $cancle_mail_account_admin);
                 $content = "<html><meta charset='" . $utf . "'><body><div style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;'>{$message}</div></body></html>";
                 $this->email->message($content);
             }
             //end changes
             //echo '<pre>'; print_r($invoice_data);
             //echo print_r($mail_data);
             //die;
             //							$message = $this->load->view('mail_templates/cancle_account_mail_admin', $mail_data,true);
             //						  	$this->email->message($message);
             // try send mail ant if not able print debug
             $this->email->send();
         }
     }
     //sending mail end
     if ($redirect_to_home == TRUE) {
         redirect('home');
     } else {
         redirect('myknewdog');
     }
 }
    $newsletter_sidebar_interest = $ci->newsletter_model->get_newsletter_interest("", $order_type = "DESC", 3, 0, $where_field_set_value);
}
//echo '<pre>'; print_r($newsletter_sidebar); die;
//Wanted add
$wanted_add = $ci->wanted_add_model->get_wanted_add('', '', '', '', '');
$get_most_three_subscribed_newsletter = $ci->subscribe_model->get_most_three_subscribed_newsletter();
?>
<aside id="sidebar">
    <div id="sidebar_right">
        <?php 
if ($this->session->userdata('is_logged_in')) {
    ?>
            <aside class="widget">		
                <div class="widget_content">
                    <label style="color: #808080;float: left;font-size: 12px; width:100%;"><?php 
    echo get_type_of_membership_txt($user_interest[0]['type_of_membership']);
    ?>
</label>
                    <div class="dash_profilepicture">

                        <div id="sidebar_profilepic" class="profilepicture">
                            <?php 
    if (@getimagesize(site_url('uploads/avatar') . "/" . $user_interest[0]['avatar'])) {
        ?>
                                <img alt="" style="width:45px; height:45px;" src="<?php 
        echo site_url('uploads/avatar') . "/" . $user_interest[0]['avatar'];
        ?>
" >
                            <?php 
    } else {
        ?>