Kelas baru ReactJS, dapatkan potongan harga 10% hingga 8 Juli 2019. Lihat Kelas
Generic placeholder image

Error di view

Ditanyakan pada tanggal 11 January 2019 oleh Patar Ebenezer Siahaan
<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
    <title>Perjalanan</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
    <link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
    <?php $this->load->view('v_client_side/css_v')?>
    <?php $this->load->view('v_client_side/css_b')?>
    <style>

      #panel {
        padding: 50px;
        display: none;
      }
      #right-panel {
        font-family: 'Roboto','sans-serif';
        line-height: 30px;
        padding-left: 10px;
      }

      #right-panel select, #right-panel input {
        font-size: 15px;
      }

      #right-panel select {
        width: 100%;
      }

      #right-panel i {
        font-size: 12px;
      }

      #right-panel {
        border-width: 2px;
        width: 29%;
        height: 400px;
        float: left;
        text-align: left;

      }
      #directions-panel {
        margin-top: 10px;
        background-color: #e8e3e3;
        padding: 10px;
        overflow: scroll;
        height: 174px;
      }

      #maps{
        position: relative;
        width: 757px;
        height: 100%;
        float: right;          
      }

      #direction{
        position: absolute;
        top: 400px;
        right: 0;
        width: 757px;
        height: 240px;
        /* border: 1px solid #d1c7c7; */
        background-color: #f2f2f2;
        overflow: scroll;
        float:left;
        display : none;

      }

     #flip {
      position: absolute;
        top: 330px;
        right: 0;
        width: 400px;

    }
    img{
      float : right;
      margin-right : 10px;
      cursor : pointer;

    }
* {box-sizing: border-box;}

.image {
  display: block;
  width : 70px;
  height : 70px;
}

.overlay {
  position: absolute; 
  background: rgb(0, 0, 0);
  background: rgba(0, 0, 0, 0.5); /* Black see-through */
  color: #f1f1f1; 
  width: 70%;
  transition: .5s ease;
  opacity:0;
  color: white;
  font-size: 20px;
  padding: 10px;
  text-align: center;
}

input[type="range"] {
    width: 100%;
    height: 28px; /* thumbHeight + (2 x thumbBorderWidth)*/
    -webkit-appearance: none; /*remove the line*/
    outline: none;
    /*background-color:cyan;*/
    border: 0; /*for firefox on android*/
    padding: 0 8px; /*for IE*/
    margin: 8px 0;
}

/*chrome and opera*/
input[type="range"]::-webkit-slider-runnable-track {
    background: #ccc; /*trackColor*/
    height: 4px; /*trackHeight*/
    border-radius: 4px; /*trackHeight*/
    transition: 0.3s;
}

input[type="range"]:hover::-webkit-slider-runnable-track,
input[type="range"]:focus::-webkit-slider-runnable-track {
    background: #777; /*activeTrackColor*/
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    background: red; /*thumbColor*/
    width: 28px; /* thumbHeight + (2 x thumbBorderWidth)*/
    height: 28px; /* thumbHeight + (2 x thumbBorderWidth)*/
    border-radius: 50%;
    margin-top: -12px; /* -[thumbHeight + (2 x thumbBorderWidth) - trackHeight]/2*/
    cursor: pointer;
    border: 5px solid #fff; /*border-width should be equal to thumbBorderWidth if you want same border width across all browsers and border-color should match the background*/
    transition: 0.3s;
}

.horizontally-stacked-slider {
    display: flex;
    align-items: center;
}

.horizontally-stacked-slider > .title {
    flex: 1;
    padding: 9px;
}

.horizontally-stacked-slider > input[type="range"] {
    flex: 1;
}
.btn {
    border: none;
    border-radius: 10px;
}
.end{
  margin-bottom : 20px;
}

#kota{
  margin-bottom : 50px;
}

#kategori{
  margin-top : -65px;
}

    </style>
  <script src="<?= base_url()?>template/cleanblog/jquery/jquery.min.js"></script>
  <script src="<?php echo base_url()?>template/pk/assets/js/bootstrap.min.js" type="text/javascript"></script>
  </head>
  <body>
    <nav class="navbar navbar-expand-md fixed-top">
        <div class="container">
        <div class="col col-1">
            <div class="navbar-translate">
                <button class="navbar-toggler navbar-toggler-right navbar-burger" type="button" data-toggle="collapse" data-target="#navbarToggler" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-bar"></span>
                    <span class="navbar-toggler-bar"></span>
                    <span class="navbar-toggler-bar"></span>
                </button>
                <a class="navbar-brand" href="<?php echo base_url()?>c_client_side/dashboard"><img src="<?= base_url()?>template/icon-logo2.png" width="50px" alt="logo perstour"></a>
            </div>
            </div>

            <div class="collapse navbar-collapse" id="navbarsExample07">
                <ul class="navbar-nav ml-auto">
                    <!-- Menu Sebelum Login -->
                        <?php
                                    $parent = $this->db->get_where('table_menu', array('parent_id'=>0));
                                    foreach ($parent->result() as $key) {
                                        $subMenu = $this->db->get_where('table_menu', array('parent_id'=>$key->menu_id));
                                        if($subMenu->num_rows()>0){
                                            /* Tampilkan submenu */
                                            echo "<li class='dropdown'>".anchor('#', $key->menu_title)."<i class = fa fa-angle-down></i>";
                                            echo "<ul role='menu' class='sub-menu nav-link'>";
                                            foreach ($subMenu->result() as $sub) {
                                                echo "<li>".anchor($sub->link, $sub->menu_title)."</li>";
                                            }
                                            echo "<ul>
                                                  </li>";
                                        }else { ?>
                        <li class="nav-item">
                            <a href="<?php echo $key->link ?>" class="nav-link"><?php echo $key->menu_title?></a>
                        </li>
                                        <?php }
                                    }
                                ?>
                    <!-- <div class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" data-toggle="dropdown" id="dropdownMenuButton" href="#pk" role="button" aria-haspopup="true" aria-expanded="false">Dropdown</a>
                        <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton">
                            <li class="dropdown-header">Dropdown header</li>
                            <a class="dropdown-item" href="#pk">Action</a>
                            <a class="dropdown-item" href="#pk">Another action</a>
                            <a class="dropdown-item" href="#pk">Something else here</a>
                            <div class="dropdown-divider"></div>
                            <a class="dropdown-item" href="#pk">Separated link</a>
                            <div class="dropdown-divider"></div>
                            <a class="dropdown-item" href="#pk">Another separated link</a>
                        </ul>
                    </div> -->
                    <?php if($this->session->userdata("status") != "login_client"): ?>
                    <li class="nav-item">
                      <a href="<?php echo base_url()?>c_client_side/login" class="btn btn-danger btn-round" data-toggle="modal" data-target="#myModal">Sign in / Register</a>
                    </li>

                    <?php else: ?>
                    <li class="nav-item">
                                  <a href="<?php echo base_url()?>c_client_side/login/logout" class="btn btn-danger btn-round">Logout</a>
                    </li>
                    <?php endif;?>

                </ul>
            </div>    
        </div>
    </nav>
    <br><br>
    <br><br>
    <br><br>
  <div class="container">
    <div class="row">
        <div class="col">
        <div id="maps"></div>
        <div id="right-panel"><div>

      <div id="flip">
        <div class="container">
          <img src="<?= base_url()?>template/direction.png" alt="Maps icon" class="image">
          <div class="overlay">Show directions</div>
        </div>  

      </div>
      <form action="" method="post"></form>
        <div id="direction"></div>

        <div class="container">
            <div class="row">
            <b>City:</b>
              <select id="kota">
                <option value="">Select City</option>
                <?php foreach ($kota as $key):?>
                  <option value="<?= $key->kota_id?>"><?= $key->nama_kota?></option>
                <?php endforeach; ?>
              </select>
            </div>
        </div>
        <div id="kategori">
          <?php foreach ($kategori as $key):?>
          <div class="horizontally-stacked-slider">
              <div class="title"><?=$key->nama_kategori;?></div>
              <!-- <div class="col-lg-8"><input type="range" value="50"></div> -->
          </div>
        </div>
              <!-- <select name="kategori" id="kategori">
                <option value="">Select kategori</option>
              </select>   -->

          <b>Start:</b>
          <select id="start">
            <?php foreach ($dataset as $key => $value):?>
              <option value="<?= $value['poiID']?>"><?= $value['poiName']?></option>
            <?php endforeach; ?>
          </select>

          <b>Waypoints:</b> <br>
          <i>(Ctrl+Click or Cmd+Click for multiple selection)</i> <br>

          <select multiple id="waypoints">
            <?php foreach ($dataset as $key => $value):?>
              <option value="<?= $value['poiID']?>"><?= $value['poiName']?></option>
            <?php endforeach; ?>
          </select>
          <b>End:</b>

          <select id="end" class="end">
               <option value="0" selected>Select end</option> 
                <?php foreach ($dataset as $key => $value):?>
                  <option value="<?= $value['_lat'].','.$value['_long']?>"><?= $value['poiName']?></option>
                <?php endforeach; ?>
          </select>

          <input type="submit" value="Submit" name="submit" id="submit" class="btn btn-primary btn-lg btn-block"/>
        </div>
      <div id="directions-panel"></div>
    <script>
      function initMap() {
        var directionsService = new google.maps.DirectionsService;
        var directionsDisplay = new google.maps.DirectionsRenderer;
        var map = new google.maps.Map(document.getElementById('maps'), {
          zoom: 5,
        //   36.210804, 138.194107
          center: {lat: 36.210804, lng: 138.194107}
        });
        directionsDisplay.setMap(map);
        directionsDisplay.setPanel(document.getElementById('direction'));

        // var control = document.getElementById('floating-panel');
        // control.style.display = 'block';
        // map.controls[google.maps.ControlPosition.TOP_CENTER].push(control);

        document.getElementById('submit').addEventListener('click', function() {
          calculateAndDisplayRoute(directionsService, directionsDisplay);
        });
      }

      function calculateAndDisplayRoute(directionsService, directionsDisplay) {
        var waypts = [];
        var checkboxArray = document.getElementById('waypoints');
        for (var i = 0; i < checkboxArray.length; i++) {
          if (checkboxArray.options[i].selected) {
            waypts.push({
              location: checkboxArray[i].value,
              stopover: true
            });
          }
        }

        directionsService.route({
          origin: document.getElementById('start').value,
          destination: document.getElementById('end').value,
          waypoints: waypts,
          optimizeWaypoints: true,
          travelMode: 'DRIVING'
        }, function(response, status) {
          if (status === 'OK') {
            directionsDisplay.setDirections(response);
            var route = response.routes[0];
            var summaryPanel = document.getElementById('directions-panel');
            summaryPanel.innerHTML = '';
            // For each route, display summary information.
            for (var i = 0; i < route.legs.length; i++) {
              var routeSegment = i + 1;
              summaryPanel.innerHTML += '<b>Route Segment: ' + routeSegment +
                  '</b><br>';
              summaryPanel.innerHTML += route.legs[i].start_address + ' to ';
              summaryPanel.innerHTML += route.legs[i].end_address + '<br>';
              summaryPanel.innerHTML += route.legs[i].distance.text + '<br><br>';
            }
          } else {
            window.alert('Directions request failed due to ' + status);
          }
        });
      }
    </script>
    <script async defer
    src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDfSJvdhmfMfVbiAJVSRKHaVMhOLSqqQmQ&callback=initMap">
    </script>
    <!-- Toggle direction maps -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

    <script>
    $(document).ready(function(){
    $("#flip").click(function(){
          $("#direction").slideToggle("slow");
              });
            });
      </script>
      </div>
    </div>
  </div>
  </form>
</body>
</html>
<script>
  $(document).ready(function(){
    $('#kota').change(function(){
      var kota_id = $('#kota').val();
      if(kota_id != '')
      {
        $.ajax({
          url:"<?php echo base_url();?>c_client_side/perjalanan/ambil_kategori",
          method: "POST",
          data:{kota_id:kota_id},
          success:function(data)
          {
            $('#kategori').html(data);
          }
        });
      }
    });
  });
</script>

Errornya begini : An uncaught Exception was encountered Type: ParseError

Message: syntax error, unexpected end of file

Filename: /var/www/tugasakhir/application/views/v_client_side/v_perjalanan.php

Line Number: 415

Backtrace:

File: /var/www/tugasakhir/application/controllers/c_client_side/Perjalanan.php Line: 16 Function: view

File: /var/www/tugasakhir/index.php Line: 315 Function: require_once

Saya sudah cek, gak ada yg masalah tp kok error ya , mohon bantuannya teman teman yg kritis dalam melihat code

1 JAWABAN / 0 KOMENTAR

Generic placeholder image
Ahmad Oriza menjawab pada tanggal 14 January 2019

Solved sudah ..