3b975a80
Administrator
change request to...
|
1
2
3
4
5
6
7
|
<div id="addEdit">
<div class="inner"><?= $this->flash->output(); ?></div>
<div class="inner">
<div class="clearfix">
<form enctype="multipart/form-data" method="post" action="" id="email_event_add_edit">
<div class="version_1 clearfix">
|
3b975a80
Administrator
change request to...
|
8
9
|
<div class="input-group">
|
62ff66e4
Administrator
change request to...
|
10
|
<input type="checkbox" id="status" value="1" name="status" <?= ((isset( $page->status ) && !empty( $page->status )) ? 'checked' : '') ?>>
|
4081157a
Administrator
change request to...
|
11
|
<label for="status">Статус рассылки</label>
|
3b975a80
Administrator
change request to...
|
12
13
14
15
16
|
</div>
<div class="input-group">
|
4081157a
Administrator
change request to...
|
17
|
<span class="input-group-addon title-block-sizing">Название рассылки</span>
|
50f0e821
Administrator
change request to...
|
18
|
<input type="text" name="name" class="form-control" value='<?= (isset( $page->name ) && !empty( $page->name ) ? $page->name : '') ?>'>
|
62ff66e4
Administrator
change request to...
|
19
|
|
3b975a80
Administrator
change request to...
|
20
21
|
</div>
|
62ff66e4
Administrator
change request to...
|
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
<div class="input-group">
<span class="input-group-addon title-block-sizing">День первого письма</span>
<select class="form-control" name="first_delivery">
<?php foreach($page->getDays() as $day):?>
<option <?= !empty( $page->first_delivery )&& $page->isActive($page->first_delivery,$day['val']) ? "selected" :"" ?> value="<?= $day['val'] ?>"><?= $day['name'] ?></option>
<?php endforeach?>
</select>
</div>
|
50f0e821
Administrator
change request to...
|
36
37
38
39
|
<div class="input-group">
<span class="input-group-addon title-block-sizing">Период</span>
<input type="text" name="period_val" class="form-control" value='<?= (isset( $page->period_val ) && !empty( $page->period_val ) ? $page->period_val : '') ?>'>
</div>
|
3b975a80
Administrator
change request to...
|
40
|
|
0ac35279
Administrator
change request to...
|
41
|
|
509f8795
Administrator
change request to...
|
42
|
<table id="templates-list" class="table table-hover">
|
62ff66e4
Administrator
change request to...
|
43
44
45
46
|
<?php foreach($events as $event):?>
<tr><td id='name'><?= $event->name ?></td><td><p class = 'btn btn-primary delete-row'>Убрать из списка</p>
<input type='hidden' value='<?= $event->id ?>' name='event[]'></td></tr>
<?php endforeach;?>
|
509f8795
Administrator
change request to...
|
47
48
49
50
51
|
</table>
<div class="input-group">
<span class="input-group-addon title-block-sizing">Введите название письма</span>
<input type="text" value="" class="form-control" name="autocomplete_user_email" id="autocomplete_templates" autocomplete="off">
</div>
|
0ac35279
Administrator
change request to...
|
52
|
|
509f8795
Administrator
change request to...
|
53
54
55
56
57
58
59
60
|
<table class="table table-hover">
<thead>
<tr>
<th id="name">Имя</th>
<th class="table-buttons"></th>
</tr>
</thead>
<tbody id="result">
|
4081157a
Administrator
change request to...
|
61
|
|
509f8795
Administrator
change request to...
|
62
63
|
</tbody>
</table>
|
4081157a
Administrator
change request to...
|
64
|
|
3b975a80
Administrator
change request to...
|
65
|
|
3b975a80
Administrator
change request to...
|
66
67
|
<div class="input-group">
|
43d8495a
Administrator
change request to...
|
68
|
<a href="<?= $this->url->get( 'series_of_letters/index') ?>" class="news_cancel float">Отмена</a>
|
3b975a80
Administrator
change request to...
|
69
70
71
72
73
74
75
|
<input type="submit" class="news_submit float" name="save" value="Сохранить">
</div>
</form>
</div>
</div>
</div>
|
4081157a
Administrator
change request to...
|
76
77
|
<script>
jQuery(document).ready( function() {
|
09aa724a
Administrator
change request to...
|
78
79
|
$('#autocomplete_templates').on('keyup', function () {
|
a78c80af
Administrator
change request to...
|
80
|
console.log('here is a lot off information');
|
4081157a
Administrator
change request to...
|
81
82
83
|
var like = $(this).val();
if (like.length > 3) {
|
8faffe86
Administrator
change request to...
|
84
|
$.post('/series_of_letters/gettemplate', {like: like}, function (data) {
|
4081157a
Administrator
change request to...
|
85
86
87
88
89
|
var ajax = $.parseJSON(data);
var count = ajax.length;
var block = $('#result');
block.html('');
for (var i = 0; i < count; i++) {
|
b7d96b61
Administrator
change request to...
|
90
|
var row = "<tr><td id='name'>" + ajax[i]['name'] + "</td><td><p data-id='" + ajax[i]['id'] + "' class = 'btn btn-primary select-template'>Добавить в список</p></td></tr>";
|
4081157a
Administrator
change request to...
|
91
92
93
94
95
96
97
|
block.append(row);
}
});
}
});
|
b7d96b61
Administrator
change request to...
|
98
|
$('#result').on('click', '.select-template', function () {
|
83d5cde0
Administrator
change request to...
|
99
|
var event = $(this).data('id');
|
4081157a
Administrator
change request to...
|
100
101
|
var row = $(this).closest('tr');
var block = $('#templates-list');
|
4081157a
Administrator
change request to...
|
102
|
var name = row.find('#name').html();
|
83d5cde0
Administrator
change request to...
|
103
104
|
var new_row = "<tr><td id='name'>" + name + "</td><td><p class = 'btn btn-primary delete-row'>Убрать из списка</p>" +
"<input type='hidden' value='" + event + "' name='event[]'></td></tr>";
|
4081157a
Administrator
change request to...
|
105
106
107
108
109
110
111
112
113
|
block.append(new_row);
row.remove();
});
$('#templates-list').on('click', '.delete-row', function () {
var row = $(this).closest('tr');
row.remove();
});
});
|
62ff66e4
Administrator
change request to...
|
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
</script>
<script>
$(function() {
$.datepicker.regional['ru'] = {
closeText: 'Закрыть',
prevText: '<Пред',
nextText: 'След>',
currentText: 'Сегодня',
monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
'Июл','Авг','Сен','Окт','Ноя','Дек'],
dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
dateFormat: 'dd.mm.yy',
firstDay: 1,
isRTL: false
};
$.datepicker.setDefaults($.datepicker.regional['ru']);
$( "#datepicker" ).datepicker({
dateFormat: "dd-mm-yy"
});
$('.active_field_select').each(function(){
if(this.checked){
$(this).parent('li').addClass('active');
}else {
$(this).parent('li').addClass('non_active');
}
});
});
|
4081157a
Administrator
change request to...
|
150
|
</script>
|