Merge branch 'master' of ssh://git.nemunai.re:6224/fic2014-server
This commit is contained in:
commit
070f1b263f
13 changed files with 70 additions and 15 deletions
|
@ -1,3 +0,0 @@
|
|||
body {
|
||||
padding: 30px;
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
//TODO: get the exercice number
|
||||
|
||||
if(!defined('ONYX')) exit;
|
||||
|
||||
class Exercice
|
||||
|
@ -18,13 +20,14 @@ class Exercice
|
|||
if (!empty($id))
|
||||
{
|
||||
$db = new BDD();
|
||||
// TODO escape id ?
|
||||
$res = $db->unique_query("SELECT `id`, `id_theme`, `require`, `level`, `points`, `statement`
|
||||
FROM exercices
|
||||
WHERE id=" . intval($id));
|
||||
WHERE id= '$id'");
|
||||
|
||||
if (!empty($res))
|
||||
{
|
||||
$this->id = intval($res['id']);
|
||||
$this->id = $res['id'];
|
||||
$this->theme = new Theme($res['id_theme']);
|
||||
$this->require = $res['require'];
|
||||
$this->level = $res['level'];
|
||||
|
@ -32,10 +35,10 @@ class Exercice
|
|||
$this->statement = $res['statement'];
|
||||
$this->files = $db->query("SELECT `id`, `path`, `name`
|
||||
FROM exercice_files
|
||||
WHERE id_exercice = $id");
|
||||
WHERE id_exercice = '$id'");
|
||||
$this->keys = $db->query("SELECT `id`, `format`, `value`
|
||||
FROM exercice_keys
|
||||
WHERE id_exercice = $id");
|
||||
WHERE id_exercice = '$id'");
|
||||
}
|
||||
$db->deconnexion();
|
||||
}
|
||||
|
@ -67,7 +70,7 @@ class Exercice
|
|||
{
|
||||
$db->query("UPDATE exercices
|
||||
SET `theme` = '".$theme."', `require` = '".$require."', `level` = '".$level."', `point` = '".$point."', `statement` = '".$statement."'
|
||||
WHERE id = ".$id);
|
||||
WHERE id = '$id'");
|
||||
|
||||
$aff = $db->affected();
|
||||
}
|
||||
|
@ -154,4 +157,4 @@ class Exercice
|
|||
"sha1" => $sha1
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,5 +2,9 @@
|
|||
|
||||
if(!defined('ONYX')) exit;
|
||||
|
||||
$exercice = new Exercice($EXERCICE);
|
||||
|
||||
$template->assign("Exercice", $exercice);
|
||||
//$template->assign("Number", $ex_number);
|
||||
|
||||
return "teams/exercice";
|
||||
|
|
|
@ -2,5 +2,4 @@
|
|||
|
||||
if(!defined('ONYX')) exit;
|
||||
|
||||
|
||||
return "teams/change";
|
||||
return "teams/me";
|
||||
|
|
|
@ -10,7 +10,7 @@ try
|
|||
|
||||
return "teams/team";
|
||||
}
|
||||
catch($e)
|
||||
catch(Exception $e)
|
||||
{
|
||||
return "404";
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{extends file="layout-nav.tpl"}
|
||||
{block name=head}
|
||||
<link href="/css/home.css" rel="stylesheet">
|
||||
<link href="/css/common.css" rel="stylesheet">
|
||||
{/block}
|
||||
{block name=content}
|
||||
<h1>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{extends file="layout-nav.tpl"}
|
||||
{block name=head}
|
||||
<link href="/css/home.css" rel="stylesheet">
|
||||
<link href="/css/common.css" rel="stylesheet">
|
||||
{/block}
|
||||
{block name=content}
|
||||
<h1>
|
||||
|
|
19
onyx/tpl/bootstrap/teams/exercice.tpl
Normal file
19
onyx/tpl/bootstrap/teams/exercice.tpl
Normal file
|
@ -0,0 +1,19 @@
|
|||
{extends file="layout-nav.tpl"}
|
||||
|
||||
{block name=head}
|
||||
<link href="/css/common.css" rel="stylesheet">
|
||||
{/block}
|
||||
|
||||
{block name=content}
|
||||
<!-- TODO: resolved number -->
|
||||
<div>
|
||||
<h1>Exercice {$Number} - X</h1>
|
||||
<ul>
|
||||
<li>Difficulté : {$Exercice->statement}</li>
|
||||
<li>Gain :</li>
|
||||
<!-- Dowloads files -->
|
||||
<li>Description</li>
|
||||
<!-- Input solution -->
|
||||
<ul>
|
||||
|
||||
{/block}
|
|
@ -1,7 +1,7 @@
|
|||
{extends file="layout-nav.tpl"}
|
||||
|
||||
{block name=head}
|
||||
<link href="/css/home.css" rel="stylesheet">
|
||||
<link href="/css/common.css" rel="stylesheet">
|
||||
{/block}
|
||||
|
||||
{block name=content}
|
||||
|
|
11
onyx/tpl/bootstrap/teams/me.tpl
Normal file
11
onyx/tpl/bootstrap/teams/me.tpl
Normal file
|
@ -0,0 +1,11 @@
|
|||
{extends file="layout-nav.tpl"}
|
||||
|
||||
{block name=head}
|
||||
<link href="/css/common.css" rel="stylesheet">
|
||||
{/block}
|
||||
|
||||
{block name=content}
|
||||
<h1>
|
||||
THIS IS ME
|
||||
</h1>
|
||||
{/block}
|
11
onyx/tpl/bootstrap/teams/summary.tpl
Normal file
11
onyx/tpl/bootstrap/teams/summary.tpl
Normal file
|
@ -0,0 +1,11 @@
|
|||
{extends file="layout-nav.tpl"}
|
||||
|
||||
{block name=head}
|
||||
<link href="/css/common.css" rel="stylesheet">
|
||||
{/block}
|
||||
|
||||
{block name=content}
|
||||
<h1>
|
||||
THIS IS SUMMARY
|
||||
</h1>
|
||||
{/block}
|
11
onyx/tpl/bootstrap/teams/team.tpl
Normal file
11
onyx/tpl/bootstrap/teams/team.tpl
Normal file
|
@ -0,0 +1,11 @@
|
|||
{extends file="layout-nav.tpl"}
|
||||
|
||||
{block name=head}
|
||||
<link href="/css/common.css" rel="stylesheet">
|
||||
{/block}
|
||||
|
||||
{block name=content}
|
||||
<h1>
|
||||
THIS IS TEAM
|
||||
</h1>
|
||||
{/block}
|
Reference in a new issue