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.2 3.5.0 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 3.9.1 3.9.10 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9
tutor / templates / dashboard / announcements.php
tutor / templates / dashboard Last commit date
announcements 4 years ago assignments 4 years ago earning 4 years ago enrolled-courses 5 years ago instructor 4 years ago my-quiz-attempts 4 years ago notifications 5 years ago question-answer 5 years ago quiz-attempts 4 years ago reviews 4 years ago settings 5 years ago withdraw-method-fields 5 years ago announcements.php 4 years ago assignments.php 4 years ago create-course.php 4 years ago dashboard.php 4 years ago earning.php 4 years ago enrolled-courses.php 4 years ago index.php 4 years ago logged-in.php 5 years ago my-courses.php 5 years ago my-profile.php 5 years ago my-quiz-attempts.php 4 years ago purchase_history.php 5 years ago question-answer.php 4 years ago quiz-attempts.php 4 years ago registration.php 4 years ago reviews.php 4 years ago settings.php 5 years ago wishlist.php 5 years ago withdraw.php 4 years ago
announcements.php
197 lines
1 <?php
2 if (!defined('ABSPATH'))
3 exit;
4 /**
5 * Template for displaying Announcements
6 *
7 * @since v.1.7.9
8 *
9 * @author Themeum
10 * @url https://themeum.com
11 *
12 * @package TutorLMS/Templates
13 * @version 1.7.9
14 */
15 $per_page = 10;
16 $paged = max(1, tutor_utils()->avalue_dot('current_page', $_GET));
17
18 $order_filter = isset($_GET['order']) ? sanitize_text_field($_GET['order']) : 'DESC';
19 $search_filter = isset($_GET['search']) ? sanitize_text_field($_GET['search']) : '';
20 //announcement's parent
21 $course_id = isset($_GET['course-id']) ? sanitize_text_field($_GET['course-id']) : '';
22 $date_filter = isset($_GET['date']) ? sanitize_text_field($_GET['date']) : '';
23
24 $year = date('Y', strtotime($date_filter));
25 $month = date('m', strtotime($date_filter));
26 $day = date('d', strtotime($date_filter));
27
28 $args = array(
29 'post_type' => 'tutor_announcements',
30 'post_status' => 'publish',
31 's' => sanitize_text_field($search_filter),
32 'post_parent' => sanitize_text_field($course_id),
33 'posts_per_page' => sanitize_text_field($per_page),
34 'paged' => sanitize_text_field($paged),
35 'orderBy' => 'ID',
36 'order' => sanitize_text_field($order_filter),
37
38 );
39 if (!empty($date_filter)) {
40 $args['date_query'] = array(
41 array(
42 'year' => $year,
43 'month' => $month,
44 'day' => $day
45 )
46 );
47 }
48 if (!current_user_can('administrator')) {
49 $args['author'] = get_current_user_id();
50 }
51 $the_query = new WP_Query($args);
52
53 //get courses
54 $courses = (current_user_can('administrator')) ? tutils()->get_courses() : tutils()->get_courses_by_instructor();
55 $image_base = tutor()->url . '/assets/images/';
56 ?>
57
58 <div class="tutor-dashboard-content-inner">
59 <h4><?php echo __('Announcement', 'tutor'); ?></h4>
60 <!--notice-->
61 <div class="tutor-component-three-col-action new-announcement-wrap">
62 <div class="tutor-announcement-big-icon">
63 <i class="tutor-icon-speaker"></i>
64 </div>
65 <div>
66 <small><?php _e('Create Announcement', 'tutor'); ?></small>
67 <p>
68 <strong>
69 <?php _e('Notify all students of your course', 'tutor'); ?>
70 </strong>
71 </p>
72 </div>
73 <div class="new-announcement-button">
74 <button type="button" class="tutor-btn tutor-announcement-add-new">
75 <?php _e('Add New Announcement', 'tutor'); ?>
76 </button>
77 </div>
78 </div>
79 <!--notice end-->
80 </div>
81 <!--sorting-->
82 <div class="tutor-dashboard-announcement-sorting-wrap">
83 <div class="tutor-form-group">
84 <label for="">
85 <?php _e('Courses', 'tutor'); ?>
86 </label>
87 <select class="tutor-report-category tutor-announcement-course-sorting ignore-nice-select">
88
89 <option value=""><?php _e('All', 'tutor'); ?></option>
90
91 <?php if ($courses) : ?>
92 <?php foreach ($courses as $course) : ?>
93 <option value="<?php echo esc_attr($course->ID) ?>" <?php selected($course_id, $course->ID, 'selected') ?>>
94 <?php echo $course->post_title; ?>
95 </option>
96 <?php endforeach; ?>
97 <?php else : ?>
98 <option value=""><?php _e('No course found', 'tutor'); ?></option>
99 <?php endif; ?>
100 </select>
101 </div>
102
103 <div class="tutor-form-group">
104 <label><?php _e('Sort By', 'tutor'); ?></label>
105 <select class="tutor-announcement-order-sorting ignore-nice-select">
106 <option <?php selected($order_filter, 'ASC'); ?>><?php _e('ASC', 'tutor'); ?></option>
107 <option <?php selected($order_filter, 'DESC'); ?>><?php _e('DESC', 'tutor'); ?></option>
108 </select>
109 </div>
110
111 <div class="tutor-form-group tutor-announcement-datepicker">
112 <label><?php _e('Date', 'tutor'); ?></label>
113 <input type="text" class="tutor_date_picker tutor-announcement-date-sorting" id="tutor-announcement-datepicker" value="<?php echo $date_filter !== '' ? tutor_get_formated_date( get_option( 'date_format' ), $date_filter ) : ''; ?>" placeholder="<?php echo get_option( 'date_format' ); ?>" autocomplete="off" />
114 <i class="tutor-icon-calendar"></i>
115 </div>
116 </div>
117 <!--sorting end-->
118 <div class="tutor-announcement-table-wrap">
119 <table class="tutor-dashboard-announcement-table" width="100%">
120 <thead>
121 <tr>
122 <th style="width:24%"><?php _e('Date', 'tutor'); ?></th>
123 <th style="text-align:left"><?php _e('Announcements', 'tutor'); ?></th>
124 </tr>
125 </thead>
126 <tbody>
127 <?php if ($the_query->have_posts()) : ?>
128 <?php foreach ($the_query->posts as $post) : ?>
129 <?php
130 $course = get_post($post->post_parent);
131 $dateObj = date_create($post->post_date);
132 $date_format = date_format($dateObj, 'j M, Y,<\b\r>h:i a');
133 ?>
134 <tr id="tutor-announcement-tr-<?php echo $post->ID; ?>">
135 <td class="tutor-announcement-date"><?php echo $date_format; ?></td>
136 <td class="tutor-announcement-content-wrap">
137 <div class="tutor-announcement-content">
138 <h4><?php echo esc_html($post->post_title); ?></h4>
139 <p><?php echo $course ? $course->post_title : ''; ?></p>
140 </div>
141 <div class="tutor-announcement-buttons">
142 <li>
143 <button type="button" course-name="<?php echo esc_attr($course->post_title) ?>" announcement-date="<?php echo esc_attr($date_format) ?>" announcement-title="<?php echo esc_attr($post->post_title); ?>" announcement-summary="<?php echo esc_attr($post->post_content); ?>" course-id="<?php echo esc_attr($post->post_parent); ?>" announcement-id="<?php echo esc_attr($post->ID); ?>" class="tutor-btn bordered-btn tutor-announcement-details">
144 <?php _e('Details', 'tutor'); ?>
145 </button>
146 </li>
147 <li class="tutor-dropdown">
148 <i class="tutor-icon-action"></i>
149 <ul class="tutor-dropdown-menu">
150 <li announcement-title="<?php echo $post->post_title; ?>" announcement-summary="<?php echo $post->post_content; ?>" course-id="<?php echo $post->post_parent; ?>" announcement-id="<?php echo $post->ID; ?>" class="tutor-announcement-edit">
151 <i class="tutor-icon-pencil"></i>
152 <?php _e('Edit', 'tutor'); ?>
153 </li>
154 <li class="tutor-announcement-delete" announcement-id="<?php echo $post->ID; ?>">
155 <i class="tutor-icon-garbage"></i>
156 <?php _e('Delete', 'tutor'); ?>
157 </li>
158 </ul>
159 </li>
160 </div>
161 </td>
162 </tr>
163 <?php endforeach; ?>
164 <?php else : ?>
165 <tr>
166 <td colspan="2">
167 <?php _e('Announcements not found', 'tutor'); ?>
168 </td>
169 </tr>
170 <?php endif; ?>
171 </tbody>
172 </table>
173
174 </div>
175
176 <!--pagination-->
177 <div class="tutor-pagination">
178 <?php
179 $big = 999999999; // need an unlikely integer
180
181 echo paginate_links( array(
182
183 'format' => '?current_page=%#%',
184 'current' => $paged,
185 'total' => $the_query->max_num_pages
186 ) );
187
188 ?>
189 </div>
190 <!--pagination end-->
191
192 <?php
193 include 'announcements/create.php';
194 include 'announcements/update.php';
195 include 'announcements/details.php';
196 ?>
197