Я новичок ie в программировании, я пытаюсь показать местоположение пользователя после нажатия на флажок, но когда я проверяю в элементе проверки -> сеть, он показывает ноль и ничего не происходит. любое решение? Это мой скриншот вот мой код флажка:
<li>
<div class="collapsible-header text-small-screen">PETUGAS</div>
<div class="main-menu-body collapsible-body">
<form id="frmposisi">
<?php
echo '<ul class="collapsible" data-collapsible="accordion">';
foreach($unor as $key_unor=>$row_unor){
echo '<li>';
echo "<div class='collapsible-header text-small-screen'>".@$row_unor->nama_unor."</div>";
echo "<div class='main-menu-body collapsible-body'>";
// echo "<p><input type='checkbox' name='posisi_".@$row_unor->id_unor."' value='posisi_".@$row_unor->id_unor."' id='posisi_".@$row_unor->id_unor."'><label for='posisi_".@$row_unor->id_unor."'> Pegawai</label></p>";
if (@$row_unor->posisi){
foreach($row_unor->posisi as $key_posisi=>$row_posisi){
echo "<p><input type='checkbox' name='posisi_".@$row_unor->id_unor."#".@$row_posisi->id_posisi."' id='posisi_".@$row_unor->id_unor."#".@$row_posisi->id_posisi."' value='".@$row_unor->id_unor."#".@$row_posisi->id_posisi."' onclick='load_position(this)' class='map-btn btn-qlue-sort'><label for='posisi_".@$row_unor->id_unor."#".@$row_posisi->id_posisi."'>".@$row_posisi->nama_posisi."</label></p>";
}
}
echo "</div>";
echo '</li>';
}
echo '</ul>';
?>
</form>
</div>
</li>
мой контроллер:
function load_position()
{
$result = $this->model_web->get_geomaps();
echo json_encode($result);
}
моя модель:
function get_geomaps(){
$post_data = $this->input->post('id_pegawai');
$date = new DateTime($this->input->post("tgl_tracking"));
$partition = $date->format('Y-m-d');
if($post_data){
$arr_posisi = array();
foreach($post_data as $key=>$val){
if (strpos($key,'posisi') !== false) {
if($val){
$arr_val = explode("#", $val);
$id_unor = $arr_val[0];
$id_posisi = $arr_val[1];
$arr_unor[] = $id_unor;
$arr_posisi[] = $id_posisi;
}
}
}
$tgl_name = (int)str_replace("-","",date('Y-m-d',strtotime($this->input->post("tgl_tracking").' +1 day')));
$this->db->select('MAX(a.id_log) as id_log,a.id_pegawai,c.nama_pegawai,c.alamat_pegawai,c.no_hp,c.wilayah_kerja,c.id_unor,c.nama_unor,
(select e.lat FROM t_geomaps PARTITION (p'.$tgl_name.') e where DATE_FORMAT(e.insert_date,"%Y-%m-%d") = "'.$this->input->post("tgl_tracking").'" and e.id_pegawai=c.id_pegawai order by e.insert_date desc limit 1) as lat,
(select e.lng FROM t_geomaps PARTITION (p'.$tgl_name.') e where DATE_FORMAT(e.insert_date,"%Y-%m-%d") = "'.$this->input->post("tgl_tracking").'" and e.id_pegawai=c.id_pegawai order by e.insert_date desc limit 1) as lng,
(select b.status from absen_log b where b.id_log=max(a.id_log)) as status');
$this->db->join('m_pegawai c','c.id_pegawai=a.id_pegawai');
$this->db->where_in('c.id_unor',$arr_unor);
$this->db->where_in('c.id_posisi',$arr_posisi);
$this->db->where('DATE_FORMAT(a.date_log,"%Y-%m-%d") = "'.$this->input->post("tgl_tracking").'"');
$this->db->group_by('a.id_pegawai');
$result = $this->db->get('absen_log a')->result();
return $result;
}
}
Мой база данных: таблица absen_log
таблица m_pegawai
таблица t_geomaps