index.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. if (cfr('CREDIT')) {
  3. if (isset ($_GET['username'])) {
  4. $login=vf($_GET['username']);
  5. // change credit expire if need
  6. if (isset ($_POST['newcreditexpire'])) {
  7. $creditexpire=$_POST['newcreditexpire'];
  8. $billing->setcreditexpire($login,$creditexpire);
  9. log_register('CHANGE CreditExpire ('.$login.') ON '.$creditexpire);
  10. rcms_redirect("?module=creditexpireedit&username=".$login);
  11. }
  12. $current_creditexpire=zb_UserGetStargazerData($login);
  13. $current_creditexpire=$current_creditexpire['CreditExpire'];
  14. if ($current_creditexpire) {
  15. $current_creditexpire=date("Y-m-d",$current_creditexpire);
  16. } else {
  17. $current_creditexpire=__('No');
  18. }
  19. $useraddress=zb_UserGetFullAddress($login).' ('.$login.')';
  20. // Edit form construct
  21. $fieldnames=array('fieldname1'=>__('Current credit expire'),'fieldname2'=>__('New credit expire'));
  22. $fieldkey='newcreditexpire';
  23. $form=web_EditorDateDataForm($fieldnames, $fieldkey, $useraddress, $current_creditexpire);
  24. $form.=web_UserControls($login);
  25. show_window(__('Edit credit expire'), $form);
  26. }
  27. } else {
  28. show_error(__('You cant control this module'));
  29. }
  30. ?>