setting.global.sms.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. global $myUser,$conf;
  3. require_once(__DIR__.SLASH.'Sms.class.php');
  4. User::check_access('sms','configure');
  5. ?>
  6. <div class="row">
  7. <div class="col-md-12">
  8. <h3><i class="fas fa-wrench"></i> Réglages Sms
  9. <?php if($myUser->can('sms', 'edit')) : ?>
  10. <div onclick="sms_setting_save();" class="btn btn-success right"><i class="fas fa-check"></i> Enregistrer</div>
  11. <?php endif; ?>
  12. </h3>
  13. <hr/>
  14. </div>
  15. </div>
  16. <p>Veuillez remplir les informations ci dessous.</p>
  17. <div class="row">
  18. <!-- search results -->
  19. <div class="col-xl-12">
  20. <?php echo Configuration::html('sms'); ?>
  21. <div class="alert alert-primary" role="alert">
  22. Si vous n'avez pas les informations ci-dessus, vous pouvez les créer a partir de votre compte ovh à l'adresse : <a href="https://api.ovh.com/createToken">https://api.ovh.com/createToken</a>
  23. </div>
  24. </div>
  25. </div>
  26. <?php if(
  27. !empty($conf->get('sms_api_key')) &&
  28. !empty($conf->get('sms_api_secret')) &&
  29. !empty($conf->get('sms_api_consumer')) &&
  30. !empty($conf->get('sms_api_service'))
  31. ): ?>
  32. <div class="row">
  33. <div class="col-xl-12">
  34. <?php
  35. $sms = new Sms();
  36. $sms->key = $conf->get('sms_api_key');
  37. $sms->secret = $conf->get('sms_api_secret');
  38. $sms->consumer = $conf->get('sms_api_consumer');
  39. $sms->service = $conf->get('sms_api_service');
  40. $infos = $sms->info($conf->get('sms_api_service'));
  41. ?>
  42. <ul class="list-group">
  43. <li class="list-group-item">Crédit restant : <span class="font-weight-bold"><?php echo $infos['creditsLeft']; ?></span>&euro;</li>
  44. <li class="list-group-item">Nom du service : <span class="font-weight-bold"><?php echo $infos['name']; ?></span></li>
  45. <li class="list-group-item">Status: <span class="font-weight-bold"><?php echo $infos['status']; ?></span></li>
  46. </ul>
  47. </div>
  48. </div>
  49. <?php endif; ?>
  50. <pre>