Sindbad~EG File Manager

Current Path : /home/numerotech/scans.numerotech.com/scan_v1/core/model/__pycache__/
Upload File :
Current File : //home/numerotech/scans.numerotech.com/scan_v1/core/model/__pycache__/RegdeskModel.cpython-310.pyc

o

˭�d�'�@s~ddlmZddlmZmZmZddlmZmZmZm	Z	m
Z
ddlmZm
Z
ddlmZeejdddd	�ZGd
d�d�ZdS)
�)�session)�request�	Blueprint�jsonify)�
create_engine�select�MetaData�Table�text)�and_�or_)�app�DATABASE_URITi)�
pool_pre_ping�pool_recyclec@sdeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�RegdeskModelc
Cszz%t�|_td|jdtd�|_td|jdtd�|_td|jdtd�|_WdSty<}zt|�WYd}~dSd}~ww)N�statesT)�autoload�
autoload_with�
conference�	delegates)	r�metar	�enginerrr�	Exception�print)�self�e�r�(D:\conference\core\model\RegdeskModel.py�__init__s��zRegdeskModel.__init__cCs.t��}td�}|�|�}|��|r|SdS)Nz�select * from delegates_iages23 t inner join delegates d on d.delegate_no = t.delegate_no where d.conference_id = 1 and t.signed_on is not null and d.is_present is null; )r�connectr
�execute�close)r�conn�stmt�resultsrrr�generateDelegatePresents
z$RegdeskModel.generateDelegatePresentcCsTt��}tdt|�d�}|�|�}|��|r dd�|D�nd}|r(|dSdS)Nz�SELECT conf_id,conf_name,conf_title,conf_key,username,regdesk_pin,conf_start_time,conf_end_time,del_table_name,is_regdesk_open,signup_table,signup_for_alldays FROM conference where regdesk_pin = z8 and is_regdesk_open > 0  order by conf_id desc limit 1;cS�g|]}t|��qSr��dict��.0�rrrr�
<listcomp>&�z6RegdeskModel.getConfDataForRegdesk.<locals>.<listcomp>r�rr r
�strr!r")r�regdesk_pinr#r$r%rrr�getConfDataForRegdesk s
z"RegdeskModel.getConfDataForRegdeskc
Cs�t��}|dkr'td|dd|d|ddt|�d�}td	�ntd|dd|d
dt|�d�}	td�}|�|�|�|�}	|��|	rYdd
�|	D�nd}	|	r_|	SdS)Nrz�select  d.delegate_id, d.delegate_no,d.role,d.full_name,d.email,d.mobile,d.city,d.state,d.membership_no,d.mc_number, d.counter,d.batch,s.signed_by,s.comments,min(s.signed_on) as signed_on, min(s.updated_at) as updated_at,d.conf_id from  z  d z left join zR s on s.delegate_no = d.delegate_no and d.conf_id = s.conf_id and s.signin_date= '�' z where d.conf_id = z� and d.delegate_no > 0 and d.delegate_no is not null and d.role not in ('VOLUNTEER','TRADE','EXHIBIOR','CREW','SUPPORT - IT','SUPPORT - AV') group by d.delegate_no order by d.delegate_no  asc;zif blockz> s on s.delegate_no = d.delegate_no and d.conf_id = s.conf_id z SET sql_mode ='' ;cSr'rr(r*rrrr-Ar.z-RegdeskModel.delegateData.<locals>.<listcomp>)rr r
r0rr!r")
r�conf_id�del_table_name�signup_for_alldays�signup_table�	curr_dater#r$�stmt_2r%rrr�delegateData,sT��������
������

zRegdeskModel.delegateDatac
Cs�t��}z;|rtd|d|dtd�}ntd|d�}t|�|�|�}|r2dd�|D�nd}|��|r=|WSWdStyU}z
t|�WYd}~Sd}~ww)Nzselect * from z where delegate_no not in (z) and device_id !='z' and sync_at is not null ; z where sync_at is not null ; cSr'rr(r*rrrr-fr.z5RegdeskModel.getRegdeskSignedData.<locals>.<listcomp>)	rr r
�	device_idrr!r"rr0)rr5�delegate_no_strr#r$r%Zsigned_datarrrr�getRegdeskSignedData\s "
��z!RegdeskModel.getRegdeskSignedDatac
Cs�g}
z]t��}|��}|�d|||||||||	g	�	dd�|jD�}
g}	|��}|dur/n
tt|
|��}|�|�q&|
�t	|��|�
�durJn|jdurPnq|��|��W|��|
S|��w)NZupdate_android_sync_data�cS�g|]}|d�qS�rr�r+�crrrr-zr.z8RegdeskModel.updateAndGetSignedCount.<locals>.<listcomp>�
r�raw_connection�cursor�callproc�description�fetchoner)�zip�append�list�nextsetr"�commit)rr4�delegate_nor5�curr_dt�	signed_by�commentsr8r6r7�sets�
connectionrE�names�set_�row_raw�rowrrr�updateAndGetSignedCountrs4
�
�

�z$RegdeskModel.updateAndGetSignedCountc
C��g}zYt��}|��}|�d|||||g�	dd�|jD�}	g}
	|��}|dur+n
tt|	|��}|
�|�q"|�t	|
��|�
�durFn|jdurLnq|��|��W|��|S|��w)NZ"usp_android_sync_with_signed_countr>cSr?r@rrArrrr-�r.z;RegdeskModel.syncAllDataWithSignedCount.<locals>.<listcomp>rC�
rr4r5�date_1r6r7rRrSrErTrUrVrWrrr�syncAllDataWithSignedCount�s4
�
�

�z'RegdeskModel.syncAllDataWithSignedCountcCsTt��}tdt|�d�}|�|�}|rdd�|D�nd}|��|r(|dSdS)Nz�select conf_id,conf_name,date(conf_start_time) as conf_start_time , date(conf_end_time) as conf_end_time from conference where conf_id =z ; cSr'rr(r*rrrr-�r.z-RegdeskModel.getConfDates.<locals>.<listcomp>rr/)rr4r#r$r%�resultrrr�getConfDates�s
zRegdeskModel.getConfDatesc
Cs�t��}d}|dkr
d}n|dkr|d}n|d|d}d|dt|�d	}||}t|�}t|�|�|�}	|��|	rHd
d�|	D�nd}	|	rN|	SdS)N� zAll Dayz
Not Collectedz  and signed_on is  null z3  and signed_on is not null and date(signed_on) = 'r3z�select delegate_id,delegate_no,role,full_name,email,mobile,city,state,membership_no,mc_number,counter,batch,signed_by,comments,signed_on,updated_at,conf_id from z where conf_id = z� and delegate_no > 0 and delegate_no is not null and role not in ('VOLUNTEER','TRADE','EXHIBIOR','CREW','SUPPORT - IT','SUPPORT - AV') cSr'rr(r*rrrr-�r.z6RegdeskModel.delegateDatByDatewise.<locals>.<listcomp>)rr r0r
rr!r")
rr4r5r[r#Z	where_conr$r9�stmt_3r%rrr�delegateDatByDatewise�s"

z"RegdeskModel.delegateDatByDatewisec
CrY)NZ$usp_android_get_overall_signed_countr>cSr?r@rrArrrr-�r.z8RegdeskModel.getOverAllcountRolewise.<locals>.<listcomp>rCrZrrr�getOverAllcountRolewise�s4
�
�

�z$RegdeskModel.getOverAllcountRolewisecCs\t��}td|dt|�d�}|�|�}|��|r$dd�|D�nd}|r,|dSdS)Nz#SELECT * FROM users where email = 'z' and password  = 'z#' and email like '%numerotec.com%';cSr'rr(r*rrrr-	r.z7RegdeskModel.GetUserForConfAppLogin.<locals>.<listcomp>rr/)r�email�passwordr#r$r%rrr�GetUserForConfAppLogins
z#RegdeskModel.GetUserForConfAppLoginN)�__name__�
__module__�__qualname__rr&r2r:r=rXr\r^rarbrerrrrr
s
0$%$rN)�flaskrrrr�
sqlalchemyrrrr	r
Zsqlalchemy.sqlrr�corer
�configrrrrrr�<module>s

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists