HEX
Server: Apache
System: Linux server1.panigaletech.com 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/captainschairit.com/wp-content/themes/captainschare/template-parts/thankyou-page-other.php
<?php
/**
 * Template Name: Thank You Page Other
 */
session_start();
unset($_SESSION['company_info']);
unset($_SESSION['msp_chosen']);
// unset($_SESSION['billing_info']);
unset($_SESSION['package_info']);
unset($_SESSION['card_info']);
// echo '<pre>'; print_r($_SESSION['company_info']);
// echo '<pre>'; print_r($_SESSION['msp_chosen']);
// if(count($_SESSION['company_info']) > 0 || count($_SESSION['msp_chosen']) > 0) {
//   // $username = strstr($_SESSION['company_info']['email'], '@', true); 
//     $username = str_replace('.', '_', $_SESSION['company_info']['company_url']); 
//     $user_id_exists = username_exists($username);
//     $error = array();
//     // echo '<pre>'; print_r($_SESSION['company_info']);
//     if ( ! $user_id_exists && false == email_exists( $_SESSION['company_info']['email'] )) {
//         // $random_password = wp_generate_password( $length = 12, $include_standard_special_chars = false );
//         // echo '<pre>'; print_r($_SESSION['company_info']);
//         $password = wp_generate_password( 8, true, false );
//         $user_id = wp_create_user($username, $password, $_SESSION['company_info']['email']);
//         // echo 'here'; exit;
//         if($user_id) {
//           $u = new WP_User( $user_id );
//           // Remove role
//           $u->remove_role( 'subscriber' );
//           // Add role
//           $u->add_role( 'future_prospect' );
//           // First name and last name
//           $u->first_name( $_SESSION['company_info']['first_name'] );
//           $u->last_name( $_SESSION['company_info']['last_name'] );

//             // $response = createCustomerProfile($_SESSION['company_info']['email'], $_SESSION['billing_info'], $_SESSION['card_info'], $_SESSION['company_info'], $_SESSION['package_info']);
//             // echo '<pre>'; print_r($response->getMessages()->getMessage());
//             // echo 'here'; exit;
//             // if (($response != null) && ($response->getMessages()->getResultCode() == "Ok")) {
//                  // echo "Succesfully created customer profile : " . $response->getCustomerProfileId() . "\n";
//                 //  $paymentProfiles = $response->getCustomerPaymentProfileIdList();
//                 //  $success[] = "Succesfully created customer profile : " . $response->getCustomerProfileId() . "\n";
//                 //  $success[] =  "SUCCESS: PAYMENT PROFILE ID : " . $paymentProfiles[0] . "\n";
//                  // echo "SUCCESS: PAYMENT PROFILE ID : " . $paymentProfiles[0] . "\n";
//                 //  add_user_meta( $user_id, 'customer_profile_id', $response->getCustomerProfileId() );
//                 //  add_user_meta( $user_id, 'payment_profile_id', $paymentProfiles[0] ); 

//                 //  session_start();
//                  add_user_meta( $user_id, 'company_info', $_SESSION['company_info'] );
//                  add_user_meta( $user_id, 'msp_chosen', $_SESSION['msp_chosen'] );
//                  update_user_meta( $user_id, 'user_active_status', 'inactive' );
//                 //  add_user_meta( $user_id, 'billing_info', $_SESSION['billing_info'] );
//                 //  add_user_meta( $user_id, 'package_info', $_SESSION['package_info'] );
//                 //  add_user_meta( $user_id, 'card_no', substr($_SESSION['card_info']['card_no'], -4) );
//                  custom_wp_new_user_notification_email($user_id, $password);
//                 //  wp_new_user_notification_custom($user_id, $random_password);
//                 //  wp_new_user_notification($user_id);
//                  unset($_SESSION['company_info']);
//                  unset($_SESSION['msp_chosen']);

//                  $url = get_site_url().'/thank-you';
//                  wp_redirect( $url );
//                 exit;
//             //  } else {
//             //     wp_delete_user($user_id);
//             //      // echo "ERROR :  Invalid response\n";
//             //      $errorMessages = $response->getMessages()->getMessage();
//             //      // echo "Response : " . $errorMessages[0]->getCode() . "  " .$errorMessages[0]->getText() . "\n";
//             //      $error[] = "ERROR :  Couldn't create profile. Please check the card details and try again.\n";
//             //     //  $error[] = "Response : " . $errorMessages[0]->getCode() . "  " .$errorMessages[0]->getText() . "\n";
//             //     //  echo '<pre>'; print_r($response); 
//             //  }
//          }
//     } else {
//         $error[] = 'User Already exists';
//     }
// }
get_header();
$page_heading = get_field('page_heading');
$thank_you_text = get_field('thank_you_text');
$thank_you_content = get_field('thank_you_content');
// echo '<pre>'; print_r($_SESSION['msp_chosen']);
?>
  <!-- Services -->
  <section class="page-section msp-menu-top" id="CompanyInfo">
    <div class="container">
      <div class="row">
        <div class="col-lg-12 text-center">
          <h2 class="heading01 mb-5"><?php echo $page_heading; ?></h2>
          <div class="text-center thank-you">
            <div class="warning-chk mt-5 pt-5">
              <i class="far fa-meh"></i>
            </div>
            <h2 class="mb-5">Thank you</h2>
            <p class="mb-3"><?php echo $thank_you_text; ?></p>
            <p><?php echo $thank_you_content; ?></p>
          </div>
        </div>
      </div>
    </div>
  </section>
<?php
get_footer();
?>