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.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 5 years ago assignments 5 years ago earning 5 years ago enrolled-courses 5 years ago instructor 5 years ago my-quiz-attempts 5 years ago notifications 5 years ago question-answer 5 years ago quiz-attempts 5 years ago reviews 5 years ago settings 5 years ago withdraw-method-fields 5 years ago announcements.php 5 years ago assignments.php 5 years ago create-course.php 5 years ago dashboard.php 5 years ago earning.php 5 years ago enrolled-courses.php 5 years ago index.php 5 years ago logged-in.php 5 years ago my-courses.php 5 years ago my-profile.php 5 years ago my-quiz-attempts.php 5 years ago purchase_history.php 5 years ago question-answer.php 5 years ago quiz-attempts.php 5 years ago registration.php 5 years ago reviews.php 5 years ago settings.php 5 years ago wishlist.php 5 years ago withdraw.php 5 years ago
announcements.php
201 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 $notify_checked = tutils()->get_option('email_to_students.new_announcement_posted');
57 ?>
58
59 <div class="tutor-dashboard-content-inner tutor-frontend-dashboard-withdrawal">
60 <h4><?php echo __('Announcement', 'tutor'); ?></h4>
61 <!--notice-->
62 <div class="withdraw-page-current-balance new-announcement-wrap">
63 <div class="balance-info new-announcement-content">
64 <div class="tutor-announcement-big-icon">
65 <i class="tutor-icon-speaker"></i>
66 </div>
67 <div>
68 <small><?php _e('Create Announcement', 'tutor'); ?></small>
69 <p>
70 <strong>
71 <?php _e('Notify all students of your course', 'tutor'); ?>
72 </strong>
73 </p>
74 </div>
75 </div>
76 <div class="new-announcement-button">
77 <button type="button" class="tutor-btn tutor-announcement-add-new">
78 <?php _e('Add New Announcement', 'tutor'); ?>
79 </button>
80 </div>
81 </div>
82 <!--notice end-->
83
84 </div>
85 <!--sorting-->
86 <div class="tutor-dashboard-announcement-sorting-wrap">
87 <div class="tutor-form-group">
88 <label for="">
89 <?php _e('Courses', 'tutor'); ?>
90 </label>
91 <select class="tutor-report-category tutor-announcement-course-sorting ignore-nice-select">
92
93 <option value=""><?php _e('All', 'tutor'); ?></option>
94
95 <?php if ($courses) : ?>
96 <?php foreach ($courses as $course) : ?>
97 <option value="<?php echo esc_attr($course->ID) ?>" <?php selected($course_id, $course->ID, 'selected') ?>>
98 <?php echo $course->post_title; ?>
99 </option>
100 <?php endforeach; ?>
101 <?php else : ?>
102 <option value=""><?php _e('No course found', 'tutor'); ?></option>
103 <?php endif; ?>
104 </select>
105 </div>
106
107 <div class="tutor-form-group">
108 <label><?php _e('Sort By', 'tutor'); ?></label>
109 <select class="tutor-announcement-order-sorting ignore-nice-select">
110 <option <?php selected($order_filter, 'ASC'); ?>><?php _e('ASC', 'tutor'); ?></option>
111 <option <?php selected($order_filter, 'DESC'); ?>><?php _e('DESC', 'tutor'); ?></option>
112 </select>
113 </div>
114
115 <div class="tutor-form-group tutor-announcement-datepicker">
116 <label><?php _e('Date', 'tutor'); ?></label>
117 <input type="text" class="tutor-announcement-date-sorting" id="tutor-announcement-datepicker" value="<?php echo $date_filter; ?>" autocomplete="off" />
118 <i class="tutor-icon-calendar"></i>
119 </div>
120 </div>
121 <!--sorting end-->
122 <div class="tutor-announcement-table-wrap">
123 <table class="tutor-dashboard-announcement-table" width="100%">
124 <thead>
125 <tr>
126 <th style="width:24%"><?php _e('Date', 'tutor'); ?></th>
127 <th style="text-align:left"><?php _e('Announcements', 'tutor'); ?></th>
128 </tr>
129 </thead>
130 <tbody>
131 <?php if ($the_query->have_posts()) : ?>
132 <?php foreach ($the_query->posts as $post) : ?>
133 <?php
134 $course = get_post($post->post_parent);
135 $dateObj = date_create($post->post_date);
136 $date_format = date_format($dateObj, 'j M, Y,<\b\r>h:i a');
137 ?>
138 <tr id="tutor-announcement-tr-<?php echo $post->ID; ?>">
139 <td class="tutor-announcement-date"><?php echo $date_format; ?></td>
140 <td class="tutor-announcement-content-wrap">
141 <div class="tutor-announcement-content">
142 <h4><?php echo esc_html($post->post_title); ?></h4>
143 <p><?php echo $course ? $course->post_title : ''; ?></p>
144 </div>
145 <div class="tutor-announcement-buttons">
146 <li>
147 <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">
148 <?php _e('Details', 'tutor'); ?>
149 </button>
150 </li>
151 <li class="tutor-dropdown">
152 <i class="tutor-icon-action"></i>
153 <ul class="tutor-dropdown-menu">
154 <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">
155 <i class="tutor-icon-pencil"></i>
156 <?php _e('Edit', 'tutor'); ?>
157 </li>
158 <li class="tutor-announcement-delete" announcement-id="<?php echo $post->ID; ?>">
159 <i class="tutor-icon-garbage"></i>
160 <?php _e('Delete', 'tutor'); ?>
161 </li>
162 </ul>
163 </li>
164 </div>
165 </td>
166 </tr>
167 <?php endforeach; ?>
168 <?php else : ?>
169 <tr>
170 <td colspan="2">
171 <?php _e('Announcements not found', 'tutor'); ?>
172 </td>
173 </tr>
174 <?php endif; ?>
175 </tbody>
176 </table>
177
178 </div>
179
180 <!--pagination-->
181 <div class="tutor-pagination">
182 <?php
183 $big = 999999999; // need an unlikely integer
184
185 echo paginate_links( array(
186
187 'format' => '?current_page=%#%',
188 'current' => $paged,
189 'total' => $the_query->max_num_pages
190 ) );
191
192 ?>
193 </div>
194 <!--pagination end-->
195
196 <?php
197 include 'announcements/create.php';
198 include 'announcements/update.php';
199 include 'announcements/details.php';
200 ?>
201