| 1 |
<?php |
| 2 |
/** |
| 3 |
* Migration page template |
| 4 |
* |
| 5 |
* @package EasyInvoice |
| 6 |
* @subpackage Migration |
| 7 |
* @since 2.0.0 |
| 8 |
*/ |
| 9 |
|
| 10 |
// Prevent direct access |
| 11 |
if (!defined('ABSPATH')) { |
| 12 |
exit; |
| 13 |
} |
| 14 |
|
| 15 |
$version_checker = EasyInvoice\Migration\VersionChecker::get_instance(); |
| 16 |
$current_version = $version_checker->get_stored_version(); |
| 17 |
$target_version = $version_checker->get_target_version(); |
| 18 |
$is_completed = $version_checker->is_migration_completed(); |
| 19 |
?> |
| 20 |
|
| 21 |
<?php if ($is_completed): ?> |
| 22 |
<!-- Migration Completed View --> |
| 23 |
<div class="wrap"> |
| 24 |
<div class="migration-container"> |
| 25 |
<div class="migration-header"> |
| 26 |
<h2>Easy Invoice Migration</h2> |
| 27 |
<div class="notice notice-success inline"> |
| 28 |
<p><strong>� |
| 29 |
Migration Completed Successfully!</strong></p> |
| 30 |
<p>Your Easy Invoice plugin has been successfully migrated to version <?php echo esc_html($target_version); ?>.</p> |
| 31 |
</div> |
| 32 |
</div> |
| 33 |
|
| 34 |
<div class="migration-info"> |
| 35 |
<h3>Migration Summary</h3> |
| 36 |
<table class="widefat"> |
| 37 |
<tr> |
| 38 |
<td><strong>Previous Version:</strong></td> |
| 39 |
<td><?php echo esc_html($current_version); ?></td> |
| 40 |
</tr> |
| 41 |
<tr> |
| 42 |
<td><strong>Current Version:</strong></td> |
| 43 |
<td><?php echo esc_html($target_version); ?></td> |
| 44 |
</tr> |
| 45 |
<tr> |
| 46 |
<td><strong>Migration Status:</strong></td> |
| 47 |
<td><span class="dashicons dashicons-yes-alt" style="color: green;"></span> Completed</td> |
| 48 |
</tr> |
| 49 |
</table> |
| 50 |
</div> |
| 51 |
|
| 52 |
<div class="migration-actions" style="margin-top: 20px;"> |
| 53 |
<a href="<?php echo admin_url('admin.php?page=easy-invoice'); ?>" class="button button-primary"> |
| 54 |
<span class="dashicons dashicons-dashboard"></span> Go to Dashboard |
| 55 |
</a> |
| 56 |
<button id="view-migration-log" class="button button-secondary"> |
| 57 |
<span class="dashicons dashicons-list-view"></span> View Migration Log |
| 58 |
</button> |
| 59 |
</div> |
| 60 |
|
| 61 |
<div id="migration-log-container" style="display: none; margin-top: 20px;"> |
| 62 |
<div class="migration-log-container"> |
| 63 |
<div class="log-header"> |
| 64 |
<h3>Migration Log</h3> |
| 65 |
<button id="copy-log" class="button button-secondary" title="Copy log to clipboard"> |
| 66 |
<span class="dashicons dashicons-clipboard"></span> Copy Log |
| 67 |
</button> |
| 68 |
</div> |
| 69 |
<div id="migration-log"></div> |
| 70 |
</div> |
| 71 |
</div> |
| 72 |
</div> |
| 73 |
</div> |
| 74 |
<?php else: ?> |
| 75 |
<!-- Migration Pending View --> |
| 76 |
<div class="wrap"> |
| 77 |
<div class="migration-container"> |
| 78 |
<div class="migration-header"> |
| 79 |
<h2>Easy Invoice Migration</h2> |
| 80 |
<p> |
| 81 |
Current Version: <?php echo esc_html($current_version); ?><br> |
| 82 |
Target Version: <?php echo esc_html($target_version); ?> |
| 83 |
</p> |
| 84 |
</div> |
| 85 |
|
| 86 |
<div class="migration-progress-bar"> |
| 87 |
<div id="migration-progress"></div> |
| 88 |
</div> |
| 89 |
|
| 90 |
<div class="migration-steps"> |
| 91 |
<div id="migration-step-settings" class="migration-step pending"> |
| 92 |
<div class="step-icon">1</div> |
| 93 |
<div class="step-content"> |
| 94 |
<div class="step-title">Settings Migration</div> |
| 95 |
<div class="step-message">Pending...</div> |
| 96 |
</div> |
| 97 |
</div> |
| 98 |
|
| 99 |
<div id="migration-step-clients" class="migration-step pending"> |
| 100 |
<div class="step-icon">2</div> |
| 101 |
<div class="step-content"> |
| 102 |
<div class="step-title">Clients Migration</div> |
| 103 |
<div class="step-message">Pending...</div> |
| 104 |
</div> |
| 105 |
</div> |
| 106 |
|
| 107 |
<div id="migration-step-post_types" class="migration-step pending"> |
| 108 |
<div class="step-icon">3</div> |
| 109 |
<div class="step-content"> |
| 110 |
<div class="step-title">Posts Migration</div> |
| 111 |
<div class="step-message">Pending...</div> |
| 112 |
</div> |
| 113 |
</div> |
| 114 |
|
| 115 |
<div id="migration-step-meta" class="migration-step pending"> |
| 116 |
<div class="step-icon">4</div> |
| 117 |
<div class="step-content"> |
| 118 |
<div class="step-title">Meta Data Migration</div> |
| 119 |
<div class="step-message">Pending...</div> |
| 120 |
</div> |
| 121 |
</div> |
| 122 |
|
| 123 |
<div id="migration-step-pro_options" class="migration-step pending"> |
| 124 |
<div class="step-icon">5</div> |
| 125 |
<div class="step-content"> |
| 126 |
<div class="step-title">Pro Options Migration</div> |
| 127 |
<div class="step-message">Pending...</div> |
| 128 |
</div> |
| 129 |
</div> |
| 130 |
|
| 131 |
<div id="migration-step-cleanup" class="migration-step pending"> |
| 132 |
<div class="step-icon">6</div> |
| 133 |
<div class="step-content"> |
| 134 |
<div class="step-title">Cleanup</div> |
| 135 |
<div class="step-message">Pending...</div> |
| 136 |
</div> |
| 137 |
</div> |
| 138 |
</div> |
| 139 |
|
| 140 |
<div id="migration-error"></div> |
| 141 |
|
| 142 |
<div class="migration-log-container"> |
| 143 |
<div class="log-header"> |
| 144 |
<h3>Migration Log</h3> |
| 145 |
<button id="copy-log" class="button button-secondary" title="Copy log to clipboard"> |
| 146 |
<span class="dashicons dashicons-clipboard"></span> Copy Log |
| 147 |
</button> |
| 148 |
</div> |
| 149 |
<div id="migration-log"></div> |
| 150 |
</div> |
| 151 |
|
| 152 |
<div class="migration-actions" style="margin-top: 20px;"> |
| 153 |
<button id="start-migration" class="button button-primary"> |
| 154 |
Start Migration |
| 155 |
</button> |
| 156 |
</div> |
| 157 |
</div> |
| 158 |
</div> |
| 159 |
<?php endif; ?> |