www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

createGame.php (4796B)


      1 <?php
      2 require_once("ressources/strings.inc");
      3 require_once("ressources/relations.inc");
      4 require_once("ressources/backend.inc");
      5 session_start();
      6 
      7 if(!isset($_SESSION['userId']))
      8 	header("location:login.php?return=createGame&showmsg=oth_login_createGame_nauth");
      9 
     10 $cgCount = getNbGameCreationRemained($_SESSION['userId']);
     11 ?>
     12 
     13 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
     14 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
     15 	<head>
     16 		<title>PtiClic - Création de partie</title>
     17 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     18 		<link rel="stylesheet" href="ressources/simple.css" />
     19 		
     20 		<?php if($cgCount > 0) {?>
     21 			<script type="text/javascript" src="ressources/jquery-1.5.1.min.js" /></script>
     22 			<script type="text/javascript" src="ressources/createGame.js" /></script>
     23 		<?php } ?>
     24 
     25 		<style type="text/css">
     26 			#wordLines input{
     27 				border : 2px solid grey;		
     28 			}
     29 			.status {
     30 				visibility: hidden;
     31 			}
     32 			.valid .status, #center.valid .status {
     33 				color: #20FF20;
     34 				visibility: visible;
     35 			}
     36 			.invalid .status, #center.invalid .status, #center .status {
     37 				color: #FF2020;
     38 				visibility: visible;
     39 			}
     40 			
     41 			.wordLinesTable {
     42 				min-height : 20px;
     43 				min-width : 20px;		
     44 				border-collapse : collapse;
     45 				border-spacing : 0px;
     46 				margin-left : 30px;
     47 			}
     48 			
     49 			.wordLinesTable td {
     50 				padding : 6px;		
     51 				padding-left : 10px;		
     52 			}
     53 			
     54 			.wordLinesTable .lightLine {
     55 				background-color : #F0F0D0;
     56 			}
     57 			
     58 			.wordLinesTable td:first-child {
     59 				text-align : right;
     60 			}
     61 
     62 
     63 			#center {		
     64 				margin-left : 100px;
     65 				margin-top : 20px;
     66 				margin-bottom : 30px;
     67 			}
     68 			
     69 			#center label {
     70 				border-bottom : 1px solid grey;
     71 				border-left : 1px solid grey;
     72 				-moz-border-radius : 100%;
     73 				padding-left : 10px;
     74 			}
     75 
     76 			
     77 			#relations {
     78 				margin-bottom : 20px;
     79 				margin-top : 10px;
     80 			}
     81 			
     82 			#relations label {
     83 				margin-left : 40px;
     84 				border-bottom : 1px solid grey;
     85 				border-left : 1px solid grey;
     86 				-moz-border-radius : 100%;
     87 				padding-left : 10px;
     88 				padding-right : 10px;
     89 			}
     90 			
     91 			#button {
     92 				margin-top : 30px;
     93 				margin-left : 50px;
     94 				margin-bottom : 40px;
     95 			}
     96 			
     97 			#button input {
     98 				margin-left : 10px;
     99 				margin-right : 40px;
    100 				padding : 4px;
    101 				padding-left : 8px;
    102 				padding-right : 8px;
    103 				font-weight : bold;
    104 			}
    105 			
    106 		</style>
    107 	</head>
    108 	<body>
    109 		<?php include("ressources/menu.inc"); ?>	
    110 		<h2>Création de parties</h2>
    111 		<?php if($cgCount > 0) { ?>
    112 			<h3>Vous pouvez créer encore <?php echo $cgCount;?> partie(s).</h3>
    113 			<form class="content creategame">
    114 				<p>Cette page vous permet de créer des parties personalisées en indiquant les mots qui seront affiché pour un mot central.<br /><br />
    115 				<div id="errorDiv" class="message warning" style="display:none;"></div>
    116 				<div id="successDiv" class="message success" style="display:none;"></div>
    117 				<a id="newCreationLink" style="display:none;" href="createGame.php">Créer une autre partie</a>
    118 				
    119 				<div id="center">
    120 					<label for="centralWord"> Le mot central : </label>
    121 					<input type="text" id="centralWord" name="centralWord" />
    122 					<span class="status">●</span>
    123 				</div>
    124 				<div id="relations">
    125 					<label for="relation1">Relation 1</label>
    126 					<select name="relation1" id="relation1">
    127 					</select>
    128 					<label for="relation2">Relation 2</label>
    129 					<select name="relation2" id="relation2">
    130 					</select>
    131 				</div>
    132 				<div id="wordLines">				
    133 					<div id="templates" style="display:none">
    134 						<table>
    135 							<thead> </thead>
    136 							<tbody>					
    137 								<tr class="wordLine">
    138 									<td>
    139 										<label for="word-"></label>
    140 									</td>
    141 									<td>
    142 										<input value="" class="word" type="text" id="word-"/>
    143 									</td>
    144 									<td>
    145 										<span class="status">●</span>
    146 									</td>
    147 									<td>
    148 										<input type="checkbox" id="r1-"/><label class="r1 relationLabel" for="r1-">Blabla</label>
    149 									</td>
    150 									<td>
    151 										<input type="checkbox" id="r2-"/><label class="r2 relationLabel" for="r2-">Blabla</label>
    152 									</td>
    153 									<td>
    154 										<input type="checkbox" id="r3-"/><label class="r3 relationLabel" for="r3-">Blabla</label>
    155 									</td>
    156 									<td>
    157 										<input type="checkbox" id="r4-"/><label class="r4 relationLabel" for="r4-">Blabla</label>
    158 									</td>
    159 								</tr>
    160 							</tbody>
    161 						</table>
    162 					</div>
    163 					
    164 					<table class="wordLinesTable">
    165 					<tr><td></td></tr>
    166 					</table>
    167 				</div>
    168 				<div id="button"></div>
    169 			</form>
    170 		<?php }
    171 		else {
    172 			echo '<span class="message warning">Vous ne disposez pas assez de points pour pouvoir créer des partes.</span>';
    173 		}?>
    174 		<?php include("ressources/footer.inc"); ?>
    175 	</body>
    176 </html>