date added

This commit is contained in:
denisvandyshev 2023-12-15 16:23:21 +03:00
parent 07ebadcdde
commit 73e5564375
14 changed files with 113 additions and 26 deletions

Binary file not shown.

View File

@ -39,7 +39,7 @@
</div>
<div class="modal-body centered-div">
<a href="QR.html" ><img src="http://qrcoder.ru/code/?http%3A%2F%2F127.0.0.1%3A8000%2Fcheck_choice%2FQR.html&4&0" width="350" height="350" border="0" title="QR код"></a>
<form><a href="QR.html"><img src="http://qrcoder.ru/code/?http%3A%2F%2F127.0.0.1%3A8000%2Fcheck_choice%2FQR.html&4&0" width="350" height="350" border="0" title="QR код" ></a></form>
</div>
@ -75,7 +75,7 @@
<div class="modal-body centered-div" style="font-size: 32px">
едуйте инструкциям на терминале
<a href="QR.html"><br><br><button style="font-size: 32px" >Далее</button></a>
<a href="QR.html"><br><br><button style="font-size: 32px" name="datetime">Далее</button></a>
</div>

View File

@ -1,7 +1,8 @@
<!-- index.html -->
{% load static %}
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
<html lang="en" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html"
xmlns="http://www.w3.org/1999/html">
<head>
@ -38,11 +39,11 @@
<td class="centered-div"><button type="button" style="width: 250px; height: 90px; font-size: 50px; opacity: 0.7; margin-bottom: 50px; margin-left: 100px; border-radius: 10px;"> {{tickets.0.price}} P. </button></td>
<td class="centered-div product-data">
<button style="border: none; background: transparent; margin-bottom: 75px"><span class="change minus" style="font-size: 75px; color: red; margin-left: 10px; font-weight: bold">
-
</span>
<button type="button" class="change minus" style="opacity: 0.7; border-radius: 10px; font-size: 50px; width: 45px; color: red"> - </button>
</span>
<input type="text" class="qty-input" value="{{tickets.0.quantity}}" name="ticket1" style="border: none; font-size: 50px; width: 25px; background: transparent;">
<span class="change plus" style="font-size: 64px; color: mediumseagreen;margin-left: 10px; ">
+
<button type="button" style="opacity: 0.7; border-radius: 10px; font-size: 50px; color: mediumseagreen">+</button>
</span>
</button></td>
</div>
@ -52,13 +53,17 @@
<td class="centered-div"><button type="button" style="width: 650px; height: 90px; font-size: 50px; opacity: 0.7; margin-bottom: 50px; border-radius: 10px;">{{tickets.1}} </button></td>
<td class="centered-div"><button type="button" style="width: 250px; height: 90px; font-size: 50px; opacity: 0.7; margin-bottom: 50px; margin-left: 100px; border-radius: 10px;"> {{tickets.1.price}} P. </button></td>
<td class="centered-div product-data">
<button style="border: none; background: transparent; margin-bottom: 75px"> <span class="change minus" style="font-size: 75px; color: red; margin-left: 10px; font-weight: bold">
-
</span>
<input type="text" class="qty-input" value="{{tickets.1.quantity}}" name="ticket2" style="border: none; font-size: 50px; width: 25px; background: transparent;">
<span class="change plus" style="font-size: 64px; color: mediumseagreen;margin-left: 10px; ">
+
</span></button></td>
<button style="border: none; background: transparent; margin-bottom: 75px">
<span class="change minus" style="font-size: 75px; color: red; margin-left: 10px; font-weight: bold; margin-bottom: 75px">
<button type="button" class="change minus" style="opacity: 0.7; border-radius: 10px; font-size: 50px; color: red; width: 45px;"> - </button>
</span>
<input type="text" class="qty-input" value="{{tickets.1.quantity}}" name="ticket2" style="border: none; font-size: 50px; width: 25px; background: transparent;">
<span class="change plus" style="font-size: 64px; color: mediumseagreen;margin-left: 10px; ">
<button type="button" style="opacity: 0.7; border-radius: 10px; font-size: 50px; color: mediumseagreen">+</button>
</span>
</button>
</td>
</tr>
<tr>
@ -66,19 +71,18 @@
<td class="centered-div"><button type="button" style="width: 250px; height: 90px; font-size: 50px; opacity: 0.7; margin-bottom: 50px; margin-left: 100px; border-radius: 10px;"> {{tickets.2.price}} P. </button></td>
<td class="centered-div product-data">
<button style="border: none; background: transparent; margin-bottom: 75px"><span class="change minus" style="font-size: 75px; color: red; margin-left: 10px; font-weight: bold">
-
<button type="button" class="change minus" style="opacity: 0.7; border-radius: 10px; font-size: 50px; color: red; width: 45px;"> - </button>
</span>
<input type="text" class="qty-input" value="{{tickets.2.quantity}}" name="ticket3" style="border: none; font-size: 50px; width: 25px; background: transparent;">
<span class="change plus" style="font-size: 64px; color: mediumseagreen;margin-left: 10px; ">
+
<button type="button" style="opacity: 0.7; border-radius: 10px; font-size: 50px; color: mediumseagreen">+</button>
</span></button></td>
</tr>
</tbody>
</table>
<!--<a class="button" href="check_choice" style="margin-left: 45%; ">Далее</a>-->
<div class="centered-div">
<button type="submit" style="background: transparent; border: None"><a href="#pay" class="button button--pen">
@ -107,8 +111,7 @@
<div style="color: darkred; font-size: 24px;">* Сопровождающие льготных посетителей приобретают "Взрослый билет". Льготникам потребуется показать документы на право льготы охраннику</div>
<div style="color: white; font-size: 24px;"><button type="button" style="opacity: 0.7; font-size: 32px; border-radius: 10px">* Сопровождающие льготных посетителей приобретают "Взрослый билет". Льготникам потребуется показать документы на право льготы охраннику</button></div>
@ -766,11 +769,6 @@
}
/* 本体と関係ないスタイル */
.container{
width : 100% ;
@ -785,5 +783,27 @@
margin-bottom : 80px ;
}
.button {
background-color: #mediumseagreen;
-webkit-border-radius: 60px;
border-radius: 60px;
border: none;
color: #eeeeee;
cursor: pointer;
display: inline-block;
font-family: sans-serif;
font-size: 32px;
padding: 20px;
text-align: center;
text-decoration: none;
}
@keyframes glowing {
0% { background-color: mediumseagreen; box-shadow: 0 0 5px #mediumseagreen; }
50% { background-color: darkgreen; box-shadow: 0 0 20px #mediumseagreen; }
100% { background-color: mediumseagreen; box-shadow: 0 0 5px #mediumseagreen; }
}
.button {
animation: glowing 1700ms infinite;
}
</style>
</style>

View File

@ -0,0 +1,16 @@
# Generated by Django 4.2.7 on 2023-12-15 11:53
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('test_browser', '0016_ticket_delete_adultticket_delete_freeticket_and_more'),
]
operations = [
migrations.DeleteModel(
name='Order',
),
]

View File

@ -0,0 +1,25 @@
# Generated by Django 4.2.7 on 2023-12-15 11:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('test_browser', '0017_delete_order'),
]
operations = [
migrations.CreateModel(
name='Order',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=150)),
('quantity0', models.PositiveIntegerField(default=0)),
('quantity1', models.PositiveIntegerField(default=0)),
('quantity2', models.PositiveIntegerField(default=0)),
('total_price', models.DecimalField(decimal_places=1, max_digits=10)),
('date', models.DateTimeField()),
],
),
]

View File

@ -0,0 +1,18 @@
# Generated by Django 4.2.7 on 2023-12-15 12:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('test_browser', '0018_order'),
]
operations = [
migrations.AlterField(
model_name='order',
name='date',
field=models.DateTimeField(default=0),
),
]

View File

@ -1,4 +1,7 @@
from datetime import timezone
from django.db import models
from django.contrib.auth.models import User
from djangoZoo import settings
@ -15,10 +18,11 @@ class Ticket(models.Model):
class Order(models.Model):
name = models.CharField(max_length=150)
quantity0 = models.PositiveIntegerField(default=0)
quantity0 = models.PositiveIntegerField(default=0)
quantity1 = models.PositiveIntegerField(default=0)
quantity2 = models.PositiveIntegerField(default=0)
total_price = models.DecimalField(max_digits=10, decimal_places=1)
date = models.DateTimeField(default=00000)

View File

@ -2,6 +2,7 @@ from django.shortcuts import render, redirect
from djangoZoo import settings
from test_browser.models import Ticket, Order
import datetime
# Create your views here.
@ -22,9 +23,10 @@ def check_choice(request):
quantity0 = request.GET['ticket1']
quantity1 = request.GET['ticket2']
quantity2 = request.GET['ticket3']
total_price = (all_Ticket[0].price * int(quantity0) + all_Ticket[1].price * int(quantity1))
element = Order(name = 'Order #', quantity0 = quantity0, quantity1 = quantity1, quantity2 = quantity2,
total_price = total_price)
total_price = total_price, date = datetime.datetime.now())
element.save()
return render(request, 'check_choice.html', {'quantity1' : quantity0,
'quantity2' : quantity1,
@ -35,6 +37,8 @@ def check_choice(request):
def QR(request):
total_cost = Order.objects.last()
total_price = total_cost.total_price
total_cost.date = datetime.datetime.now()
total_cost.save()
return render(request, 'QR.html', {'total_price' : total_price})