Advertisement
aprilala

Untitled

Jan 31st, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 13.15 KB | None | 0 0
  1. <?php
  2.     session_start();
  3.     session_regenerate_id();
  4.     include('connection.php');
  5.                
  6.     if(isset($_GET['id'])){
  7.         $get_id = $_GET['id'];
  8.         $selected_emp = mysql_query("Select * from loglocation where id = '{$get_id}'");
  9.     $selected_id = mysql_fetch_array($selected_emp);
  10.     $latitude = $selected_id['latitude'];
  11.     $longitude = $selected_id['longitude'];
  12.     $zoom = 10;
  13.    
  14.     }
  15.     else{
  16.         $get_id = NULL;
  17.         $latitude = 12.879721;
  18.         $longitude = 121.77401699999996;
  19.         $zoom = 6;
  20.        
  21.     }
  22.    
  23.    
  24.    
  25. ?>
  26.  
  27. <?php
  28. //          function getaddress($lat,$lng)
  29.     //      {
  30.         //  $url = 'http://maps.googleapis.com/maps/api/geocode/json?latlng='.trim($lat).','.trim($lng).'&sensor=false';
  31.         //  $json = @file_get_contents($url);
  32.         //  $data=json_decode($json);
  33.         //  $status = $data->status;
  34.         //  if($status=="OK")
  35.         //  return $data->results[0]->formatted_address;
  36.         //  else
  37.         //  return false;
  38.         //  }
  39. ?>
  40.  
  41. <?php
  42.             include('connection.php');
  43.             $selected_userLog = mysql_query("Select * from loglocation where id = '{$get_id}'");
  44.             $selected_idLog = mysql_fetch_array($selected_userLog);
  45.             $latLog= $selected_idLog['latitude']; //latitude
  46.             $lngLog= $selected_idLog['longitude']; //longitude
  47.             //$addressLog= getaddress($latLog,$lngLog);
  48.            
  49.         ?>
  50. <html>
  51.     <head>
  52.     <title>Locator</title>
  53.     <script src="https://maps.googleapis.com/maps/api/js"></script>
  54.     <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
  55.    
  56.    
  57.     <link rel="stylesheet" href="css/drop.css">
  58.     <link rel="stylesheet" href="css/drop2.css">
  59.     <link rel="stylesheet" href="css/table.css" type="text/css"/>
  60.     <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
  61.     <script src="js/script.js"></script>
  62.     <link rel="stylesheet" href="css/design.css">
  63.     <script src="js/script1.js"></script>
  64.     <script src="js/script2.js"></script>
  65.     <link rel="icon" href="images/icon.ico" />
  66.    
  67.         <style>
  68.         ::-webkit-scrollbar {
  69.             width: 8px;
  70.             height: 8px;
  71.             }
  72.  
  73.         ::-webkit-scrollbar-track {
  74.         -webkit-box-shadow: outset 0 0 5px rgba(0,154,255,0.1);
  75.         border-radius: 15px;
  76.         background-color:#f0f0f0;
  77.         }
  78.  
  79.         ::-webkit-scrollbar-thumb {
  80.         border-radius: 5px;
  81.         -webkit-box-shadow: inset 0 0 5px rgba(0,154,255,0.1);
  82.         background-color:#d3d1d1;
  83.         }
  84.     </style>
  85.         <script>
  86.         //start of jquery
  87.        
  88.        
  89.         $("document").ready(function() {
  90.  
  91.             $(".showz").click(function() {
  92.                 var a = document.getElementById("darkWindowS");
  93.                 var b = document.getElementById("bg");
  94.                
  95.                 $("#whole").fadeTo("slow",0.9);
  96.                 //b.style.visibility="visible";
  97.                 //a.style.visibility="visible";
  98.             });
  99.            
  100.            
  101.             $("#hidez").click(function() {
  102.                 $("#whole").fadeToggle();
  103.                
  104.             });
  105.            
  106.  
  107.         });
  108.  
  109.     </script>
  110.     <style>
  111.         .showz{
  112.             cursor:pointer;
  113.         }
  114.         #bg
  115.         {
  116.         padding:10px;
  117.         width:1100px;
  118.         height:570px;
  119.         background-color:#537C7C;
  120.         opacity:2;
  121.         position:absolute;
  122.         margin-left:100px;
  123.         margin-top:-620px;
  124.        
  125.         z-index:99;
  126.         font-family:century gothic;
  127.         font-size:10px;
  128.         }
  129.        
  130.        
  131.         #darkWindowS
  132.         {
  133.         padding:10px;
  134.         width:100%;
  135.         height:102%;
  136.         background-color:#000;
  137.         opacity: 0.7;
  138.         margin-left:-8px;
  139.         margin-top:-64px;
  140.         z-index:99;
  141.        
  142.         font-family:century gothic;
  143.         font-size:10px;
  144.         }
  145.         #btnSave{
  146.             height:30px;
  147.             width:156px;
  148.         }
  149.         #btnAdd{
  150.             height:30px;
  151.             width:156px;
  152.         }
  153.         #btnDel{
  154.             height:30px;
  155.             width:156px;
  156.         }
  157.         #f1{
  158.         width:50px;
  159.         }
  160.         #f2{
  161.         width:50px;
  162.         margin-top:-198px;
  163.         margin-left:200px;
  164.         }
  165.         #text{
  166.         position:absolute;
  167.         margin-top:-560px;
  168.         margin-left:950px;
  169.         }
  170.         #msgSent{
  171.         position:absolute;
  172.         margin-top:150px;
  173.         }
  174.         #wel{
  175.             font-family:century gothic;
  176.             font-size:20px;
  177.             position:fixed;
  178.            
  179.             margin-left:1000px;
  180.             margin-top:30px;
  181.         }
  182.         #pangalan{
  183.             font-family:century gothic;
  184.             font-size:20px;
  185.             position:fixed;
  186.             margin-top:30px;
  187.             margin-left:1105;
  188.             color:#000;
  189.            
  190.         }
  191.         #txtemail{
  192.         background-color:teal;
  193.         }
  194.         #tabs{
  195.         width:1320px;
  196.         position:fixed;
  197.         margin-left:5px;
  198.         margin-top:40px;
  199.         height:550px;
  200.         }
  201.         #tabs-1{
  202.         margin-left:-20px;
  203.         width:1310px;
  204.         }
  205.         #tabs-2{
  206.         margin-left:-20px;
  207.         width:605px;
  208.         }
  209.         #sobra{
  210.         overflow:scroll;
  211.         height:440px;
  212.        
  213.         background-color:#fff;
  214.         overflow-x:hidden;
  215.         margin-top:10px;
  216.         }
  217.         #sobra2{
  218.         overflow:scroll;
  219.         height:440px;
  220.         background-color:#fff;
  221.         overflow-x:hidden;
  222.         margin-top:10px;
  223.         }
  224.         li{
  225.             font-family:century gothic;
  226.             font-size:13px;
  227.         }
  228.         #header{
  229.        
  230.         position:relative;
  231.         margin-top:-8px;
  232.         margin-left:-8px;
  233.         width:101.2%;
  234.         background-color:#00a8ff;
  235.         height:80px;
  236.         position:fixed;
  237.         }
  238.        
  239.         #picheader{
  240.         width:20%;
  241.         margin-top:-8px;
  242.         }
  243.         #logout{
  244.         position:fixed;
  245.        
  246.         margin-left:1230px;
  247.         margin-top:-10px;
  248.         }
  249.         #searchbox{
  250.         height:30px;
  251.         border-radius:3px;
  252.         font-family:century gothic;
  253.         font-size:15px;
  254.         margin-left:404px;
  255.         }
  256.         #searchbox1{
  257.         height:30px;
  258.         border-radius:3px;
  259.         font-family:century gothic;
  260.         font-size:15px;
  261.         margin-left:404px;
  262.         }
  263.         .icon {
  264.         background:#FFFFFF url(images/search.png) no-repeat 4px 4px;
  265.         padding:14px 14px 14px 30px;
  266.         height:0px;
  267.         background-position:left;
  268.         }​
  269.     </style>
  270.     <?php
  271.    
  272.         include('connection.php');
  273.         $selected_emp = mysql_query("Select * from loglocation where id = '{$get_id}'");
  274.         $selected_id = mysql_fetch_array($selected_emp);
  275.        
  276.     ?>
  277.    
  278.     <script>
  279.         function map(lat,lon)
  280.         {
  281.         var myCenter=new google.maps.LatLng(lat,lon);
  282.         var mapProp = {
  283.           center:myCenter,
  284.           zoom:10,
  285.           mapTypeId:google.maps.MapTypeId.ROADMAP
  286.           };
  287.  
  288.         var map=new google.maps.Map(document.getElementById("googleMap"),mapProp);
  289.  
  290.         var marker=new google.maps.Marker({
  291.           position:myCenter,
  292.           });
  293.  
  294.         marker.setMap(map);
  295.            
  296.         var infowindow = new google.maps.InfoWindow({
  297.   content:""
  298.   });
  299.  
  300. infowindow.open(map,marker);
  301.  
  302.         google.maps.event.addDomListener(window, 'load', map);
  303.         }
  304.        
  305.         $(function() {
  306.         $( "#tabs" ).tabs({
  307.         collapsible: true
  308.         });
  309.         });
  310.         function show(){
  311.             var a = document.getElementById("shout");
  312.             a.style.display="block";
  313.             var b = document.getElementById("edit");
  314.             b.style.display="none";
  315.             var c = document.getElementById("del");
  316.             c.style.display="none";
  317.         }
  318.        
  319.         function show1(){
  320.             var a = document.getElementById("edit");
  321.             a.style.display="block";
  322.             var b = document.getElementById("shout");
  323.             b.style.display="none";
  324.             var c = document.getElementById("del");
  325.             c.style.display="none";
  326.         }
  327.         function show2(){
  328.             var a = document.getElementById("edit");
  329.             a.style.display="none";
  330.             var b = document.getElementById("shout");
  331.             b.style.display="none";
  332.             var c = document.getElementById("del");
  333.             c.style.display="block";
  334.         }
  335.     </script>
  336.    
  337.     <script>
  338.             var val;
  339.             function send(ci){
  340.                 var regexp = /^[a-zA-Z]+$/;
  341.                 val = prompt("Enter mobile number:");
  342.                 if(val>0){
  343.                     alert("Location sent to "+val);
  344.                     window.document.location.href = "smssender.php?value="+val+"&ci="+ci;
  345.                 }
  346.                 else if(val == ""){
  347.                     alert("Empty field is not allowed!");
  348.                 }
  349.                 else if(val.match(regexp)){
  350.                     alert("INVALID INPUT!");
  351.                 }
  352.             }
  353.         </script>
  354.         <script>
  355.             function search()
  356.                 {
  357.                 var titleOrig = document.getElementById("searchbox").value;
  358.                 var title = "searchbox="+titleOrig;
  359.  
  360.                 //checking the value of searchbox
  361.                 if(titleOrig.length==0)
  362.                 {
  363.  
  364.                 }
  365.  
  366.                 //CHECKING OF BROWSER
  367.                 if(window.XMLHttpRequest)
  368.                 {
  369.                 xmlhttp = new XMLHttpRequest();
  370.                 }
  371.                 else
  372.                 {
  373.                 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  374.                 }
  375.                 if(xmlhttp)
  376.                 {
  377.                 xmlhttp.onreadystatechange = pangresponse;
  378.                 xmlhttp.open("POST","ajaxBackEnd.php",true);
  379.                 xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
  380.                 xmlhttp.send(title);
  381.                 }
  382.                 function pangresponse()
  383.                 {
  384.                 if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
  385.                 {
  386.                 document.getElementById("recordtable").innerHTML = xmlhttp.responseText;
  387.                 }
  388.                 else
  389.                 {
  390.                 }
  391.                 }
  392.                 }
  393.         </script>
  394.         <script>
  395.                 function search1()
  396.                 {
  397.                 var titleOrig = document.getElementById("searchbox1").value;
  398.                 var title = "searchbox1="+titleOrig;
  399.  
  400.                 //checking the value of searchbox
  401.                 if(titleOrig.length==0)
  402.                 {
  403.  
  404.                 }
  405.  
  406.                 //CHECKING OF BROWSER
  407.                 if(window.XMLHttpRequest)
  408.                 {
  409.                 xmlhttp = new XMLHttpRequest();
  410.                 }
  411.                 else
  412.                 {
  413.                 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  414.                 }
  415.                 if(xmlhttp)
  416.                 {
  417.                 xmlhttp.onreadystatechange = pangresponse;
  418.                 xmlhttp.open("POST","ajaxBackEnd1.php",true);
  419.                 xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
  420.                 xmlhttp.send(title);
  421.                 }
  422.                 function pangresponse()
  423.                 {
  424.                 if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
  425.                 {
  426.                 document.getElementById("recordtable1").innerHTML = xmlhttp.responseText;
  427.                 }
  428.                 else
  429.                 {
  430.                 }
  431.                 }
  432.                 }
  433.         </script>
  434.    
  435.    
  436.  
  437.     </head>
  438.     <body>
  439.         <div id="header"><img id="picheader" src="images/header.png" /> </div>
  440.         <label id="wel">Welcome,</label> <label id="pangalan"><?php echo $_SESSION['login'];?></label>
  441.        
  442.         </br>
  443.        
  444.         <form method="post" action="logout.php">
  445.         <a id="logout" href="logout.php" class="demo-pricing demo-pricing-1">Logout</a>
  446.         </form>
  447.        
  448.         <form method = "get" action = "Home.php?id=<?php echo $selected_id['id']?>&location=<?php echo $selected_id['address'];?>;">
  449.             <div id="tabs">
  450.   <ul>
  451.     <li><a href="#tabs-1">Activity LOGS</a></li>
  452.     <li><a href="#tabs-2">Web Users</a></li>
  453.     <li><a href="#tabs-3">Mobile Users</a></li>
  454.     <li><a href="#tabs-4">Station/Office</a></li>
  455.    
  456.   </ul>
  457.   <div id="tabs-1">
  458.        
  459.             <input placeholder="Search" type="text" id="searchbox" class="icon" onkeyup="search();"/>
  460.             <br/>
  461.         <div id="sobra">
  462.            
  463.             <table id="recordtable" class="table-fill" align="">
  464.                
  465.                 <tr id="fix">
  466.                     <th style='width:110px;text-align:center;'>Name</th>
  467.                     <th style='width:110px;text-align:center;'>Address</th>
  468.                     <th style='width:110px;text-align:center;'>Contact</th>
  469.                     <th style='width:110px;text-align:center;'>Current Location</th>
  470.                     <th style='width:110px;text-align:center;'>Date</th>
  471.                     <th colspan=4 style='width:110px;text-align:center;'>Action</th>
  472.                 </tr>
  473.                 <?php
  474.                 $query = mysql_query("SELECT * FROM loglocation where help_status = 1 order by ID DESC ");
  475.                 while($fet = mysql_fetch_array($query)){
  476.                     echo
  477.                         "<tr>
  478.                             <td class='text-left' style='width:410px;text-align:center;'>{$fet['fullname']}</td>
  479.                             <td class='text-left' style='width:410px;text-align:center;'>{$fet['address']}</td>
  480.                            
  481.                             <td class='text-left' style='width:110px;text-align:center;'>{$fet['number']}</td>
  482.                             <td class='text-left' style='padding:5px;width:440px;text-align:center;'>{$fet['currentLocation']}</td>
  483.                             <td class='text-left' style='width:300px;text-align:center;'>{$fet['date']}</td>
  484.                             <td class='text-left' style='padding:5px;width:120px;text-align:center;'><a onclick='send({$fet['id']})' href='#'><img src='images/send.png' style='width:50%;' title='send' /></a></td>
  485.                             <td class='text-left' style='padding:5px;width:120px;text-align:center;'><a href='delete.php?id={$fet['id']}'><img src='images/delete.png' style='width:50%;' title='delete' /></a></td>
  486.                             <td class='text-left' style='padding:5px;width:120px;text-align:center;'><a onclick='map({$fet['latitude']},{$fet['longitude']})' class='showz'><img src='images/plot.png' style='width:50%;' title='view map of current location' /></a></td>
  487.                         </tr>";
  488.                 }
  489.                
  490.                
  491.             ?>
  492.             </table>
  493.         </div>
  494.     </div>
  495.   <div id="tabs-2">
  496.     <input placeholder="Search" type="text" id="searchbox1" class="icon" onkeyup="search1();"/>
  497.     <div id="sobra2">
  498.            
  499.             <table id="recordtable1" class="table-fill" align="">
  500.            
  501.                 <tr id="fix">
  502.                     <th style='width:110px;text-align:center;'>Name</th>
  503.                     <th style='width:110px;text-align:center;'>Address</th>
  504.                     <th style='width:110px;text-align:center;'>Contact number</th>
  505.                     <th style='width:110px;text-align:center;'>Date</th>
  506.                     <th style='width:110px;text-align:center;'>Time</th>
  507.                 </tr>
  508.                 <?php
  509.                 $query = mysql_query("SELECT * FROM user order by user_id DESC ");
  510.                 while($fet = mysql_fetch_array($query)){
  511.                     echo
  512.                         "<tr>
  513.                             <td class='text-left' style='width:100px;text-align:center;'>{$fet['fullname']}</td>
  514.                             <td class='text-left' style='width:110px;text-align:center;'>{$fet['address']}</td>
  515.                             <td class='text-left' style='width:110px;text-align:center;'>{$fet['number']}</td>
  516.                             <td class='text-left' style='width:110px;text-align:center;'>{$fet['date']}</td>
  517.                             <td class='text-left' style='width:110px;text-align:center;'>{$fet['time']}</td>
  518.                            
  519.                          </tr>";
  520.                 }
  521.                
  522.                
  523.             ?>
  524.             </table>
  525.         </div>
  526.    
  527.     </div>
  528.  
  529. </div>
  530. </form>
  531.        
  532.         </br>
  533.         <div id="whole" style="display:none;">
  534.  
  535. <div id="darkWindowS" >
  536. </div>
  537. <div id="bg">
  538.  <div id='googleMap' style='margin-left:auto;opacity:1;position:absolute;width:1100px;height:571px;'></div>
  539.  
  540. <input id="hidez" type="image" src="images/delete.png" style="z-index:4;width:5%;position:absolute; right: -22px; top:-30px;" />
  541.  
  542. </div>
  543. </div>
  544.     </body>
  545. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement