<?php
session_start();
$lpbj = $_GET['lpbj'];
include_once("../../../../../lib/konfig.php");
include_once("../../../../../lib/function.php");
$MySQLi = new MySQLi($strDBHostName, $strDBUsername, $strDBPassword, $strDBName);
$query = "SELECT count(A.ID) as ID FROM tpc_h_lpbj A
          Left join(select h_lpbj_ID,stsAktif from tpc_d_lpbj) B on B.h_lpbj_ID = A.ID
          where A.strKdLPBJ = '" . $lpbj . "' and B.stsAktif = 2;";
$result = $MySQLi->query($query);
$row = $result->fetch_array();
echo $row['ID'];
