<?php
  include ("forms/dbcnct.php");

  $AuthFName = $_REQUEST['name'];
  $AuthEmail = $_REQUEST['email'];
  $AuthMobile = $_REQUEST['mnumber'];
  $AuthSubject = $_REQUEST['subject'];
  $Comments = $_REQUEST['message'];
  
  $deliveryemail = 'editoricelj@gmail.com';

  $date = date_default_timezone_set('Asia/Kolkatta');
  $today = date("F j, Y, g:i a T");
  $VerfiyEmail = $_REQUEST['vemail'];
    
    if($VerfiyEmail == ''){
    
	$tmpFilePath = $_FILES['paper']['tmp_name'];
		if ($tmpFilePath != ""){
			$file = $newFilePath = "PaperSubmits/" .$_FILES['paper']['name'];
			move_uploaded_file($tmpFilePath, $newFilePath);

			$query = mysqli_query($db_connect, "INSERT into ICELAPaper (UserTime,AuthName,AuthEmail,AuthMobile,AuthSubject,AuthComments,FileLocation) 
			values ('$today','$AuthFName','$AuthEmail','$AuthMobile','$AuthSubject','$Comments','$file')") or die(mysqli_error($db_connect));

		 
			$Message ='
			<div class="row MailForm" style="box-shadow: 4px 2px 4px 4px solid #8295ff;width:700px;margin:auto;display:block;border:1px solid #bfbc00;">
				<div class="container">
					<div class="Mail_Header" style="background:#1343f0;border-bottom:1px solid #d4d4d6;padding:5px;">
						<p><img src="assets/img/icna.png" style="height:120px;width:120px;margin:auto;display:block;" /></p>
						<p style="color:#fff;">Hello Respected '.$AuthFName.',</p>
						<p style="color:#fff;">This is an Automatic mail from ICELJ, we have received your submission from our website.</p>
					</div>
					<div class="Mail_Body" style="background:#fff;border-bottom:1px solid #2206bf;color:#000;">
						<p>Thank you for Contacting us. We received your Details as</p>
						<table class="Tb_Border" border="1" style="min-width:100%;padding:5px;color:#000;">
							<tr style="padding:5px;">
								<td>Main Author Name</td>
								<td style="color:#000;">'.$AuthFName.' </td>
							</tr>
							<tr>
								<td>Mobile Number</td>
								<td style="color:#000;">'.$AuthMobile.' </td>
							</tr>
							<tr>
								<td>Title</td>
								<td style="color:#000;">'.$AuthSubject.' </td>
							</tr>
							<tr>
								<td>Comments</td>
								<td style="color:#000;">'.$Comments.'</td>
							</tr>
						</table>
					</div>
					<div class="Mail_Footer" style="background:#abacb3;color:#000;padding:10px;">
						<p>For further details please share your words with us on <b style="color:#000;">editoricelj@gmail.com</b>.
						<br>
						Regards,
						<br>
						ICELJ.</p>
					</div>
				</div>
			</div>
			';

   	require 'class/class.phpmailer.php';
	$mail = new PHPMailer;
	$mail->IsSMTP();								//Sets Mailer to send message using SMTP
	$mail->Host = 'mail.icelj.com';		//Sets the SMTP hosts of your Email hosting, this for Godaddy
	$mail->Port = '465';								//Sets the default SMTP server port
	$mail->SMTPAuth = true;							//Sets SMTP authentication. Utilizes the Username and Password variables
	$mail->Username = 'no-replay@icelj.com';					//Sets SMTP username
	$mail->Password = 'gdhfhjhgkjgdsgfd2345^';					//Sets SMTP password
	$mail->SMTPSecure = 'ssl';							//Sets connection prefix. Options are "", "ssl" or "tls"
	$mail->From = $_POST["email"];					//Sets the From email address for the message
	$mail->FromName = $_POST["name"];				//Sets the From name of the message
	$mail->AddAddress('no-replay@icelj.com', 'ICELJ');		//Adds a "To" address
	$mail->WordWrap = 50;							//Sets word wrapping on the body of the message to a given number of characters
	$mail->IsHTML(true);							//Sets message type to HTML
	$mail->AddAttachment($file);					//Adds an attachment from a path on the filesystem
	$mail->Subject = 'Submitted Paper To ICELJ';				//Sets the Subject of the message
	$mail->Body = $Message;							//An HTML or plain text message body
	if($mail->Send())								//Send an Email. Return true on success or false on error
	{
		$return = 'You Have Submitted Your Paper, Our Editors Will Review Your Paper & Get Back To You. Thank you !!';
		unlink($file);
	}
	else
	{
		$return = 'Ohh No...There is an Error, Please try again.';
	}
    }
    else{
        echo "";
    }
}
?>
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0" name="viewport">

  <title>International Council of English and Literature Journal</title>
  
  <meta content="International Council of English and Literature Journal (ICELJ)" name="title">
  <meta content="https://www.icelj.com/assets/img/icna.png" name="og:image">
  <meta content="ICELJ" name="author">
  <meta content="International Council of English and Literature Journal (ICELJ) aims to advance knowledge of and to develop expertise in critical and scientific inquiry in English, Literature and teaching. The journal is intended for academics, researchers, teacher educators and graduate students who are involved in research and dissemination of knowledge in the field." name="descriptison">
  <meta content="International Council of English and Literature Journal (ICELJ), English Journal" name="keywords">

  <!-- Favicons -->
  <link href="assets/img/icna.png" rel="icon">
  <link href="assets/img/icna.png" rel="apple-touch-icon">

  <!-- Google Fonts - ->
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,500,500i,600,600i,700,700i|Satisfy" rel="stylesheet">

  <!-- Vendor CSS Files -->
  <link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  <link href="assets/vendor/icofont/icofont.min.css" rel="stylesheet">
  <link href="assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
  <link href="assets/vendor/owl.carousel/assets/owl.carousel.min.css" rel="stylesheet">
  <link href="assets/vendor/venobox/venobox.css" rel="stylesheet">

  <!-- Template Main CSS File -->
  <link href="assets/css/style.css" rel="stylesheet">
  <link href="assets/css/added.css" rel="stylesheet">
</head>

<body>
	<div class="top-header">
		<div class="innner">
			<div class="row">
				<!--
				<div class="col-2">
					<img src="assets/img/icna.png" class="logo" alt="Logo" />
				</div>
				-->
				<div class="col-9">
					<p class="sub-title">Delmon Publications</p>
					<h2 class="title">International Council of English and Literature Journal (ICELJ)</h2>
					<h3 class="caption">An International Peer-Reviewed English Journal</h3>
				</div>
				<div class="col-3 right">
					<h6 class="issn">ISSN : Applied</h6>
					<h6 class="issn">Submission : editoricelj@gmail.com</h6>
					<h6 class="issn">Contact : 7993394447</h6>
				</div>
			</div>
		</div>
	</div>
  <header id="header" class="d-flex justify-content-center align-items-center">
	<div class="header-menu">
		<nav class="nav-menu d-none d-lg-block">
		  <ul>
			<li><a href="index.php">Home</a></li>
			<li><a href="Archives.php">Archives</a></li>
			<li class="current"><a href="Submit+Paper.php">Submit Paper</a></li>
			<li><a href="Editorial+Board.php">Editorial Board</a></li>
			<li><a href="Ethics.php">Ethics</a></li>
			<li><a href="Review.php">Review</a></li>
			<li><a href="FAQ.php">FAQ</a></li>
			<li><a href="Submission+Guidelines.php">Submission Guidelines</a></li>
			<li><a href="Contact.php">Contact</a></li>

		  </ul>
		</nav><!-- .nav-menu -->
	</div>
  </header><!-- End Header -->

  <main id="main">
	
    <!-- ======= Contact Me Section ======= -->
    <section id="contact" class="contact">
      <div class="container">

        <div class="section-title">
          <span>Submit Manuscript</span>
          <h2>Submit Manuscript</h2>
          <p>Except this Online Submission, there is no other method to submit your Paper to ICELJ.</p>
        </div>

        <div class="row">
          <div class="col-lg-12">
            <form method="post" role="form" class="php-email-form" enctype="multipart/form-data">
              <p>
				* Fill Details of Main Author.
				<br>
				<span class="mandt">*</span>Marked Fields Are Mandatory.
			  </p>
			  <div class="form-row">
			    <div class="col-md-5 form-group">
                  <label><span class="mandt">*</span>Author Name :</label>
				  <input type="text" name="name" class="form-control" id="name" placeholder="Type Full Name Here" data-rule="required" data-msg="Please enter Your Full Name" />
                  <div class="validate"></div>
                </div>
                <div class="col-md-4 form-group">
                  <label><span class="mandt">*</span>Author Email Id :</label>
				  <input type="email" class="form-control" name="email" id="email" placeholder="Type Email-Id Here" data-rule="email" data-msg="Please enter a valid email" />
                  <div class="validate"></div>
                </div>
                <div class="col-md-4 form-group" style="display:none">
                  <label><span class="mandt">*</span>Author Email Id :</label>
				  <input type="email" class="form-control" name="vemail" id="email" placeholder="Type Email-Id Here" data-rule="" data-msg="Please enter a valid email" />
                  <div class="validate"></div>
                </div>
                <div class="col-md-3 form-group">
                  <label><span class="mandt">*</span>Author Contact Number :</label>
				  <input type="number" class="form-control" name="mnumber" id="mnumber" placeholder="Type Contact Number Here" data-rule="number" data-msg="Please enter a valid Contact Number" />
                  <div class="validate"></div>
                </div>
              </div>
              <div class="form-group">
                <label><span class="mandt">*</span>Title of Paper :</label>
				<input type="text" class="form-control" name="subject" id="subject" placeholder="Type Title of Paper Here" data-rule="minlen:4" data-msg="Please enter at least 8 chars of subject" />
                <div class="validate"></div>
              </div>
			  <div class="form-group give-height">
			    <label><span class="mandt">*</span>Attach Paper :</label>
                <input type="file" class="form-control" name="paper" id="paper" placeholder="Attach Your Paper" data-rule="minlen:required" data-msg="Please Attach Your Paper" />
                <div class="validate"></div>
              </div>
			  
              <div class="form-group">
                <label>Message <span>{ If Any }</span> :</label>
				<textarea class="form-control" name="message" rows="6" data-rule="required" data-msg="Please write something for us" placeholder="Message"></textarea>
                <div class="validate"></div>
              </div>
              <div class="mb-3">
                <div id="return"><?php print_r($return); ?></div>
                <div class="loading">Loading</div>
                <div class="error-message"></div>
                <div class="sent-message">Your message has been sent. Thank you!</div>
              </div>
              <div class="text-center"><button type="submit">Send Message</button></div>
            </form>
          </div>

        </div>

      </div>
    </section><!-- End Contact Me Section -->

  </main>
    <footer class="footer">
	<div class="container">
		<div class="row">
			<div class="col-lg-3 col-md-3 col-xs-12">
				<h5 class="footer-heading">Contact Us</h5>
				<p class="desc">Delmon Publications,
				P.Nainavaram,Ambapuram post,
				Vijayawada Rural, Vijayawada, Krishna district
				Andhra Pradesh, India.
				Pin Code: 520012
				</p>
			</div>
			<div class="col-lg-2 col-md-3 col-xs-12">
				<h5 class="footer-heading">Talk to Us</h5>
				<p class="desc"><a href="tel:+91-7993394447">+91-7993394447</a></p>
			</div>
			<div class="col-lg-2 col-md-2 col-xs-12">
				<h5 class="footer-heading">Email Us</h5>
				<p class="desc"><a href="mailto:editoricelj@gmail.com">editoricelj@gmail.com</a></p>
			</div>
			<div class="col-lg-5 col-md-4 col-xs-12">
				<h5 class="footer-heading">Quick Links</h5>
				<div class="row">
					<div class="col-lg-6 col-md-6 col-xs-12">
						<p class="desc"><a href="Archives.php">Archives</a></p>
						<p class="desc"><a href="Submit+Paper.php">Submit Paper</a></p>
						<p class="desc"><a href="Editorial+Board.php">Editorial Board</a></p>
					</div>
					<div class="col-lg-6 col-md-6 col-xs-12">
						<p class="desc"><a href="FAQ.php">FAQ</a></p>
						<p class="desc"><a href="Ethics.php">Ethics</a></p>
						<p class="desc"><a href="Review.php">Review</a></p>
						<p class="desc"><a href="Submission+Guidelines.php">Submission Guidelines</a></p>
						<p class="desc"><a href="Contact.php">Contact</a></p>
					</div>
				</div>
			</div>
		</div>		
	</div>	
  </footer>
  <div class="dev-note">
		Copyrights For <script type="text/javascript">var today = new Date();var year = today.getFullYear();document.write(year);</script> Registered by Delmon Publications
		<br>
		Developed & Maintained By BVS Infotech.
  </div>
  <a href="#" class="back-to-top"><i class="icofont-simple-up"></i></a>

  <!-- Vendor JS Files -->
  <script src="assets/vendor/jquery/jquery.min.js"></script>
  <script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
  <script src="assets/vendor/jquery.easing/jquery.easing.min.js"></script>
  <!-- <script src="assets/vendor/php-email-form/validate.js"></script> -->
  <script src="assets/vendor/waypoints/jquery.waypoints.min.js"></script>
  <script src="assets/vendor/counterup/counterup.min.js"></script>
  <script src="assets/vendor/owl.carousel/owl.carousel.min.js"></script>
  <script src="assets/vendor/isotope-layout/isotope.pkgd.min.js"></script>
  <script src="assets/vendor/venobox/venobox.min.js"></script>

  <!-- Template Main JS File -->
  <script src="assets/js/main.js"></script>

</body>

</html>