Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions FusionIIIT/applications/library/issue_details.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import requests
from applications.globals.models import ExtraInfo
from bs4 import BeautifulSoup

url1 = "http://172.27.20.250/webopac/"
url2 ="frmissuesofuser.aspx?title=Issue%20Details%20of%20The%20%20Members"
#r2 = requests.get(url1+url2)
Expand All @@ -12,7 +12,7 @@
eventvalid = soup.find(id="__EVENTVALIDATION")['value']

Status = "Complete"
memberid = "2015181"
memberid = ExtraInfo.objects.get(user = request.user).id

formfields={'__VIEWSTATE':viewstate,
"__VIEWSTATEGENERATOR":viewgen,
Expand Down Expand Up @@ -55,4 +55,4 @@
print("Issue Date :",tr.contents[6].text)
print("Item Category :",tr.contents[7].text)
else :
print("No Records Found")
print("No Records Found")
7 changes: 4 additions & 3 deletions FusionIIIT/applications/library/overdue.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import requests
from applications.globals.models import ExtraInfo
from bs4 import BeautifulSoup

url1 = "http://172.27.20.250/webopac/"
url2 ="CircTotalFineUserWise.aspx?title=Over%20Due%20Details%20of%20MembersD"
#r2 = requests.get(url1+url2)
Expand All @@ -10,10 +10,11 @@
viewstate = soup.find(id="__VIEWSTATE")['value']
viewgen = soup.find(id="__VIEWSTATEGENERATOR")['value']
eventvalid = soup.find(id="__EVENTVALIDATION")['value']
memberid = ExtraInfo.objects.get(user = request.user).id
formfields={'__VIEWSTATE':viewstate,
"__VIEWSTATEGENERATOR":viewgen,
'__EVENTVALIDATION':eventvalid,
'ctl00$ContentPlaceHolder1$txtuserid':'74',
'ctl00$ContentPlaceHolder1$txtuserid':memberid,
'ctl00$ContentPlaceHolder1$cmdcheck': 'Enter'}
r3 = requests.post(url1+url2,cookies=r1.cookies,data=formfields)
#print(r1.status_code)
Expand Down Expand Up @@ -81,4 +82,4 @@
print("Total O.D.C :", tr.contents[5].text)
print("Cause :", tr.contents[5].text)
else :
print("No Records Found")
print("No Records Found")
7 changes: 4 additions & 3 deletions FusionIIIT/applications/library/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.shortcuts import render

from applications.globals.models import ExtraInfo
# """
# This Function is used to View the Issued Items of the user acording to the tags.
# The Data is scraped from the institutes library module hosted on the web OPAC server.
Expand Down Expand Up @@ -37,7 +37,7 @@ def libraryModule(request):
eventvalid = soup.find(id="__EVENTVALIDATION")['value']

Status = "Complete"
memberid = "74"
memberid = ExtraInfo.objects.get(user = request.user).id

formfields={'__VIEWSTATE':viewstate,
"__VIEWSTATEGENERATOR":viewgen,
Expand Down Expand Up @@ -94,7 +94,7 @@ def libraryModule(request):
formfields={'__VIEWSTATE':viewstate,
"__VIEWSTATEGENERATOR":viewgen,
'__EVENTVALIDATION':eventvalid,
'ctl00$ContentPlaceHolder1$txtuserid':'74',
'ctl00$ContentPlaceHolder1$txtuserid':memberid,
'ctl00$ContentPlaceHolder1$cmdcheck': 'Enter'}
r3 = requests.post(url1+url2,cookies=r1.cookies,data=formfields)
#print(r1.status_code)
Expand Down Expand Up @@ -185,3 +185,4 @@ def libraryModule(request):
context={"data1": yo, "due": due, "data2": yo1}
print(request.user)
return render(request, "libraryModule/libraryModule.html", context)

16 changes: 1 addition & 15 deletions FusionIIIT/templates/libraryModule/libraryModule.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,7 @@ <h3>
</div>
</div>

<div class="ui divider"></div>

<div class="row">
<div class="ui row">
<div id="textSegmentDiv">
<div class="ui active large text loader"
id="loader">
Loading ...
</div>

<div id="textLoader" style="max-height: 87.5vh; overflow-y: auto; overflow-x: hidden;">
{% block alerts %}
{% include 'libraryModule/alerts.html' %}
{% endblock %}
</div>


</div>
</div>
Expand Down