1
0
Fork 0

Compare commits

...

10 Commits

Author SHA1 Message Date
Daniel Tartavel e87d019b1e debug 2023-03-16 16:24:09 +01:00
Daniel Tartavel 51638bcce6 debug 2023-03-16 16:22:57 +01:00
Daniel Tartavel f03c52813c debug 2023-03-16 15:23:41 +01:00
Daniel Tartavel 645a1089d5 debug 2023-03-16 14:54:43 +01:00
Daniel Tartavel 4839b71521 debug 2023-03-16 14:50:35 +01:00
Daniel Tartavel 041a776302 debug 2022-10-19 16:34:21 +02:00
Daniel Tartavel 1217276932 debu 2022-10-19 16:28:36 +02:00
Daniel Tartavel c4e1568207 debug 2022-10-19 16:19:16 +02:00
Daniel Tartavel 8b74aeeac7 debug 2022-10-19 16:09:29 +02:00
Daniel Tartavel 8ef9fcc288 ajout de l'edition des résultats de la votation 2022-10-19 15:52:46 +02:00
6 changed files with 110 additions and 9 deletions

42
gestion/index2.php Normal file
View 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
View 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);
}
}
}
?>

View File

@ -79,20 +79,22 @@ 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="idVotation" value="' . $value["id"] . '"/> ' . $value["titre"] . '&nbsp;:' . $value["libelle"] . '<br>';
//print '<input type="radio" name="id" value="' . $value["id"] . '"/> ' . $value["titre"] . '&nbsp;:' . $value["libelle"] . '<br>';
print '<a href="' . $path . '?id=' . $value["id"] . '">' . $value["libelle"] . '</a><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();
}

View File

@ -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,12 +22,13 @@ 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>');
@ -38,5 +39,5 @@ print('
</div>
</section>');
require_once './footer.html';
require_once 'footer.html';
?>

View File

@ -87,7 +87,16 @@ if ($dolibarr->result->num_rows == 0)
}
}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();

View File

@ -33,7 +33,7 @@ print(' <br><br>
if (empty($idVotation))
{
choixVotation('/vote.resultat.php');
choixVotation('/vote/vote.resultat.php');
}else
{
print('