Example #1
0
 public function execute()
 {
     if (empty($_GET['uid'])) {
         throw new Exception('empty uid');
     }
     if (empty($_GET['repertory_id'])) {
         throw new Exception('empty repertory_id');
     }
     if (empty($_GET['parent_id'])) {
         throw new Exception('empty parent_id');
     }
     if (empty($_GET['move'])) {
         throw new Exception('empty move');
     }
     if (empty($_GET['move_number'])) {
         throw new Exception('empty move_number');
     }
     if (empty($_GET['move_fen'])) {
         throw new Exception('empty move_fen');
     }
     if (empty($_GET['move_side'])) {
         throw new Exception('empty move_side');
     }
     $return = addinrepertorie($_GET['uid'], $_GET['repertory_id'], $_GET['parent_id'], $_GET['move'], $_GET['move_number'], $_GET['move_fen'], $_GET['move_side']);
     $this->return = $return;
 }
Example #2
0
        exit;
        $legalMoves = array();
    } else {
        if ($resultChessCurrentMove['move_side'] == $_GET['side']) {
            pr($legalMoves);
            if (!empty($legalMoves)) {
                foreach ($legalMoves as $k => $v) {
                    $uid = $_SESSION['user']['id'];
                    $repertory_id = $_GET['id'];
                    $parent_id = $resultChessCurrentMove['move_id'];
                    $move = $v['move'];
                    $move_number = $level;
                    $move_fen = $v['fen'];
                    $move_side = $toMove;
                    //echo "$uid, $repertory_id, $parent_id, $move, $move_number, $move_fen, $move_side<br>";
                    addinrepertorie($uid, $repertory_id, $parent_id, $move, $move_number, $move_fen, $move_side);
                }
                $refresh = 1;
            }
        } else {
            $find = true;
        }
    }
    ?>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script src="<?php 
    echo $newPath;
    ?>
js/jquery-ui-1.8.23.custom.min.js" type="text/javascript"></script>
<script language="javascript">