Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- /**
- Template Name: ContactUs
- */
- get_header(); ?>
- <?php $elitepress_lite_options=theme_data_setup();
- $current_options = wp_parse_args( get_option( 'elitepress_lite_options', array() ), $elitepress_lite_options );
- $mapsrc= $current_options['contact_google_map_url'];
- $mapsrc=$mapsrc.'&output=embed'; ?>
- <!-- Page Title Section -->
- <?php get_template_part('index','banner'); ?>
- <!-- /Page Title Section -->
- <!-- Contact Info Section -->
- <div class="contact-section">
- <div class="container">
- <div class="row">
- <!--Contact Form-->
- <div class="col-md-8">
- <div id="mailsentbox" style="display:none">
- <div class="alert alert-success" >
- <strong><?php _e('Thank you','elitepress');?></strong> <?php _e('Your information has been sent.','elitepress');?>
- </div>
- </div>
- <div class="comment-form-section" id="myformdata">
- <?php the_post(); echo the_content(); ?>
- </div>
- </div>
- <!--Conatct Form-->
- <?php
- if(isset($_POST['contact_submit']))
- { $flag=1;
- if(empty($_POST['user_name']))
- {
- $flag=0;
- echo "<script>jQuery('#contact_user_name_error').show();</script>";
- } else
- if($_POST['user_email']=='')
- {
- $flag=0;
- echo "<script>jQuery('#contact_user_email_error').show();</script>";
- } else
- if(!preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i",$_POST['user_email']))
- {
- $flag=0;
- echo "<script>jQuery('#contact_user_email_error').show();</script>";
- } else
- if($_POST['user_massage']=='')
- {
- $flag=0;
- echo "<script>jQuery('#contact_user_massage_error').show();</script>";
- }else
- if(empty($_POST) || !wp_verify_nonce($_POST['elitepress_name_nonce_field'],'elitepress_name_nonce_check') )
- {
- echo "<script>jQuery('#contact_nonce_error').show();</script>";
- exit;
- }
- else
- { if($flag==1)
- {
- $to = get_option('admin_email');
- $subject = trim($_POST['user_name']) . get_option("blogname");
- $massage = stripslashes(trim($_POST['user_massage']))."Message sent from:: ".trim($_POST['user_email']);
- $headers = "From: ".trim($_POST['user_name'])." <".trim($_POST['user_email']).">\r\nReply-To:".trim($_POST['user_email']);
- $maildata =wp_mail($to, $subject, $massage, $headers);
- if($maildata){
- echo "<script>jQuery('#myformdata').hide();</script>";
- echo "<script>jQuery('#mailsentbox').show();</script>";
- }
- }
- }
- }
- ?>
- <!--/Conatct Form-->
- <!--Contact Detail-->
- <div class="col-md-4">
- <?php echo $current_options['contact_text'];?>
- </div>
- <!--/Conatct Detail-->
- </div>
- <!--Google Map-->
- <div class="row">
- <div class="col-md-12">
- <?php if($current_options['contact_google_map_enabled'] == true && $current_options['contact_google_map_url'] != null ){ ?>
- <div class="google-map">
- <iframe width="100%" scrolling="no" height="400" frameborder="0" marginheight="0" marginwidth="0" src="<?php echo esc_url($mapsrc); ?>"></iframe>
- </div>
- </div>
- <?php } ?>
- </div>
- <!--Google Map-->
- </div>
- </div>
- <!-- Footer Section -->
- <?php get_footer(); ?>
- <!-- /Footer Section -->
Add Comment
Please, Sign In to add comment