Exemple #1
0
 public function bsalted_payments()
 {
     $db = new db();
     $sessinon = new SessionHelper();
     $stage = new Event();
     $helper = new SiteHelper();
     $order_fields = $this->addition_fields_list();
     $user_fields = User::addition_fields_list();
     $user_id = User::getID();
     $chosen_course = User::getMeta($user_id, $user_fields['course']);
     $course_stages_data = array();
     $user_stages = User::getPaidStages();
     $is_user_has_deposit = User::getMeta($user_id, $user_fields['deposit']);
     $course_id = isset($_GET['course-id']) && !empty($_GET['course-id']) ? $_GET['course-id'] : User::getCourseID($user_id);
     if (isset($course_id) && !empty($course_id)) {
         $course_stages = $stage->getByParentID($course_id);
         foreach ($course_stages as $object) {
             $course_name = $stage->getNameByID($object->post_id);
             $course_stages_data[$course_name] = $object->post_id;
         }
         SessionHelper::set($order_fields['course'], $course_id);
         SessionHelper::set($order_fields['stages'], $course_stages_data);
     } else {
         SessionHelper::set($order_fields['stages'], 'DEPOSIT');
     }
     $helper->enqueue_script('bsalted-front', '/js/main/front.js');
     $helper->localize_js('bsalted-front', 'bsaltedAjax', array('ajaxurl' => admin_url('admin-ajax.php')));
     if (!empty($chosen_course) && count($user_stages) == 5) {
         $course_id = User::getCourseID($user_id);
         //prevent if get isset
         $course = $db->getEntry($course_id);
         echo '<div class="bsalted-payment-message"><h3>You have paid for all the stages of the course ' . $course->post_title . '</h3></div>';
     } elseif (isset($course_id) && !empty($course_id)) {
         include_once dirname(__FILE__) . '/view/bsalted-payments.php';
     } else {
         // echo '<div class="bsalted-payment-message"><h3> You need to choose Course Program first.</h3></div>';
         include_once dirname(__FILE__) . '/view/bsalted-payments.php';
     }
 }
		<th scope="col" id="author" class="manage-column column-author" style="">Protege login</th>
		<th scope="col" id="categories" class="manage-column column-categories" style="">Preferred Dates</th>
		<th scope="col" id="tags" class="manage-column column-tags" style="">First Proposal</th>
		<th scope="col" id="comments" class="manage-column column-comments num sortable desc" style="">Second Proposal</th>
		<th scope="col" id="date" class="manage-column column-date sortable asc" style="">
				Make a proposal
		</th>
	</tr>
	</thead>

	<tbody id="the-list">
			<?php 
foreach ($users as $user_obj) {
    $user_id = $user_obj->user_id;
    $user_proposal = User::getMeta($user_id, $user_fields['proposals']);
    $user_course = User::getCourseID($user_id);
    if ($user_proposal) {
        continue;
    }
    $user = User::getByID($user_id)[0];
    $user_form_id = User::getMeta($user_id, $user_fields['registration-form']);
    $user_event_dates = User::getPreferedDatesID($user_form_id);
    ?>
				
				<tr id="post-1" class="iedit bsalted-proposal-row">
					<th scope="row" class="check-column">
					</th>
					<td class="post-title page-title column-title">
						<strong><?php 
    echo $user->display_name;
    ?>
<?php

use Nerds\Bsalted\Entity\UserEntity\User;
use Nerds\Bsalted\Entity\EventEntity\Event;
use Nerds\Base\Util\Helpers\SessionHelper;
use Nerds\Base\Util\Helpers\SiteHelper;
$order_fields = $this->addition_fields_list();
$user_stages = User::getPaidStages();
$products = array_keys(SiteHelper::product_stage_relation());
$is_user_has_deposit = User::getMeta($user_id, $user_fields['deposit']);
$is_user_has_proposals = User::getMeta($user_id, $user_fields['proposals']);
$course_id = isset($_GET['course-id']) && !empty($_GET['course-id']) ? $_GET['course-id'] : User::getCourseID($user_id);
$course = $db->getEntry($course_id);
$stage1 = new Event();
#var_dump($stage1->getConfirmedByCountry(876));
#var_dump(User::getBoughtStage('stage-name-PRE', 876));
#var_dump(User::getRegistrationForm(106)[11]);
?>

<?php 
if (!User::is_filled_registration()) {
    ?>
	<h2>Please fill the <a href="<?php 
    echo site_url();
    ?>
/account/adventures-registration-form/">Registration Form</a></h2>
<?php 
} elseif (empty($is_user_has_deposit)) {
    ?>
	<div class="bsalted-payments">
		<h3 class="noPay">To begin just put money on your deposit:</h3>