<?php
/**
 * Shop-Reviews
 *
 * @released under the GNU General Public License
 * inspired and in parts based on
 * Copyright (c) 2003 osCommerce
 * @author H-P Sausen
 * @copyright (c) since 2010 web4design.de
 * @contact webmaster@web4design.de
 * @version 3.0
 */

include(MH_DIR_CONFIG . 'config_shopvoting/admin/common.php');
include(MH_DIR_CONFIG . 'config_shopvoting/admin/common_header.php');
?>

<div id="borderbox">
<div class="">
<?php echo WEB4DESIGN_DE_SR_SYNCHRONIZATION_INFO_TEXT; ?>
</div>
<div class="splitter">&nbsp;</div>
    
        <table class="maintab">
            <tr>
                <td colspan="3">
                
                    <?php 
                    
                    if($_GET['syncpage'] != '') {
                        echo '<div class="successsync">' . $voting->old_new_version_synchronization($_GET['syncpage']) . '</div>';
                        
                    }
                    
                    if($_GET['deletepage'] != '') {
                        echo '<div class="successsync">' . $voting->delete_old_database($_GET['deletepage']) . '</div>';   

                    if(sizeof($voting->check_pre_version()) <= 0) {
                        mh_redirect(shopvoting_admin_page_link(Shopvoting::FILENAME_SHOPREVIEW_MANAGE));
                    }

                        
                    }
                    
                    ?>
                
                    <?php
                    if ($_POST) {
                        $voting->__construct();

                        ?>
                        <div class="speichern"><?php echo WEB4DESIGN_DE_SR_UPDATED; ?></div>
                    <?php } ?>
                </td>
            </tr>
            <tr>
                <td width="49%" style="vertical-align: top;">
                    <p class="adminConfigHeader"><strong><?php echo WEB4DESIGN_DE_SR_SYNCHRONIZATION_DBS_OLD; ?></strong></p>
<?php

$table_array = $voting->check_pre_version();

echo '<table class="settingtab">';
echo '<tr>';
echo '<th style="width: 180px;">' . WEB4DESIGN_DE_SR_SYNCHRONIZATION_TOPIC_DB . '</th>';
echo '<th style="width: 80px;">' . WEB4DESIGN_DE_SR_SYNCHRONIZATION_TOPIC_DB_ENTRYS . '</th>';
echo '<th style="width: 80px;">' . WEB4DESIGN_DE_SR_SYNCHRONIZATION_TOPIC_SYNC . '</th>';
echo '</tr>';

foreach($table_array as $key => $value) {
    echo '<tr>';
    echo '<td>' . $key . '</td>';
    echo '<td>' . $value . '</td>';
    echo '<td><a href="' . shopvoting_admin_page_link(Shopvoting::FILENAME_SHOPREVIEW_SYNCHRONIZATION,'syncpage=' . $key) . '">' . WEB4DESIGN_DE_SR_SYNCHRONIZATION_BUTTON_SYNC . '</td>';
    echo '</tr>';
}
echo '</table>';

?>
                </td>
                <td width="2%">&nbsp;</td>
                <td width="49%" style="vertical-align: top;">
                    <p class="adminConfigHeader"><strong><?php echo WEB4DESIGN_DE_SR_SYNCHRONIZATION_DBS_NEW; ?></strong></p>
                
                
<?php

$table_array = $voting->check_current_version();

echo '<table class="settingtab">';
echo '<tr>';
echo '<th style="width: 180px;">' . WEB4DESIGN_DE_SR_SYNCHRONIZATION_TOPIC_DB . '</th>';
echo '<th style="width: 80px;">' . WEB4DESIGN_DE_SR_SYNCHRONIZATION_TOPIC_DB_ENTRYS . '</th>';
echo '</tr>';

foreach($table_array as $key => $value) {
    echo '<tr>';
    echo '<td>' . $key . '</td>';
    echo '<td>' . $value . '</td>';
    echo '</tr>';
}
echo '</table>';

?>                
                
                
                </td>
            </tr>
        </table>
<br /><br />
<div class="splitter">&nbsp;</div>
<?php

$table_array = $voting->check_pre_version();
echo '<p>' . WEB4DESIGN_DE_SR_SYNCHRONIZATION_INFO_TEXT_DELETE . '</p>';
echo '<table class="settingtab" style="width: 300px;">';
echo '<tr>';
echo '<th style="width:220px;">' . WEB4DESIGN_DE_SR_SYNCHRONIZATION_TOPIC_DB . '</th>';
echo '<th style="width:80px;">' . WEB4DESIGN_DE_SR_SYNCHRONIZATION_TOPIC_DELETE . '</th>';
echo '</tr>';  
foreach($table_array as $key => $value) {
    echo '<tr>';
    echo '<td>' . $key . '</td>';
    echo '<td><a href="' . shopvoting_admin_page_link(Shopvoting::FILENAME_SHOPREVIEW_SYNCHRONIZATION,'deletepage=' . $key) . '">' . WEB4DESIGN_DE_SR_SYNCHRONIZATION_BUTTON_DELETE . '</td>';
    echo '</tr>';
}
echo '</table>';


?>
        
        
    <p class="clr">&nbsp;</p>
</div>
