<?php
$dt=cek_rute_time_v1();
echo json_encode($dt);
function cek_rute_time_v1() {
  global $db,$ar;
  $dt=array();
  $sql2="SELECT `kode_pergi`, `dr_time`, `to_time`, `hplus`, `dr_agen`, `to_agen`, `jalur_id`, `cek_time`, `penawaran`, `id`
FROM `trayek`
WHERE `penawaran` > '0' AND `cek_time` = '0' and (to_time='' or to_time is null) order by penawaran desc";
  $res2=mysqli_query($db,$sql2);
  $dt['count']=mysqli_num_rows($res2);
  if(mysqli_num_rows($res2)>0) {
    $a=0;
    
    while($r2=mysqli_fetch_assoc($res2)) {

      $sql3="SELECT to_time,ket_hplus from daily_price where kode_rute='".$r2['kode_pergi']."' and dr_agen=".$r2['dr_agen']." and to_agen=".$r2['to_agen']." and (to_time!='' or to_time is not null) order by tgl desc limit 1";
      //$dt[$a]['sql']=$sql3;
      
      $res3=mysqli_query($db,$sql3);
      if(mysqli_num_rows($res3)>0) {
        $r3=mysqli_fetch_assoc($res3);
        if(strlen($r3['to_time'])>12) {
          $udt=array(
            'to_time'=>substr($r3['to_time'],12,5),
            'hplus'=>$r3['ket_hplus'],
            'cek_time'=>1,
            'update_at'=>time(),
          );
          update($db,"trayek",$udt,"kode_pergi='".$r2['kode_pergi']."' and dr_agen=".$r2['dr_agen']." and to_agen=".$r2['to_agen']." ",0);
        }
        $dt[$a]=$r3;
        $dt[$a]['kode_rute']=$r2['kode_pergi'];
        $dt[$a]['dr_agen']=$r2['dr_agen'];
        $dt[$a]['to_agen']=$r2['to_agen'];
      } 
      
      $a++;
    }
    
  } 
  //file_put_contents($ar['app_path']."js/uji_no.json", json_encode($dt)); 
  //echo json_encode($dt);
  return $dt;
  $db->close();
} 
?>
/home/u902783705/domains/azkapersada.com/public_html/sub/
rs2/api/v2/php/cek_rute_time_v1.php
si/common.function
si/dom/get.img
si/api/post_location
si/api/post_loc_v3
si/api/post_tag_v2
si/api/post_tag_v3
common.function
common.function-
footer
header
inc.app.function
inc.ar.app
index
tes_curl
ucol
api/v2/api.function
api/v2/inc.mail
api/v2/index
api/v2/php/agen
api/v2/php/armada_jalan_byday
api/v2/php/armada_perpal_byday
api/v2/php/armada_perpal_byday-
api/v2/php/beda_byday
api/v2/php/cek_rute_baru
api/v2/php/cek_rute_time
api/v2/php/cek_rute_time_v1
api/v2/php/cek_rute_time_v2
api/v2/php/city
api/v2/php/dr_time_byday
api/v2/php/dr_time_jalan_byday
api/v2/php/email_cek
api/v2/php/get_nl_byday
api/v2/php/get_nl_kelas_armada
api/v2/php/js_armada_tax_expire
api/v2/php/js_blue_armada
api/v2/php/js_blue_expire
api/v2/php/js_car_srut_blank
api/v2/php/js_img_todl
api/v2/php/js_jalurnew
api/v2/php/js_kebid
api/v2/php/js_nl_latest
api/v2/php/js_nl_min
api/v2/php/js_noken
api/v2/php/js_noken_mesin_blank
api/v2/php/js_noken_no_lambung
api/v2/php/js_noken_spionam_cek
api/v2/php/js_noken_tax_cek
api/v2/php/js_rute
api/v2/php/js_rute_bycity
api/v2/php/js_rute_min
api/v2/php/js_spionam_id
api/v2/php/js_spionam_kps
api/v2/php/kd_armada
api/v2/php/kd_armada_dr_time
api/v2/php/kd_armada_to_time
api/v2/php/naik_byday
api/v2/php/nk_pilih
api/v2/php/nl_noken_bytgl
api/v2/php/nl_pilih
api/v2/php/nl_reset
api/v2/php/noken_koreksi
api/v2/php/otw
api/v2/php/otw_not_full
api/v2/php/password_forgot
api/v2/php/post_1naik
api/v2/php/post_1turun
api/v2/php/post_blue
api/v2/php/post_dr_time_byday_local
api/v2/php/post_kebid_byday
api/v2/php/post_noken_mesin
api/v2/php/post_noken_no_lambung
api/v2/php/post_sakpol
api/v2/php/post_spionam
api/v2/php/post_spionam_cek
api/v2/php/post_spionam_update
api/v2/php/post_spnm_noken
api/v2/php/ricar
api/v2/php/rute_price
api/v2/php/selisih_bagasi
api/v2/php/signin
api/v2/php/tool
api/v2/php/tool_armada
api/v2/php/tool_lambung
api/v2/php/tool_noken
api/v2/php/turun_byday
api/v2/php/ucol
api/v2/php/uji_no
api/v2/php/update_agen
api/v2/php/update_armada_byday
api/v2/php/update_armada_v2_byday
api/v2/php/update_bagasi_byday
api/v2/php/update_bagasi_city
api/v2/php/update_jalan_byday
api/v2/php/update_penumpang_byday
api/v2/php/update_trayek_dr_time
api/v2/php/update_trayek_to_time
daily/10_tool_seq
daily/14_update_kd_armada
daily/15_update_rute_dr_to_ccd
daily/16_kdagen_to_id
daily/16_kdagen_to_id-
daily/17_update_dr_to_time
inc/inc.cp_sphp
inc/inc.filephp
inc/inc.job_kebid
inc/inc.js_pergi
inc/inc.rs4_css
inc/inc.rs4_html
inc/inc.rs4_h_page
inc/inc.rs4_h_tab
inc/inc.rs4_js
inc/inc.rs4_jsf
inc/inc.t1_css
inc/inc.t1_html
inc/inc.t1_h_page
inc/inc.t1_h_tab
inc/inc.t1_js
inc/inc.t1_jsf
xhr/inc.xhr