<?php
if(isset($_REQUEST['submit'])){
$name=$_REQUEST['name'];
$mobile=$_REQUEST['mobile'];
$email=$_REQUEST['email'];

	if (isset ( $_FILES ['doc']['name'] )) {
    $path = "assets/images/";
	     $img = $_FILES ['doc'] ['name'];
        $fileName = time();
        $fileExtension = "." . pathinfo ( $path . $img, PATHINFO_EXTENSION );
        $returnValue = $fileName . $fileExtension;
        $copy = 1;
        while ( file_exists ( $path . $returnValue ) ) {
            $returnValue = $fileName . '-copy-' . $copy . $fileExtension;
            $copy ++;
        }
        $tmp_file = $_FILES ['doc'] ['tmp_name'];
        move_uploaded_file ( $tmp_file, $path . $returnValue );
      
	}
$to = "tomerpreeti15@gmail.com";
$subject = "Career Request";
$message='
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Quick Chat</title>

    <!-- Google Font -->
    <link href="https://fonts.googleapis.com/css2?family=Fira+Sans:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet">
    <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">

    <style>
        table, th, td {
          border:1px solid #cbcbcb;
          border-collapse: collapse;
        }

        .main{
            width: 800px;
            margin: 0px auto;
            padding: 20px;
        }
        </style>

</head>
<body style="background: #3f5ca9; padding: 100px 100px; color: #333;">
    <div class="main" style="width: 800px; background: #fff; margin: 0 auto; box-shadow: 2px 2px 8px #ddd; padding: 20px; ">

        <table style="border: 1px solid #cbcbcb; width:100%">
        <tr>
           <th style="border: none; padding: 10px 0px;" colspan="2"><img src="https://rudransh.in/html/assets/images/logo/logo2.png" alt="" style="width: 200px;"></th>
            </tr>
            <tr>
                <th style="color: #0964ab; padding: 7px 0px; font-size: 26px; letter-spacing: 1px; font-family: "Open Sans", sans-serif; font-weight: 400; border: none; background: #e9e9e9;" colspan="2">Mail from Quick Chat Website</th>
            </tr>
            
            <tr>
                <th style="color: #0964ab; padding: 7px 0px; font-size: 32px; letter-spacing: 1px; font-family: "Open Sans", sans-serif; font-weight: 400; border: none; background: #e9e9e9;" colspan="2">'.$subject.'</th>
            </tr>
           
              
                <tr>
                <td style="font-family: "Open Sans", sans-serif; font-weight: 500; font-size: 24px; border: 1px solid #cbcbcb; padding: 5px 0px; padding: 5px;"><b>Name :</b></td>
                <td style="font-family: "Open Sans", sans-serif; font-weight: 400; font-size: 24px; border: 1px solid #cbcbcb; padding: 5px 0px; padding: 5px;">'.$name.'</td>
            </tr>
             
                <tr>
                <td style="font-family: "Open Sans", sans-serif; font-weight: 500; font-size: 24px; border: 1px solid #cbcbcb; padding: 5px 0px; padding: 5px;"><b>Mobile :</b></td>
                <td style="font-family: "Open Sans", sans-serif; font-weight: 400; font-size: 24px; border: 1px solid #cbcbcb; padding: 5px 0px; padding: 5px;">'.$mobile.'</td>
            </tr>
                    <tr>
                <td style="font-family: "Open Sans", sans-serif; font-weight: 500; font-size: 24px; border: 1px solid #cbcbcb; padding: 5px 0px; padding: 5px;"><b>Email :</b></td>
                <td style="font-family: "Open Sans", sans-serif; font-weight: 400; font-size: 24px; border: 1px solid #cbcbcb; padding: 5px 0px; padding: 5px;">'.$email.'</td>
            </tr>

    <tr>
                <td style="font-family: "Open Sans", sans-serif; font-weight: 500; font-size: 24px; border: 1px solid #cbcbcb; padding: 5px 0px; padding: 5px;"><b>Document :</b></td>
                <td style="font-family: "Open Sans", sans-serif; font-weight: 400; font-size: 24px; border: 1px solid #cbcbcb; padding: 5px 0px; padding: 5px;"><a href="https://rudransh.in/html/assets/images/'.$returnValue.'" target="_blank"><img src="https://rudransh.in/html/assets/images/doc.png" alt="" hight="80px;" width="80px;"></a></td>
            </tr>

           
        </table>
       
       
    </div>
</body>';

// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

// More headers
$headers .= 'From: <'.$email.'>' . "\r\n";
mail($to,$subject,$message,$headers);
echo "<script>alert('Your Inquiry Submit Successfully ');</script>";
echo "<script>window.location='thankyou.php'</script>";
}
?>