first commit
This commit is contained in:
@@ -0,0 +1,125 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-10">
|
||||
<div>
|
||||
<form method="GET" action="/notifications/noticelist">
|
||||
<div class="row">
|
||||
<div class="col-xs-4 col-md-3">
|
||||
<label for="">From - To</label>
|
||||
<input type="text" class="form-control" name="from_to" value="<?= $params['from_to']??'' ?>" readonly>
|
||||
</div>
|
||||
<div class="col-xs-4 col-md-3">
|
||||
<label for="">Account email</label>
|
||||
<input type="text" class="form-control" name="account_email" value="<?= $params['account_email']??'' ?>">
|
||||
</div>
|
||||
<div class="col-xs-4 col-md-3">
|
||||
<label for="">Msg status</label>
|
||||
<select name="status" class="form-control">
|
||||
<option value="">Select a status</option>
|
||||
<?php foreach($notificationStatus as $statusId => $statusName): ?>
|
||||
<option
|
||||
value="<?php echo $statusId; ?>"
|
||||
<?= (isset($params['status']) && $params['status'] == $statusId) ? 'selected' : '' ?>
|
||||
><?php echo $statusName; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-xs-4 col-md-3">
|
||||
<label for="">Notice type</label>
|
||||
<select name="notice_type" class="form-control">
|
||||
<option value="">Select a notification type</option>
|
||||
<?php foreach($notificationTypes as $row): ?>
|
||||
<option
|
||||
value="<?php echo $row->notice_type; ?>"
|
||||
<?= (isset($params['notice_type']) && $params['notice_type'] == $row->notice_type) ? 'selected' : '' ?>
|
||||
><?php echo $row->description; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-4 col-md-3">
|
||||
<label for="">Trigger key</label>
|
||||
<input type="text" class="form-control" name="trigger_key" value="<?= $params['trigger_key']??'' ?>">
|
||||
</div>
|
||||
<div class="col-xs-4 col-md-3">
|
||||
<label for="">Email msg</label>
|
||||
<input type="text" class="form-control" name="email_msg" value="<?= $params['email_msg']??'' ?>">
|
||||
</div>
|
||||
<div class="col-xs-4 col-md-3">
|
||||
<label for="">Mode</label>
|
||||
<input type="text" class="form-control" name="mode" value="<?= $params['mode']??'' ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class=" m-y-sm">
|
||||
<button type="submit" class="btn btn-primary btn-sm">Search</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="m-y-sm"><?= $pagination_link ?></div>
|
||||
<div class="panel panel-flat">
|
||||
<?= $notification_table ?>
|
||||
</div>
|
||||
<div><?= $pagination_link ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$( document ).ready(function() {
|
||||
/** date range picker */
|
||||
let datepickerOptions = {
|
||||
autoUpdateInput: false,
|
||||
locale: {
|
||||
format: 'YYYY-MM-DD',
|
||||
cancelLabel: 'Clear'
|
||||
}
|
||||
};
|
||||
|
||||
let fromToElement = $('input[name="from_to"]');
|
||||
const fromToVal = fromToElement.val();
|
||||
if (fromToVal == '') {
|
||||
datepickerOptions.startDate = moment().subtract(7, 'days').format('YYYY-MM-DD');
|
||||
datepickerOptions.endDate = moment().format('YYYY-MM-DD');
|
||||
}
|
||||
fromToElement.daterangepicker(datepickerOptions);
|
||||
|
||||
fromToElement.on('apply.daterangepicker', function(ev, picker) {
|
||||
$(this).val(picker.startDate.format('YYYY-MM-DD') + ' - ' + picker.endDate.format('YYYY-MM-DD'));
|
||||
});
|
||||
|
||||
fromToElement.on('cancel.daterangepicker', function(ev, picker) {
|
||||
fromToElement.val('');
|
||||
});
|
||||
});
|
||||
|
||||
function pushNotification(notice_id, member_id) {
|
||||
// alert(notice_id);
|
||||
|
||||
$('#msgl' + notice_id).html('Processing...');
|
||||
$('#acc' + notice_id).prop('disabled', true);
|
||||
$.ajax({
|
||||
url: "/notifications/sendnotification?notice_id=" + notice_id + "&member_id=" + member_id
|
||||
}).done(function (data) {
|
||||
$('#msgl'+ notice_id).html(data);
|
||||
$('#acc' + notice_id).prop('disabled', false);
|
||||
});
|
||||
return false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function pushCard(notice_id, member_id) {
|
||||
// alert(notice_id);
|
||||
|
||||
$('#msgl' + notice_id).html('Processing...');
|
||||
$('#acc' + notice_id).prop('disabled', true);
|
||||
$.ajax({
|
||||
url: "/notifications/generateCard?notice_id=" + notice_id + "&member_id=" + member_id
|
||||
}).done(function (data) {
|
||||
$('#msgl'+ notice_id).html(data);
|
||||
$('#acc' + notice_id).prop('disabled', false);
|
||||
});
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user