diff --git a/media/resolution_files/res_con_0f3824dc-3a79-4a23-bdcb-5a2f257cdd12.pdf b/media/resolution_files/res_con_0f3824dc-3a79-4a23-bdcb-5a2f257cdd12.pdf new file mode 100644 index 0000000..15d9168 Binary files /dev/null and b/media/resolution_files/res_con_0f3824dc-3a79-4a23-bdcb-5a2f257cdd12.pdf differ diff --git a/media/resolution_files/res_con_1d40348d-94f5-4ee9-a1a9-f27d3f587bba.pdf b/media/resolution_files/res_con_1d40348d-94f5-4ee9-a1a9-f27d3f587bba.pdf new file mode 100644 index 0000000..15d9168 Binary files /dev/null and b/media/resolution_files/res_con_1d40348d-94f5-4ee9-a1a9-f27d3f587bba.pdf differ diff --git a/media/resolution_files/res_con_838cf8bc-768d-4e64-b390-d886dc8fd5ca.pdf b/media/resolution_files/res_con_838cf8bc-768d-4e64-b390-d886dc8fd5ca.pdf new file mode 100644 index 0000000..15d9168 Binary files /dev/null and b/media/resolution_files/res_con_838cf8bc-768d-4e64-b390-d886dc8fd5ca.pdf differ diff --git a/media/resolution_files/res_con_a8e6eddf-1b56-44b3-b03a-22b578a02134.pdf b/media/resolution_files/res_con_a8e6eddf-1b56-44b3-b03a-22b578a02134.pdf new file mode 100644 index 0000000..15d9168 Binary files /dev/null and b/media/resolution_files/res_con_a8e6eddf-1b56-44b3-b03a-22b578a02134.pdf differ diff --git a/media/resolution_files/res_con_fb3a048e-4f41-4953-b3ba-06c09c1fd5f6.pdf b/media/resolution_files/res_con_fb3a048e-4f41-4953-b3ba-06c09c1fd5f6.pdf new file mode 100644 index 0000000..47a1fc2 Binary files /dev/null and b/media/resolution_files/res_con_fb3a048e-4f41-4953-b3ba-06c09c1fd5f6.pdf differ diff --git a/misdghs/__pycache__/__init__.cpython-311.pyc b/misdghs/__pycache__/__init__.cpython-311.pyc index dc8d1e0..d64e07e 100644 Binary files a/misdghs/__pycache__/__init__.cpython-311.pyc and b/misdghs/__pycache__/__init__.cpython-311.pyc differ diff --git a/misdghs/__pycache__/settings.cpython-311.pyc b/misdghs/__pycache__/settings.cpython-311.pyc index 8a40470..27bd9e5 100644 Binary files a/misdghs/__pycache__/settings.cpython-311.pyc and b/misdghs/__pycache__/settings.cpython-311.pyc differ diff --git a/misdghs/__pycache__/urls.cpython-311.pyc b/misdghs/__pycache__/urls.cpython-311.pyc index 0c4adad..2fa248f 100644 Binary files a/misdghs/__pycache__/urls.cpython-311.pyc and b/misdghs/__pycache__/urls.cpython-311.pyc differ diff --git a/misdghs/__pycache__/wsgi.cpython-311.pyc b/misdghs/__pycache__/wsgi.cpython-311.pyc index eb5ac91..9dd3375 100644 Binary files a/misdghs/__pycache__/wsgi.cpython-311.pyc and b/misdghs/__pycache__/wsgi.cpython-311.pyc differ diff --git a/resulation/__pycache__/__init__.cpython-311.pyc b/resulation/__pycache__/__init__.cpython-311.pyc index 9c593ac..fc37c87 100644 Binary files a/resulation/__pycache__/__init__.cpython-311.pyc and b/resulation/__pycache__/__init__.cpython-311.pyc differ diff --git a/resulation/__pycache__/admin.cpython-311.pyc b/resulation/__pycache__/admin.cpython-311.pyc index 6807a92..baa4371 100644 Binary files a/resulation/__pycache__/admin.cpython-311.pyc and b/resulation/__pycache__/admin.cpython-311.pyc differ diff --git a/resulation/__pycache__/apps.cpython-311.pyc b/resulation/__pycache__/apps.cpython-311.pyc index c4cbb5d..37c4480 100644 Binary files a/resulation/__pycache__/apps.cpython-311.pyc and b/resulation/__pycache__/apps.cpython-311.pyc differ diff --git a/resulation/__pycache__/models.cpython-311.pyc b/resulation/__pycache__/models.cpython-311.pyc index 34e05f2..6a0f5f1 100644 Binary files a/resulation/__pycache__/models.cpython-311.pyc and b/resulation/__pycache__/models.cpython-311.pyc differ diff --git a/resulation/__pycache__/urls.cpython-311.pyc b/resulation/__pycache__/urls.cpython-311.pyc index fcfdf5d..303e692 100644 Binary files a/resulation/__pycache__/urls.cpython-311.pyc and b/resulation/__pycache__/urls.cpython-311.pyc differ diff --git a/resulation/__pycache__/views.cpython-311.pyc b/resulation/__pycache__/views.cpython-311.pyc index b6eded1..115dd3e 100644 Binary files a/resulation/__pycache__/views.cpython-311.pyc and b/resulation/__pycache__/views.cpython-311.pyc differ diff --git a/resulation/migrations/__pycache__/0001_initial.cpython-311.pyc b/resulation/migrations/__pycache__/0001_initial.cpython-311.pyc index ae94248..6c66bdf 100644 Binary files a/resulation/migrations/__pycache__/0001_initial.cpython-311.pyc and b/resulation/migrations/__pycache__/0001_initial.cpython-311.pyc differ diff --git a/resulation/migrations/__pycache__/0002_remove_savepdf_minutes_file_and_more.cpython-311.pyc b/resulation/migrations/__pycache__/0002_remove_savepdf_minutes_file_and_more.cpython-311.pyc index 836c973..7edbbe1 100644 Binary files a/resulation/migrations/__pycache__/0002_remove_savepdf_minutes_file_and_more.cpython-311.pyc and b/resulation/migrations/__pycache__/0002_remove_savepdf_minutes_file_and_more.cpython-311.pyc differ diff --git a/resulation/migrations/__pycache__/0003_alter_savepdf_m_date_alter_savepdf_m_number.cpython-311.pyc b/resulation/migrations/__pycache__/0003_alter_savepdf_m_date_alter_savepdf_m_number.cpython-311.pyc index eb7a311..0207c8e 100644 Binary files a/resulation/migrations/__pycache__/0003_alter_savepdf_m_date_alter_savepdf_m_number.cpython-311.pyc and b/resulation/migrations/__pycache__/0003_alter_savepdf_m_date_alter_savepdf_m_number.cpython-311.pyc differ diff --git a/resulation/migrations/__pycache__/0004_alter_savepdf_options_alter_savepdf_attendance_file_and_more.cpython-311.pyc b/resulation/migrations/__pycache__/0004_alter_savepdf_options_alter_savepdf_attendance_file_and_more.cpython-311.pyc index 4364b3b..af7d295 100644 Binary files a/resulation/migrations/__pycache__/0004_alter_savepdf_options_alter_savepdf_attendance_file_and_more.cpython-311.pyc and b/resulation/migrations/__pycache__/0004_alter_savepdf_options_alter_savepdf_attendance_file_and_more.cpython-311.pyc differ diff --git a/resulation/migrations/__pycache__/0005_alter_savepdf_attendance_file_and_more.cpython-311.pyc b/resulation/migrations/__pycache__/0005_alter_savepdf_attendance_file_and_more.cpython-311.pyc index 780900c..34d7a20 100644 Binary files a/resulation/migrations/__pycache__/0005_alter_savepdf_attendance_file_and_more.cpython-311.pyc and b/resulation/migrations/__pycache__/0005_alter_savepdf_attendance_file_and_more.cpython-311.pyc differ diff --git a/resulation/migrations/__pycache__/0006_rename_savepdf_resulation.cpython-311.pyc b/resulation/migrations/__pycache__/0006_rename_savepdf_resulation.cpython-311.pyc index 2fcb05f..3d5248d 100644 Binary files a/resulation/migrations/__pycache__/0006_rename_savepdf_resulation.cpython-311.pyc and b/resulation/migrations/__pycache__/0006_rename_savepdf_resulation.cpython-311.pyc differ diff --git a/resulation/migrations/__pycache__/0007_alter_resulation_m_venue_alter_resulation_tittle.cpython-311.pyc b/resulation/migrations/__pycache__/0007_alter_resulation_m_venue_alter_resulation_tittle.cpython-311.pyc index 871b4f0..0df8d3d 100644 Binary files a/resulation/migrations/__pycache__/0007_alter_resulation_m_venue_alter_resulation_tittle.cpython-311.pyc and b/resulation/migrations/__pycache__/0007_alter_resulation_m_venue_alter_resulation_tittle.cpython-311.pyc differ diff --git a/resulation/migrations/__pycache__/0008_alter_resulation_attendance_file_and_more.cpython-311.pyc b/resulation/migrations/__pycache__/0008_alter_resulation_attendance_file_and_more.cpython-311.pyc index 81f7198..92cdc96 100644 Binary files a/resulation/migrations/__pycache__/0008_alter_resulation_attendance_file_and_more.cpython-311.pyc and b/resulation/migrations/__pycache__/0008_alter_resulation_attendance_file_and_more.cpython-311.pyc differ diff --git a/resulation/migrations/__pycache__/0009_alter_resulation_attendance_file_and_more.cpython-311.pyc b/resulation/migrations/__pycache__/0009_alter_resulation_attendance_file_and_more.cpython-311.pyc index 9229521..bb68b5d 100644 Binary files a/resulation/migrations/__pycache__/0009_alter_resulation_attendance_file_and_more.cpython-311.pyc and b/resulation/migrations/__pycache__/0009_alter_resulation_attendance_file_and_more.cpython-311.pyc differ diff --git a/resulation/migrations/__pycache__/__init__.cpython-311.pyc b/resulation/migrations/__pycache__/__init__.cpython-311.pyc index 0633b8d..5c1e530 100644 Binary files a/resulation/migrations/__pycache__/__init__.cpython-311.pyc and b/resulation/migrations/__pycache__/__init__.cpython-311.pyc differ diff --git a/resulation/urls.py b/resulation/urls.py index 544d0a5..fca90b2 100644 --- a/resulation/urls.py +++ b/resulation/urls.py @@ -12,7 +12,9 @@ urlpatterns = [ path('resulation/', resulation.views.Savepdf, name='resulation'), path('viewresulation/', resulation.views.Viewresulation, name='viewresulation'), path('deed/', resulation.views.Contract, name='deed'), + path('viewdeed/', resulation.views.Viewcontract, name='viewdeed'), path('mou/', resulation.views.Mou, name='mou'), + path('viewmou/', resulation.views.Viewmou, name='viewmou'), path('/', resulation.views.file_download, name='file-download'), path('rcm/', resulation.views.file_download, name='download_file'), ] diff --git a/resulation/views.py b/resulation/views.py index aad930e..fda2a97 100644 --- a/resulation/views.py +++ b/resulation/views.py @@ -89,8 +89,102 @@ def file_download(request, type, filename): return FileResponse(open(file_path, 'rb'), content_type='application/pdf') -def Contract(request): - return render(request,'resulation/contract.html') + def Mou(request): - return render(request,'resulation/mou.html') \ No newline at end of file + if request.method == 'POST': + try: + # Get text form fields + pdftype= request.POST.get('pdftype') + first_party = request.POST.get('first_party') + second_party = request.POST.get('second_party') + contract_mou_date = request.POST.get('contract_mou_date') + # Get file uploads + res_con_mou_file = request.FILES.get('res_con_mou_file') + + if res_con_mou_file: + new_filename2 = f"res_con_{uuid.uuid4()}.pdf" + path2 = os.path.join('media', 'resolution_files', new_filename2) + + print(path2) + with open(path2, 'wb') as destination: + for chunk in res_con_mou_file.chunks(): + destination.write(chunk) + seminar = resulation( + pdftype=pdftype, + first_party = first_party, + second_party = second_party, + contract_mou_date = contract_mou_date, + res_con_mou_file=new_filename2, + ) + seminar.save() + message = "Data Inserted successfully" + # Redirect after a successful save + return render(request, "resulation/home.html", {'message': message}) + + except Exception as e: + # Handle any errors (e.g., invalid file types or sizes) + print(f"Error processing form: {str(e)}") + return render(request, 'resulation/mou.html', {'error': str(e)}) + + else: + # Render the form template + return render(request, 'resulation/mou.html') + +def Viewmou(request): + # Get all records from database + pdf_records = resulation.objects.all().order_by('-m_date') # Latest first + return render(request, 'resulation/viewmou.html', {'pdf_records': pdf_records}) + + + +def Contract(request): + if request.method == 'POST': + try: + # Get text form fields + pdftype= request.POST.get('pdftype') + contract_name= request.POST.get('topic') + first_party = request.POST.get('first_party') + second_party = request.POST.get('second_party') + contract_mou_date = request.POST.get('contract_mou_date') + contract_mou_closing_date = request.POST.get('closing_date') + duration= request.POST.get('duration') + # Get file uploads + res_con_mou_file = request.FILES.get('res_con_mou_file') + + if res_con_mou_file: + new_filename2 = f"res_con_{uuid.uuid4()}.pdf" + path2 = os.path.join('media', 'resolution_files', new_filename2) + + print(path2) + with open(path2, 'wb') as destination: + for chunk in res_con_mou_file.chunks(): + destination.write(chunk) + seminar = resulation( + pdftype=pdftype, + topic=contract_name, + first_party = first_party, + second_party = second_party, + contract_mou_date = contract_mou_date, + closing_date= contract_mou_closing_date, + duration=duration, + res_con_mou_file=new_filename2, + ) + seminar.save() + message = "Data Inserted successfully" + # Redirect after a successful save + return render(request, "resulation/home.html", {'message': message}) + + except Exception as e: + # Handle any errors (e.g., invalid file types or sizes) + print(f"Error processing form: {str(e)}") + return render(request, 'resulation/contract.html', {'error': str(e)}) + + else: + # Render the form template + return render(request, 'resulation/contract.html') + +def Viewcontract(request): + # Get all records from database + pdf_records = resulation.objects.all().order_by('-m_date') # Latest first + return render(request, 'resulation/viewcontract.html', {'pdf_records': pdf_records}) \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index ce0939d..6729661 100644 --- a/templates/base.html +++ b/templates/base.html @@ -21,11 +21,11 @@ Home diff --git a/templates/resulation/contract.html b/templates/resulation/contract.html index a3e8d66..90dddf1 100644 --- a/templates/resulation/contract.html +++ b/templates/resulation/contract.html @@ -1,55 +1,226 @@ {% extends "base.html" %} {% block content %} -
-

Fillup the form and upload your Contract

-
- + +
+

Fill up the form and upload Contract

+ +
- - + + - - - + + - - - - - + + - - - + + - - + - - + - - - - - - - - + + + + + + + {% csrf_token %} +
Name of organizationType of Upload
TropicContract Name
First Party
Second PartySecond Party
Contract DateContract Signing Date
End DateContract End Date
Duration of Cotract
Upload Resulation
Upload Contract
-
diff --git a/templates/resulation/mou.html b/templates/resulation/mou.html index 8a15473..cf5801e 100644 --- a/templates/resulation/mou.html +++ b/templates/resulation/mou.html @@ -1,42 +1,214 @@ {% extends "base.html" %} {% block content %} -
-

Fillup the form and upload MOU

-
- + +
+

Fill up the form and upload your MoU

+ +
- - + + - - - - - - - - - + - + + {% csrf_token %}
Name of organizationType of Upload
Tropic/Subject
First Party
Second Party
MoU Date
Upload MoU
diff --git a/templates/resulation/viewcontract.html b/templates/resulation/viewcontract.html new file mode 100644 index 0000000..5e9f9c2 --- /dev/null +++ b/templates/resulation/viewcontract.html @@ -0,0 +1,75 @@ +{% extends "base.html" %} +{% block content %} +{% load static %} + +
+
+

Contracts

+ +
+ {% if pdf_records %} + + + + + + + + + + + + + + + + {% for record in pdf_records %} + + + + + + + + + + + {% endfor %} + +
IDTypeTopicFirst PartySecond PartyContract Signing DateContract End DateDuration Of ContractContract
{{ record.eid }}{{ record.pdftype=contract }}{{ record.topic }}{{ record.first_party }}{{ record.second_party }}{{ record.contract_mou_date|date:"d M Y" }}{{ record.closing_date|date:"d M Y" }} + {% if record.res_con_mou_file %} + Download + {% endif %} +
+ {% else %} +

No records found.

+ {% endif %} +
+ + + +{% endblock content %} \ No newline at end of file diff --git a/templates/resulation/viewmou.html b/templates/resulation/viewmou.html new file mode 100644 index 0000000..6746b30 --- /dev/null +++ b/templates/resulation/viewmou.html @@ -0,0 +1,70 @@ +{% extends "base.html" %} +{% block content %} +{% load static %} + +
+
+

PDF Records

+ +
+ {% if pdf_records %} + + + + + + + + + + + + + {% for record in pdf_records %} + + + + + + + + + {% endfor %} + +
IDTypeFirst PartySecond PartyMoU DateMoU
{{ record.eid }}{{ record.pdftype }}{{ record.first_party }}{{ record.second_party }}{{ record.contract_mou_date|date:"d M Y" }} + {% if record.res_con_mou_file %} + Download + {% endif %} +
+ {% else %} +

No records found.

+ {% endif %} +
+ + + +{% endblock content %} \ No newline at end of file diff --git a/templates/resulation/viewresulation.html b/templates/resulation/viewresulation.html index 3edcf02..5ce349f 100644 --- a/templates/resulation/viewresulation.html +++ b/templates/resulation/viewresulation.html @@ -4,7 +4,7 @@
-

PDF Records

+

Resulation/Meeting Minutes

{% if pdf_records %}