<?php
/**
 * Notification
 *
 * Email sent for form notification.
 *
 * @since   7.0
 *
 * @package WPrequal
 */

namespace WPrequal;

if ( ! defined( 'ABSPATH' ) ) {
	die( 'Access denied!!' );
}

extract( $contact ); ?>

<html lang="en-US">

	<head>

		<meta name="viewport" content="width=device-width, initial-scale=1">

		<title><?php esc_html_e( 'WPrequal Lead', 'wprequal' ); ?></title>

		<style type="text/css">
			body{
				font-family: "Ek Mukta", sans-serif;
				font-size: 20px;
				font-weight: 200;
				line-height: 1.5;
				max-width:600px;
				text-align: left;
			}
			tr{
				clear: both;
				text-align: left;
			}
			td{
				padding: 9px 5px;
				text-align: left;
			}
			label {
				text-align: left;
			}
			.wprequal-logo{
				max-width:200px;
			}
			.button{
				padding:7px 9px;
				background:#15B658;
				color:#fff;
				text-decoration:none;
			}
			.button:hover{
				background:#ccc;
				color:#000;
			}
		</style>

	</head>

	<body>

		<div itemscope itemtype="https://schema.org/LocalBusiness">

			<h3><?php esc_html_e( 'Please contact your new WPrequal Lead ASAP.', 'wprequal' ); ?></h3>

			<table>

				<tbody>

					<?php if ( ! empty( $fname ) ) { ?>

						<tr>
							<th>
								<label for="fname"><?php esc_html_e( 'First Name', 'wprequal' ); ?></label>
							</th>

							<td id="fname"><?php echo esc_html( $fname ); ?></td>
						</tr>

					<?php } ?>

					<?php if ( ! empty( $lname ) ) { ?>

						<tr>
							<th>
								<label for="lname"><?php esc_html_e( 'Last Name', 'wprequal' ); ?></label>
							</th>

							<td id="lname"><?php echo esc_html( $lname ); ?></td>
						</tr>

					<?php } ?>

					<?php if ( ! empty( $email ) ) { ?>

						<tr>
							<th>
								<label for="email"><?php esc_html_e( 'Email Address', 'wprequal' ); ?></label>
							</th>

							<td id="email"><?php echo esc_html( $email ); ?></td>
						</tr>

					<?php } ?>

					<?php if ( ! empty( $phone ) ) { ?>

						<tr>
							<th>
								<label for="phone"><?php esc_html_e( 'Phone', 'wprequal' ); ?></label>
							</th>

							<td id="phone"><?php echo esc_html( $phone ); ?></td>
						</tr>

					<?php } ?>

					<?php if ( ! empty( $comments ) ) { ?>

						<tr>
							<th>
								<label for="comments"><?php esc_html_e( 'Comments', 'wprequal' ); ?></label>
							</th>

							<td id="comments"><?php echo esc_html( $comments ); ?></td>
						</tr>

					<?php } ?>

				</tbody>

			</table>

			<table>

				<tbody>

					<?php $fields = is_array( $fields ) ? $fields : array(); ?>

					<?php foreach ( $fields as $key => $value ) { ?>

						<tr>

							<th>
								<label for="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $labels[$key] ); ?></label>
							</th>

							<td id="<?php echo esc_attr( $key ); ?>">

								<?php if ( Core::status( 1 ) ) {
                                    echo esc_html( $value );
                                } else {
                                    view( 'buttons', 'go-premium' );
                                } ?>

							</td>

						</tr>

					<?php } ?>

					<tr>

						<th>
							<label for="source-url"><?php esc_html_e( 'Source URL', 'wprequal' ); ?></label>
						</th>

						<td>
							<a href="<?php echo esc_url( $source_url ); ?>" id="source-url"><?php echo esc_html( $source_url ); ?></a>
						</td>

					</tr>

				</tbody>

			</table>

			<table>

				<tbody>

					<tr>
						<td><?php esc_html_e( 'WPrequal Leads', 'wprequal' ); ?></td>
					</tr>
					<tr>
						<td><?php echo esc_html( 'support@wprequal.com' ); ?></td>
					</tr>

					<tr>
						<td>
							<img src="<?php echo esc_url( $logo ); ?>" alt="WPrequal logo" class="wprequal-logo">
						</td>
					</tr>

				</tbody>

			</table>

		</div>

	</body>

</html>