97 lines
		
	
	
		
			4.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
		
		
			
		
	
	
			97 lines
		
	
	
		
			4.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
|  | {% extends "mnfapp/base.html" %} | ||
|  | {% load static %} | ||
|  | {% block content %} | ||
|  |     <meta charset="UTF-8"> | ||
|  |     <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
|  |     <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
|  |     <title> Refer your Friends</title> | ||
|  |     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> | ||
|  | 
 | ||
|  |     <style> | ||
|  |         .sample-container{ | ||
|  |             width:60vw; | ||
|  |             margin: auto; | ||
|  |             margin-top: 10vh; | ||
|  |             border-radius: 10px; | ||
|  |             padding: 1em; | ||
|  |             display: grid; | ||
|  |             grid-template-columns: auto auto; | ||
|  |             box-shadow: 4px 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); | ||
|  |         } | ||
|  |         .sample-container input{ | ||
|  |             margin: auto; | ||
|  |             width: 25vw; | ||
|  |             margin-top: 5px; | ||
|  |             margin-bottom: 5px; | ||
|  |         } | ||
|  |         .sample-container button{ | ||
|  |             width: 10vw; | ||
|  |             margin: 0.4em; | ||
|  |             text-align: center; | ||
|  |             margin-top: 1em; | ||
|  |         } | ||
|  |         #h1{ | ||
|  |             text-align: center; | ||
|  |             /* color: linear-gradient(#ee364d , rgb(0, 89, 255)); */ | ||
|  |             background: -webkit-linear-gradient(#ee364d, rgb(56, 109, 206)); | ||
|  |             -webkit-background-clip: text; | ||
|  |             -webkit-text-fill-color: transparent; | ||
|  |         } | ||
|  |     </style> | ||
|  |     <div> | ||
|  |         <h1 style="text-align: center; margin-top: 1em;">Refer Your Friends</h1> | ||
|  |         <h3 id="h1"> | ||
|  |             Recommend three of your friends and get 1 month extra absolutely free! | ||
|  |         </h3> | ||
|  |         <div style="width: 100vw; text-align: center;"> | ||
|  |         <span> | ||
|  |             {%if message%} | ||
|  |             <h5 style="color: green;">{{message}}</h5> | ||
|  |             {%endif%} | ||
|  |         </span> | ||
|  |         </div> | ||
|  |         <div class="sample-container"> | ||
|  |             <form action="" method="POST" class="form-group"> | ||
|  |                 {% csrf_token %} | ||
|  |                 <div id='inp' style="display: grid; grid-template-columns: auto auto;"> | ||
|  |                     <input type="text" placeholder="Name" class="form-control border border-dark" name="name1"  required> | ||
|  |                     <input type="email" placeholder="Email" class="form-control border border-dark" name="email1" id="email1" required> | ||
|  |                     <input type="text" placeholder="Name" class="form-control border border-dark" name="name2" > | ||
|  |                     <input type="email" placeholder="Email" class="form-control border border-dark" name="email2" id="email2"> | ||
|  |                     <input type="text" placeholder="Name" class="form-control border border-dark" name="name3"> | ||
|  |                     <input type="email" placeholder="Email" class="form-control border border-dark" name="email3" id="email3"> | ||
|  |                 </div> | ||
|  |                 <h4 id="text" style="color: red;text-align:center;"></h4> | ||
|  |                 <div style="display: flex; width: 15vw; margin: auto;margin-left: 22.5vw; text-align: center;"> | ||
|  |                 <!-- <button onclick="addmore()" type="button" class="btn btn-success" id="add">add more</button> --> | ||
|  |                 <button type="submit" class="btn btn-primary" id="refer">Refer Nowqwsqwqew</button> | ||
|  |                 </div> | ||
|  |                  | ||
|  |             </form> | ||
|  |         </div> | ||
|  |     </div> | ||
|  | 
 | ||
|  |     <script> | ||
|  |         $('#refer').click(function(){ | ||
|  |             if($('#email1').val() == $('#email2').val() || $('#email2').val() == $('#email3').val() || $('#email1').val() == $('#email3').val()){ | ||
|  |                 document.getElementById('text').innerHTML = 'Email id should be different' | ||
|  |                 return false | ||
|  |             } | ||
|  |             if($('#email1').val() == '{{user.email}}' || $('#email3').val() == '{{user.email}}' || $('#email3').val() == '{{user.email}}'){ | ||
|  |                 document.getElementById('text').innerHTML = 'You cant put your registered email id. LOL' | ||
|  |                 return false | ||
|  |             } | ||
|  |         }) | ||
|  | 
 | ||
|  |          | ||
|  |     </script> | ||
|  |     <script> | ||
|  |         var x = 4 | ||
|  |         function addmore(){ | ||
|  |             document.getElementById('inp').innerHTML+='<input type="text" placeholder="Name" class="form-control border border-dark" name="name'+x+'" required>' | ||
|  |             document.getElementById('inp').innerHTML+='<input type="email" placeholder="Email" class="form-control border border-dark" name="email'+x+'" id="email3" required>' | ||
|  |             x=x+1 | ||
|  |         } | ||
|  |     </script> | ||
|  | {%endblock%} |