Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
agent87 committed Oct 14, 2021
0 parents commit 8cb2686
Show file tree
Hide file tree
Showing 5,004 changed files with 1,932,662 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Build and Release Folders
bin-debug/
bin-release/
[Oo]bj/
[Bb]in/

# Other files and folders
.settings/

# Executables
*.swf
*.air
*.ipa
*.apk

#Django Stuff
*.log
db.sqlite3

# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
# should NOT be excluded as they contain compiler settings and other important
# information for Eclipse / Flash Builder.
__pycache__
*.pyc
Empty file added Auth/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions Auth/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions Auth/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class AuthConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'Auth'
73 changes: 73 additions & 0 deletions Auth/engine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
from . import models
from datetime import datetime
from django.utils import timezone
import time

class dashboard:
def compile(customerid):
context = {}
models.Parkinglog.objects.filter(customerid=customerid)

return context



class ParkingLog:
def compile(customerid):
Logs = models.Parkinglog.objects.all()
context = {
'History' : {'Count' : Logs.count(),
'List': ParkingLog.History_list(Logs)},
'Today' : {'Cars' : Logs.filter(date=timezone.now()).count(),
'Revenue': ParkingLog.Today_revenue(Logs)},
'Parked' : {'Now': Logs.filter(status='Parked').count(),
'List': ParkingLog.Parked_list(Logs)}

}

return context

def History_list(logs):
History_list = []
for log in logs:
item = {'TicketId': log.ticketid}
item['Date'] = str(log.date)
item['PlateNum'] = log.platenum
item['EntryGate'] = log.entrygateid
item['Checkin'] = datetime.utcfromtimestamp(log.checkintime).strftime('%H:%M:%S')
item['Checkout'] = datetime.utcfromtimestamp(log.checkouttime).strftime('%Y-%m-%d %H:%M:%S') if log.checkouttime else None
item['ExitGate'] = log.exitgateid
item['Status'] = log.status
item['Duration'] = log.duration
item['Cash'] = log.cash
History_list.append(item)

return History_list

def Parked_list(logs):
Today_list = []
for log in logs.filter(status='Parked'):
item = {'TicketId': str(log.ticketid)}
item['Date'] = str(log.date)
item['PlateNum'] = log.platenum
item['EntryGate'] = log.entrygateid
item['Checkin'] = datetime.utcfromtimestamp(log.checkintime).strftime('%H:%M:%S')
item['Status'] = log.status
item['Duration'] = int((time.time() - log.checkintime) / 60)
item['Cash'] = log.cash
Today_list.append(item)

return Today_list

def Today_revenue(logs):
Today_revenue = 0
for log in logs.filter(status='Exited'):
Today_revenue += int(log.cash)

return Today_revenue






93 changes: 93 additions & 0 deletions Auth/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Generated by Django 3.2.5 on 2021-07-29 14:26

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Cameradef',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('cameraid', models.CharField(db_column='CameraId', max_length=50)),
('type', models.CharField(db_column='Type', max_length=50)),
('modelnum', models.CharField(db_column='ModelNum', max_length=50)),
('ipaddress', models.CharField(blank=True, db_column='IpAddress', max_length=50, null=True)),
('macaddress', models.CharField(blank=True, db_column='MacAddress', max_length=50, null=True)),
('manufacturer', models.CharField(blank=True, db_column='Manufacturer', max_length=50, null=True)),
('origin', models.CharField(blank=True, db_column='Origin', max_length=50, null=True)),
],
),
migrations.CreateModel(
name='Customers',
fields=[
('customerid', models.CharField(db_column='CustomerId', max_length=50, primary_key=True, serialize=False)),
('clienttype', models.CharField(blank=True, db_column='ClientType', max_length=70, null=True)),
('fname', models.CharField(blank=True, db_column='FName', max_length=50, null=True)),
('lname', models.CharField(blank=True, db_column='LName', max_length=50, null=True)),
('email', models.CharField(blank=True, db_column='Email', max_length=80, null=True)),
('mobile', models.CharField(blank=True, db_column='Mobile', max_length=13, null=True)),
('position', models.CharField(blank=True, db_column='Position', max_length=20, null=True)),
('companyname', models.CharField(blank=True, db_column='CompanyName', max_length=50, null=True)),
('companymail', models.CharField(blank=True, db_column='CompanyMail', max_length=70, null=True)),
('companyid', models.CharField(blank=True, db_column='CompanyId', max_length=30, null=True)),
('address', models.CharField(blank=True, db_column='Address', max_length=50, null=True)),
('sector', models.CharField(blank=True, db_column='Sector', max_length=50, null=True)),
('district', models.CharField(blank=True, db_column='District', max_length=40, null=True)),
('city', models.CharField(blank=True, db_column='City', max_length=30, null=True)),
('province', models.CharField(blank=True, db_column='Province', max_length=30, null=True)),
('geolocation', models.CharField(blank=True, db_column='GeoLocation', max_length=50, null=True)),
('country', models.CharField(blank=True, db_column='Country', max_length=30, null=True)),
('comments', models.CharField(blank=True, db_column='Comments', max_length=500, null=True)),
('enrollmentdate', models.DateField(blank=True, null=True)),
],
),
migrations.CreateModel(
name='Gatesdef',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('gateid', models.CharField(db_column='GateId', max_length=50)),
('customerid', models.CharField(db_column='CustomerId', max_length=50)),
('flow', models.CharField(db_column='Flow', max_length=50)),
('description', models.CharField(blank=True, db_column='Description', max_length=50, null=True)),
('cashiername', models.CharField(blank=True, db_column='CashierName', max_length=50, null=True)),
('cameraid', models.CharField(blank=True, db_column='CameraId', max_length=50, null=True)),
],
),
migrations.CreateModel(
name='Parkinglog',
fields=[
('ticketid', models.UUIDField(db_column='TicketId', primary_key=True, serialize=False)),
('customerid', models.CharField(db_column='CustomerId', max_length=50)),
('date', models.DateField(db_column='Date')),
('platenum', models.CharField(db_column='PlateNum', max_length=50)),
('entrygateid', models.CharField(db_column='EntryGateId', max_length=50)),
('checkintime', models.BigIntegerField(db_column='CheckinTime')),
('checkouttime', models.BigIntegerField(blank=True, db_column='CheckoutTime', null=True)),
('exitgateid', models.CharField(blank=True, db_column='ExitGateId', max_length=50, null=True)),
('status', models.CharField(blank=True, db_column='Status', max_length=50, null=True)),
('duration', models.FloatField(blank=True, db_column='Duration', null=True)),
('cash', models.FloatField(blank=True, db_column='Cash', null=True)),
],
),
migrations.CreateModel(
name='Tarrif',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('customerid', models.CharField(db_column='CustomerId', max_length=50)),
('fromtime', models.FloatField(blank=True, db_column='FromTime', null=True)),
('totime', models.FloatField(blank=True, db_column='ToTime', null=True)),
('cost', models.FloatField(blank=True, db_column='Cost', null=True)),
('initiatedby', models.CharField(blank=True, db_column='Initiatedby', max_length=50, null=True)),
('date', models.DateField(blank=True, db_column='Date', null=True)),
('lastupdate', models.DateField(blank=True, db_column='LastUpdate', null=True)),
('updatelog', models.CharField(blank=True, db_column='UpdateLog', max_length=50, null=True)),
],
),
]
Empty file added Auth/migrations/__init__.py
Empty file.
95 changes: 95 additions & 0 deletions Auth/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Make sure each ForeignKey and OneToOneField has `on_delete` set to the desired behavior
# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
# Feel free to rename the models, but don't rename db_table values or field names.
from django.db import models


class Cameradef(models.Model):
cameraid = models.CharField(db_column='CameraId', max_length=50) # Field name made lowercase.
type = models.CharField(db_column='Type', max_length=50) # Field name made lowercase.
modelnum = models.CharField(db_column='ModelNum', max_length=50) # Field name made lowercase.
ipaddress = models.CharField(db_column='IpAddress', max_length=50, blank=True, null=True) # Field name made lowercase.
macaddress = models.CharField(db_column='MacAddress', max_length=50, blank=True, null=True) # Field name made lowercase.
manufacturer = models.CharField(db_column='Manufacturer', max_length=50, blank=True, null=True) # Field name made lowercase.
origin = models.CharField(db_column='Origin', max_length=50, blank=True, null=True) # Field name made lowercase.


class Customers(models.Model):
customerid = models.CharField(db_column='CustomerId', primary_key=True, max_length=50) # Field name made lowercase.
clienttype = models.CharField(db_column='ClientType', max_length=70, blank=True, null=True) # Field name made lowercase.
fname = models.CharField(db_column='FName', max_length=50, blank=True, null=True) # Field name made lowercase.
lname = models.CharField(db_column='LName', max_length=50, blank=True, null=True) # Field name made lowercase.
email = models.CharField(db_column='Email', max_length=80, blank=True, null=True) # Field name made lowercase.
mobile = models.CharField(db_column='Mobile', max_length=13, blank=True, null=True) # Field name made lowercase.
position = models.CharField(db_column='Position', max_length=20, blank=True, null=True) # Field name made lowercase.
companyname = models.CharField(db_column='CompanyName', max_length=50, blank=True, null=True) # Field name made lowercase.
companymail = models.CharField(db_column='CompanyMail', max_length=70, blank=True, null=True) # Field name made lowercase.
companyid = models.CharField(db_column='CompanyId', max_length=30, blank=True, null=True) # Field name made lowercase.
address = models.CharField(db_column='Address', max_length=50, blank=True, null=True) # Field name made lowercase.
sector = models.CharField(db_column='Sector', max_length=50, blank=True, null=True) # Field name made lowercase.
district = models.CharField(db_column='District', max_length=40, blank=True, null=True) # Field name made lowercase.
city = models.CharField(db_column='City', max_length=30, blank=True, null=True) # Field name made lowercase.
province = models.CharField(db_column='Province', max_length=30, blank=True, null=True) # Field name made lowercase.
geolocation = models.CharField(db_column='GeoLocation', max_length=50, blank=True, null=True) # Field name made lowercase.
country = models.CharField(db_column='Country', max_length=30, blank=True, null=True) # Field name made lowercase.
comments = models.CharField(db_column='Comments', max_length=500, blank=True, null=True) # Field name made lowercase.
enrollmentdate = models.DateField(blank=True, null=True)



class Gatesdef(models.Model):
gateid = models.CharField(db_column='GateId', max_length=50) # Field name made lowercase.
customerid = models.CharField(db_column='CustomerId', max_length=50) # Field name made lowercase.
flow = models.CharField(db_column='Flow', max_length=50) # Field name made lowercase.
description = models.CharField(db_column='Description', max_length=50, blank=True, null=True) # Field name made lowercase.
cashiername = models.CharField(db_column='CashierName', max_length=50, blank=True, null=True) # Field name made lowercase.
cameraid = models.CharField(db_column='CameraId', max_length=50, blank=True, null=True) # Field name made lowercase.


class Parkinglog(models.Model):
ticketid = models.UUIDField(db_column='TicketId', primary_key=True) # Field name made lowercase.
customerid = models.CharField(db_column='CustomerId', max_length=50) # Field name made lowercase.
date = models.DateField(db_column='Date') # Field name made lowercase.
platenum = models.CharField(db_column='PlateNum', max_length=50) # Field name made lowercase.
entrygateid = models.CharField(db_column='EntryGateId', max_length=50) # Field name made lowercase.
checkintime = models.BigIntegerField(db_column='CheckinTime') # Field name made lowercase.
checkouttime = models.BigIntegerField(db_column='CheckoutTime', blank=True, null=True) # Field name made lowercase.
exitgateid = models.CharField(db_column='ExitGateId', max_length=50, blank=True, null=True) # Field name made lowercase.
status = models.CharField(db_column='Status', max_length=50, blank=True, null=True) # Field name made lowercase.
duration = models.FloatField(db_column='Duration', blank=True, null=True) # Field name made lowercase.
cash = models.FloatField(db_column='Cash', blank=True, null=True) # Field name made lowercase.



class Tarrif(models.Model):
customerid = models.CharField(db_column='CustomerId', max_length=50) # Field name made lowercase.
fromtime = models.FloatField(db_column='FromTime', blank=True, null=True) # Field name made lowercase.
totime = models.FloatField(db_column='ToTime', blank=True, null=True) # Field name made lowercase.
cost = models.FloatField(db_column='Cost', blank=True, null=True) # Field name made lowercase.
initiatedby = models.CharField(db_column='Initiatedby', max_length=50, blank=True, null=True) # Field name made lowercase.
date = models.DateField(db_column='Date', blank=True, null=True) # Field name made lowercase.
lastupdate = models.DateField(db_column='LastUpdate', blank=True, null=True) # Field name made lowercase.
updatelog = models.CharField(db_column='UpdateLog', max_length=50, blank=True, null=True) # Field name made lowercase.




class Subcription:
customerid = models.CharField(db_column='CustomerId', max_length=50) # Field name made lowercase.
subscriptionid = models.CharField(db_column='SubscriptionId', max_length=50) # Field name made lowercase.
platenumber = models.CharField(db_column='PlateNumber', max_length=50) # Field name made lowercase.
subscription_date = models.DateField(db_column='SubscriptionDate') # Field name made lowercase.
subscription_end_date = models.DateField(db_column='SubscriptionEndDate') # Field name made lowercase.
subscription_type = models.CharField(db_column='SubscriptionType', max_length=50) # Field name made lowercase.
subscription_status = models.CharField(db_column='SubscriptionStatus', max_length=50) # Field name made lowercase.
subscription_amount = models.FloatField(db_column='SubscriptionAmount') # Field name made lowercase.
contact_number = models.CharField(db_column='ContactNumber', max_length=50) # Field name made lowercase.
office_location = models.CharField(db_column='OfficeLocation', max_length=50) # Field name made lowercase.
parkingLot = models.CharField(db_column='ParkingLot', max_length=50) # Field name made lowercase.



Loading

0 comments on commit 8cb2686

Please sign in to comment.