} } 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'])); $newTrans->save(); } $teams = Team::find_all(); $assocs = Assoc::find_all(); if ($player->category == 1) {
<?php require_once "includes/init.php"; $villages = Village::find_all(); $teams = Team::find_all(); if (sizeof($_POST) > 0) { $player = new Player(); $player->get_values(); $player->dob = strtotime($player->dob); $player->save(); if ($player->category == 1) { $contract = new Contract(); $contract->set($player->id, $_POST['team'], strtotime($_POST['contFrom']), strtotime($_POST['contTo'])); $contract->save(); $ins = new Insurance(); $ins->set($player->id, strtotime($_POST['insTo'])); $ins->save(); if ($_POST['visaTo'] != '') { $visa = new Visa(); $visa->set($player->id, strtotime($_POST['visaTo'])); $visa->save(); } } $files = File::get_files(); if ($files[0] != NULL) { $files[0]->name = "Player" . $player->id; $files[0]->save_file_in(UPLOAD_DIR . "images/photos/"); } } ?> <html>