Esempio n. 1
0
$section1->addText("LISTA DE COMPORTAMIENTO - " . strtoupper($team->name), array("size" => 22, "bold" => true, "align" => "right"));
$styleTable = array('borderSize' => 6, 'borderColor' => '888888', 'cellMargin' => 40);
$styleFirstRow = array('borderBottomColor' => '0000FF', 'bgColor' => 'AAAAAA');
$table1 = $section1->addTable("table1");
$table1->addRow();
$table1->addCell()->addText("Nombre Completo");
for ($i = 0; $i < $range; $i++) {
    $table1->addCell()->addText(date("d-M", strtotime($_GET["start_at"]) + $i * (24 * 60 * 60)));
}
foreach ($alumns as $al) {
    $alumn = $al->getAlumn();
    $table1->addRow();
    $table1->addCell(3000)->addText($alumn->name . " " . $alumn->lastname);
    for ($i = 0; $i < $range; $i++) {
        $date_at = date("Y-m-d", strtotime($_GET["start_at"]) + $i * (24 * 60 * 60));
        $asist = BehaviorData::getByATD($alumn->id, $_GET["team_id"], $date_at);
        $v = "";
        if ($asist != null) {
            if ($asist->kind_id == 1) {
                $v = "B";
            } else {
                if ($asist->kind_id == 2) {
                    $v = "E";
                } else {
                    if ($asist->kind_id == 3) {
                        $v = "M";
                    } else {
                        if ($asist->kind_id == 4) {
                            $v = "MM";
                        }
                    }
Esempio n. 2
0
<?php

if (!empty($_POST)) {
    $found = BehaviorData::getByATD($_POST["alumn_id"], $_POST["team_id"], $_POST["date_at"]);
    if ($found == null && $_POST["kind_id"] != "") {
        $assis = new BehaviorData();
        $assis->alumn_id = $_POST["alumn_id"];
        $assis->team_id = $_POST["team_id"];
        $assis->kind_id = $_POST["kind_id"];
        $assis->date_at = $_POST["date_at"];
        $assis->add();
    } else {
        if ($found = !null && $_POST["kind_id"] != "") {
            $found = BehaviorData::getByATD($_POST["alumn_id"], $_POST["team_id"], $_POST["date_at"]);
            $found->kind_id = $_POST["kind_id"];
            $found->update();
        } else {
            if ($_POST["kind_id"] == "") {
                $found = BehaviorData::getByATD($_POST["alumn_id"], $_POST["team_id"], $_POST["date_at"]);
                $found->del();
            }
        }
    }
}