<?php
include 'include/db.php';

date_default_timezone_set("Asia/Kolkata");
$company_name=mysqli_real_escape_string($conn,$_REQUEST['company_name']);
$business_name=mysqli_real_escape_string($conn,$_REQUEST['business_name']);
$website_link=mysqli_real_escape_string($conn,$_REQUEST['website_link']);
$gst_number=mysqli_real_escape_string($conn,$_REQUEST['gst_number']);
$reg_number=mysqli_real_escape_string($conn,$_REQUEST['reg_number']);
$company_email=mysqli_real_escape_string($conn,$_REQUEST['company_email']);
$company_phone=mysqli_real_escape_string($conn,$_REQUEST['company_phone']);
$company_addrress=mysqli_real_escape_string($conn,$_REQUEST['company_addrress']);
$prefix=mysqli_real_escape_string($conn,$_REQUEST['prefix']);
$default_admin_id=mysqli_real_escape_string($conn,$_REQUEST['default_admin_id']);
$date=date('Y-m-d H:i');

$query="update company_details set default_admin_id='$default_admin_id',company_name='$company_name',business_name='$business_name',website_link='$website_link',gst_number='$gst_number',registration_number='$reg_number',company_email='$company_email',company_phone='$company_phone',company_address='$company_addrress',details_mdf_date='$date' ";
$connection=mysqli_query($conn,$query);
if($connection)
{
    echo '<script> alert("Details Updated successfully"); window.location="company_details_edit.php"; </script>';
}
else
{
     echo '<script> alert("sorry, something went wrong"); window.location="company_details_edit.php"; </script>';
}
?>