= '$lastmod' and chgby != '{$_SESSION['instance']['prefix']}' order by lastmod asc, tid asc"; // $toRcv = mysql_query($rcvQuery, $rLink); // $nToRcv = mysql_num_rows($toRcv); // // $sndQuery = "select * from `transaction_log` order by lastmod"; // $toSnd = mysql_query($sndQuery, $mLink); // $nToSnd = mysql_num_rows($toSnd); // // $_SESSION['sync']['ttl'] = $nToSnd + $nToRcv; // // if (false and $_SESSION['sync']['ttl'] > 150) // { // while ($r = mysql_fetch_assoc($toSnd)) // { $ta['tid'] = $r['tid']; // $ta['lastmod'] = $r['lastmod']; // $ta['tble'] = $r['tble']; // $ta['chgby'] = $r['chgby']; // // $_SESSION['snd'][] = $ta; // } // while ($r = mysql_fetch_assoc($toRcv)) // { $ta['tid'] = $r['tid']; // $ta['lastmod'] = $r['lastmod']; // $ta['tble'] = $r['tble']; // $ta['chgby'] = $r['chgby']; // // $_SESSION['rcv'][] = $ta; // } // // $_SESSION['request'] = $_REQUEST; // // include_once 'header.html'; // // echo "\n"; // echo "\n"; // // echo "


\n"; // echo " \n"; // echo " \n"; // echo " \n"; // echo " \n"; // echo " \n"; // echo " \n"; // echo " \n"; // echo " \n"; // echo " \n"; // echo " \n"; // echo "
\n"; // echo "

Synchronizing; please wait

"; // echo "
\n"; // echo " Page will automatically reload in a moment.....\n"; // echo "


\n"; // echo " \n"; // echo "
\n"; //// debug(); // echo " \n"; // echo "\n"; // exit(0); // } // } // $_SESSION['instance']['hasSyncd'] = 'yes'; $_SESSION['current']['period'] = calcDates(); if ($_REQUEST['p'] == "signout" or $_REQUEST['p'] == "stale") { // log the logout if ($_REQUEST['p'] == "signout") { $msg = "LOGOUT_NORMAL"; $caller = ""; //$caller = $_SESSION['user']['userName']; } else { //$msg = "AUTOLOGOUT_STALE"; //$caller = "SYSTEM"; $msg = "AUTOLOGOUT"; $caller = "STALE"; } sqlUpdate("logins", "locked='$msg [$caller]', touch='".date("YmdHis")."',activity=''", "tid='".$_SESSION['user']['sessionTid']."'", true, false); // preserve "calendar only" flag if ($_SESSION['instance']['calendarView']) $additional = "&calendar"; else $additional = ""; // Unset all of the session variables. $_SESSION = array(); // If it's desired to kill the session, also delete the session cookie. // Note: This will destroy the session, and not just the session data! if (ini_get("session.use_cookies")) { $params = session_get_cookie_params(); setcookie(session_name(), '', time() - 42000, $params["path"], $params["domain"], $params["secure"], $params["httponly"]); } session_destroy(); echo "\n"; exit(); } if (array_key_exists("dropAutoLogIn", $_REQUEST)) { setcookie("alii[loginName]", "", time() - 3600); setcookie("alii[passwrd]", "", time() - 3600); } if (!array_key_exists("dropAutoLogIn", $_REQUEST) and !array_key_exists("noLogIn", $_REQUEST) and empty($_SESSION['user'])) { // autologin by cookie if (!empty($_REQUEST['loginName']) and !empty($_REQUEST['passwrd']) and array_key_exists("saveLogIn", $_REQUEST)) { // save cookie - "alii" = "Aspin Log In Information" setcookie("alii[loginName]", $_REQUEST['loginName'], time() + 2592000, "/"); setcookie("alii[passwrd]", $_REQUEST['passwrd'], time() + 2592000, "/"); } else if (empty($_REQUEST['loginName']) and empty($_REQUEST['passwrd']) and isset($_COOKIE['alii'])) { // if there is a cookie, load details foreach ($_COOKIE['alii'] as $name => $value) $_REQUEST[$name] = $value; setcookie("alii[loginName]", $_REQUEST['loginName'], time() + 2592000, "/"); setcookie("alii[passwrd]", $_REQUEST['passwrd'], time() + 2592000, "/"); } } $defaults = array ( "myaspin" => "news", "orders" => "search", "calendar" => "calendar", "reports" => "timesheets", "inventory" => "receive", "management" => "createclient", "scheduling" => "scheduling", "help" => "about", "update" => "updates" ); if ($_SESSION['user']['empNo'] == 3) // I prefer to start on 'accountable labor' $defaults['reports'] = "labortimes"; $screenWidth = 1000; if (!empty($_REQUEST['archive'])) { $oldPath = pathinfo($_REQUEST['archive']); $newPatchName = "archive/".$oldPath['dirname']."/".$oldPath['filename'].".".date("YmdHis").".".$oldPath['extension']; rename($_REQUEST['archive'], $newPatchName); unset($_REQUEST['archive']); } //----- attempt to fix ' in REQUEST ----- $arrayValues[0]['v'] = $_REQUEST; $idx = 0; while ($idx < count($arrayValues)) { foreach ($arrayValues[$idx]['v'] as $k => $v) { if (is_array($v)) { //$nv = count($arrayValues); //$arrayValues[$nv]['v'] = $v; //$arrayValues[$nv]['k'] = $arrayValues[$idx]['k']."[$k]"; } else if ($k != "SC035") { //echo $head.$arrayValues[$idx]['k']."[$k] => $v".$tail."\n"; if (strpos($v, "\'") !== false) { //echo "\n"; $_REQUEST[$k] = str_replace("\'", "´", $v); //echo "\n"; } } } $idx++; } //----- end fix ----- include_once 'header.html'; // check for updates // if ($rLink and ($_SESSION['instance']['sdbIfce'] == $_SESSION['instance']['master'])) // { // $udList = "select * from updatesql where terminal not like '%|{$_SESSION['instance']['prefix']}%'"; // echo "\n"; // $udList = mysql_query($udList, $rLink); // add $rlink here .... // while ($ud = mysql_fetch_assoc($udList)) // { mysql_query($ud['query'], $mLink); // mysql_query("update updatesql set terminal='{$ud['terminal']}{$_SESSION['instance']['prefix']}|' where idx='{$ud['idx']}'", $rLink); // } // // $udList = "select * from updates where terminal like '%|{$_SESSION['instance']['prefix']}%'"; // $udList = mysql_query($udList, $rLink); // if (mysql_num_rows($udList)) // { // while ($ud = mysql_fetch_assoc($udList)) // { // settin UPDATE_ENABLED to false will cause the system to NOT copy the updates // // but to flag them all as done anyway - this is mostly for new systems that start // // with an up-to-date file system so that it doesn't waste resources overwriting // // files that don't need to be // if ($_SESSION['instance']['UPDATE_ENABLED']) // { $src = $_SESSION['instance']['UPDATE_SOURCE'].$ud['source']; // echo "\n"; // // $dest = $_SESSION['instance']['DOCUMENT_ROOT'].$ud['destination']; // $fInfo = pathinfo($dest); // $destBak = $fInfo['dirname']."/".$fInfo['filename'].".".date("YmdHis").".".$fInfo['extension']; // echo "\n"; // // if (file_exists($dest)) // rename($dest, $destBak); // // $data = file_get_contents($src); // $handle = fopen($dest, "w"); // if ($handle !== false) // { // fwrite($handle, $data); // fclose($handle); // // $udStr = str_replace("|".$_SESSION['instance']['prefix'], $ud['terminal']); // mysql_query("update updates set terminal='$udStr' where idx='{$ud['idx']}'", $rLink); // } // } // else // mysql_query("update updates set terminal='{$ud['terminal']}{$_SESSION['instance']['prefix']}|' where idx='{$ud['idx']}'", $rLink); // } // } // else // echo "\n"; // } // end updating include_once 'preprocess.php'; // preprocessing for "closed call" search and "message left" search if (in_array($_SESSION['user']['empNo'], array( 2, 3))) { $todayStr = date("Ymd"); if (empty($_REQUEST['targetFromDate'])) { if (empty($_SESSION['wDate'])) { $_REQUEST['targetFromDate'] = $todayStr; $_REQUEST['targetToDate'] = $todayStr; } else { $_REQUEST['targetFromDate'] = $_SESSION['wDate']; $_REQUEST['targetToDate'] = $_SESSION['w2Date']; } } $nwDate = str_replace(array("-",".","/","\\"), "", $_REQUEST['targetFromDate']); $nw2Date = str_replace(array("-",".","/","\\"), "", $_REQUEST['targetToDate']); if ($nw2Date < $nwDate) { if ($nwDate == $_SESSION['wDate']) { $wDate = $nw2Date; $w2Date = $nw2Date; } else { $wDate = $nwDate; $w2Date = $nwDate; } } else { $wDate = $nwDate; $w2Date = $nw2Date; } $_SESSION['wDate'] = $wDate; $_SESSION['w2Date'] = $w2Date; if ($_REQUEST['targetFromDate'] == $todayStr) $targetDateIsToday = true; else $targetDateIsToday = false; } if ($_SESSION['user']['empNo'] and $_SESSION['user']['empNo'] != 3) $stale = " onLoad = \"setTimeout('document.location.href=\'./?p=stale\'', ".($_SESSION['GLOBAL_TIMEOUT'] * 60000).");\""; echo "\n"; echo "\n"; echo "\n"; echo " \n"; echo " "; echo " \n"; echo "\t\t\n\n"; echo " \n"; echo " \n"; echo "\t\t\n"; echo "\t\t\t\n"; echo "\t\t\n"; echo " \n"; echo "\n"; echo "\t\t\n"; $inc_pg = "modules/".$_SESSION['current']['p'].".php"; include $inc_pg; echo "\t\t\n"; echo " \n"; echo "
"; echo "
"; echo " \n"; echo "
    \n"; if (!empty($_SESSION['user'])) { if (!$_SESSION['instance']['calendarView']) { mkTab("myaspin","myServMan", "navagation1", "p", $_SESSION['current']['p']); mkTab("orders","Orders", "navagation1", "p", $_SESSION['current']['p']); } mkTab("scheduling","Calendar", "navagation1", "p", $_SESSION['current']['p']); if (!$_SESSION['instance']['calendarView']) { if ($_SESSION['user']['access'] & 0x0008) mkTab("reports","Reports", "navagation1", "p", $_SESSION['current']['p']); if ($_SESSION['user']['empNo'] == 3) mkTab("inventory","Inventory", "navagation1", "p", $_SESSION['current']['p']); mkTab("management","Management", "navagation1", "p", $_SESSION['current']['p']); //if ($_SESSION['user']['empNo'] == 3)//if ($screenWidth == 1250) // mkTab("update","Manage Updates", "navagation1", "p", $_SESSION['current']['p']); } if ($_SESSION['instance']['prefix']== "035") mkTab("tinytodo","To Do Lists", "navagation1", "p", $_SESSION['current']['p']); if (in_array($_SESSION['user']['empNo'], array( 2, 3))) { mkTab("closings", "Closings", "navagation1", "p", $_SESSION['current']['p']); mkTab("messages", "Messages", "navagation1", "p", $_SESSION['current']['p']); } mkTab("signout","Sign Out", "navagation1", "p", $_SESSION['current']['p']); } echo "\t\t\t\t
\n"; echo "\t\t\t\t
\n\n"; echo "\t\t\t
\n"; echo "\t\t\t\t"; echo "\t\t\t
\n"; if ($rLink) doSync(); ?>