DmitrMakeev
commited on
Commit
•
757b606
1
Parent(s):
9c86df2
Update biz_v.html
Browse files- biz_v.html +123 -1
biz_v.html
CHANGED
@@ -102,7 +102,129 @@
|
|
102 |
<div id="dropdown-container"></div>
|
103 |
<button id="sendGetRequestButton">Обновить базу пользователей WhatCRM</button>
|
104 |
|
105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
<script>
|
107 |
const notyf = new Notyf({
|
108 |
duration: 5000,
|
|
|
102 |
<div id="dropdown-container"></div>
|
103 |
<button id="sendGetRequestButton">Обновить базу пользователей WhatCRM</button>
|
104 |
|
105 |
+
|
106 |
+
|
107 |
+
|
108 |
+
|
109 |
+
|
110 |
+
|
111 |
+
|
112 |
+
|
113 |
+
|
114 |
+
|
115 |
+
|
116 |
+
|
117 |
+
<h1>Upload CSV File</h1>
|
118 |
+
<form id="uploadForm" enctype="multipart/form-data" method="post">
|
119 |
+
<div class="input-row">
|
120 |
+
<input type="file" name="file" accept=".csv">
|
121 |
+
</div>
|
122 |
+
<div class="input-row">
|
123 |
+
<label>
|
124 |
+
<input type="checkbox" name="verify_phone" value="1"> Verify Phone
|
125 |
+
</label>
|
126 |
+
<label>
|
127 |
+
<input type="checkbox" name="add_curator" value="1"> Add Curator
|
128 |
+
</label>
|
129 |
+
</div>
|
130 |
+
<input id="uploadButton" type="submit" value="Upload">
|
131 |
+
</form>
|
132 |
+
<div id="result"></div>
|
133 |
+
<div class="loader"></div>
|
134 |
+
|
135 |
+
<script src="https://cdn.jsdelivr.net/npm/notyf/notyf.min.js"></script>
|
136 |
+
|
137 |
+
<script>
|
138 |
+
document.getElementById('uploadForm').addEventListener('submit', function(event) {
|
139 |
+
event.preventDefault();
|
140 |
+
const form = new FormData(this);
|
141 |
+
const loader = document.querySelector('.loader');
|
142 |
+
loader.style.display = 'block'; // Показываем спиннер
|
143 |
+
|
144 |
+
fetch('/upload_csv', {
|
145 |
+
method: 'POST',
|
146 |
+
body: form
|
147 |
+
})
|
148 |
+
.then(response => response.json())
|
149 |
+
.then(data => {
|
150 |
+
loader.style.display = 'none'; // Скрываем спиннер после завершения
|
151 |
+
const notyf = new Notyf({
|
152 |
+
duration: 5000, // Длительность показа уведомления
|
153 |
+
position: {
|
154 |
+
x: 'right',
|
155 |
+
y: 'bottom'
|
156 |
+
},
|
157 |
+
types: [
|
158 |
+
{
|
159 |
+
type: 'success',
|
160 |
+
background: 'green',
|
161 |
+
icon: {
|
162 |
+
className: 'notyf__icon--success',
|
163 |
+
tagName: 'span',
|
164 |
+
text: ''
|
165 |
+
}
|
166 |
+
}
|
167 |
+
]
|
168 |
+
});
|
169 |
+
notyf.success(data.message); // Показываем уведомление с сообщением от сервера
|
170 |
+
})
|
171 |
+
.catch(error => {
|
172 |
+
console.error('Error:', error);
|
173 |
+
loader.style.display = 'none'; // Скрываем спиннер в случае ошибки
|
174 |
+
const notyf = new Notyf({
|
175 |
+
duration: 5000, // Длительность показа уведомления
|
176 |
+
position: {
|
177 |
+
x: 'right',
|
178 |
+
y: 'bottom'
|
179 |
+
},
|
180 |
+
types: [
|
181 |
+
{
|
182 |
+
type: 'error',
|
183 |
+
background: 'red',
|
184 |
+
icon: {
|
185 |
+
className: 'notyf__icon--error',
|
186 |
+
tagName: 'span',
|
187 |
+
text: ''
|
188 |
+
}
|
189 |
+
}
|
190 |
+
]
|
191 |
+
});
|
192 |
+
notyf.error('An error occurred while uploading the file.'); // Показываем уведомление об ошибке
|
193 |
+
});
|
194 |
+
});
|
195 |
+
</script>
|
196 |
+
|
197 |
+
|
198 |
+
|
199 |
+
|
200 |
+
|
201 |
+
|
202 |
+
|
203 |
+
|
204 |
+
|
205 |
+
|
206 |
+
|
207 |
+
|
208 |
+
|
209 |
+
|
210 |
+
|
211 |
+
|
212 |
+
|
213 |
+
|
214 |
+
|
215 |
+
|
216 |
+
|
217 |
+
|
218 |
+
|
219 |
+
|
220 |
+
|
221 |
+
|
222 |
+
|
223 |
+
|
224 |
+
|
225 |
+
|
226 |
+
|
227 |
+
|
228 |
<script>
|
229 |
const notyf = new Notyf({
|
230 |
duration: 5000,
|