← All changes
|
inc/admin/views/tools/database/html-clean-database.php
+75
-75
4.3.9
→
4.4.8
View file →
| @@ -1,75 +1,75 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * Template tool create indexs fo tables database. | |
| 4 | - * | |
| 5 | - * @template html-create-indexs-tables | |
| 6 | - * @author tungnx | |
| 7 | - * @package learnpress/admin/views/tools/database | |
| 8 | - * @version 1.0.0 | |
| 9 | - * @since 4.0.3 | |
| 10 | - */ | |
| 11 | - | |
| 12 | -defined( 'ABSPATH' ) or die(); | |
| 13 | -$lp_db_sessions = LP_Sessions_DB::getInstance(); | |
| 14 | -global $wpdb; | |
| 15 | -$clean_tables = array( 'learnpress_sessions' ); | |
| 16 | -?> | |
| 17 | - | |
| 18 | -<div class="card" id="lp-tool-clean-database"> | |
| 19 | - <h2><?php echo sprintf( '%s', __( 'Clean Data System', 'learnpress' ) ); ?></h2> | |
| 20 | - <p><?php _e( 'Remove old data, not use or expire', 'learnpress' ); ?></p> | |
| 21 | - <div class="tools-prepare__message"></div> | |
| 22 | - <div id="tools-select__id" class="tools-select__data"> | |
| 23 | - <ul class="clean-table"> | |
| 24 | - <?php | |
| 25 | - foreach ( $clean_tables as $clean_table ) : | |
| 26 | - $color_code = '#ffffff'; | |
| 27 | - $rows = $lp_db_sessions->count_row_db_sessions(); | |
| 28 | - if ( $rows > 500 ) { | |
| 29 | - $color_code = '#ff0000'; | |
| 30 | - } | |
| 31 | - ?> | |
| 32 | - <li style="background-color: <?php echo esc_attr( $color_code ); ?>"> | |
| 33 | - <input type="checkbox" id="clean-table__<?php echo esc_attr( $clean_table ); ?>" | |
| 34 | - name="clean-table__<?php echo esc_attr( $clean_table ); ?>" | |
| 35 | - value="<?php echo esc_attr( $clean_table ); ?>"> | |
| 36 | - <label for="clean-table__<?php echo esc_attr( $clean_table ); ?>"> | |
| 37 | - <?php echo sprintf( '%s (%d) %s', $clean_table, $lp_db_sessions->count_row_db_sessions(), __( 'rows expire', 'learnpress' ) ); ?> | |
| 38 | - </label> | |
| 39 | - <br> | |
| 40 | - </li> | |
| 41 | - <?php endforeach; ?> | |
| 42 | - </ul> | |
| 43 | - </div> | |
| 44 | - <p class="tools-button"> | |
| 45 | - <button type="button" class="button lp-btn lp-btn-clean-db"> | |
| 46 | - <?php esc_html_e( 'Delete', 'learnpress' ); ?> | |
| 47 | - </button> | |
| 48 | - </p> | |
| 49 | - | |
| 50 | - <div class="wrapper-lp-loading" style="display: none"> | |
| 51 | - <?php | |
| 52 | - $i = 0; | |
| 53 | - foreach ( $clean_tables as $clean_table ) : | |
| 54 | - ++$i; | |
| 55 | - $rows = $lp_db_sessions->count_row_db_sessions(); | |
| 56 | - ?> | |
| 57 | - <div class="progressbar__item step-<?php echo esc_attr( $i ); ?>" data-total="<?php echo esc_attr( $rows ); ?>"> | |
| 58 | - <div class="progressbar__container"> | |
| 59 | - <div class="progressbar__content"> | |
| 60 | - <h4><?php echo sprintf( '%s: %s', esc_html__( 'Table name', 'learnpress' ), $clean_table ); ?></h4> | |
| 61 | - <div class="progressbar__indexs"> | |
| 62 | - <span class="progressbar__rows"> | |
| 63 | - <?php echo sprintf( '0 / %d %s', $rows, __( 'expire', 'learnpress' ) ); ?> | |
| 64 | - </span> | |
| 65 | - <span class="progressbar__percent">( 0% )</span> | |
| 66 | - </div> | |
| 67 | - </div> | |
| 68 | - <div class="progressbar__value"></div> | |
| 69 | - </div> | |
| 70 | - </div> | |
| 71 | - <div class="lp-tool__message"></div> | |
| 72 | - <?php endforeach; ?> | |
| 73 | - </div> | |
| 74 | -</div> | |
| 75 | - | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Template tool create indexs fo tables database. | |
| 4 | + * | |
| 5 | + * @template html-create-indexs-tables | |
| 6 | + * @author tungnx | |
| 7 | + * @package learnpress/admin/views/tools/database | |
| 8 | + * @version 1.0.0 | |
| 9 | + * @since 4.0.3 | |
| 10 | + */ | |
| 11 | + | |
| 12 | +defined( 'ABSPATH' ) or die(); | |
| 13 | +$lp_db_sessions = LP_Sessions_DB::getInstance(); | |
| 14 | +global $wpdb; | |
| 15 | +$clean_tables = array( 'learnpress_sessions' ); | |
| 16 | +?> | |
| 17 | + | |
| 18 | +<div class="card" id="lp-tool-clean-database"> | |
| 19 | + <h2><?php echo sprintf( '%s', __( 'Clean Data System', 'learnpress' ) ); ?></h2> | |
| 20 | + <p><?php _e( 'Remove old data, not use or expire', 'learnpress' ); ?></p> | |
| 21 | + <div class="tools-prepare__message"></div> | |
| 22 | + <div id="tools-select__id" class="tools-select__data"> | |
| 23 | + <ul class="clean-table"> | |
| 24 | + <?php | |
| 25 | + foreach ( $clean_tables as $clean_table ) : | |
| 26 | + $color_code = '#ffffff'; | |
| 27 | + $rows = $lp_db_sessions->count_row_db_sessions(); | |
| 28 | + if ( $rows > 500 ) { | |
| 29 | + $color_code = '#ff0000'; | |
| 30 | + } | |
| 31 | + ?> | |
| 32 | + <li style="background-color: <?php echo esc_attr( $color_code ); ?>"> | |
| 33 | + <input type="checkbox" id="clean-table__<?php echo esc_attr( $clean_table ); ?>" | |
| 34 | + name="clean-table__<?php echo esc_attr( $clean_table ); ?>" | |
| 35 | + value="<?php echo esc_attr( $clean_table ); ?>"> | |
| 36 | + <label for="clean-table__<?php echo esc_attr( $clean_table ); ?>"> | |
| 37 | + <?php echo sprintf( '%s (%d) %s', $clean_table, $lp_db_sessions->count_row_db_sessions(), __( 'rows expire', 'learnpress' ) ); ?> | |
| 38 | + </label> | |
| 39 | + <br> | |
| 40 | + </li> | |
| 41 | + <?php endforeach; ?> | |
| 42 | + </ul> | |
| 43 | + </div> | |
| 44 | + <p class="tools-button"> | |
| 45 | + <button type="button" class="button lp-btn lp-btn-clean-db"> | |
| 46 | + <?php esc_html_e( 'Delete', 'learnpress' ); ?> | |
| 47 | + </button> | |
| 48 | + </p> | |
| 49 | + | |
| 50 | + <div class="wrapper-lp-loading" style="display: none"> | |
| 51 | + <?php | |
| 52 | + $i = 0; | |
| 53 | + foreach ( $clean_tables as $clean_table ) : | |
| 54 | + ++$i; | |
| 55 | + $rows = $lp_db_sessions->count_row_db_sessions(); | |
| 56 | + ?> | |
| 57 | + <div class="progressbar__item step-<?php echo esc_attr( $i ); ?>" data-total="<?php echo esc_attr( $rows ); ?>"> | |
| 58 | + <div class="progressbar__container"> | |
| 59 | + <div class="progressbar__content"> | |
| 60 | + <h4><?php echo sprintf( '%s: %s', esc_html__( 'Table name', 'learnpress' ), $clean_table ); ?></h4> | |
| 61 | + <div class="progressbar__indexs"> | |
| 62 | + <span class="progressbar__rows"> | |
| 63 | + <?php echo sprintf( '0 / %d %s', $rows, __( 'expire', 'learnpress' ) ); ?> | |
| 64 | + </span> | |
| 65 | + <span class="progressbar__percent">( 0% )</span> | |
| 66 | + </div> | |
| 67 | + </div> | |
| 68 | + <div class="progressbar__value"></div> | |
| 69 | + </div> | |
| 70 | + </div> | |
| 71 | + <div class="lp-tool__message"></div> | |
| 72 | + <?php endforeach; ?> | |
| 73 | + </div> | |
| 74 | +</div> | |
| 75 | + | |