Exemple #1
0
function add_to_msg($msg, $silent = true, $logonly = false)
{
    global $client_sync_msg;
    $client_sync_msg .= $msg;
    $GLOBALS['log']->info("SYNC:" . strip_tags($msg));
    if (!$logonly) {
        display_sync_status($msg, 'current_substatus');
        if (!$silent) {
            echo "<script>document.getElementById('current_msg').innerHTML +='{$msg}'</script>";
            echo str_repeat(' ', 256);
            flush();
        }
    }
}
Exemple #2
0
     }
     add_to_msg("Sync started at LOCAL:" . $timedate->to_display_date_time($local_time, true) . "  SERVER:" . $timedate->to_display_date_time($start_time, true) . "<br>");
     flush();
     $_SESSION['sync_start_time'] = $start_time;
     $_SESSION['sync_local_time'] = $local_time;
 } else {
     $start_time = $_SESSION['sync_start_time'];
     $local_time = $_SESSION['sync_local_time'];
     add_to_msg("Sync started at LOCAL:" . $timedate->to_display_date_time($local_time, true) . "  SERVER:" . $timedate->to_display_date_time($start_time, true) . "<br>");
     flush();
 }
 if (!isset($_REQUEST['offset']) && !isset($_REQUEST['rel_offset'])) {
     add_to_msg($title, true, true);
     add_to_msg("<br>Module: " . $sync_module . " <br>Last Sync- LOCAL:" . $timedate->to_display_date_time($local_last_sync, true) . " SERVER:" . $timedate->to_display_date_time($last_sync, true) . "<br>", false);
 }
 display_sync_status($title);
 //if we have an offset we already cleared the module
 if ($clean_sync == 1 && empty($_REQUEST['offset']) && empty($_REQUEST['rel_offset'])) {
     add_to_msg("Clearing Records For " . $sync_module);
     clean_for_sync($sync_module);
     $max = $CLEAN_SYNC_MAX;
     $rel_max = $CLEAN_SYNC_MAX;
 }
 //Step 1 Retrieve Records From Local Machine
 if (empty($_REQUEST['offset']) && empty($_REQUEST['rel_offset'])) {
     add_to_msg("Retrieving Modified Records - Local<br>", false);
     //Current Time In GMT
     if ($sync_modules[$sync_module_index]['direction'] == 'both' || $sync_modules[$sync_module_index] == 'up') {
         if (!isset($_SESSION['sync_entry_list'])) {
             $altered = get_altered($sync_module, $local_last_sync, $local_time);
         } else {