Compare commits
10 Commits
7422d5c89b
...
e87d019b1e
Author | SHA1 | Date | |
---|---|---|---|
e87d019b1e | |||
51638bcce6 | |||
f03c52813c | |||
645a1089d5 | |||
4839b71521 | |||
041a776302 | |||
1217276932 | |||
c4e1568207 | |||
8b74aeeac7 | |||
8ef9fcc288 |
42
gestion/index2.php
Normal file
42
gestion/index2.php
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
require_once '../session_init.php';
|
||||||
|
require_once 'config.inc.php';
|
||||||
|
require_once 'db.class.php';
|
||||||
|
require_once 'entete.php';
|
||||||
|
|
||||||
|
$db = new db();
|
||||||
|
print(' <br><br>
|
||||||
|
<!-- lalis Grid Section -->
|
||||||
|
|
||||||
|
<section id="content">
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12 text-center">
|
||||||
|
<h3>Gestion des votes</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
');
|
||||||
|
$votationsList = $db->queryVotationList();
|
||||||
|
print ("<table>");
|
||||||
|
foreach($votationsList as $votation)
|
||||||
|
{
|
||||||
|
print("<tr><td>");
|
||||||
|
print('<a href="' . $vote_url . 'gestion/saisieVotes.php?idVotation=' . $votation["id"] . '">' . $votation["libelle"] . '</a></td><td>');
|
||||||
|
if ($votation["status"] == 1)
|
||||||
|
{
|
||||||
|
print(_("Cloturé"));
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
print(_("En cours"));
|
||||||
|
}
|
||||||
|
print('</td></tr>');
|
||||||
|
}
|
||||||
|
print('</table>');
|
||||||
|
print('
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>');
|
||||||
|
|
||||||
|
require_once 'footer.html';
|
||||||
|
?>
|
47
identification.php
Normal file
47
identification.php
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class adherent
|
||||||
|
{
|
||||||
|
protected $idAdherent;
|
||||||
|
protected $nom;
|
||||||
|
protected $prenom;
|
||||||
|
protected $req_url = 'https://librepc.com:10081/cloud/apps/oauth2/api/v1/token';
|
||||||
|
protected $authurl = 'https://librepc.com:10081/cloud/apps/oauth2/authorize';
|
||||||
|
//protected $acc_url = 'https://fireeagle.yahooapis.com/oauth/access_token';
|
||||||
|
//protected $api_url = 'https://fireeagle.yahooapis.com/api/0.1';
|
||||||
|
protected $conskey = 'your_consumer_key';
|
||||||
|
protected $conssec = 'your_consumer_secret';
|
||||||
|
|
||||||
|
function identification($idAdherent)
|
||||||
|
{
|
||||||
|
// En état state=1 la prochaine requete doit inclure le oauth_token.
|
||||||
|
// Si ce n'est pas le cas, retour à 0
|
||||||
|
if(!isset($_GET['oauth_token']) && $_SESSION['state']==1) $_SESSION['state'] = 0;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$oauth = new OAuth($conskey,$conssec,OAUTH_SIG_METHOD_HMACSHA1,OAUTH_AUTH_TYPE_URI);
|
||||||
|
$oauth->enableDebug();
|
||||||
|
if(!isset($_GET['oauth_token']) && !$_SESSION['state']) {
|
||||||
|
$request_token_info = $oauth->getRequestToken($req_url);
|
||||||
|
$_SESSION['secret'] = $request_token_info['oauth_token_secret'];
|
||||||
|
$_SESSION['state'] = 1;
|
||||||
|
header('Location: '.$authurl.'?oauth_token='.$request_token_info['oauth_token']);
|
||||||
|
exit;
|
||||||
|
} else if($_SESSION['state']==1) {
|
||||||
|
$oauth->setToken($_GET['oauth_token'],$_SESSION['secret']);
|
||||||
|
$access_token_info = $oauth->getAccessToken($acc_url);
|
||||||
|
$_SESSION['state'] = 2;
|
||||||
|
$_SESSION['token'] = $access_token_info['oauth_token'];
|
||||||
|
$_SESSION['secret'] = $access_token_info['oauth_token_secret'];
|
||||||
|
}
|
||||||
|
$oauth->setToken($_SESSION['token'],$_SESSION['secret']);
|
||||||
|
$oauth->fetch("$api_url/user.json");
|
||||||
|
$json = json_decode($oauth->getLastResponse());
|
||||||
|
print_r($json);
|
||||||
|
} catch(OAuthException $E)
|
||||||
|
{
|
||||||
|
print_r($E);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
@ -79,20 +79,22 @@ function choixVotation($path, $methode = 2, $confirm = true) //2 = toutes les v
|
|||||||
$result = $db->query($query);
|
$result = $db->query($query);
|
||||||
$votations = $db->result->fetch_all(MYSQLI_ASSOC);
|
$votations = $db->result->fetch_all(MYSQLI_ASSOC);
|
||||||
|
|
||||||
print ('<form method="get" action="' . $path . '">');
|
//print ('<form method="get" action="' . $path . '">');
|
||||||
print "<pre>";
|
//print "<pre>";
|
||||||
foreach($votations as $key => $value )
|
foreach($votations as $key => $value )
|
||||||
{
|
{
|
||||||
print '<input type="radio" name="idVotation" value="' . $value["id"] . '"/> ' . $value["titre"] . ' :' . $value["libelle"] . '<br>';
|
//print '<input type="radio" name="id" value="' . $value["id"] . '"/> ' . $value["titre"] . ' :' . $value["libelle"] . '<br>';
|
||||||
|
print '<a href="' . $path . '?id=' . $value["id"] . '">' . $value["libelle"] . '</a><br>';
|
||||||
}
|
}
|
||||||
// TODO confirmation du choix par javascript si $confirm = true
|
// TODO confirmation du choix par javascript si $confirm = true
|
||||||
|
|
||||||
print '</pre><br>
|
/*print '</pre><br>
|
||||||
<div>
|
<div>
|
||||||
<input type="submit" value="Envoyer"/>
|
<input type="submit" value="Envoyer"/>
|
||||||
<input type="submit" formaction="index.php" value="' . _("Annuler") . '"/>
|
<input type="submit" formaction="index.php" value="' . _("Annuler") . '"/>
|
||||||
</div>
|
</div>
|
||||||
</form>';
|
</form>';
|
||||||
|
*/
|
||||||
$db->close();
|
$db->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once '../session_init.php';
|
require_once 'session_init.php';
|
||||||
require_once 'config.inc.php';
|
require_once 'config.inc.php';
|
||||||
require_once 'db.class.php';
|
require_once 'db.class.php';
|
||||||
require_once 'entete.php';
|
require_once 'entete.php';
|
||||||
@ -22,12 +22,13 @@ print ("<table>");
|
|||||||
foreach($votationsList as $votation)
|
foreach($votationsList as $votation)
|
||||||
{
|
{
|
||||||
print("<tr><td>");
|
print("<tr><td>");
|
||||||
print('<a href="' . $vote_url . 'gestion/saisieVotes.php?idVotation=' . $votation["id"] . '">' . $votation["libelle"] . '</a></td><td>');
|
|
||||||
if ($votation["status"] == 1)
|
if ($votation["status"] == 1)
|
||||||
{
|
{
|
||||||
|
print('<a href="' . $vote_url . 'vote.resultat.php?id=' . $votation["id"] . '">' . $votation["libelle"] . '</a></td><td>');
|
||||||
print(_("Cloturé"));
|
print(_("Cloturé"));
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
|
print('<a href="' . $vote_url . 'vote.form.php?v=' . $votation["id"] . '">' . $votation["libelle"] . '</a></td><td>');
|
||||||
print(_("En cours"));
|
print(_("En cours"));
|
||||||
}
|
}
|
||||||
print('</td></tr>');
|
print('</td></tr>');
|
||||||
@ -38,5 +39,5 @@ print('
|
|||||||
</div>
|
</div>
|
||||||
</section>');
|
</section>');
|
||||||
|
|
||||||
require_once './footer.html';
|
require_once 'footer.html';
|
||||||
?>
|
?>
|
||||||
|
@ -87,7 +87,16 @@ if ($dolibarr->result->num_rows == 0)
|
|||||||
}
|
}
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
print " Bonjour " . $votant['firstname'] . " " . $votant['lastname'] . ',</h4>' . EOLH . EOLH . "Le vote ne sera ouvert qu'à partir du " . formattedate('fr', $votation['td'] , "Europe/Paris") . " et jusqu'au " . formattedate('fr', $votation['df'] , "Europe/Paris") . '.' . EOLH . "Si vous pensez que ceci est une erreur, veuillez prendre contact avec les responsables de l'association.</h4>";
|
print('
|
||||||
|
<h3>VOTE</h3>
|
||||||
|
<h4>');
|
||||||
|
$db->resultats($idVotation);
|
||||||
|
print (' <div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>');
|
||||||
|
//print " Bonjour " . $votant['firstname'] . " " . $votant['lastname'] . ',</h4>' . EOLH . EOLH . "Le vote n'est ouvert que du " . formattedate('fr', $votation['td'] , "Europe/Paris") . " au " . formattedate('fr', $votation['df'] , "Europe/Paris") . '.' . EOLH . "Si vous pensez que ceci est une erreur, veuillez prendre contact avec les responsables de l'association.</h4>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$db->close();
|
$db->close();
|
||||||
|
@ -33,7 +33,7 @@ print(' <br><br>
|
|||||||
|
|
||||||
if (empty($idVotation))
|
if (empty($idVotation))
|
||||||
{
|
{
|
||||||
choixVotation('/vote.resultat.php');
|
choixVotation('/vote/vote.resultat.php');
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
print('
|
print('
|
||||||
|
Reference in New Issue
Block a user