<?php
    session_start();
    include 'config.php';
    // var_dump($_POST);die;
    $csv = $_POST['csv'];
    $count = $_POST['count'];
    $uid = $_SESSION['userid'];
    $uname = $_SESSION['uname'];
    $regime_type = $_SESSION['regime_type'];
    $cargo_channel = $_SESSION['cargo_channel'];   
    $aid = $_SESSION['session_id'];


    $sql = "SELECT csv_generated,no_of_shipments FROM activity_log where id = $aid ";
    // var_dump($sql);//die;
    $result = mysqli_query($con,$sql);
    while ($row = $result->fetch_assoc()) 
    {
        $c = $row['csv_generated'];
    }
    $csv_count = $c + $csv;
    $manifest_count = $no_of_shipments + $count - 1;

    //get matched data from countries table
    $sql_stmt = "UPDATE activity_log SET no_of_shipments = $manifest_count , csv_generated = $csv_count where id = $aid ";
    if ($con->query($sql_stmt) === TRUE)
    {
        return true;
    }
    else
    {
        return false;
    }
?>