Conditions | 13 |
Paths | 192 |
Total Lines | 376 |
Code Lines | 325 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
384 | function setConfig() |
||
385 | { |
||
386 | global $tr_config, $xoopsModule, $modversion, $xoopsDB; |
||
387 | |||
388 | |||
389 | /** @var Xdonations\Utility $utility */ |
||
390 | $utility = new Xdonations\Utility(); |
||
391 | |||
392 | //------------------------------------------------------------------------ |
||
393 | $adminObject = \Xmf\Module\Admin::getInstance(); |
||
394 | $adminObject->displayNavigation('donations.php?op=Config'); ?> |
||
395 | <script Language="JavaScript"> |
||
396 | function isEmailAddr(email) { |
||
397 | var result = false; |
||
398 | var theStr = String(email); |
||
399 | var index = theStr.indexOf("@"); |
||
400 | if (index > 0) { |
||
401 | var pindex = theStr.indexOf(".", index); |
||
402 | if ((pindex > index + 1) && (theStr.length > pindex + 1)) |
||
403 | result = true; |
||
404 | } |
||
405 | return result; |
||
406 | } |
||
407 | |||
408 | function validRequired(formField, fieldLabel, message) { |
||
409 | var result = true; |
||
410 | |||
411 | if (formField.value === "") { |
||
412 | alert(message.replace("%1\$s", field)); |
||
413 | |||
414 | formField.focus(); |
||
415 | result = false; |
||
416 | } |
||
417 | |||
418 | return result; |
||
419 | } |
||
420 | |||
421 | function allDigits(str) { |
||
422 | return inValidCharSet(str, "0123456789"); |
||
423 | } |
||
424 | |||
425 | function inValidCharSet(str, charset) { |
||
426 | var result = true; |
||
427 | |||
428 | // Note: doesn't use regular expressions to avoid early Mac browser bugs |
||
429 | for (var i = 0; i < str.length; i++) |
||
430 | if (charset.indexOf(str.substr(i, 1)) < 0) { |
||
431 | result = false; |
||
432 | break; |
||
433 | } |
||
434 | |||
435 | return result; |
||
436 | } |
||
437 | |||
438 | function validInt(formField, fieldLabel, required, message) { |
||
439 | var result = true; |
||
440 | |||
441 | if (required && !validRequired(formField, fieldLabel, message)) |
||
442 | result = false; |
||
443 | |||
444 | if (result) { |
||
445 | // var num = parseInt(formField.value,10); |
||
446 | if (!allDigits(formField.value)) { |
||
447 | if (required) { |
||
448 | //alert('Please enter a number for the "' + fieldLabel +'" field.'); |
||
449 | alert(message.replace("%1\$s", fieldLabel)); |
||
450 | formField.focus(); |
||
451 | result = false; |
||
452 | } |
||
453 | elseif(formField.value == "") |
||
454 | { |
||
455 | return true; |
||
456 | } |
||
457 | else |
||
458 | { |
||
459 | //alert('Please enter a number or a blank for the "' + fieldLabel +'" field.'); |
||
460 | alert(message.replace("%1\$s", fieldLabel)); |
||
461 | formField.focus(); |
||
462 | result = false; |
||
463 | } |
||
464 | } |
||
465 | } |
||
466 | |||
467 | return result; |
||
468 | } |
||
469 | |||
470 | |||
471 | function validateURL(formField, value, secure) { |
||
472 | |||
473 | var match = /https/i.test(value); |
||
474 | |||
475 | if (value !== "" && !/^http/i.test(value)) { |
||
476 | alert('The URL must start with http://'); |
||
477 | formField.focus(); |
||
478 | |||
479 | return false; |
||
480 | } |
||
481 | |||
482 | if (secure && value !== "" && !/^https/i.test(value)) { |
||
483 | // alert('This should reside on a HTTPS server. Users will be warned about viewing secure and non-secure data on the same page'); |
||
484 | return confirm('This URL does not begin with https://\nThis image should reside on an HTTPS server.\nIf you use this URL, users will receive a warning\nabout viewing secure and non-secure data on the same page.\n\n Are you sure you want to continue?'); |
||
485 | } |
||
486 | |||
487 | return true; |
||
488 | } |
||
489 | |||
490 | |||
491 | function checkCancelledURL() { |
||
492 | if (document.tr_configs.var_pp_image_url.value === "") |
||
493 | alert('There is no URL for a Cancelled payment. If you do not enter\na URL for cancelled payments PayPal will also use\nthis URL for cancelled payments.'); |
||
494 | |||
495 | return true; |
||
496 | } |
||
497 | </script> |
||
498 | <?php |
||
499 | //------------------------------------------------------------------------------- |
||
500 | echo "<form name=\"tr_configs\" action=\"donations.php\" method=\"post\">\n" . "<input type=\"hidden\" name=\"op\" value=\"updateConfig\">\n"; |
||
501 | echo "<table style=\"border-width: 1px; width: 90%; text-align: center;\"><tr>\n"; |
||
502 | echo "<td style=\"text-align: center; font-weight: bold;\" class=\"title\">\n"; |
||
503 | echo '<h3>' . _AD_XDONATION_CONFIG_MODULE . "</h3>\n"; |
||
504 | echo "<table style=\"border-width: 1px; text-align: center;\">\n"; |
||
505 | |||
506 | $utility::showTextBox('don_button_top', '<span style="font-weight: bold;">' . _AD_XDONATION_IMG_BUTTON_TOP . '</span>', '', '70', 'onChange="return validateURL(this,this.value);"'); |
||
507 | $utility::showImgXYBox('don_top_img_width', 'don_top_img_height', '<span style="font-weight: bold;">' . _AD_XDONATION_IMAGE_SIZE . '</span>', '4', "onChange='return validInt(this,\"" . _AD_XDONATION_IMAGE_SIZE . '",0,"' . _AD_XDONATION_ALERTE_INPUT_NUMBER . "\");'"); |
||
508 | $utility::showTextBox('don_button_submit', '<span style="font-weight: bold;">' . _AD_XDONATION_IMG_BUTTON_URL . '</span>', '', '70', 'onChange="return validateURL(this,this.value);"'); |
||
509 | $utility::showImgXYBox('don_sub_img_width', 'don_sub_img_height', '<span style="font-weight: bold;">' . _AD_XDONATION_IMAGE_SIZE . '</span>', '4', "onChange='return validInt(this,\"" . _AD_XDONATION_IMAGE_SIZE . '",0,"' . _AD_XDONATION_ALERTE_INPUT_NUMBER . "\");'"); |
||
510 | //"onChange='return validInt(this,"._AD_XDONATION_IMAGE_SIZE.")'" |
||
511 | $utility::showTextBox('don_name_prompt', '<span style="font-weight: bold;">' . _AD_XDONATION_USERNAME_REQUEST . '</span>', '', '70', ''); |
||
512 | $utility::showTextBox('don_name_yes', '<span style="font-weight: bold;">' . _AD_XDONATION_USERNAME_REQUEST_YES . '</span>', '', '50', ''); |
||
513 | $utility::showTextBox('don_name_no', '<span style="font-weight: bold;">' . _AD_XDONATION_USERNAME_REQUEST_NO . '</span>', '', '50', ''); |
||
514 | |||
515 | $desc = 'This is where you can appeal to your' . 'users and your community for donations.' . 'Suggestion: Explain why you need donations,' . 'what you do with the money and how you' . 'manage it. Make them comfortable that' . 'they are not throwing their money away.'; |
||
516 | |||
517 | $sql = 'SELECT * FROM ' . $xoopsDB->prefix('donations_config') . " WHERE name = 'don_text'"; |
||
518 | $Recordset = $xoopsDB->query($sql); |
||
519 | $row = $xoopsDB->fetchArray($Recordset); |
||
520 | $donText = $row['text']; |
||
521 | echo "<tr>\n" |
||
522 | . " <td title=\"{$desc}\" style=\"text-align: right; font-weight: bold;\">" |
||
523 | . _AD_XDONATION_INTRODUCE_TEXT |
||
524 | . "</td>\n" |
||
525 | . " <td title=\"{$desc}\" style=\"text-align: left;\">" |
||
526 | . "<textarea name=\"var_xdonation_text-rawtext-txt\" cols=\"100\" rows=\"20\">{$donText}</textarea></td>\n"; |
||
527 | echo "</tr>\n"; |
||
528 | |||
529 | // $utility::showTextBox('don_amt_checked', '<span style=\'font-weight: bold;\'>'._AD_XDONATION_AMOUNT_DEFAULT.'</span>', '', '4', "onChange=\"return validInt(this,'"._AD_XDONATION_AMOUNT_DEFAULT."',1,'"._AD_XDONATION_ALERTE_INPUT_NUMBER."');\""); |
||
530 | |||
531 | echo "</table>\n"; |
||
532 | echo "<br>\n"; |
||
533 | |||
534 | $query_Recordset1 = 'SELECT * FROM ' . $xoopsDB->prefix('donations_config') . " WHERE name = 'don_amount' ORDER BY subtype"; |
||
535 | $Recordset1 = $xoopsDB->query($query_Recordset1); |
||
536 | $row_Recordset1 = $xoopsDB->fetchArray($Recordset1); |
||
537 | $totalRows_Recordset1 = $xoopsDB->getRowsNum($Recordset1); |
||
538 | $desc = htmlentities($row_Recordset1['text'], ENT_QUOTES | ENT_HTML5); |
||
539 | |||
540 | echo "<table style=\"border-width: 1px; width: 100px; text-align: center;\">\n"; |
||
541 | echo ' <tr><td style="text-align: center; width: 100%; font-weight: bold;" colspan="8">' . _AD_XDONATION_SUGGESTED_AMOUNT . "<br></td></tr>\n"; |
||
542 | $row1 = " <tr><td title=\"{$desc}\" style=\"text-align: center;\"></td>\n"; |
||
543 | $row2 = " <tr><td title=\"{$desc}\" style=\"text-align: center; font-weight: bold;\">" . _AD_XDONATION_AMOUNT . "</td>\n"; |
||
544 | do { |
||
545 | $row1 .= " <td title=\"{$desc}\" style=\"text-align: center;\">{$row_Recordset1['subtype']}</td>\n"; |
||
546 | $row2 .= " <td title=\"{$desc}\" style=\"text-align: center;\"><input size=\"4\" name=\"var_xdonation_amount-{$row_Recordset1['subtype']}\" type=\"text\" value=\"{$row_Recordset1['value']}\" onChange=\"return validInt(this,'" |
||
547 | . _AD_XDONATION_SUGGESTED_AMOUNT |
||
548 | . " #{$row_Recordset1['subtype']}',1,'" |
||
549 | . _AD_XDONATION_ALERTE_INPUT_NUMBER |
||
550 | . "');\"></td>\n"; |
||
551 | } while (false !== ($row_Recordset1 = $xoopsDB->fetchArray($Recordset1))); |
||
552 | |||
553 | $row1 .= "</tr>\n"; |
||
554 | $row2 .= "</tr>\n"; |
||
555 | echo "{$row1} {$row2}\n"; |
||
556 | |||
557 | // display default option |
||
558 | $query_cfg = 'SELECT * FROM ' . $xoopsDB->prefix('donations_config') . " WHERE name = 'don_amt_checked' LIMIT 1"; |
||
559 | $cfgResult = $xoopsDB->query($query_cfg); |
||
560 | $amt = $xoopsDB->fetchArray($cfgResult); |
||
561 | $amt_checked = (int)$amt['value']; |
||
562 | echo '<tr><td>' . _AD_XDONATION_DEFAULT . "</td>\n"; |
||
563 | for ($i = 1; $i < 8; ++$i) { |
||
564 | $checked = ($i == $amt_checked) ? ' checked' : ''; |
||
565 | echo "<td><input type=\"radio\" name=\"var_xdonation_amt_checked\"{$checked} value=\"{$i}\"></td>\n"; |
||
566 | } |
||
567 | echo "</tr>\n"; |
||
568 | echo "</table>\n"; |
||
569 | |||
570 | echo "</td></tr>\n"; |
||
571 | echo '<tr><td style="text-align: center; width: 100%;"><br><input type="submit" value="' . _AD_XDONATION_SUBMIT . '"></td></tr>'; |
||
572 | echo "</table><br><br>\n"; |
||
573 | $adminObject->displayNavigation('donations.php?op=Config'); |
||
574 | echo "<table style=\"border-width: 1px; width: 90%; text-align: center;\"><tr>\n"; |
||
575 | echo '<td class="title" style="font-weight: bold; text-align: center;"><h3>' . _AD_XDONATION_CONFIG_PAYPAL_HEADER . "</h3><br>\n"; |
||
576 | echo "<table style=\"border-width: 1px; text-align: center;\">\n"; |
||
577 | |||
578 | $rsql = 'SELECT rank_id, rank_title FROM ' . $xoopsDB->prefix('ranks') . ' '; |
||
579 | $rresult = $xoopsDB->query($rsql); |
||
580 | $r_array = []; |
||
581 | while (false !== ($r_row = $xoopsDB->fetchRow($rresult))) { |
||
582 | $r_array[] = $r_row; |
||
583 | } |
||
584 | $utility::showDropBox('paypal_url', '<span style=\'font-weight: bold;\'>' . _AD_XDONATION_IPN_URL . '</span>'); |
||
585 | $utility::showTextBox('receiver_email', '<span style=\'font-weight: bold;\'>' . _AD_XDONATION_IPN_EMAIL_RECEIVER . '</span>', '', '40', ''); |
||
586 | $utility::showTextBox('ty_url', '<span style=\'font-weight: bold;\'>' . _AD_XDONATION_IPN_URL_SUCCESS . '</span>', '', '80', 'onChange="checkCancelledURL(); return validateURL(this,this.value);"'); |
||
587 | $utility::showTextBox('pp_cancel_url', '<span style=\'font-weight: bold;\'>' . _AD_XDONATION_IPN_URL_CANCELED . '</span>', '', '80', 'onChange="return validateURL(this,this.value);"'); |
||
588 | $utility::showTextBox('pp_itemname', '<span style=\'font-weight: bold;\'>' . _AD_XDONATION_PP_ITEM_NAME . '</span>', '', '20', ''); |
||
589 | $utility::showTextBox('pp_item_num', '<span style=\'font-weight: bold;\'>' . _AD_XDONATION_PP_ITEM_NUMBER . '</span>', '', '20', ''); |
||
590 | $utility::showTextBox('pp_image_url', '<span style=\'font-weight: bold;\'>' . _AD_XDONATION_PP_IMG . '</span>', '', '60', ''); |
||
591 | $utility::showYNBox('pp_get_addr', '<span style=\'font-weight: bold;\'>' . _AD_XDONATION_PP_ASK_CP_ADRESS . '</span>'); |
||
592 | $utility::showDropBox('pp_curr_code', '<span style=\'font-weight: bold;\'>' . _AD_XDONATION_PP_MONEY . '</span>'); |
||
593 | $gsql = 'SELECT groupid, name FROM ' . $xoopsDB->prefix('groups') . ' WHERE groupid>3'; |
||
594 | $gresult = $xoopsDB->query($gsql); |
||
595 | $g_array = []; |
||
596 | while (false !== ($g_row = $xoopsDB->fetchRow($gresult))) { |
||
597 | $g_array[] = $g_row; |
||
598 | } |
||
599 | $utility::showArrayDropBox('assign_group', '<span style=\'font-weight: bold;\'>' . _AD_XDONATION_PP_GROUP . '</span>', $g_array); |
||
600 | $rsql = 'SELECT rank_id, rank_title FROM ' . $xoopsDB->prefix('ranks') . ' '; |
||
601 | $rresult = $xoopsDB->query($rsql); |
||
602 | $r_array = []; |
||
603 | while (false !== ($r_row = $xoopsDB->fetchRow($rresult))) { |
||
604 | $r_array[] = $r_row; |
||
605 | } |
||
606 | $utility::showArrayDropBox('assign_rank', '<span style=\'font-weight: bold;\'>' . _AD_XDONATION_PP_RANK . '</span>', $r_array); |
||
607 | $utility::showYNBox('don_forceadd', '<span style=\'font-weight: bold;\'>' . _AD_XDONATION_ADD_ANYWAY . '</span>'); |
||
608 | |||
609 | echo "</table><br>\n"; |
||
610 | |||
611 | echo "<table style=\"border-width: 1px; width: 100px; text-align: center;\">\n"; |
||
612 | echo ' <tr><td style="text-align: center; width: 100%; font-weight: bold;" colspan="2">' . _AD_XDONATION_IPN_LOGGING . "<br></td></tr>\n"; |
||
613 | echo " <tr>\n" . ' <td style="text-align: right; font-weight: bold;">' . _AD_XDONATION_IPN_LOGGING_LEVEL . "</td>\n" . " <td style=\"text-align: left;\">\n" . " <select size=\"1\" name=\"var_ipn_dbg_lvl\">\n"; |
||
614 | echo ' <option '; |
||
615 | if (0 == $tr_config['ipn_dbg_lvl']) { |
||
616 | echo 'selected '; |
||
617 | } |
||
618 | echo 'value="0">' . _AD_XDONATION_LOG_OFF . "</option>\n"; |
||
619 | echo ' <option '; |
||
620 | if (1 == $tr_config['ipn_dbg_lvl']) { |
||
621 | echo 'selected '; |
||
622 | } |
||
623 | echo 'value="1">' . _AD_XDONATION_LOG_ONLY_ERRORS . "</option>\n"; |
||
624 | echo ' <option '; |
||
625 | if (2 == $tr_config['ipn_dbg_lvl']) { |
||
626 | echo 'selected '; |
||
627 | } |
||
628 | echo 'value="2">' . _AD_XDONATION_LOG_EVERYTHING . "</option>\n"; |
||
629 | echo " </select>\n" . " </td>\n" . " </tr>\n"; |
||
630 | |||
631 | $utility::showTextBox('ipn_log_entries', '<nobr><span style=\'font-weight: bold;\'>' . _AD_XDONATION_LOG_ENTRY . '</span></nobr>', '', '4', ''); |
||
632 | |||
633 | $desc = 'This box shows the link to the IPN recorder. |
||
634 | This link must be pasted EXACTLY as it is |
||
635 | into your PayPal IPN profile. You can click |
||
636 | on the "test" link to the right to verify |
||
637 | that the IPN recorder is functioning correctly.'; |
||
638 | $desc = htmlentities($desc, ENT_QUOTES | ENT_HTML5); |
||
639 | echo "<tr>\n" |
||
640 | . " <td title =\"$desc\" style=\"text-align: right; font-weight: bold;\">" |
||
641 | . _AD_XDONATION_IPN_LINK |
||
642 | . "</td>\n" |
||
643 | . " <td title =\"$desc\" style=\"text-align: center;\"> " |
||
644 | . XOOPS_URL |
||
645 | . '/modules/' |
||
646 | . $xoopsModule->getVar('dirname') |
||
647 | . "/ipnppd.php \n" |
||
648 | . ' <br><a href="' |
||
649 | . XOOPS_URL |
||
650 | . '/modules/' |
||
651 | . $xoopsModule->getVar('dirname') |
||
652 | . '/ipnppd.php?dbg=1" target="_blank"><span style="font-weight: bold; font-style: italic;"><img src="../assets/images/admin/info.png" style="height: 16px; width: 16px;" alt=""> ' |
||
653 | . _AD_XDONATION_TEST_IPN |
||
654 | . "</span></a>\n" |
||
655 | . " </td>\n" |
||
656 | . "</tr>\n"; |
||
657 | echo "</table><br>\n"; |
||
658 | echo "</td></tr>\n"; |
||
659 | echo '<tr><td style="text-align: center; width: 100%;"><input type="submit" value="' . _AD_XDONATION_SUBMIT . "\">\n"; |
||
660 | echo '</td></tr></table><br><br>'; |
||
661 | |||
662 | //Goal Preferences |
||
663 | //=============================== |
||
664 | $adminObject->displayNavigation('donations.php?op=Config'); |
||
665 | echo "<table style=\"border-width: 1px; width: 90%; text-align: center;\">\n" . " <tr>\n"; |
||
666 | echo " <td style=\"text-align: center; font-weight: bold;\" class=\"title\">\n" . ' <h3>' . _AD_XDONATION_GOAL_PREFERENCES . "</h3>\n"; |
||
667 | echo " <table style=\"border-width: 1px; text-align: center;\">\n" . " <tr><td style=\"text-align: center;\">\n"; |
||
668 | echo " <table style=\"border-width: 1px; text-align: center;\">\n"; |
||
669 | $utility::showDropBox('use_goal', '<span style=\'font-weight: bold;\'>' . _AD_XDONATION_GOAL_TYPE . '.</span>'); |
||
670 | echo " </table>\n"; |
||
671 | |||
672 | $query_Recordset1 = 'SELECT * FROM ' . $xoopsDB->prefix('donations_config') . " WHERE name = 'week_goal' AND subtype<>'Default'"; |
||
673 | $Recordset1 = $xoopsDB->query($query_Recordset1); |
||
674 | $row_Recordset1 = $xoopsDB->fetchArray($Recordset1); |
||
675 | $totalRows_Recordset1 = $xoopsDB->getRowsNum($Recordset1); |
||
676 | $desc = htmlentities($row_Recordset1['text'], ENT_QUOTES | ENT_HTML5); |
||
677 | |||
678 | echo " <table style=\"border-width: 1px; width: 100px; text-align: center;\">\n" . ' <tr><td style="text-align: center; width: 100%; font-weight: bold;" colspan="5">' . _AD_XDONATION_GOAL_HEBDO . "<br></td></tr>\n"; |
||
679 | $row1 = " <tr>\n" . ' <td style="text-align: center; font-weight: bold;">' . _AD_XDONATION_WEEK . "</td>\n"; |
||
680 | $row2 = " <tr>\n" . ' <td style="text-align: center; font-weight: bold;">' . _AD_XDONATION_GOAL . "</td>\n"; |
||
681 | //------------------------------------------------------------- |
||
682 | $shortMonth = explode('|', _AD_XDONATION_SHORT_MONTH); |
||
683 | $ordinaux = explode('|', _AD_XDONATION_NUMBER_ORDINAUX); |
||
684 | //------------------------------------------------------------- |
||
685 | $h = 0; |
||
686 | do { |
||
687 | $ord = $ordinaux[$h++]; |
||
688 | $row1 .= " <td title=\"{$desc}\" style=\"text-align: center;\">{$ord}</td>\n"; |
||
689 | $row2 .= " <td title=\"{$desc}\" style=\"text-align: center;\"><input size=\"4\" name=\"var_week_goal-$row_Recordset1[subtype]\" type=\"text\" value=\"$row_Recordset1[value]\" onChange=\"return validInt(this,'$row_Recordset1[subtype] " |
||
690 | . _AD_XDONATION_GOAL_DONATION |
||
691 | . "',1,'" |
||
692 | . _AD_XDONATION_ALERTE_INPUT_NUMBER |
||
693 | . "');\"></td>\n"; |
||
694 | } while (false !== ($row_Recordset1 = $xoopsDB->fetchArray($Recordset1))); |
||
695 | $row1 .= " </tr>\n"; |
||
696 | $row2 .= " </tr>\n"; |
||
697 | echo "{$row1} {$row2}"; |
||
698 | |||
699 | echo "</table>\n"; |
||
700 | |||
701 | $query_Recordset1 = 'SELECT * FROM ' . $xoopsDB->prefix('donations_config') . " WHERE name = 'month_goal' AND subtype<>'Default'"; |
||
702 | $Recordset1 = $xoopsDB->query($query_Recordset1); |
||
703 | $row_Recordset1 = $xoopsDB->fetchArray($Recordset1); |
||
704 | $totalRows_Recordset1 = $xoopsDB->getRowsNum($Recordset1); |
||
705 | $desc = htmlentities($row_Recordset1['text'], ENT_QUOTES | ENT_HTML5); |
||
706 | |||
707 | $h = 0; |
||
708 | echo "<table style=\"border-width: 1px; width: 100px; text-align: center;\">\n"; |
||
709 | echo ' <tr><td style="text-align: center; width: 100%; font-weight: bold;" colspan="13">' . _AD_XDONATION_GOAL_MENSUEL . "</td></tr><br>\n"; |
||
710 | $row1 = " <tr>\n" . ' <td style="text-align: center; font-weight: bold;">' . _AD_XDONATION_MONTH . "</td>\n"; |
||
711 | $row2 = " <tr>\n" . ' <td style="text-align: center; font-weight: bold;">' . _AD_XDONATION_GOAL . "</td>\n"; |
||
712 | do { |
||
713 | $month = $shortMonth[$h++]; |
||
714 | $row1 .= " <td title=\"{$desc}\" style=\"text-align: center;\">{$month}</td>\n"; |
||
715 | $row2 .= " <td title=\"{$desc}\" style=\"text-align: center;\"><input size=\"4\" name=\"var_month_goal-$row_Recordset1[subtype]\" type=\"text\" value=\"$row_Recordset1[value]\" onChange=\"return validInt(this,'$row_Recordset1[subtype] " |
||
716 | . _AD_XDONATION_GOAL_DONATION |
||
717 | . "',1,'" |
||
718 | . _AD_XDONATION_ALERTE_INPUT_NUMBER |
||
719 | . "');\"></td>\n"; |
||
720 | } while (false !== ($row_Recordset1 = $xoopsDB->fetchArray($Recordset1))); |
||
721 | $row1 .= " </tr>\n"; |
||
722 | $row2 .= " </tr>\n"; |
||
723 | echo "{$row1}{$row2}"; |
||
724 | |||
725 | echo "</table>\n"; |
||
726 | echo "<table style=\"border-width: 1px; width: 100px; text-align: center;\">\n"; |
||
727 | $utility::showTextBox('swing_day', '<span style=\'font-weight: bold;\'>' . _AD_XDONATION_SWING_DAY . '</span>', '175', '4', "onChange='return validInt(this,\"" . _AD_XDONATION_SWING_DAY . '",1,"' . _AD_XDONATION_ALERTE_INPUT_NUMBER . "\");'"); |
||
728 | echo "</table>\n"; |
||
729 | |||
730 | $query_Recordset1 = 'SELECT * FROM ' . $xoopsDB->prefix('donations_config') . " WHERE name = 'quarter_goal' AND subtype<>'Default'"; |
||
731 | $Recordset1 = $xoopsDB->query($query_Recordset1); |
||
732 | $row_Recordset1 = $xoopsDB->fetchArray($Recordset1); |
||
733 | $totalRows_Recordset1 = $xoopsDB->getRowsNum($Recordset1); |
||
734 | $desc = htmlentities($row_Recordset1['text'], ENT_QUOTES | ENT_HTML5); |
||
735 | |||
736 | echo "<table style=\"border-width: 1px; width: 100px; text-align: center;\">\n"; |
||
737 | echo ' <tr><td style="text-align: center; width: 100%; font-weight: bold;" colspan="5">' . _AD_XDONATION_QUARTER . "<br></td></tr>\n"; |
||
738 | $row1 = ' <tr><td style="text-align: center; font-weight: bold;">' . _AD_XDONATION_QUARTER . "</td>\n"; |
||
739 | $row2 = ' <tr><td style="text-align: center; font-weight: bold;">' . _AD_XDONATION_GOAL . "</td>\n"; |
||
740 | $h = 0; |
||
741 | do { |
||
742 | $ord = $ordinaux[$h++]; |
||
743 | $row1 .= " <td title='{$desc}' class='center;'>{$ord}</td>\n"; |
||
744 | $row2 .= " <td title='{$desc}' class='center;'><input size=\"4\" name=\"var_quarter_goal-$row_Recordset1[subtype]\" type=\"text\" value=\"$row_Recordset1[value]\" onChange=\"return validInt(this,'$row_Recordset1[subtype] " |
||
745 | . _AD_XDONATION_GOAL_DONATION |
||
746 | . "',1,'" |
||
747 | . _AD_XDONATION_ALERTE_INPUT_NUMBER |
||
748 | . "');\"></td>\n"; |
||
749 | } while (false !== ($row_Recordset1 = $xoopsDB->fetchArray($Recordset1))); |
||
750 | $row1 .= " </tr>\n"; |
||
751 | $row2 .= " </tr>\n"; |
||
752 | echo "{$row1} {$row2}"; |
||
753 | |||
754 | echo "</table><br>\n"; |
||
755 | echo "</td></tr>\n"; |
||
756 | echo '<tr><td style="text-align: center; width: 100%;"><input type="submit" value="' . _AD_XDONATION_SUBMIT . "\"></td></tr>\n"; |
||
757 | echo "</table><br>\n"; |
||
758 | echo "</td></tr></table>\n"; |
||
759 | echo "</form>\n"; |
||
760 | } |
||
982 |