DmitrMakeev
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -42,7 +42,6 @@ def init_db(db_name):
|
|
42 |
name TEXT NOT NULL,
|
43 |
phone TEXT NOT NULL,
|
44 |
email TEXT NOT NULL,
|
45 |
-
curator TEXT NOT NULL,
|
46 |
vk_id TEXT NOT NULL,
|
47 |
chat_id TEXT NOT NULL,
|
48 |
ws_statys TEXT NOT NULL,
|
@@ -162,7 +161,6 @@ def add_data_gc():
|
|
162 |
name = request.args.get('name')
|
163 |
phone = request.args.get('phone')
|
164 |
email = request.args.get('email')
|
165 |
-
curator = request.args.get('curat', '') # Добавлен новый параметр
|
166 |
vk_id = request.args.get('vk_id', '')
|
167 |
chat_id = request.args.get('chat_id', '')
|
168 |
ws_statys = request.args.get('ws_st', '')
|
@@ -192,22 +190,20 @@ def add_data_gc():
|
|
192 |
if existing_contact:
|
193 |
cursor.execute('''
|
194 |
UPDATE contacts SET
|
195 |
-
name = ?, email = ?,
|
196 |
web_statys = ?, fin_progress = ?, shop_statys_full = ?, pr1 = ?, pr2 = ?,
|
197 |
pr3 = ?, pr4 = ?, pr5 = ?, ad_url = ?
|
198 |
WHERE phone = ? OR email = ?
|
199 |
-
''', (name, email,
|
200 |
shop_statys_full, pr1, pr2, pr3, pr4, pr5, ad_url, phone, email))
|
201 |
-
print(f"Updated contact: {name} - {phone} - {email}")
|
202 |
else:
|
203 |
cursor.execute('''
|
204 |
INSERT INTO contacts (
|
205 |
-
name, phone, email,
|
206 |
shop_statys_full, pr1, pr2, pr3, pr4, pr5, ad_url
|
207 |
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
208 |
-
''', (name, phone, email,
|
209 |
shop_statys_full, pr1, pr2, pr3, pr4, pr5, ad_url))
|
210 |
-
print(f"Inserted new contact: {name} - {phone} - {email}")
|
211 |
|
212 |
conn.commit()
|
213 |
conn.close()
|
@@ -232,7 +228,6 @@ def add_contact():
|
|
232 |
name = request.args.get('name')
|
233 |
phone = request.args.get('phone')
|
234 |
email = request.args.get('email')
|
235 |
-
curator = request.args.get('curat', '') # Добавлен новый параметр
|
236 |
vk_id = request.args.get('vk_id', '')
|
237 |
chat_id = request.args.get('chat_id', '')
|
238 |
ws_statys = request.args.get('ws_statys', '')
|
@@ -262,19 +257,19 @@ def add_contact():
|
|
262 |
if existing_contact:
|
263 |
cursor.execute('''
|
264 |
UPDATE contacts SET
|
265 |
-
name = ?, email = ?,
|
266 |
web_statys = ?, fin_progress = ?, shop_statys_full = ?, pr1 = ?, pr2 = ?,
|
267 |
pr3 = ?, pr4 = ?, pr5 = ?, ad_url = ?
|
268 |
WHERE phone = ? OR email = ?
|
269 |
-
''', (name, email,
|
270 |
shop_statys_full, pr1, pr2, pr3, pr4, pr5, ad_url, phone, email))
|
271 |
else:
|
272 |
cursor.execute('''
|
273 |
INSERT INTO contacts (
|
274 |
-
name, phone, email,
|
275 |
shop_statys_full, pr1, pr2, pr3, pr4, pr5, ad_url
|
276 |
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
277 |
-
''', (name, phone, email,
|
278 |
shop_statys_full, pr1, pr2, pr3, pr4, pr5, ad_url))
|
279 |
|
280 |
conn.commit()
|
@@ -290,7 +285,6 @@ def add_contact():
|
|
290 |
|
291 |
|
292 |
|
293 |
-
|
294 |
|
295 |
|
296 |
@app.route('/data_gc')
|
|
|
42 |
name TEXT NOT NULL,
|
43 |
phone TEXT NOT NULL,
|
44 |
email TEXT NOT NULL,
|
|
|
45 |
vk_id TEXT NOT NULL,
|
46 |
chat_id TEXT NOT NULL,
|
47 |
ws_statys TEXT NOT NULL,
|
|
|
161 |
name = request.args.get('name')
|
162 |
phone = request.args.get('phone')
|
163 |
email = request.args.get('email')
|
|
|
164 |
vk_id = request.args.get('vk_id', '')
|
165 |
chat_id = request.args.get('chat_id', '')
|
166 |
ws_statys = request.args.get('ws_st', '')
|
|
|
190 |
if existing_contact:
|
191 |
cursor.execute('''
|
192 |
UPDATE contacts SET
|
193 |
+
name = ?, email = ?, vk_id = ?, chat_id = ?, ws_statys = ?, ws_stop = ?,
|
194 |
web_statys = ?, fin_progress = ?, shop_statys_full = ?, pr1 = ?, pr2 = ?,
|
195 |
pr3 = ?, pr4 = ?, pr5 = ?, ad_url = ?
|
196 |
WHERE phone = ? OR email = ?
|
197 |
+
''', (name, email, vk_id, chat_id, ws_statys, ws_stop, web_statys, fin_progress,
|
198 |
shop_statys_full, pr1, pr2, pr3, pr4, pr5, ad_url, phone, email))
|
|
|
199 |
else:
|
200 |
cursor.execute('''
|
201 |
INSERT INTO contacts (
|
202 |
+
name, phone, email, vk_id, chat_id, ws_statys, ws_stop, web_statys, fin_progress,
|
203 |
shop_statys_full, pr1, pr2, pr3, pr4, pr5, ad_url
|
204 |
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
205 |
+
''', (name, phone, email, vk_id, chat_id, ws_statys, ws_stop, web_statys, fin_progress,
|
206 |
shop_statys_full, pr1, pr2, pr3, pr4, pr5, ad_url))
|
|
|
207 |
|
208 |
conn.commit()
|
209 |
conn.close()
|
|
|
228 |
name = request.args.get('name')
|
229 |
phone = request.args.get('phone')
|
230 |
email = request.args.get('email')
|
|
|
231 |
vk_id = request.args.get('vk_id', '')
|
232 |
chat_id = request.args.get('chat_id', '')
|
233 |
ws_statys = request.args.get('ws_statys', '')
|
|
|
257 |
if existing_contact:
|
258 |
cursor.execute('''
|
259 |
UPDATE contacts SET
|
260 |
+
name = ?, email = ?, vk_id = ?, chat_id = ?, ws_statys = ?, ws_stop = ?,
|
261 |
web_statys = ?, fin_progress = ?, shop_statys_full = ?, pr1 = ?, pr2 = ?,
|
262 |
pr3 = ?, pr4 = ?, pr5 = ?, ad_url = ?
|
263 |
WHERE phone = ? OR email = ?
|
264 |
+
''', (name, email, vk_id, chat_id, ws_statys, ws_stop, web_statys, fin_progress,
|
265 |
shop_statys_full, pr1, pr2, pr3, pr4, pr5, ad_url, phone, email))
|
266 |
else:
|
267 |
cursor.execute('''
|
268 |
INSERT INTO contacts (
|
269 |
+
name, phone, email, vk_id, chat_id, ws_statys, ws_stop, web_statys, fin_progress,
|
270 |
shop_statys_full, pr1, pr2, pr3, pr4, pr5, ad_url
|
271 |
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
272 |
+
''', (name, phone, email, vk_id, chat_id, ws_statys, ws_stop, web_statys, fin_progress,
|
273 |
shop_statys_full, pr1, pr2, pr3, pr4, pr5, ad_url))
|
274 |
|
275 |
conn.commit()
|
|
|
285 |
|
286 |
|
287 |
|
|
|
288 |
|
289 |
|
290 |
@app.route('/data_gc')
|