if (isset($_POST['return_transfer'])) { $transfer = Transfer::find_by_sql("SELECT * FROM transfers WHERE player = {$_GET['id']} AND returned = 0 ORDER BY start DESC"); if (isset($transfer[0])) { $transfer[0]->returned = time(); $transfer[0]->save(); } } if (isset($_POST['contFrom']) && isset($_POST['contTo'])) { $newCont = new Contract(); $newCont->set($_GET['id'], $_POST['team'], strtotime($_POST['contFrom']), strtotime($_POST['contTo'])); $newCont->save(); } if (isset($_POST['loanFrom']) && isset($_POST['loanTo'])) { $contractTeam = $player->find_contract_team(); $newLoan = new Loan(); $newLoan->set($_GET['id'], $contractTeam->id, $_POST['toteam'], strtotime($_POST['loanFrom']), strtotime($_POST['loanTo'])); $newLoan->save(); } if (isset($_POST['insTo'])) { $newIns = new Insurance(); $newIns->set($_GET['id'], strtotime($_POST['insTo'])); $newIns->save(); } if (isset($_POST['visaTo'])) { $newVisa = new Visa(); $newVisa->set($_GET['id'], strtotime($_POST['visaTo'])); $newVisa->save(); } if (isset($_POST['transFrom'])) { $newTrans = new Transfer(); $newTrans->set($_GET['id'], $_POST['assoc'], strtotime($_POST['transFrom']));