<?php
    session_start();
    include 'config.php';
    $uid = $_SESSION['userid'];
    $uname = $_SESSION['uname'];
    $regime_type = $_SESSION['regime_type'];
    $cargo_channel = $_SESSION['cargo_channel'];   
    $searchTerm = $_POST['term'];

    if($_POST['ins'] == 1)
    {
        $sql_stmt = "SELECT code FROM inco_terms where code = '$searchTerm'  AND ins = 'Y' ";
    }
    else if($_POST['fri'] == 1)
    {
        $sql_stmt = "SELECT code FROM inco_terms where code = '$searchTerm'  AND fri = 'Y' ";
    }
    else
    {
        $sql_stmt = "SELECT code FROM inco_terms where code = '$searchTerm' ";
    }
    $result = mysqli_query($con,$sql_stmt);
    $rows = mysqli_num_rows($result); 
    echo $rows;
?>