public function register_metaboxes() { $event = new Event(); $event->register_metabox(); $course = new Course(); $course->register_metabox(); SiteHelper::hideCustomMetabox(); }
public function load_resourses() { // wp_enqueue_style( 'momentum-css', SiteHelper::getResoursesPath() . '/js/moment/min/moment.min.css'); // wp_enqueue_style( 'bsalted-css', SiteHelper::getResoursesPath() . '/css/main.css' ); wp_enqueue_style('fullcalendar-css', SiteHelper::getResoursesPath() . '/js/fullcalendar/dist/fullcalendar.min.css'); wp_enqueue_style('qtip-css', SiteHelper::getResoursesPath() . '/js/qtip/jquery.qtip.min.css'); wp_enqueue_style('chosen-css', SiteHelper::getResoursesPath() . '/js/chosen/chosen.min.css'); wp_enqueue_script('momentum-js', SiteHelper::getResoursesPath() . '/js/moment/min/moment.min.js', array('jquery'), '1.1', false); wp_enqueue_script('fullcalendar-js', SiteHelper::getResoursesPath() . '/js/fullcalendar/dist/fullcalendar.min.js', array('jquery'), '1.1', false); wp_enqueue_script('qtip-js', SiteHelper::getResoursesPath() . '/js/qtip/jquery.qtip.js', array('jquery'), '1.1', false); wp_enqueue_script('chosen-js', SiteHelper::getResoursesPath() . '/js/chosen/chosen.jquery.min.js', array('jquery'), '1.1', false); wp_enqueue_script('bsalted-js', SiteHelper::getResoursesPath() . '/js/main/main.js', array('jquery'), '1.1', false); $db = new DatabaseAccessWrapper(); $role = User::getRole(); $stage = new Event(); wp_localize_script('fullcalendar-js', 'bsaltedEventsData', $stage->getData()); wp_localize_script('fullcalendar-js', 'bsaltedOptions', $db::get_option('bsalted_adventures_days')); if (in_array($role, UserRole::restricted())) { SiteHelper::hideCustomMenuItem(); if (!$role === 'director_of_logistics') { wp_localize_script('bsalted-js', 'userRole', 'limited'); } } }
</a> <?php } ?> </td> <td><a target="_blank" class="bsalted-assessment <?php echo $savant_link_text; ?> " href="<?php SiteHelper::getAssessmentURL($assessment_savant_form_id, $assessment_savant_id); ?> "><?php echo $savant_link_text; ?> </a></td> <td><a target="_blank" class="" href="<?php SiteHelper::getAssessmentURL(4, $user_form_id); ?> ">Show</a></td> </tr> <?php } ?> </tbody> </table> <?php } ?>
public function set_product_price($stage_id) { if (is_array($stage_id)) { foreach ($stage_id as $id) { $stage_name = Event::getNameByID($id); $stage_price = Event::getPriceByID($id); $product_id = SiteHelper::product_stage_relation()[$stage_name]; db::updateEntryMeta($product_id, '_price', $stage_price); } } else { $stage_name = Event::getNameByID($stage_id); $stage_price = Event::getPriceByID($stage_id); $product_id = SiteHelper::product_stage_relation()[$stage_name]; db::updateEntryMeta($product_id, '_price', $stage_price); } }
use Nerds\Base\Util\Helpers\SiteHelper; use Nerds\Base\Util\Helpers\DatabaseAccessWrapper as db; use Nerds\Bsalted\Entity\UserEntity\User; use Nerds\Bsalted\Entity\EventEntity\Event; use Nerds\Bsalted\Entity\CourseEntity\Course; use Nerds\Bsalted\Entity\OrderEntity\Order; $users = User::getByRole('adventure_consultant'); $user_id = User::getID(); $user_name = User::getFullName($user_id); $user_capitan_id = SiteHelper::getConsultantCapitan($user_id); $user_capitan_name = User::getFullName($user_capitan_id); $user_code = User::getCode($user_id); $date_type = isset($_GET['report-type']) && !empty($_GET['report-type']) ? $_GET['report-type'] : 'week'; $period = SiteHelper::getConsultantOrders($user_code, 'week', 'period'); #$user_orders = SiteHelper::getConsultantOrders($user_code, 'week', 'period'); $user_protege = SiteHelper::getConsultantProteges($user_id); $date_range = date('F j, Y', strtotime('+1 day', strtotime($period))); $user_account = 0; $user_amount = db::get_option('bsalted_cosultant_amount'); $user_bonus5 = db::get_option('bsalted_cosultant_bonus5'); $user_bonus10 = db::get_option('bsalted_cosultant_bonus10'); $user_fields = User::addition_fields_list(); $stage_type_fields = Event::types_fields_list(); $user_ordrs = User::getOrdersByDate(21, 'week'); #var_dump($user_amount); ?> <div class="bsalted-consultant-top"> <h2>Hello <?php echo $user_name;
public function send_proposal() { $form_data = array(); $data = parse_str($_POST['data'], $form_data); $user_email = self::getInfo($form_data['user-id'])->user_email; $headers = array('Content-Type: text/html; charset=UTF-8'); $subject = 'Bsalted Course Proposals'; $user_fields = $this->addition_fields_list(); $proposals_id = array($form_data['proposal-first'], $form_data['proposal-second']); $body = SiteHelper::create_proposal($proposals_id[0], $proposals_id[1]); $this->updateMeta($form_data['user-id'], $user_fields['proposals'], $proposals_id); wp_mail($user_email, $subject, $body, $headers); }
<th scope="col" id="title" class="manage-column column-title sortable desc" style="">ID</th> <th scope="col" id="author" class="manage-column column-author" style="">Adventure Consultant name</th> <th scope="col" id="categories" class="manage-column column-categories" style="">Introspective Sales</th> <th scope="col" id="tags" class="manage-column column-tags" style="">Course Sales</th> <th scope="col" id="date" class="manage-column column-date sortable asc" style=""> - </th> </tr> </thead> <tbody id="the-list"> <?php foreach ($users as $user_obj) { $user_id = $user_obj->ID; $user_code = User::getCode($user_id); $user_orders = SiteHelper::getConsultantOrders($user_code, $report_type); $user_sales = array(); $user_course_sales = 0; $user_int_sales = 0; #$from_date = date('F j, Y', strtotime('+1 day', strtotime($user_data['period']))); foreach ($user_orders as $order) { $order_id = $order->ID; $order_course_id = db::getEntryMeta($order_id, $user_course_field)[0]; $user_sales[$order_id][$order_course_id] = array(); $order_obj = new \WC_Order($order_id); $order_items = $order_obj->get_items(); foreach ($order_items as $item) { #array_push($user_sales[$order_id][$order_course_id], $item['product_id']); $product_name = array_search($item['product_id'], $products); if ($product_name === 'PRE') { $user_course_sales++;
public function getUpcommingStages() { $db = new db(); $user_id = User::getID(); $user_fields = User::addition_fields_list(); $user_form_id = User::getMeta($user_id, $user_fields['registration-form']); // $user_form_model = \RGFormsModel::get_lead($user_form_id); $user_event_dates = User::getPreferedDatesID($user_form_id); $events_id = $db->getPostID('\\Nerds\\Bsalted\\Entity\\EventEntity\\Event'); $stage_fields = $this->types_fields_list(); $current_date = date('Y-m-d'); $dates = array(); $filtered_events = array(); $selectd_events = array(); foreach ($events_id as $ev) { $ev_date = date('Y-m-d', db::getEntryMeta($ev->ID, $stage_fields['start']) ? db::getEntryMeta($ev->ID, $stage_fields['start'])[0] : db::getEntryMeta($ev->ID, $stage_fields['start'])); if ($ev_date > $current_date) { $dates[$ev->ID] = $ev_date; } } asort($dates); $ev_dates = array_values($dates); foreach ($user_event_dates as $user_date) { $ev_date = SiteHelper::find_closest($ev_dates, $user_date); $filtered_events[] = $ev_date; $key = array_search($ev_date, $ev_dates); if ($key !== false && $ev_date !== null) { $ev_dates[$key] = null; } } foreach ($dates as $event_id => $event_date) { if (in_array($event_date, $filtered_events) && $this->stage_place_aviability($event_id)) { $selectd_events[$event_id] = $event_date; } } return $selectd_events; }
Full Amount </label> </div> <br> <div class="form-row clearfix"> <input type="hidden" name="<?php echo $order_fields['offer']; ?> " id="<?php echo $order_fields['offer']; ?> " value=""> <input type="submit" class="submit" id="add-product-to-cart" value="Make Payment"> </div> <?php } elseif (count($user_stages) == 4 && SiteHelper::is_course_confirmed($course_id)) { ?> <h2>Pay for the course <?php echo $course->post_title; ?> :</h2> <div class="form-row clearfix"> <input name="bsalted-stages" id="first_offer" class="stage" type="radio"> <label for="first_offer"> Presentation & Evaluation Adventure </label> </div> <br> <div class="form-row clearfix"> <input type="hidden" name="<?php echo $order_fields['offer'];