<?php
include_once("../../lib/konfig.php");
$bj = $_POST['id'];
$MySQLi = new MySQLi($strDBHostName, $strDBUsername, $strDBPassword, $strDBName);
$query =    "select count(lot) as cari from(
select concat(shift,date_format(tgl,'%y'),date_format(tgl,'%m'),date_format(tgl,'%d'),LPAD(kd_mesin, 2, '0')) as lot
from tb_lot) as tb_scan
where tb_scan.lot in (select left('$bj',9));";
$result = $MySQLi->query($query);
$row = $result->fetch_array();
echo $row['cari'];
