Ejemplo n.º 1
0
VCMS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with VCMS. If not, see <http://www.gnu.org/licenses/>.
*/
if (!is_object($libGlobal) || !$libAuth->isLoggedin()) {
    exit;
}
$libDb->connect();
if ($libAuth->isLoggedin()) {
    if (!$libTime->isValidSemesterString($_GET['semester'])) {
        die('Das angegebene Semester ist nicht valide.');
    }
    $stmt = $libDb->prepare("SELECT * FROM base_person WHERE gruppe = 'P' AND semester_reception = :semester ORDER BY name, vorname");
    $stmt->bindValue(':semester', $_GET['semester']);
    $stmt->execute();
    $table = new vcms\LibTable($libDb);
    $table->addHeader(array('semester_reception', 'anrede', 'rang', 'titel', 'vorname', 'praefix', 'name', 'suffix', 'zusatz1', 'strasse1', 'ort1', 'plz1', 'land1', 'telefon1', 'email', 'status', 'gruppe'));
    while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
        $table->addRowByArray(array($row['semester_reception'], $row['anrede'], $row['rang'], $row['titel'], $row['vorname'], $row['praefix'], $row['name'], $row['suffix'], $row['zusatz1'], $row['strasse1'], $row['ort1'], $row['plz1'], $row['land1'], $row['telefon1'], $row['email'], $row['status'], $row['gruppe']));
    }
    if (isset($_GET['type']) && $_GET['type'] == 'csv') {
        $table->writeContentAsCSV('jubilaeen_' . $_GET['semester'] . '.csv');
    } else {
        $table->writeContentAsHtmlTable('jubilaeen_' . $_GET['semester'] . '.html');
    }
}
Ejemplo n.º 2
0
(at your option) any later version.

VCMS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with VCMS. If not, see <http://www.gnu.org/licenses/>.
*/
if (!is_object($libGlobal) || !$libAuth->isLoggedin()) {
    exit;
}
$libDb->connect();
if ($libAuth->isLoggedin()) {
    if (!is_numeric($_GET['jahr'])) {
        die('Das angegebene Jahr ist keine Zahl.');
    }
    $stmt = $libDb->prepare("SELECT * FROM base_person WHERE (gruppe = 'P' OR gruppe = 'B' OR gruppe = 'F' OR gruppe = 'C' OR gruppe = 'W' OR gruppe = 'G') AND datum_geburtstag != '' AND datum_geburtstag IS NOT NULL AND datum_geburtstag != '0000-00-00' ORDER BY DATE_FORMAT(datum_geburtstag, '%m%d')");
    $table = new vcms\LibTable($libDb);
    $table->addHeader(array('datum_geburtstag', 'alter', 'anrede', 'rang', 'titel', 'vorname', 'praefix', 'name', 'suffix', 'zusatz1', 'strasse1', 'ort1', 'plz1', 'land1', 'telefon1', 'email', 'status', 'gruppe'));
    $stmt->execute();
    while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
        $table->addRowByArray(array($row['datum_geburtstag'], $_GET['jahr'] - $row['datum_geburtstag'], $row['anrede'], $row['rang'], $row['titel'], $row['vorname'], $row['praefix'], $row['name'], $row['suffix'], $row['zusatz1'], $row['strasse1'], $row['ort1'], $row['plz1'], $row['land1'], $row['telefon1'], $row['email'], $row['status'], $row['gruppe']));
    }
    if (isset($_GET['type']) && $_GET['type'] == 'csv') {
        $table->writeContentAsCSV('geburtstage' . $_GET['jahr'] . '.csv');
    } else {
        $table->writeContentAsHtmlTable('geburtstage' . $_GET['jahr'] . '.html');
    }
}
Ejemplo n.º 3
0
    if ($_GET['datenart'] == 'mitglieder_anschreiben') {
        $sql = "SELECT anrede, titel, rang, vorname, praefix, name, suffix, zusatz1, strasse1, ort1, plz1, land1, datum_adresse1_stand, zusatz2, strasse2, ort2, plz2, land2, datum_adresse2_stand, email, gruppe, status, base_region1.bezeichnung, base_region2.bezeichnung FROM base_person LEFT JOIN base_region AS base_region1 ON base_region1.id = base_person.region1 LEFT JOIN base_region AS base_region2 ON base_region2.id = base_person.region2 WHERE (gruppe = 'F' OR gruppe = 'B' OR gruppe = 'P') AND anschreiben_zusenden=1 ORDER BY plz1, name";
        $header = array('anrede', 'titel', 'rang', 'vorname', 'praefix', 'name', 'suffix', 'zusatz1', 'strasse1', 'ort1', 'plz1', 'land1', 'stand1', 'zusatz2', 'strasse2', 'ort2', 'plz2', 'land2', 'stand2', 'email', 'gruppe', 'status', 'region1', 'region2');
    } elseif ($_GET['datenart'] == 'mitglieder_spendenquittung') {
        $sql = "SELECT anrede, titel, rang, vorname, praefix, name, suffix, zusatz1, strasse1, ort1, plz1, land1, datum_adresse1_stand, zusatz2, strasse2, ort2, plz2, land2, datum_adresse2_stand, email, gruppe, status, base_region1.bezeichnung, base_region2.bezeichnung FROM base_person LEFT JOIN base_region AS base_region1 ON base_region1.id = base_person.region1 LEFT JOIN base_region AS base_region2 ON base_region2.id = base_person.region2 WHERE (gruppe = 'F' OR gruppe = 'B' OR gruppe = 'P') AND spendenquittung_zusenden=1 ORDER BY plz1, name";
        $header = array('anrede', 'titel', 'rang', 'vorname', 'praefix', 'name', 'suffix', 'zusatz1', 'strasse1', 'ort1', 'plz1', 'land1', 'stand1', 'zusatz2', 'strasse2', 'ort2', 'plz2', 'land2', 'stand2', 'email', 'gruppe', 'status', 'region1', 'region2');
    } elseif ($_GET['datenart'] == 'damenflor_anschreiben') {
        $sql = "SELECT anrede, titel, rang, vorname, praefix, name, suffix, zusatz1, strasse1, ort1, plz1, land1, datum_adresse1_stand, zusatz2, strasse2, ort2, plz2, land2, datum_adresse2_stand, email, gruppe, status, base_region1.bezeichnung, base_region2.bezeichnung FROM base_person LEFT JOIN base_region AS base_region1 ON base_region1.id = base_person.region1 LEFT JOIN base_region AS base_region2 ON base_region2.id = base_person.region2 WHERE (gruppe = 'C' OR gruppe = 'G' OR gruppe = 'W') AND anschreiben_zusenden=1 ORDER BY plz1, name";
        $header = array('anrede', 'titel', 'rang', 'vorname', 'praefix', 'name', 'suffix', 'zusatz1', 'strasse1', 'ort1', 'plz1', 'land1', 'stand1', 'zusatz2', 'strasse2', 'ort2', 'plz2', 'land2', 'stand2', 'email', 'gruppe', 'status', 'region1', 'region2');
    } elseif ($_GET['datenart'] == 'damenflor_spendenquittung') {
        $sql = "SELECT anrede, titel, rang, vorname, praefix, name, suffix, zusatz1, strasse1, ort1, plz1, land1, datum_adresse1_stand, zusatz2, strasse2, ort2, plz2, land2, datum_adresse2_stand, email, gruppe, status, base_region1.bezeichnung, base_region2.bezeichnung FROM base_person LEFT JOIN base_region AS base_region1 ON base_region1.id = base_person.region1 LEFT JOIN base_region AS base_region2 ON base_region2.id = base_person.region2 WHERE (gruppe = 'C' OR gruppe = 'G' OR gruppe = 'W') AND spendenquittung_zusenden=1 ORDER BY plz1, name";
        $header = array('anrede', 'titel', 'rang', 'vorname', 'praefix', 'name', 'suffix', 'zusatz1', 'strasse1', 'ort1', 'plz1', 'land1', 'stand1', 'zusatz2', 'strasse2', 'ort2', 'plz2', 'land2', 'stand2', 'email', 'gruppe', 'status', 'region1', 'region2');
    } elseif ($_GET['datenart'] == 'vereine') {
        $sql = "SELECT name, titel, rang, dachverband, zusatz1, strasse1, ort1, plz1, land1, aktivitas, ahahschaft FROM base_verein WHERE anschreiben_zusenden=1 ORDER BY plz1";
        $header = array('name', 'titel', 'rang', 'dachverband', 'zusatz1', 'strasse1', 'ort1', 'plz1', 'land1', 'aktivitas', 'ahahschaft');
    } elseif ($_GET['datenart'] == 'vips') {
        $sql = "SELECT anrede, titel, rang, vorname, praefix, name, suffix, zusatz1, strasse1, ort1, plz1, land1, datum_adresse1_stand FROM base_vip ORDER BY plz1, name";
        $header = array('anrede', 'titel', 'rang', 'vorname', 'praefix', 'name', 'suffix', 'zusatz1', 'strasse1', 'ort1', 'plz1', 'land1', 'stand1');
    }
    if ($sql != '' && is_array($header)) {
        $stmt = $libDb->prepare($sql);
        $table = new vcms\LibTable($libDb);
        $table->addHeader($header);
        $table->addTableByStatement($stmt);
        if (isset($_GET['type']) && $_GET['type'] == 'csv') {
            $table->writeContentAsCSV($_GET['datenart'] . '.csv');
        } else {
            $table->writeContentAsHtmlTable($_GET['datenart'] . '.html');
        }
    }
}