コード例 #1
0
ファイル: data_birthdays.php プロジェクト: uwol/vcms
(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');
    }
}
コード例 #2
0
ファイル: data_anniversaries.php プロジェクト: uwol/vcms
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');
    }
}