SRC/app/Http/Controllers/GameController.php
This commit is contained in:
Malibu 2015-03-20 18:39:32 +01:00
commit 554ff59064
3 changed files with 13 additions and 6 deletions

View File

@ -3,7 +3,14 @@ import xml.etree.ElementTree as ET
import MySQLdb as mdb
import sys
import re
import os
import httplib
def exists(site, path):
c = httplib.HTTPConnection(site)
c.request('HEAD', path)
response = c.getresponse()
c.close()
return response.status == 200
def insert (cur, table, dict) :
keys = ""
@ -101,8 +108,7 @@ try :
image = child.text.encode('utf-8')
# On s'interesee qu'aux oeuvres ayant une image
response = os.system("ping -c 1 " + "http://www.augustins.org/documents/10180/156407/"+image)
if image != "NULL" and response == 0 :
if image != "NULL" and exists('www.augustins.org','/documents/10180/156407/'+image):
if str(datation)+str(datation2) in listeDatation :
iddatation = listeDatation[str(datation)+str(datation2)]
else :

View File

@ -39,7 +39,6 @@ class AdminController extends Controller {
public function addUser()
{
$user = new Referent;
$user->nom = Input::get('nom');
$user->email = Input::get('email');
$user->etablissement = Input::get('etablissement');

View File

@ -18,7 +18,9 @@
}
function preload () {
game.load.spritesheet('balls', '{{ URL::to('imgs/puzzle/balls.png') }}', 17, 17);
game.load.image('trophee', '{{ URL::to('imgs/trophees/or.png') }}');
game.load.image('trophee3', '{{ URL::to('imgs/trophees/or.png') }}');
game.load.image('trophee2', '{{ URL::to('imgs/trophees/argent.png') }}');
game.load.image('trophee1', '{{ URL::to('imgs/trophees/bronze.png') }}');
for(i=1; i<=selection.length; i++) {
game.load.spritesheet("tableau"+i, selection[i-1].src, selection[i-1].width/dimensions[0], selection[i-1].height/dimensions[1]);
@ -213,7 +215,7 @@
var ratioImage = 0.8;
var dimensions = [{{$dimension}}, {{$dimension}}];
var nbToPlay = {{$nbTab}};
var trophy = {{ $niveau }};
var images = [];
@foreach ($oeuvres as $i => $oeuvre)
images.push("http://www.augustins.org/documents/10180/156407/{{ $oeuvre -> image}}");