2 /* Copyright 2013, 2014 Arun Persaud <arun@nubati.net>
4 * This file is part of e-DoKo.
6 * e-DoKo is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * e-DoKo is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with e-DoKo. If not, see <http://www.gnu.org/licenses/>.
21 error_reporting(E_ALL);
25 include_once("config.php"); /* needs to be first in list, since other includes use this */
26 include_once("./include/db.php"); /* database only */
28 /* open the database */
33 if(isset($_SESSION['id']))
35 $myid = $_SESSION['id'];
37 $result = DB_query_array("SELECT count(player) from Game ".
38 " WHERE player=".DB_quote_smart($myid).
39 " AND ( status='pre' OR status='play' ) ");
41 $ret=array('turn'=>'yes');
43 $ret=array('turn'=>'no');
45 echo json_encode($ret);