Compare commits
No commits in common. "e87d019b1e59ceb5a55e124f4215df6143c778a2" and "7422d5c89b3d9ee313f06177240f543d4d21c768" have entirely different histories.
e87d019b1e
...
7422d5c89b
@ -1,42 +0,0 @@
|
||||
<?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';
|
||||
?>
|
@ -1,47 +0,0 @@
|
||||
<?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,22 +79,20 @@ function choixVotation($path, $methode = 2, $confirm = true) //2 = toutes les v
|
||||
$result = $db->query($query);
|
||||
$votations = $db->result->fetch_all(MYSQLI_ASSOC);
|
||||
|
||||
//print ('<form method="get" action="' . $path . '">');
|
||||
//print "<pre>";
|
||||
print ('<form method="get" action="' . $path . '">');
|
||||
print "<pre>";
|
||||
foreach($votations as $key => $value )
|
||||
{
|
||||
//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>';
|
||||
print '<input type="radio" name="idVotation" value="' . $value["id"] . '"/> ' . $value["titre"] . ' :' . $value["libelle"] . '<br>';
|
||||
}
|
||||
// TODO confirmation du choix par javascript si $confirm = true
|
||||
|
||||
/*print '</pre><br>
|
||||
print '</pre><br>
|
||||
<div>
|
||||
<input type="submit" value="Envoyer"/>
|
||||
<input type="submit" formaction="index.php" value="' . _("Annuler") . '"/>
|
||||
</div>
|
||||
</form>';
|
||||
*/
|
||||
$db->close();
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
require_once 'session_init.php';
|
||||
require_once '../session_init.php';
|
||||
require_once 'config.inc.php';
|
||||
require_once 'db.class.php';
|
||||
require_once 'entete.php';
|
||||
@ -22,13 +22,12 @@ 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('<a href="' . $vote_url . 'vote.resultat.php?id=' . $votation["id"] . '">' . $votation["libelle"] . '</a></td><td>');
|
||||
print(_("Cloturé"));
|
||||
}else
|
||||
{
|
||||
print('<a href="' . $vote_url . 'vote.form.php?v=' . $votation["id"] . '">' . $votation["libelle"] . '</a></td><td>');
|
||||
print(_("En cours"));
|
||||
}
|
||||
print('</td></tr>');
|
||||
@ -39,5 +38,5 @@ print('
|
||||
</div>
|
||||
</section>');
|
||||
|
||||
require_once 'footer.html';
|
||||
require_once './footer.html';
|
||||
?>
|
||||
|
@ -87,16 +87,7 @@ if ($dolibarr->result->num_rows == 0)
|
||||
}
|
||||
}else
|
||||
{
|
||||
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>";
|
||||
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>";
|
||||
}
|
||||
}
|
||||
$db->close();
|
||||
|
@ -33,7 +33,7 @@ print(' <br><br>
|
||||
|
||||
if (empty($idVotation))
|
||||
{
|
||||
choixVotation('/vote/vote.resultat.php');
|
||||
choixVotation('/vote.resultat.php');
|
||||
}else
|
||||
{
|
||||
print('
|
||||
|
Reference in New Issue
Block a user