MMCT TEAM
Server IP : 162.214.80.37  /  Your IP : 216.73.216.68
Web Server : Apache
System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : imyrqtmy ( 2189)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home2/imyrqtmy/public_html/Quickex/builty/vendor/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/imyrqtmy/public_html/Quickex/builty/vendor/add_builty.php
<?php



include("inc/config.php");

if(isset($_POST['add_builty'])){

    $emp_id = $_POST['emp_id'];
    $origin = $_POST['origin'];
    $destination = $_POST['destination'];
    $origin_address = $_POST['origin_address'];

    $origin_gst = $_POST['origin_gst'];
    $origin_phone = $_POST['origin_phone'];
    $origin_eway = $_POST['origin_eway'];
    $grno = $_POST['grno'];
    $qacl = $_POST['qacl'];
    $transport_by = $_POST['transport_by'];
    $booking_date = $_POST['booking_date'];
    $booking_time = $_POST['booking_time'];
    $destination_address = $_POST['destination_address'];
    $destination_gst = $_POST['destination_gst'];
    $destination_phone = $_POST['destination_phone'];
    $destination_eway = $_POST['destination_eway'];
    $pkg_total = $_POST['pkg_total'];
    $pkg_type = $_POST['pkg_type'];
    $party_invoice = $_POST['party_invoice'];
    $party_name = $_POST['party_name'];
    $dimension = $_POST['dimension'];
    $saidtocontent = $_POST['saidtocontent'];
    $quantity = $_POST['quantity'];
    $gross_weight = $_POST['gross_weight'];
    $charge_weight = $_POST['charge_weight'];
    $amount = $_POST['amount'];
    $consignee = $_POST['consignee'];
    $consignor = $_POST['consignor'];
    $freight_rate = $_POST['freight_rate'];
    $freight_amount = $_POST['freight_amount'];
    $cod_rate = $_POST['cod_rate'];
    $cod_amount = $_POST['cod_amount'];
    $fov_rate = $_POST['fov_rate'];
    $fov_amount = $_POST['fov_amount'];
    $doc_rate = $_POST['doc_rate'];
    $doc_amount = $_POST['doc_amount'];
    $cartage_rate = $_POST['cartage_rate'];
    $cartage_amount = $_POST['cartage_amount'];
    $labour_rate = $_POST['labour_rate'];
    $labour_amount = $_POST['labour_amount'];
    $octroi_rate = $_POST['octroi_rate'];
    $octroi_amount = $_POST['octroi_amount'];
    $other_rate = $_POST['other_rate'];
    $other_amount = $_POST['other_amount'];
    $gst_rate = $_POST['gst_rate'];
    $gst_amount = $_POST['gst_amount'];
    $total_amount = $_POST['total_amount'];
    $delivery_detail = $_POST['delivery_detail'];
    $delivery_time = $_POST['delivery_time'];
    $ttb_origin = $_POST['ttb_origin'];
    $to_pay = $_POST['to_pay'];
    $paid = $_POST['paid'];
    $status = $_POST['status'];
   



    // Construct the SQL query with sanitized input data


    $query = "INSERT INTO `builties` 
    (`emp_id`, `origin`, `destination`, `origin_address`, `origin_gst`, `origin_phone`, `origin_eway`, `grno`, `qacl`, `transport_by`, `booking_date`, `booking_time`, `destination_address`, `destination_gst`, `destination_phone`, `destination_eway`, `pkg_total`, `pkg_type`, `party_invoice`, `party_name`, `dimension`, `saidtocontent`, `quantity`, `gross_weight`, `charge_weight`, `amount`, `consignee`, `consignor`, `freight_rate`, `freight_amount`, `cod_rate`, `cod_amount`, `fov_rate`, `fov_amount`, `doc_rate`, `doc_amount`, `cartage_rate`, `cartage_amount`, `labour_rate`, `labour_amount`, `octroi_rate`, `octroi_amount`, `other_rate`, `other_amount`, `gst_rate`, `gst_amount`, `total_amount`, `delivery_detail`, `delivery_time`, `ttb_origin`, `to_pay`, `paid`, `status`) 
    VALUES 
    ('$emp_id', '$origin', '$destination', '$origin_address', '$origin_gst', '$origin_phone', '$origin_eway', '$grno', '$qacl', '$transport_by', 
    '$booking_date', '$booking_time', '$destination_address', '$destination_gst', '$destination_phone', '$destination_eway', 
    '$pkg_total', '$pkg_type', '$party_invoice', '$party_name', '$dimension', '$saidtocontent', '$quantity', '$gross_weight', '$charge_weight', '$amount', 
    '$consignee', '$consignor', '$freight_rate', '$freight_amount', '$cod_rate', '$cod_amount', '$doc_rate', '$doc_amount', '$fov_rate', '$fov_amount', 
    '$cartage_rate', '$cartage_amount', '$labour_rate', '$labour_amount', '$octroi_rate', '$octroi_amount', '$other_rate', 
    '$other_amount', '$gst_rate', '$gst_amount', '$total_amount', '$delivery_detail', '$delivery_time', '$ttb_origin', 
    '$to_pay', '$paid', '$status')";

   

   
    $query_run = mysqli_query($conn, $query);

    if($query_run){
     
        $_SESSION['status'] = "Data Uploaded Successfully";
        header('Location: view-builty.php');
        exit;
    } else {
        $_SESSION['status'] = "Data Not Uploaded Successfully";
        header('Location: builty.php');
        exit;
    }
}


if (isset($_POST['update_builty'])) {
    $id = $_POST['id'];
    $emp_id = $_POST['emp_id'];
 
    $origin = $_POST['origin'];
    $destination = $_POST['destination'];
    $origin_address = $_POST['origin_address'];

    $origin_gst = $_POST['origin_gst'];
    $origin_phone = $_POST['origin_phone'];
    $origin_eway = $_POST['origin_eway'];
    $grno = $_POST['grno'];
    $qacl = $_POST['qacl'];
    $transport_by = $_POST['transport_by'];
    $booking_date = $_POST['booking_date'];
    $booking_time = $_POST['booking_time'];
    $destination_address = $_POST['destination_address'];
    $destination_gst = $_POST['destination_gst'];
    $destination_phone = $_POST['destination_phone'];
    $destination_eway = $_POST['destination_eway'];
    $pkg_total = $_POST['pkg_total'];
    $pkg_type = $_POST['pkg_type'];
    $party_invoice = $_POST['party_invoice'];
    $party_name = $_POST['party_name'];
    $dimension = $_POST['dimension'];
    $saidtocontent = $_POST['saidtocontent'];
    $quantity = $_POST['quantity'];
    $gross_weight = $_POST['gross_weight'];
    $charge_weight = $_POST['charge_weight'];
    $amount = $_POST['amount'];
    $consignee = $_POST['consignee'];
    $consignor = $_POST['consignor'];
    $freight_rate = $_POST['freight_rate'];
    $freight_amount = $_POST['freight_amount'];
    $cod_rate = $_POST['cod_rate'];
    $cod_amount = $_POST['cod_amount'];
    $doc_rate = $_POST['doc_rate'];
    $doc_amount = $_POST['doc_amount'];
    $fov_rate = $_POST['fov_rate'];
    $fov_amount = $_POST['fov_amount'];
    $cartage_rate = $_POST['cartage_rate'];
    $cartage_amount = $_POST['cartage_amount'];
    $labour_rate = $_POST['labour_rate'];
    $labour_amount = $_POST['labour_amount'];
    $octroi_rate = $_POST['octroi_rate'];
    $octroi_amount = $_POST['octroi_amount'];
    $other_rate = $_POST['other_rate'];
    $other_amount = $_POST['other_amount'];
    $gst_rate = $_POST['gst_rate'];
    $gst_amount = $_POST['gst_amount'];
    $total_amount = $_POST['total_amount'];
    $delivery_detail = $_POST['delivery_detail'];
    $delivery_time = $_POST['delivery_time'];
    $ttb_origin = $_POST['ttb_origin'];
    $to_pay = $_POST['to_pay'];
    $paid = $_POST['paid'];
    $status = $_POST['status'];


    $query = "UPDATE `builties` SET 
    `emp_id`='$emp_id',
    `origin`='$origin',
    `destination`='$destination',
    `origin_address`='$origin_address',
    `origin_gst`='$origin_gst',
    `origin_phone`='$origin_phone',
    `origin_eway`='$origin_eway',
    `grno`='$grno',
    `qacl`='$qacl',
    `transport_by`='$transport_by',
    `booking_date`='$booking_date',
    `booking_time`='$booking_time',
    `destination_address`='$destination_address',
    `destination_gst`='$destination_gst',
    `destination_phone`='$destination_phone',
    `destination_eway`='$destination_eway',
    `pkg_total`='$pkg_total',
    `pkg_type`='$pkg_type',
    `party_invoice`='$party_invoice',
     `party_name`='$party_name',
      `dimension`='$dimension',
    `saidtocontent`='$saidtocontent',
    `quantity`='$quantity',
    `gross_weight`='$gross_weight',
    `charge_weight`='$charge_weight',
    `amount`='$amount',
    `consignee`='$consignee',
    `consignor`='$consignor',
    `freight_rate`='$freight_rate',
    `freight_amount`='$freight_amount',
    `cod_rate`='$cod_rate',
    `cod_amount`='$cod_amount',
     `fov_rate`='$fov_rate',
    `fov_amount`='$fov_amount',
    `doc_rate`='$doc_rate',
    `doc_amount`='$doc_amount',
    `cartage_rate`='$cartage_rate',
    `cartage_amount`='$cartage_amount',
    `labour_rate`='$labour_rate',
    `labour_amount`='$labour_amount',
    `octroi_rate`='$octroi_rate',
    `octroi_amount`='$octroi_amount',
    `other_rate`='$other_rate',
    `other_amount`='$other_amount',
    `gst_rate`='$gst_rate',
    `gst_amount`='$gst_amount',
    `total_amount`='$total_amount',
    `delivery_detail`='$delivery_detail',
    `delivery_time`='$delivery_time',
    `ttb_origin`='$ttb_origin',
    `to_pay`='$to_pay',
    `paid`='$paid',
    `status`='$status'
WHERE `id`='$id'";


    $query_run = mysqli_query($conn, $query);

    if ($query_run) {
        $_SESSION['status'] = "Updated Successfully";
        header('Location: view-builty.php');
    } else {
        $_SESSION['status'] = " Not Updated Successfully";
        header('Location: view-builty.php');
    }
}



// if (isset($_POST['complete_project'])) {
//     $project_id = $_POST['project_id'];

 
//     $query = "UPDATE projects SET project_status = 'Complete' WHERE id = '$project_id'";
//     $query_run = mysqli_query($conn, $query);

//     if ($query_run) {
      
//         header("Location: view-project.php?status=success");
//         exit();
//     } else {
       
//         header("Location: view-project.php?status=error");
//         exit();
//     }
// } else {
//     header("Location: view-project.php");
//     exit();
// }




// delete

if (isset($_POST['delete_builty'])) {

    $id = $_POST['delete_id'];
    
    $query = "DELETE FROM `builties` WHERE id = '$id'";
    $query_run = mysqli_query($conn, $query);

    if ($query_run) {
        $_SESSION['status'] = "Deleted Successfully";
        header('Location: view-builty.php');
    } else {
        $_SESSION['status'] = "Not Deleted Successfully";
        header('Location: view-builty.php');
    }
}

?>

MMCT - 2023