コード例 #1
0
ファイル: growth-group-import.cli.php プロジェクト: alcf/chms
    $objParentGroup = Group::CreateGroupForMinistry($objMinistry, GroupType::GroupCategory, trim($strTokens[0]), 'Growth Groups in ' . $objGrowthGroupLocation->Location);
    $objGroupCategory = new GroupCategory();
    $objGroupCategory->Group = $objParentGroup;
    $objGroupCategory->Save();
    $objGgResult = $objMySqli->Query('SELECT * FROM growth_group WHERE growth_group_location_id=' . $objRow['id'] . ' ORDER BY id');
    while ($objGgRow = $objGgResult->fetch_array()) {
        $objGroup = Group::CreateGroupForMinistry($objMinistry, GroupType::GrowthGroup, $objGgRow['name'], 'Growth Group for ' . $objGgRow['name'], $objParentGroup);
        $objGrowthGroup = new GrowthGroup();
        $objGrowthGroup->Group = $objGroup;
        $objGrowthGroup->GrowthGroupLocationId = $objGgRow['growth_group_location_id'];
        $objGrowthGroup->GrowthGroupDayTypeId = $objGgRow['growth_group_day_type_id'];
        $objGrowthGroup->MeetingBitmap = $objGgRow['meeting_bitmap'];
        $objGrowthGroup->StartTime = $objGgRow['start_time'];
        $objGrowthGroup->EndTime = $objGgRow['end_time'];
        $objGrowthGroup->Address1 = $objGgRow['address_1'];
        $objGrowthGroup->Address2 = $objGgRow['address_2'];
        $objGrowthGroup->CrossStreet1 = $objGgRow['cross_street_1'];
        $objGrowthGroup->CrossStreet2 = $objGgRow['cross_street_2'];
        $objGrowthGroup->ZipCode = $objGgRow['zip_code'];
        $objGrowthGroup->Longitude = $objGgRow['longitude'];
        $objGrowthGroup->Latitude = $objGgRow['latitude'];
        $objGrowthGroup->Accuracy = $objGgRow['accuracy'];
        $objGrowthGroup->Save();
        $objStructureResult = $objMySqli->Query('SELECT * FROM growthgroupstructure_growthgroup_assn where growth_group_id=' . $objGgRow['id']);
        while ($objStructureRow = $objStructureResult->fetch_array()) {
            $objGrowthGroup->AssociateGrowthGroupStructure(GrowthGroupStructure::Load($objStructureRow['growth_group_structure_id']));
        }
    }
}
$objMySqli->Close();
Group::RefreshHierarchyDataForMinistry($objMinistry->Id);
コード例 #2
0
<?php

@($db = new mysqli("localhost", "dunaich_csaba", "12345", "dunaich_database"));
if (mysqli_connect_errno()) {
    printf("Verbindung fehlgeschlagen: %s\n", mysqli_connect_error());
    exit;
}
// SQL Befehle
$sql_befehl = "CREATE TABLE IF NOT EXISTS zeiterfassungstabelle(\n  userId VARCHAR(50) DEFAULT NULL,\n  nachname VARCHAR(50) DEFAULT NULL,\n  vorname VARCHAR(50) DEFAULT NULL,\n  totalzeitSekunden INT(11) DEFAULT NULL,\n  PRIMARY KEY (userId)\n)";
if ($db->query($sql_befehl)) {
    echo "<div class='jumbotron'>Tabelle f&uuml;r Zeiterfassung erfolgreich erstellt!</div>";
} else {
    echo "<div class='jumbotron'>Konnte keine Tabelle erstellen. Wahrscheinlich gibts die schon.</div>";
}
$db->Close();