<?php
if (isset($_POST['submit'])){
	$firstname=$_POST['firstname'];
	$email=$_POST['email'];
	$phone=$_POST['phone'];
	$t_from=$_POST['t_from'];
	$t_to=$_POST['t_to'];
	$weight=$_POST['weight'];
	$type=$_POST['type'];
	$subject = "New Request on Your Website ";
	
$message='<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>
    <style type="text/css">
  @import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;1,100;1,200;1,300&display=swap");
          *{
            font-family: "Poppins", sans-serif;
          }
</style>
</head>

<body>
    <table style="max-width:600px;margin:auto;border-spacing:0;background:#eb0028;padding:4px;border-radius:16px;overflow:hidden" align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
        <tbody>
            <tr>
                <td style="border-collapse:collapse">
                    <table style="margin:auto;border-spacing:0;background:white;border-radius:12px; overflow:hidden" align="center" border="0" cellpadding="0"  cellspacing="0" width="100%">
                        <tbody>
                            <tr>
                                <td style="border-collapse:collapse">
                                    <table style="border-spacing:0;border-collapse:collapse" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
                                        <tbody>
                                            <tr>
                                                <td style="border-collapse:collapse;padding:16px 32px" align="left" valign="middle">
                                                    <table style="border-spacing:0;border-collapse:collapse" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
                                                        <tbody>
                                                            <tr>
                                                                <td style="padding:0;text-align:center;border-collapse:collapse" width="40" align="middle" valign="middle"> <img src="	https://www.dropexpcargo.com/images/logo.png" title="Cargo" alt="Cargo" style="height: 100px;"></td>
                                                                
                                                                
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td style="border-collapse:collapse;padding:0 16px">
                                    <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="background:#f7f9fa;padding:16px;border-radius:8px;overflow:hidden;margin-bottom: 10px;">
                                        <tbody>
                                            <tr>
                                                <td align="left" valign="middle" style="border-collapse:collapse;padding-bottom:16px;">
                                                    <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                                        <tbody>
                                                            <tr>
                                                                <td align="left" valign="top" style="border-collapse:collapse; text-align: center;"><span style="border-collapse:collapse;font-size:16px;font-weight:500;width:100%;display:block">New Request</span> </td>
                                                                <td width="32" align="left" valign="middle" style="border-collapse:collapse"></td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                            
                                            <tr>
                                                <td align="left" valign="middle" style="border-collapse:collapse;padding:8px 0;border-bottom:1px solid #eaeaed;font-size:12px">
                                                    <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                                        <tbody>
                                                            <tr>
                                                                <td width="28%" align="left" valign="top" style="border-collapse:collapse;text-transform:capitalize"> Name</td>
                                                                <td width="16" align="left" valign="top" style="border-collapse:collapse;font-weight:normal">:</td>
                                                                <td align="left" valign="top" style="border-collapse:collapse;font-weight:normal"> '. $firstname.'</td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="left" valign="middle" style="border-collapse:collapse;padding:8px 0;border-bottom:1px solid #eaeaed;font-size:12px">
                                                    <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                                        <tbody>
                                                            <tr>
                                                                <td width="28%" align="left" valign="top" style="border-collapse:collapse;text-transform:capitalize">Email</td>
                                                                <td width="16" align="left" valign="top" style="border-collapse:collapse;font-weight:normal">:</td>
                                                                <td align="left" valign="top" >'. $email .'</td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="left" valign="middle" style="border-collapse:collapse;padding:8px 0;border-bottom:1px solid #eaeaed;font-size:12px">
                                                    <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                                        <tbody>
                                                            <tr>
                                                                <td width="28%" align="left" valign="top" style="border-collapse:collapse;text-transform:capitalize">Phone</td>
                                                                <td width="16" align="left" valign="top" style="border-collapse:collapse;font-weight:normal">:</td>
                                                                <td align="left" valign="top" style="border-collapse:collapse;font-weight:normal"> '. $phone .'</td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="left" valign="middle" style="border-collapse:collapse;padding:8px 0;border-bottom:1px solid #eaeaed;font-size:12px">
                                                    <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                                        <tbody>
                                                            <tr>
                                                                <td width="28%" align="left" valign="top" style="border-collapse:collapse;text-transform:capitalize">transportForm</td>
                                                                <td width="16" align="left" valign="top" style="border-collapse:collapse;font-weight:normal">:</td>
                                                                <td align="left" valign="top">'. $t_from .'</td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="left" valign="middle" style="border-collapse:collapse;padding:8px 0;border-bottom:1px solid #eaeaed;font-size:12px">
                                                    <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                                        <tbody>
                                                            <tr>
                                                                <td width="28%" align="left" valign="top" style="border-collapse:collapse;text-transform:capitalize">transportTo</td>
                                                                <td width="16" align="left" valign="top" style="border-collapse:collapse;font-weight:normal">:</td>
                                                                <td align="left" valign="top" style="border-collapse:collapse;font-weight:normal"> 
                                                                '. $t_to .'</td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="left" valign="middle" style="border-collapse:collapse;padding:8px 0;border-bottom:1px solid #eaeaed;font-size:12px">
                                                    <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                                        <tbody>
                                                            <tr>
                                                                <td width="28%" align="left" valign="top" style="border-collapse:collapse;text-transform:capitalize">Weight</td>
                                                                <td width="16" align="left" valign="top" style="border-collapse:collapse;font-weight:normal">:</td>
                                                                <td align="left" valign="top" style="border-collapse:collapse;font-weight:normal"> '. $weight .'</td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="left" valign="middle" style="border-collapse:collapse;padding:8px 0;border-bottom:1px solid #eaeaed;font-size:12px">
                                                    <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                                                        <tbody>
                                                            <tr>
                                                                <td width="28%" align="left" valign="top" style="border-collapse:collapse;text-transform:capitalize">TransportType</td>
                                                                <td width="16" align="left" valign="top" style="border-collapse:collapse;font-weight:normal">:</td>
                                                                <td align="left" valign="top" style="border-collapse:collapse;font-weight:normal">'. $type.'</td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                            
                                            
                                           
                                        </tbody>
                                    </table>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
        </tbody>
    </table>
</body>

</html>';  
$to = "drop.expresscargo@gmail.com";
$header = "From:noreply@tbteck.in \r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html\r\n";

$retval = mail ($to,$subject,$message,$header);
if($retval){
    header("Location: confirm.php");
}
	$firstname=$_POST['firstname'];
	$email=$_POST['email'];
	$phone=$_POST['phone'];
	$t_from=$_POST['t_from'];
	$t_to=$_POST['t_to'];
	$weight=$_POST['weight'];
	$type=$_POST['type'];
	$package=$_POST['Package'];
	$types=$_POST['types'];
$message="
New request on your Website!
Name : $firstname
Phone : $phone
Transport From : $t_from
Transport To : $t_to
Weight : $weight
Transport Type : $type
www.dropexpcargo.com";

// Telegram function which you can call
function telegram($msg) {
        global $telegrambot,$telegramchatid;
        $url='https://api.telegram.org/bot'.$telegrambot.'/sendMessage';$data=array('chat_id'=>$telegramchatid,'text'=>$msg);
        $options=array('http'=>array('method'=>'POST','header'=>"Content-Type:application/x-www-form-urlencoded\r\n",'content'=>http_build_query($data),),);
        $context=stream_context_create($options);
        $result=file_get_contents($url,false,$context);
        return $result;
}
        
// Set your Bot ID and Chat ID.
$telegrambot='6481862453:AAHGfPkLE6aazfKhpWCYb1un1e1_hbGG7VE';
$telegramchatid= -4033968759;
telegram ($message);
}
	?>