當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Contract::set方法代碼示例

本文整理匯總了PHP中Contract::set方法的典型用法代碼示例。如果您正苦於以下問題:PHP Contract::set方法的具體用法?PHP Contract::set怎麽用?PHP Contract::set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Contract的用法示例。


在下文中一共展示了Contract::set方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: time

     $cont = Contract::find_by_sql("SELECT * FROM contracts WHERE player = {$_GET['id']} AND expiry>" . time() . " AND term = 0 ORDER BY date_of_reg DESC");
     if (isset($cont[0])) {
         $cont[0]->term = 1;
         $cont[0]->save();
     }
 }
 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();
開發者ID:kunal-bajpai,項目名稱:gfa,代碼行數:31,代碼來源:playerView.php

示例2: Player

<?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>
開發者ID:kunal-bajpai,項目名稱:gfa,代碼行數:31,代碼來源:addPlayer.php


注:本文中的Contract::set方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。