<?php
session_start();

	if(!isset($_SESSION['linkarisecrm']))
	{
		header('Location: index.php');
		return;
	}
		$brmid = $_SESSION['linkarisebranchid'];
	$cmpmid = $_SESSION['linkarisecmpmid'];




	include("connect.php");
	include("removespecial.php");

	$cmpname=removespecialchar($_POST['cmpname']);
	$cmpcaddress=removespecialchar($_POST['cmpcaddress']);
	$cmpcity=$_POST['cmpcity'];
	$cmpstate=$_POST['cmpstate'];
	$cmpcountry="India";
	$accountno=removespecialchar($_POST['accountno']);
	$accountname=removespecialchar($_POST['accountname']);
	$ifsccode=removespecialchar($_POST['ifsccode']);
	$bankbranchname=removespecialchar($_POST['bankbranchname']);
	

	
$f1=$_POST['f1'];
	$f2=$_POST['f2'];
	$fyear=$_POST['fyear'];

	

	if(empty($_FILES['file']['name']) == false  )
	{
		$image1=$_FILES['file']['name'];
		$ext = pathinfo($image1, PATHINFO_EXTENSION);
		$filename1 = date("YmdHis").'.'.$ext;
		$path = "images";
		if($ext=='png' || $ext=='jpg' || $ext=='jpeg')
		 {
		move_uploaded_file( $_FILES['file']['tmp_name'], $path ."/". $filename1 );

		$attach11 = ",cmpheaderimg='$filename1'";
		}
	}

	if(empty($_FILES['file1']['name']) == false  )
	{
		$image2=$_FILES['file1']['name'];
		$ext1 = pathinfo($image2, PATHINFO_EXTENSION);
		$filename11 = date("YmdHis").'.'.$ext1;
		$path = "images";
		if($ext1=='png' || $ext1=='jpg' || $ext1=='jpeg')
		 {
		move_uploaded_file( $_FILES['file1']['tmp_name'], $path ."/". $filename11 );

		$attach22 = ",cmpfooterimg='$filename11'";
		}
	}

	  $eve = "update res_company_master set cmpdetail1='$f1',cmpdetail2='$f2',cmpname='$cmpname',cmpcaddress='$cmpcaddress',cmpcity='$cmpcity',cmpstate='$cmpstate',cmpcountry='$cmpcountry' $attach11 $attach22,cmpyear='$fyear',accountno='$accountno',accountname='$accountname',ifsccode='$ifsccode',bankbranchname='$bankbranchname' where cmpmid=$cmpmid";


	if ($conn->query($eve) === TRUE)
	{
		$_SESSION['msg'] = "General Settings Information Updated";


	}
	header("Location: companysetting.php");
?>
