コード例 #1
0
 public function show2($LogKey1 = NULL, $LogKey2 = NULL)
 {
     $clause = "LogKey1 = " . $LogKey1;
     $filters = array();
     if (Input::get('FILTERS-ALL') != "T") {
         $filters = $this->ArrayOfFilters(Input::all());
         $clause = $this->GetFilterClause($filters) . "LogKey1 = " . $LogKey1;
     } else {
         foreach (LogType::all() as $logType) {
             array_unshift($filters, $logType->ID);
         }
     }
     if ($LogKey2) {
         $clause = $clause . " and LogKey2 = " . $LogKey2;
     }
     $logs = Logs::whereraw($clause)->get();
     $kTyp = KitTypes::find($LogKey1);
     $kit = Kits::find($LogKey2);
     $title = "Log for " . $kTyp->Name . " -> " . $kit->Name;
     if ((int) $kit->Specialized == 1) {
         $title = $title . ' + ' . $kit->SecializedName;
     }
     return CheckIfAuthenticated('Logs.show', ['ID' => $LogKey2, 'logs' => $logs, 'logTitle' => $title, 'logTypes' => LogType::all(), 'filters' => $filters], 'home.index', [], true);
 }
コード例 #2
0
 public function contents($kitID)
 {
     return CheckIfAuthenticated('kit.kitContents', ['kitContents' => Kits::find($kitID)->contents], 'home.index', [], true);
 }
コード例 #3
0
 public function destroy($kitID)
 {
     $kit = Kits::find($kitID);
     foreach (Booking::where('KitID', '=', $kitID)->get() as $book) {
         foreach (BookingDetails::where('BookingID', '=', $book->ID)->get() as $detail) {
             BookingDetails::destroy($detail->ID);
         }
         Booking::destroy($book->ID);
     }
     foreach ($kit->contents as $content) {
         KitContents::destroy($content->ID);
     }
     Kits::destroy($kitID);
 }