Sindbad~EG File Manager
from core import app
from flask import render_template_string
from flask import url_for,render_template,request
from datetime import datetime, date, time, timedelta
import datetime
import math,random,string
import time
from requests.utils import requote_uri
class Helper:
APIKey = "w347H52d96";
testmail = "sridharan.r@numerotec.com"
AppType = "DASHBOARD"
# AiosMembershipNumber = ['vrsi','mos','tnoa','ipgs']
# AadhaarNumber = ['tnoa']
# ColumnDescription = ['vrsi','mos','tnoa','ipgs','csos','apots']
membership_app_link = {"1":"https://membership.vrsi.in/","2":"https://membership.moseye.org/","3":"https://membership.tnoa.info/","4":"https://membership.ipgs.org.in/","6":"https://members.csos.co.in/"}
delegatte_app_link = {"1":"https://delegate.vrsi.in/2/vrsi22","7":"https://delegate.urbanedge.co.in/1/iages23","8":"https://selsi-reg.numerotech.com/3/selsi22","10":"https://kos-reg.numerotech.com/4/kos22"}
abstract_app_link = {"7","https://abs.iages2023.com/1/iages23","8","https://selsi-abs.numerotech.com/login/3/selsi22"}
profile_app_link = {"1":"http://profile.vrsi.in/","2":"http://profile.moseye.org/","3":"https://profile.tnoa.info/","6":"http://profile.csos.co.in/"}
def date_diff(d1, d2):
# fmt = '%H:%M'
d1 = date(d1,'%Y, %m, %d')
d2 = date(d2,'%Y, %m, %d')
diff = str(d1) - str(d2)
return diff
def random_otp():
digits = "123456789"
otp_random = ""
for i in range(4) :
random.seed(time.process_time())
otp_random += digits[math.floor(random.random() * 9)]
return otp_random
def getcurrenttimestamp():
ct = datetime.datetime.now()
ts = ct.timestamp()
return ts
def email_mask(email):
if email:
lo = email.find('@')
if lo>0:
mask_email = email[0]+"*****"+email[lo-1:]
return mask_email
return email
def mobile_mask(mobile):
if mobile:
lo = len(mobile)
if lo>0:
mask = mobile[:2]+"******"+mobile[lo-2:]
return mask
return mobile
def convert_html_for_payment_screen(payment_content,member):
temp = app.jinja_env.from_string("{{payment_content.payment_content|safe}}").render(payment_content=payment_content,member=member)
return render_template_string(temp,payment_content=payment_content,member=member)
# def convert_html_for_mail_screen(mail_content,userData,qul_data,exp_data,image,prosec_data,society):
# temp = app.jinja_env.from_string("{{mail_content|safe}}").render(mail_content=mail_content,userData=userData,qul_data=qul_data,exp_data=exp_data,image=image,prosec_data=prosec_data,society=society)
# return render_template_string(temp,mail_content=mail_content,userData=userData,qul_data=qul_data,exp_data=exp_data,image=image,prosec_data=prosec_data,society=society)
def convert_html_for_mail_screen(data):
temp = app.jinja_env.from_string("{{mail_content|safe}}").render(**data)
return render_template_string(temp,**data)
def merge_tags(text,values):
for k, v in values.items():
text = text.replace('*|'+k+'|*', v)
return text
def pagination_tool(total,page,limit):
numpages = math.ceil(total/limit)
return render_template('back_office/pagination.html',total=total,limit=limit,page=page,numpages=numpages)
def base_url():
base_url = request.host_url
if "https" in base_url :
pass
else :
base_url = base_url.replace("http" ,"https")
return base_url
def sendWhatsApp(mobile,wp_content):
wp_content = requote_uri(wp_content)
h_link = "http://wa.me/91"+mobile+"?text="+wp_content
return h_link
def list_diff(list1, list2):
# return list(set(list1).symmetric_difference(set(list2)))
return list(set(list1).difference(set(list2)))
# c = set(list1).union(set(list2)) # or c = set(list1) | set(list2)
# d = set(list1).intersection(set(list2)) # or d = set(list1) & set(list2)
# return list(c - d)
def id_generator(size=10, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
app.jinja_env.globals.update(Helper=Helper)
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists