setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); } catch(PDOException $e) { echo "Хьюстон, у нас проблемы."; file_put_contents('PDOErrors.txt', $e->getMessage(), FILE_APPEND); } try { if ( isset($_SESSION['tzphp']) && $_SESSION['tzphp'] != "" ) { $STH = $DBH->prepare('SET time_zone= :tz'); $STH->bindParam(':tz', $_SESSION['tzphp']); $STH->execute(); date_default_timezone_set($_SESSION['tzphp']); } } catch(PDOException $e) { // echo $_SESSION['gmt']; echo "Хьюстон, у нас проблемы.".$e->getMessage() . $_SESSION['tzphp'] ; file_put_contents('PDOErrors.txt', $e->getMessage(), FILE_APPEND); $STH = $DBH->prepare('SET time_zone= GMT'); $STH->execute(); date_default_timezone_set('GMT'); } mb_internal_encoding("UTF-8"); $STH = $DBH->prepare('set names utf8'); $STH->execute(); ?> prepare('select * from block where id = :id'); $_STH->bindParam(':id', $id ); $_STH->execute(); $_STH->setFetchMode(PDO::FETCH_ASSOC); while($_myrow = $_STH->fetch()) { $block = true; $lat0 = $_myrow['lat0']; $lat1 = $_myrow['lat1']; $lon0 = $_myrow['lon0']; $lon1 = $_myrow['lon1']; } } $i = 0; $arr=""; while($myrow = $STH->fetch()) { if ( $block ) { if ( $myrow['lat'] > $lat0 && $myrow['lon'] > $lon0 && $myrow['lat'] < $lat1 && $myrow['lon'] < $lon1 ) continue; } if ( $myrow['lat'] == 0 || $myrow['lon'] == 0 ) continue; if ( $myrow['speed'] == 0 && $sort == 3 ) continue; //segarezh if ( $myrow['speed'] == 0 && ( $id == 1396 || $id == 161 ) ) continue; $arr[$i]['a'] = round($myrow['alt'],0); $arr[$i]['t'] = floatval ($myrow['lat']); $arr[$i]['n'] = floatval ($myrow['lon']); $arr[$i]['s'] = $myrow['speed']; $arr[$i]['tm'] = $myrow['gps_time']; if ( $sort == 1 ) $arr[$i]['c'] = $myrow['idrow']; if ( $sort == 2 ) $arr[$i]['tm'] = $myrow['mob_time']; if ($start_time==0) $start_time=$arr[$i]['tm']/1000; else $arr[$i]['tm']=$arr[$i]['tm']/1000-$start_time; $i = $i + 1; $max_time = $myrow['gps_time']; } $res[0] = $arr; $res[1] = $max_time; return $res; } function processMsgs ( $DBH, $STH ) { $i = 0; $msgs=""; $max_ins_date=0; // $msgs[$i]['mi']=""; while($myrow = $STH->fetch()) { $msgs[$i]['mi'] = $myrow['id']; $msgs[$i]['ui'] = $myrow['userid']; $msgs[$i]['t'] = $myrow['lat']; $msgs[$i]['n'] = $myrow['lon']; $msgs[$i]['m'] = $myrow['msg']; $msgs[$i]['l'] = $myrow['login']; $msgs[$i]['tm'] = $myrow['ins_date']; $ST = $DBH->prepare("select fromu, msg, ins_date from msgs_priv where msgsid = :id order by ins_date"); $ST->bindParam(':id', $myrow['id']); $ST->execute(); $y = 0; while($row = $ST->fetch()) { $mlist[$y]['m'] = $row['msg']; $mlist[$y]['d'] = $row['ins_date']; $mlist[$y]['u'] = $row['fromu']; $y = $y + 1; } $msgs[$i]['ml'] = $mlist; $mlist = null; $max_ins_date = $myrow['ins_date']; $i = $i + 1; } $arr[0] = $msgs; $arr[1] = $max_ins_date; return $arr; } function processLB ( $DBH, $STH ) { $i = 0; $msgs=""; $max_ins_date=0; // $msgs[$i]['mi']=""; //name, lat ,lon, msg, time while($myrow = $STH->fetch()) { $msgs[$i]['t'] = $myrow['lat']; $msgs[$i]['n'] = $myrow['lon']; $msgs[$i]['m'] = $myrow['msg']; $msgs[$i]['l'] = $myrow['name']; $msgs[$i]['tm'] = $myrow['time']; $max_ins_date = $myrow['time']; $i = $i + 1; } $arr[0] = $msgs; $arr[1] = $max_ins_date; return $arr; } function processPhotos ( $STH ) { $i = 0; $p=""; // $msgs[$i]['mi']=""; while($myrow = $STH->fetch()) { $p[$i]['url'] = '/photos/upload/' . $myrow['filename'] . '.jpg'; $p[$i]['n'] = $myrow['lon'] ; $p[$i]['t'] = $myrow['lat'] ; $p[$i]['tm'] = $myrow['gps_time'] ; $p[$i]['i'] = $myrow['id']; $p[$i]['s'] = md5('p'.$myrow['id']) ; $i = $i + 1; } return $p; } function processDays ( $STH ) { $i = 0; $d=""; // $msgs[$i]['mi']=""; while($myrow = $STH->fetch()) { $d[$i] = $myrow['gps_time']; $i = $i + 1; } return $d; } ?>
Notice: Undefined index: id in /var/www/kovalev/data/www/tutundra.com/l/get_plt.php on line 11

Notice: Undefined variable: DBH in /var/www/kovalev/data/www/tutundra.com/l/get_plt.php on line 14

Fatal error: Call to a member function prepare() on null in /var/www/kovalev/data/www/tutundra.com/l/get_plt.php on line 14