Exemplo n.º 1
0
 def post(self, request):
     Firstname = request.POST.get('Firstname')
     Lastname = request.POST.get('Lastname')
     Dateofbirth = request.POST.get('Dateofbirth')
     print(Firstname)
     Gender = request.POST.get('Gender')
     print(Gender)
     print("######")
     Maritial = request.POST.get('Maritial')
     print(Maritial)
     Nationality = request.POST.get('Nationality')
     Email = request.POST.get('Email')
     request.session['agn_stdmail'] = Email
     Address = request.POST.get('Address')
     City = request.POST.get('City')
     State = request.POST.get('State')
     Country = request.POST.get('Country')
     Phonenumber = request.POST.get('Phonenumber')
     print(request.session['Email2'])
     agentid = request.session['agentid']
     agentmail = request.session['Email2']
     print("done")
     student = Student(Firstname=Firstname,
                       Phonenumber=Phonenumber,
                       Email=Email,
                       Password=None,
                       Confirmpassword=None)
     student.register()
     stdind = Stdind(Firstname=Firstname,
                     Lastname=Lastname,
                     Dateofbirth=Dateofbirth,
                     Gender=Gender,
                     Maritial=Maritial,
                     Nationality=Nationality,
                     Email=Email,
                     Address=Address,
                     City=City,
                     State=State,
                     Country=Country,
                     Phonenumber=Phonenumber,
                     Agentid=agentid,
                     Agentmail=agentmail)
     stdind.register()
     value = {
         'Firstname': Firstname,
         'Lastname': Lastname,
         'Dateofbirth': Dateofbirth,
         'Gender': Gender,
         'Maritial': Maritial,
         'Nationality': Nationality,
         'Email': Email,
         'Address': Address,
         'City': City,
         'State': State,
         'Country': Country,
         'Phonenumber': Phonenumber
     }
     data = {'value': value}
     return render(request, 'agent_portal/Personal.html', data)
Exemplo n.º 2
0
    def get(self, request):
        data = {}
        print(request.session['Email1'])
        student = Student.get_student_by_email(request.session['Email1'])
        qwe = "rty"
        print(student)
        print(qwe)
        if (student):
            stdind = Stdind.get_stdind_by_email(student.Email)
        print(stdind)
        if (stdind):
            value = {
                'Firstname': stdind.Firstname,
                'Lastname': stdind.Lastname,
                'Dateofbirth': stdind.Dateofbirth,
                'Gender': stdind.Gender,
                'Maritial': stdind.Maritial,
                'Nationality': stdind.Nationality,
                'Email': stdind.Email,
                'Address': stdind.Address,
                'City': stdind.City,
                'State': stdind.State,
                'Country': stdind.Country,
                'Phonenumber': stdind.Phonenumber
            }
            data = {'value': value}

        return render(request, 'student_portal/Personal_details.html', data)
Exemplo n.º 3
0
 def get(self, request):
     data = {}
     student = Student.get_student_by_email(request.session['Email1'])
     if (student):
         stdacd = Stdacd.get_stdacd_by_email(student.Email)
     if (stdacd):
         value = {
             'Sscqual': stdacd.Sscqual,
             'Sscname': stdacd.Sscname,
             'Sscdate': stdacd.Sscdate,
             'Sscmarks': stdacd.Sscmarks,
             'Sscgrading': stdacd.Sscgrading,
             'SscDoc': stdacd.SscDoc,
             'Intqual': stdacd.Intqual,
             'Intname': stdacd.Intname,
             'Intdate': stdacd.Intdate,
             'Intmarks': stdacd.Intmarks,
             'Intgrading': stdacd.Intgrading,
             'IntDoc': stdacd.IntDoc,
             'Uniqual': stdacd.Uniqual,
             'Uniname': stdacd.Uniname,
             'Unicname': stdacd.Unicname,
             'Unidate': stdacd.Unidate,
             'Unimarks': stdacd.Unimarks,
             'Unigrading': stdacd.Unigrading,
             'UniDoc': stdacd.UniDoc
         }
         data = {'value': value}
     return render(request, 'student_portal/Academic _Details.html', data)
Exemplo n.º 4
0
    def post(self,request):

        temp_pass=request.POST.get('temp_pass')
        Password=request.POST.get('Password')
        Confirmpassword=request.POST.get('Confirmpassword')
        student=Student.get_student_by_email(Email)
        #student.Password=None
        print(temp_pass)
        print(a)
        print(Password)

        print(Confirmpassword)
        if(temp_pass==a):
          
            print("nanda")
            student.Password=make_password(Password)
            student.Confirmpassword=make_password(Confirmpassword)
            #student.temp_pass=None
            student.register()
            print(student.Password)
            request.session.clear()
            return render(request,'signup/new_studentlogin.html')
        else:
            error_message2="Please Enter Valid Temporary Password"
            return render(request,'signup_forms/password_reset_confirmstd.html',{'error2':error_message2})
Exemplo n.º 5
0
    def get(self, request):

        #print(request.user.first_name)
        #print(request.user.username)
        #print(request.user.email)
        #print(request.user.phonenumber)
        try:
            #print(request.session['Email1'])

            student = Student.objects.get(Email=request.session['Email1'])

        except:
            Firstname = request.user.first_name
            Phonenumber = None
            Email = request.user.email
            Password = None
            Confirmpassword = None

            student = Student(Firstname=Firstname,
                              Phonenumber=Phonenumber,
                              Email=Email,
                              Password=Password,
                              Confirmpassword=Confirmpassword)
            if (Student.objects.get(Email=Email) == None):
                student.register()

            request.session['Email1'] = Email
            request.session['Firstname1'] = Firstname
            print(request.session['Email1'])

            users = User.objects.all().filter(email=request.session['Email1'])

            if (users):
                for user in range(1, len(users)):
                    users[user].delete()

            student = Student.objects.get(Email=Email)

        value = {'Name': student.Firstname}
        data = {}
        data['value'] = value

        return render(request, 'student_portal/index.html', data)
Exemplo n.º 6
0
 def post(self,request):
     global Email
     Email=request.POST.get('Email')
     request.session['Email1']=Email
     print(request.session['Email1'])
     a1=Student.IsExists(Email)
     if(a1):
         if(temp_pass.do(Email)):
             error_message="Email has been sent successfully pls check your mail"
             return render(request,'signup_forms/password_resetstd.html',{'error':error_message})
     else:
         error_message1="Please Enter Valid Email"
         return render(request,'signup_forms/password_resetstd.html',{'error1':error_message1})
Exemplo n.º 7
0
    def get(self, request):
        data = {}
        student = Student.get_student_by_email(request.session['Email1'])
        if (student):
            stdpro = Stdpro.get_stdpro_by_email(student.Email)
            stdpro1 = Stdpro1.get_stdpro1_by_email(student.Email)
        if (stdpro):
            testeng = []
            yeareng = []
            overallscoreeng = []
            uploadeng = []
            for i in range(0, len(stdpro)):
                testeng.append(stdpro[i].Testeng)
                yeareng.append(stdpro[i].Yeareng)
                overallscoreeng.append(stdpro[i].Overallscoreeng)
                uploadeng.append(stdpro[i].Urleng)
            list = []
            for i in range(0, len(stdpro)):
                list.append({
                    'Testeng': testeng[i],
                    'Yeareng': yeareng[i],
                    'Overallscoreeng': overallscoreeng[i],
                    'Uploadeng': uploadeng[i]
                })

            data['stdpro'] = list
            print(list)
        if (stdpro1):
            testad = []
            yearad = []
            overallscoread = []
            uploadad = []
            for i in range(0, len(stdpro1)):
                testad.append(stdpro1[i].Testad)
                yearad.append(stdpro1[i].Yearad)
                overallscoread.append(stdpro1[i].Overallscoread)
                uploadad.append(stdpro1[i].Urlad)
            list1 = []
            for i in range(0, len(stdpro1)):
                list1.append({
                    'Testad': testad[i],
                    'Yearad': yearad[i],
                    'Overallscoread': overallscoread[i],
                    'Uploadad': uploadad[i]
                })
            data['stdpro1'] = list1
            print(list1)
            print(data)

        return render(request,
                      'student_portal/professional_qualification.html', data)
Exemplo n.º 8
0
    def post(self, request):
        cap_token = request.POST.get('g-recaptcha-response')
        cap_url = "https://www.google.com/recaptcha/api/siteverify"
        cap_secret = "6Ldz2mUaAAAAAEdaQk09xE1rimhHzmwCplGIXeqo"
        cap_data = {'secret': cap_secret, 'response': cap_token}
        cap_server_response = requests.post(url=cap_url, data=cap_data)
        cap_json = json.loads(cap_server_response.text)
        #if(cap_json['success']==False):
        #    error_message='Captcha is invalid!! Try Again Pls!'
        #    return render(request,'signup/New_studentlogin.html',{'error':error_message})

        print("vastunda")
        Email = request.POST.get('Email')
        Password = request.POST.get('Password')
        student = Student.get_student_by_email(Email)
        error_message = None
        if student:
            flag = check_password(Password, student.Password)
            print("hai")
            if flag:
                request.session['Student'] = student.id
                request.session['Firstname1'] = student.Firstname
                request.session['Email1'] = student.Email
                value = {'Name': request.session['Firstname1']}
                data = {'value': value}
                try:
                    stdacd = Stdacd.objects.all().get(Email=student.Email)
                    stdind = Stdind.objects.all().get(Email=student.Email)
                    stdcour = Stdcour.objects.all().get(Email=student.Email)
                    return render(request, 'student_portal/index.html', data)
                except:
                    return redirect('stdind')

                #return render (request,)
                '''
                if studentlogin.return_url():
                    return HttpResponseRedirect(return_url)
                else:
                    studentlogin.return_url=None
                    return redirect('homepage')
                    '''
            else:
                error_message = 'Password is invalid!!!'
        else:
            print(Email)
            error_message = 'Email is invalid!!!'
        return render(request, 'signup/New_studentlogin.html',
                      {'error': error_message})
Exemplo n.º 9
0
 def get(self, request):
     data = {}
     student = Student.get_student_by_email(request.session['Email1'])
     if (student):
         stdcour = Stdcour.get_stdcour_by_email(student.Email)
     if (stdcour):
         value = {
             'Applyingfor': stdcour.Applyingfor,
             'Date': stdcour.Date,
             'pcoun1': stdcour.pcoun1,
             'pcoun2': stdcour.pcoun2,
             'pcoun3': stdcour.pcoun3,
             'pcour4': stdcour.pcour4,
             'pcour5': stdcour.pcour5,
             'pcour6': stdcour.pcour6
         }
         data = {'value': value}
     return render(request, 'student_portal/Course_application.html', data)
Exemplo n.º 10
0
    def post(self, request):
        data = {}
        student1 = Student.get_student_by_email(request.session['Email1'])
        Phonenumber = request.POST.get('Phonenumber')
        if (Phonenumber != None):
            student1.Phonenumber = Phonenumber
            print(student1.Phonenumber)
            student1.register()
        a = student1.Password
        Password = request.POST.get('Password')
        Confirmpassword = request.POST.get('Confirmpassword')
        Confirmpassword1 = request.POST.get('Confirmpassword1')
        error_message = None
        flag = check_password(Password, a)
        if (Phonenumber):
            data = {'Phonenumber': student1.Phonenumber}
            return render(request, 'student_portal/Password_security.html',
                          data)
        if (flag):
            if (Confirmpassword == Confirmpassword1):

                student1.Password = make_password(Confirmpassword)
                student1.Confirmpassword = make_password(Confirmpassword1)
                student1.register()
                data = {'Phonenumber': student1.Phonenumber}
                return render(request, 'student_portal/Password_security.html',
                              data)
            else:

                error_message = 'Password and current password doesnt match !!!'
                data = {'Phonenumber': student1.Phonenumber}
                data['error'] = error_message

                return render(request, 'student_portal/Password_security.html',
                              data)
        else:
            error_message = 'Current Password is invalid!!!'
            data = {'Phonenumber': student1.Phonenumber}
            data['error'] = error_message
            return render(request, 'student_portal/Password_security.html',
                          data)
Exemplo n.º 11
0
    def post(self, request):
        postData = request.POST
        Firstname = postData.get('Firstname')
        Email = postData.get('Email')
        Phonenumber = postData.get('Phonenumber')
        Password = postData.get('Password')
        Confirmpassword = postData.get('Confirmpassword')
        print(Firstname)

        error_message = None
        studentsignup1 = Student.IsExists(Email)
        value = {
            'Firstname': Firstname,
            'Email': Email,
            'Password': Password,
            'Phonenumber': Phonenumber,
            'Confirmpassword': Confirmpassword
        }

        print(Email)
        if (studentsignup1):
            error_message = "Email already Exists !!"
            data = {'value': value, 'error': error_message}
            return render(request, 'signup/new_student_signup.html', data)
        if (Password != Confirmpassword):
            error_message = "Password is not valid"
            data = {'value': value, 'error': error_message}
            return render(request, 'signup/new_student_signup.html', data)

        print(Password)

        studentsignup = Student(Firstname=Firstname,
                                Email=Email,
                                Phonenumber=Phonenumber,
                                Password=Password,
                                Confirmpassword=Confirmpassword)
        studentsignup.Password = make_password(studentsignup.Password)
        studentsignup.Confirmpassword = make_password(
            studentsignup.Confirmpassword)
        studentsignup.register()
        print("aaaaaa")
        return redirect('studentloginpage')
Exemplo n.º 12
0
    def post(self, request):
        Email = request.session['Email1']
        Applyingfor = request.POST.get('Applyingfor')
        Date = request.POST.get('Date')
        pcoun1 = request.POST.get('pcoun1')
        pcoun2 = request.POST.get('pcoun2')
        pcoun3 = request.POST.get('pcoun3')
        pcour4 = request.POST.get('pcour4')
        pcour5 = request.POST.get('pcour5')
        pcour6 = request.POST.get('pcour6')

        print(pcoun1)

        stdcour = Stdcour(Applyingfor=Applyingfor,
                          Date=Date,
                          pcoun1=pcoun1,
                          pcoun2=pcoun2,
                          pcoun3=pcoun3,
                          pcour4=pcour4,
                          pcour5=pcour5,
                          pcour6=pcour6,
                          Email=Email)
        student = Student.get_student_by_email(Email)
        stdcour1 = Stdcour.get_stdcour_by_email(student.Email)
        if (stdcour1):
            stdcour1.delete()
        stdcour.register()
        value = {
            'Applyingfor': Applyingfor,
            'Date': Date,
            'pcoun1': pcoun1,
            'pcoun2': pcoun2,
            'pcoun3': pcoun3,
            'pcour4': pcour4,
            'pcour5': pcour5,
            'pcour6': pcour6
        }
        data = {'value': value}
        return render(request, 'student_portal/Course_application.html', data)
Exemplo n.º 13
0
 def get(self, request):
     student1 = Student.get_student_by_email(request.session['Email1'])
     print(student1.Phonenumber)
     data = {'Phonenumber': student1.Phonenumber}
     return render(request, 'student_portal/Password_security.html', data)
Exemplo n.º 14
0
 def post(self, request):
     print("hiii")
     Firstname = request.POST.get('Firstname')
     Lastname = request.POST.get('Lastname')
     Dateofbirth = request.POST.get('Dateofbirth')
     print(Firstname)
     Gender = request.POST.get('Gender')
     print(Gender)
     print("######")
     Maritial = request.POST.get('Maritial')
     print(Maritial)
     Nationality = request.POST.get('Nationality')
     Email = request.POST.get('Email')
     Address = request.POST.get('Address')
     City = request.POST.get('City')
     State = request.POST.get('State')
     Country = request.POST.get('Country')
     Phonenumber = request.POST.get('Phonenumber')
     print(Email)
     print(request.session['Email1'])
     print("done")
     if (Email != request.session['Email1']):
         print("hii")
         error_message = "ohh your email doesn't matched with login mail"
         return render(request, 'student_portal/Personal_details.html',
                       {'error': error_message})
     else:
         student = Student.get_student_by_email(Email)
         stdind1 = Stdind.get_stdind_by_email(student.Email)
         #if(City==None or Country == None):
         #   City=Stdind1.City
         #   Country=Stdind1.Country
         stdind = Stdind(Firstname=Firstname,
                         Lastname=Lastname,
                         Dateofbirth=Dateofbirth,
                         Gender=Gender,
                         Maritial=Maritial,
                         Nationality=Nationality,
                         Email=Email,
                         Address=Address,
                         City=City,
                         State=State,
                         Country=Country,
                         Phonenumber=Phonenumber)
         if (stdind1):
             stdind1.delete()
         stdind.register()
         value = {
             'Firstname': Firstname,
             'Lastname': Lastname,
             'Dateofbirth': Dateofbirth,
             'Gender': Gender,
             'Maritial': Maritial,
             'Nationality': Nationality,
             'Email': Email,
             'Address': Address,
             'City': City,
             'State': State,
             'Country': Country,
             'Phonenumber': Phonenumber
         }
         data = {'value': value}
         return render(request, 'student_portal/Personal_details.html',
                       data)
Exemplo n.º 15
0
    def post(self, request):
        print("in post man in stddetail")
        Email = request.session['Email1']
        Sscqual = request.POST.get('Sscqual')
        print("123456")
        print(Sscqual)
        Sscname = request.POST.get('Sscname')
        Sscdate = request.POST.get('Sscdate')
        Sscmarks = request.POST.get('Sscmarks')
        Sscgrading = request.POST.get('Sscgrading')
        SscDoc = request.FILES['SscDoc']

        fs = FileSystemStorage()
        name = fs.save(SscDoc.name, SscDoc)
        url = fs.url(name)
        print(url)
        Intqual = request.POST.get('Intqual')
        Intname = request.POST.get('Intname')
        Intdate = request.POST.get('Intdate')
        Intmarks = request.POST.get('Intmarks')
        Intgrading = request.POST.get('Intgrading')
        IntDoc = request.FILES['IntDoc']

        name1 = fs.save(IntDoc.name, IntDoc)
        url1 = fs.url(name1)
        Uniqual = request.POST.get('Uniqual')
        Uniname = request.POST.get('Uniname')
        Unicname = request.POST.get('Unicname')
        Unidate = request.POST.get('Unidate')
        Unimarks = request.POST.get('Unimarks')
        Unigrading = request.POST.get('Unigrading')
        UniDoc = request.FILES['UniDoc']

        name2 = fs.save(UniDoc.name, UniDoc)
        url2 = fs.url(name2)
        stdacd = Stdacd(Email=Email,
                        Sscqual=Sscqual,
                        Sscname=Sscname,
                        Sscdate=Sscdate,
                        Sscmarks=Sscmarks,
                        Sscgrading=Sscgrading,
                        SscDoc=SscDoc,
                        Intqual=Intqual,
                        Intname=Intname,
                        Intdate=Intdate,
                        Intmarks=Intmarks,
                        Intgrading=Intgrading,
                        IntDoc=IntDoc,
                        Uniqual=Uniqual,
                        Uniname=Uniname,
                        Unicname=Unicname,
                        Unidate=Unidate,
                        Unimarks=Unimarks,
                        Unigrading=Unigrading,
                        UniDoc=UniDoc)

        student = Student.get_student_by_email(Email)
        stdacd1 = Stdacd.get_stdacd_by_email(student.Email)
        if (stdacd1):
            stdacd1.delete()
        stdacd.register()
        value = {
            'Sscqual': Sscqual,
            'Sscname': Sscname,
            'Sscdate': Sscdate,
            'Sscmarks': Sscmarks,
            'Sscgrading': Sscgrading,
            'SscDoc': url,
            'Intqual': Intqual,
            'Intname': Intname,
            'Intdate': Intdate,
            'Intmarks': Intmarks,
            'Intgrading': Intgrading,
            'IntDoc': url1,
            'Uniqual': Uniqual,
            'Uniname': Uniname,
            'Unicname': Unicname,
            'Unidate': Unidate,
            'Unimarks': Unimarks,
            'Unigrading': Unigrading,
            'UniDoc': url2
        }
        data = {'value': value}
        return render(request, 'student_portal/Academic _Details.html', data)