\chapter{Badging Dashboard}

There are several badging options available to staff all found on the Badging Dashboard. In addition to name badges, this is also where the Envelope Labels are located. Note that this section pertains to the Admin section. There is another section for Onsite Staff which uses separate files including separate controllers. See below for details.



View: admin/badging/dashboard 

Route: admin.badging.dashboard

\begin{enumerate}
    \item Print Multiple Badges
    \begin{itemize}
        \item Print Range
        \item Print All Badges
    \end{itemize}
    \item Correct a Badge (Admin Section)
    \begin{itemize}
        \item Print All Badges
        \item Print Single Badge
    \end{itemize}
    \item Correct a Badge (For Onsite Staff)
    \begin{itemize}
        \item Print All Badges
        \item Print Single Badge
    \end{itemize}
    \item Envelope Labels 
    \begin{itemize}
        \item Registration Envelope Labels 
        \item Registration Envelope Labels - Registration without meals
        \item Ticketing Envelope Labels
    \end{itemize}
\end{enumerate}



\section{Print Multiple Badges}

This section includes two options. The most common use will be to print the range of badges. A convention will likely print all badges only once. 

Prints on PC/Nametag N6LPWB 4" x 3". Note that Avery has 4" x 3" labels but not with the same layout as the PC/Nametag N6LPWB label.

\subsection{Print Range}
This option prints all the badges including and between two order IDs.

\begin{lstlisting}[language=PHP, numbers=none, basicstyle=\small, caption={Relevant Files for Print Range}, frame=single, framesep=10pt]
Get URL: admin/tickets/report_badges?start_order_id=ORDER_ID&end_order_id=ORDER_ID
Get route: admin.tickets.report_badges
Controller: Admin\TicketController@reportBadges
Labels: $pdf = new PDF_Label('N6LPWB');
\end{lstlisting}



\subsection{Print All Badges}
As the title implies, this will print all badges for the current season. 

Prints on PC/Nametag N6LPWB 4" x 3". Note that Avery has 4" x 3" labels but not with the same layout as the PC/Nametag N6LPWB label.

\begin{lstlisting}[language=PHP, numbers=none, basicstyle=\small, caption={Print all badges}, frame=single, framesep=10pt]
Get URL: admin/fpdf
Controller: Admin\PdfController@pdf
Labels: $pdf = new PDF_Label('N6LPWB');
\end{lstlisting}
    

\section{Correct a Badge (Admin Section)}

Search form for finding records by 
\begin{itemize}
    \item Email (text input) OR 
    \item Customer ID (text input) OR
    \item Customer Name (dropdown list)
\end{itemize}

This top level form returns a user who purchased one or many registrations. The following screens will allow printing of all badges belonging to the order or the ability to view, edit, if necessary,  and print each individual badge.

The user dropdown list includes only users who have orders after the current Reg Startdate

\begin{lstlisting}[language=PHP, numbers=none, basicstyle=\small, caption={Query for Correct a Badge User dropdown list}, frame=single, framesep=10pt]
    $users = User::whereHas('orders', function($q){
        $q->where('order_status_id', 1)
        ->where('orders.created_at', '>=', Setting::where('key','REG_STARTDATE')
        ->pluck('value'));
    })->orderBy('firstname')->get()->pluck('full_name', 'id');
\end{lstlisting}
 



Returned view: 

\subsection{Print all Badges}

Click the button which makes a get request.

This will print all of the badges in this search result. 

Prints on PC/Nametag N6LPWB 4" x 3". Note that Avery has 4" x 3" labels but not with the same layout as the PC/Nametag N6LPWB label.

\begin{lstlisting}[language=PHP, numbers=none, basicstyle=\small, caption={Relevant Files for Correct a Badge}, frame=single, framesep=10pt]
Get URL: admin/badging/users/orders
Get route: admin.badging.users.orders.pdf
Controller: Admin\BadgingController@usersOrdersPdf
Labels: $pdf = new PDF_Label('N6LPWB');
\end{lstlisting}



% \begin{lstlisting}[language=PHP, numbers=none, basicstyle=\small, caption={Relevant files for Correct a badge - Print all Badges}, frame=single, framesep=10pt]
% Get URL: /admin/badging/users/orders/pdf?user=USER_ID
% Get route: admin.badging.users.orders.pdf
% Controller: Admin\BadgingController@usersOrdersPdf
% Label: $pdf = new PDF_Label('N6LPWB');
% \end{lstlisting}


\subsection{Print Single Badge}
Click the Select button to print a single badge for that person.

The resulting page will list all of the attendees associated to the order. 

Next to each name is a SELECT button which loads the badge details from attendees\_orders into the form on the card on the right side.

This edit form allows changes to be made to the badge. Clicking Save writes the changes to the database.

Clicking the PRINT THIS BADGE, invokes a get request to print the single badge on xxx paper size.

\begin{lstlisting}[language=PHP, numbers=none, basicstyle=\small, caption={Relevant files for Correct a badge - Print single badge}, frame=single, framesep=10pt]
Get Route: admin/badging/users/{attendees_order}/pdf
Controller: Admin\BadgingController@usersOrders
Route Path: admin.badging.users.orders
\end{lstlisting}

\section{Correct a Badge (For Onsite Staff)}

Search form for finding records by 
\begin{itemize}
    \item Email (text input) OR 
    \item Customer ID (text input) OR
    \item Customer Name (dropdown list)
\end{itemize}

This top level form returns a user who purchased one or many registrations. The following screens will allow printing of all badges belonging to the order or the ability to view, edit, if necessary,  and print each individual badge.

Oniste Dashboard

\begin{lstlisting}[language=PHP, numbers=none, basicstyle=\small, caption={Onsite Dashboard}, frame=single, framesep=10pt]
Get URL: onsite/dashboard
Get route: onsite.dashboard
Controller: Onsite\OnsiteController@dashboard
\end{lstlisting}

The user dropdown list includes only users who have orders after the current Reg Startdate

\begin{lstlisting}[language=PHP, numbers=none, basicstyle=\small, caption={Query for Correct a Badge User dropdown list}, frame=single, framesep=10pt]
    $users = User::whereHas('orders', function($q){
        $q->where('order_status_id', 1)
        ->where('orders.created_at', '>=', Setting::where('key','REG_STARTDATE')
        ->pluck('value'));
    })->orderBy('firstname')->get()->pluck('full_name', 'id');
\end{lstlisting}






Returned view: 

\subsection{Print all Badges}

Click the button which makes a get request.

This will print all of the badges in this search result. 

Prints on PC/Nametag N6LPWB 4" x 3". Note that Avery has 4" x 3" labels but not with the same layout as the PC/Nametag N6LPWB label.

\begin{lstlisting}[language=PHP, numbers=none, basicstyle=\small, caption={Relevant Files for Correct a Badge}, frame=single, framesep=10pt]
Get URL: admin/badging/users/orders
Get route: admin.badging.users.orders.pdf
Controller: Admin\BadgingController@usersOrdersPdf
Labels: $pdf = new PDF_Label('N6LPWB');
\end{lstlisting}



% \begin{lstlisting}[language=PHP, numbers=none, basicstyle=\small, caption={Relevant files for Correct a badge - Print all Badges}, frame=single, framesep=10pt]
% Get URL: /admin/badging/users/orders/pdf?user=USER_ID
% Get route: admin.badging.users.orders.pdf
% Controller: Admin\BadgingController@usersOrdersPdf
% Label: $pdf = new PDF_Label('N6LPWB');
% \end{lstlisting}


\subsection{Print Single Badge}
Click the Select button to print a single badge for that person.

The resulting page will list all of the attendees associated to the order. 

Next to each name is a SELECT button which loads the badge details from attendees\_orders into the form on the card on the right side.

This edit form allows changes to be made to the badge. Clicking Save writes the changes to the database.

Clicking the PRINT THIS BADGE, invokes a get request to print the single badge on xxx paper size.

\begin{lstlisting}[language=PHP, numbers=none, basicstyle=\small, caption={Relevant files for Correct a badge - Print single badge}, frame=single, framesep=10pt]
Get Route: admin/badging/users/{attendees_order}/pdf
Controller: Admin\BadgingController@usersOrders
Route Path: admin.badging.users.orders
\end{lstlisting}

\section{Envelope Labels}

\subsection{Registration Envelope Labels}
Prints labels on full sheets (Avery 5163, 2x10). 

\begin{lstlisting}[language=PHP, numbers=none, basicstyle=\small, caption={Relevant files for Registration Envelope Labels}, frame=single, framesep=10pt]
Get URL: admin/badging/envelope/pre-registration
Get route: admin.badging.envelope.pre-registration
Controller: Admin\BadgingEnvelopeController@preregistration
Label: $pdf = new PDF_Label('5163');
\end{lstlisting}


\subsection{Registration Envelope Labels - Registration without meals}
Prints labels on full sheets (Avery 5163, 2x10). 

\begin{lstlisting}[language=PHP, numbers=none, basicstyle=\small, caption={Relevant files for Registration Envelope Labels - Registration without meals}, frame=single, framesep=10pt]
Get URL: admin/badging/envelope/pre-registration-only
Get route: admin.badging.envelope.pre-registration-only
Controller: Admin\BadgingEnvelopeController@preregistration_only
Label: $pdf = new PDF_Label('5163');
\end{lstlisting}

\subsection{Ticket Envelope Labels}
Prints labels on full sheets (Avery 5163, 2x10). 

\begin{lstlisting}[language=PHP, numbers=none, basicstyle=\small, caption={Relevant files for Ticket Envelope Labels}, frame=single, framesep=10pt]
Get URL: admin/badging/envelope/ticket
Get route: admin.badging.envelope.ticket
Controller: Admin\BadgingEnvelopeController@ticket
Label: $pdf = new PDF_Label('5163');
\end{lstlisting}