% Template for 36 entries
% Replacements: Look for \textcolor{red}{} and DATABLOCK
\documentclass[11pt,fleqn,oneside,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{color}
\usepackage{ifthen}
\usepackage[ngerman]{babel}
\usepackage{textcomp}
\usepackage{fancyhdr}
\pagestyle{fancy}

% page layout
\setlength{\paperwidth}{210mm}
\setlength{\paperheight}{297mm}
\setlength{\voffset}{0mm}
\setlength{\hoffset}{0mm}
\setlength{\oddsidemargin}{0mm}
\setlength{\evensidemargin}{0mm}
\setlength{\marginparsep}{1.5mm}
\setlength{\marginparwidth}{60mm}
\setlength{\marginparpush}{1mm}
\setlength{\parindent}{0cm} %% avoid indent on new paragraph
\setlength{\oddsidemargin}{-17.9mm}
\setlength{\headsep}{3mm}
\setlength{\headheight}{8mm}
\setlength{\topskip}{0mm}
\setlength{\topmargin}{-18mm}
\setlength{\footskip}{-1mm}
\setlength{\headwidth}{189mm}
\setlength{\textwidth}{189mm}
\setlength{\textheight}{261.5mm}
\renewcommand{\baselinestretch}{1}

% rulewidth 
\renewcommand{\headrulewidth}{0.25mm}
\renewcommand{\footrulewidth}{0.25mm}
\setlength{\fboxrule}{0.1mm}

% command for a newpage
\newcommand{\sophomorixnewpage}[9]{
\newpage
\lhead{\bf Zugangsdatenliste}
\chead{\LARGE \bf #1}
\rhead{\bf \large \today}
\lfoot{\textcolor{red}{SCHOOL-LONGNAME}}
\cfoot{\textcolor{red}{TEACHERMEMBERS}}
\rfoot{\textcolor{red}{FILENAME}}
}

% command to create entry
\newcommand{\sophomorixdatabox}[9]{%
\ifthenelse{\equal{#3}{}}{% if empty sAMAccountName
\fbox{ % fbox start
\begin{minipage}[b][26mm][c]{43mm}
\begin{center}
\rule[2mm]{25mm}{0.4mm}
\end{center}
\end{minipage}%
}   % fbox end
}{% else sAMAccountName given
\fbox{ % fbox start
\begin{minipage}[b][26mm][c]{43mm}
\begin{center}
\texttt{#1, #2} \par Klasse: \texttt{#6} \par Passwort: \texttt{#4} \par Login: \texttt{#3}
\end{center}
\end{minipage}%
}   % fbox end
}}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

% DATABLOCK START
\sophomorixnewpage{m2kk3t}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{Maier}{Sarina}{maiersa42}{EkqLjsjd6p}{bsz}{m2kk3t}{student}{20170905165452.0Z}{10999}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixnewpage{7a}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{Maier}{Sarina}{maiersa42}{EkqLjsjd6p}{bsz}{7a}{student}{20170905165452.0Z}{10999}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
\sophomorixdatabox{}{}{}{}{}{}{}{}{}%
% DATABLOCK END

\end{document}
