Пример #1
0
 function save()
 {
     $db = Database::getConnection();
     if ($this->new) {
         $stmt = $db->prepare("INSERT INTO events(name, start, format,\n        host, cohost, kvalue, number, season, series,\n        threadurl, reporturl, metaurl, finalized, prereg_allowed, player_reportable, player_editdecks)\n        VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, ?, ?, ?)");
         $stmt->bind_param("sssssdddssssddd", $this->name, $this->start, $this->format, $this->host, $this->cohost, $this->kvalue, $this->number, $this->season, $this->series, $this->threadurl, $this->reporturl, $this->metaurl, $this->prereg_allowed, $this->player_reportable, $this->player_editdecks);
         $stmt->execute() or die($stmt->error);
         $stmt->close();
         $this->newSubevent($this->mainrounds, 1, $this->mainstruct);
         $this->newSubevent($this->finalrounds, 2, $this->finalstruct);
     } else {
         $stmt = $db->prepare("UPDATE events SET\n        start = ?, format = ?, host = ?, cohost = ?, kvalue = ?,\n        number = ?, season = ?, series = ?, threadurl = ?, reporturl = ?,\n        metaurl = ?, finalized = ?, prereg_allowed = ?, active = ?, current_round = ?, player_reportable = ?, player_editdecks = ? WHERE name = ?");
         $stmt or die($db->error);
         $stmt->bind_param("ssssdddssssdddddds", $this->start, $this->format, $this->host, $this->cohost, $this->kvalue, $this->number, $this->season, $this->series, $this->threadurl, $this->reporturl, $this->metaurl, $this->finalized, $this->prereg_allowed, $this->active, $this->current_round, $this->player_reportable, $this->player_editdecks, $this->name);
         $stmt->execute() or die($stmt->error);
         $stmt->close();
         if ($this->mainid == NULL) {
             $this->newSubevent($this->mainrounds, 1, $this->mainstruct);
         } else {
             $main = new Subevent($this->mainid);
             $main->rounds = $this->mainrounds;
             $main->type = $this->mainstruct;
             $main->save();
         }
         if ($this->finalid == NULL) {
             $this->newSubevent($this->finalrounds, 2, $this->finalstruct);
         } else {
             $final = new Subevent($this->finalid);
             $final->rounds = $this->finalrounds;
             $final->type = $this->finalstruct;
             $final->save();
         }
     }
 }
Пример #2
0
										<span class="data-value"><?php 
    echo $row->nama_event;
    ?>
</span>
									</p>
									<p class="data-row">
										<span class="data-name">Nama Event</span>
										<span class="data-value"><?php 
    echo $row->nama_sub_event;
    ?>
</span>
									</p>
									<p class="data-row">
										<span class="data-name">Waktu</span>
										<span class="data-value"><?php 
    echo Subevent::dateindo($row->tanggal);
    echo " ";
    echo $row->jam;
    ?>
</span>
									</p>
									<p class="data-row">
										<span class="data-name">Lokasi</span>
										<span class="data-value"><?php 
    echo $row->lokasi;
    ?>
</span>
									</p>
								</div>

								<div class="about">