Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- Template Name: Contact
- */
- get_header();
- get_template_part('index','banner');
- $appointment_options=theme_setup_data();
- $contact_setting = wp_parse_args( get_option( 'appointment_options', array() ), $appointment_options );
- $about_setting = wp_parse_args( get_option( 'appointment_options', array() ), $appointment_options );
- //echo "<pre>"; print_r($contact_setting); wp_die();
- $mapsrc= $contact_setting['contact_google_map_url'];
- $mapsrc=$mapsrc.'&output=embed';
- ?>
- <!-- Contact Section -->
- <div class="page-builder">
- <div class="container">
- <div class="row">
- <div class="col-md-12">
- <?php
- the_post();
- the_content();?>
- </div>
- </div>
- <div class="row">
- <!--Contact Form-->
- <?php if( $contact_setting['contact_google_map_enabled'] == 1) { ?>
- <div class="col-md-12"><?php } else { ?><div class="col-md-8"><?php } ?>
- <div id="mailsentbox" style="display:none">
- <div class="alert alert-success" >
- <strong><?php _e('Thank you','appointment');?></strong> <?php _e('Your information has been sent.','appointment');?>
- </div>
- </div>
- <div class="contact-title"><h2><?php echo $contact_setting['send_usmessage']; ?></h2></div>
- <div class="contact-form-section" id="myformdata">
- <form class="form-inline" role="form" method="post" action="#">
- <?php wp_nonce_field('appointment_name_nonce_check','appointment_name_nonce_field'); ?>
- <div class="contact-form-group">
- <input type="name" name="user_name" id="user_name" placeholder="<?php _e('Name','appointment'); ?>" class="contact-form-control">
- <span style="display:none; color:red" id="contact_user_name_error"><?php _e('Name','appointment'); ?> </span>
- </div>
- <div class="contact-form-group">
- <input type="email" name="user_email" id="user_email" placeholder="<?php _e('Email','appointment'); ?>" class="contact-form-control">
- <span style="display:none; color:red" id="contact_user_email_error"><?php _e('Email','appointment'); ?> </span>
- </div>
- <div class="contact-form-group-textarea">
- <textarea placeholder="<?php _e('Message','appointment'); ?>" name="user_massage" id="user_massage" class="contact-form-control-textarea" rows="7"></textarea>
- <span style="display:none; color:red" id="contact_user_massage_error"><?php _e('Message','appointment'); ?></span>
- </div>
- <button class="blogdetail-btn" id="contact_submit" name="contact_submit" type="submit"><?php _e('Send Message', 'appointment'); ?></button>
- </form>
- </div>
- </div>
- <!--/Contact 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['appointment_name_nonce_field'],'appointment_name_nonce_check') )
- {
- echo "<script>jQuery('#contact_nonce_error').show();</script>";
- exit;
- }
- else
- {
- if($flag==1)
- {
- $to = get_option('admin_email');
- //print_r($to);
- $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>";
- }
- }
- }
- }
- ?>
- <!--Google Map-->
- <?php if( $contact_setting['contact_google_map_enabled'] == 0) { ?>
- <div class="col-md-4">
- <div class="contact-title"><h2><?php echo $contact_setting['contact_google_title'];?></h2></div>
- <div class="google-map">
- <iframe width="100%" scrolling="no" height="285" frameborder="0" marginheight="0" marginwidth="0" src="<?php echo esc_url($mapsrc); ?>"></iframe>
- </div>
- </div>
- <?php } ?>
- <!--Google Map-->
- </div>
- </div>
- </div>
- <!-- /Contact Section -->
- <div class="clearfix"></div>
- <!-- Contact Detail Section -->
- <?php if( $contact_setting['contact-callout-enable'] == 0) { ?>
- <div class="contact-detail-section" style="background: url('<?php echo $contact_setting['contact_callout_back']; ?>') repeat <?php echo $contact_setting['contact_attachment']; ?> 0 0 rgba(0, 0, 0, 0); background-size:cover;">
- <div class="overlay" style="background: none repeat scroll 0 0 <?php echo ($contact_setting['contact_overlay']!=true?'transparent':'rgba(0, 0, 0, 0.2)'); ?>;">
- <div class="container">
- <!-- Section Title -->
- <div class="row">
- <div class="col-md-12">
- <div class="section-heading-title">
- <h1 class="text-color"><?php echo $contact_setting['contact_title']; ?></h1>
- <p class="text-color"><?php echo $contact_setting['contact_description']; ?></p>
- </div>
- </div>
- </div>
- <!-- /Section Title -->
- <!-- Contact Area -->
- <div class="row">
- <div class="col-md-4">
- <div class="contact-detail-area">
- <i class="fa <?php echo $contact_setting['contact_call_icon'];?>"></i>
- <h6><?php echo $contact_setting['contact_call_title']; ?></h6>
- <address><?php echo $contact_setting['contact_call_description'];?></address>
- </div>
- </div>
- <div class="col-md-4">
- <div class="contact-detail-area">
- <i class="fa <?php echo $contact_setting['contact_add_icon']; ?>"></i>
- <h6><?php echo $contact_setting['contact_add_title']; ?></h6>
- <address><?php echo $contact_setting['contact_add_description']; ?></address>
- </div>
- </div>
- <div class="col-md-4">
- <div class="contact-detail-area">
- <i class="fa <?php echo $contact_setting['contact_mail_icon']; ?>"></i>
- <h6><?php echo $contact_setting['contact_mail_title']; ?></h6>
- <address><?php echo $contact_setting['contact_mail_description']; ?></address>
- </div>
- </div>
- </div>
- <!-- /Contact Area -->
- </div>
- </div>
- </div>
- <?php } ?>
- <!-- /Contact Detail Section -->
- <div class="clearfix"></div>
- <!-- Horizontal Callout Section -->
- <div class="hrtl-callout-section">
- <div class="container">
- <div class="row">
- <div class="col-md-9">
- <h2><?php echo $contact_setting['contact_callout_title']; ?></h2>
- <p><?php echo $contact_setting['contact_callout_description']; ?></p>
- </div>
- <div class="col-md-3">
- <div class="hrtl-btn-area">
- <a href="<?php echo $contact_setting['contact_callout_button_link']; ?>" <?php if( $contact_setting['contact_callout_link_target'] == 1) { echo "target='_blank'"; } ?> class="hrtl-btn"><?php echo $contact_setting['contact_callout_button']; ?></a>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- /Horizontal Callout Section -->
- <!-- Team Section -->
- <?php if( $about_setting['team_section_enable' ] == '') { ?>
- <div class="team-section">
- <div class="container">
- <!-- Section Title -->
- <div class="row">
- <div class="col-md-12">
- <div class="section-heading-title">
- <h1><?php echo $about_setting['about_team_title']; ?></h3>
- <p><?php echo $about_setting['about_team_description']; ?></p>
- </div>
- </div>
- </div>
- <!-- /Section Title -->
- <!-- Team Area -->
- <div class="row"> <!-- id="team_scroll" -->
- <?php
- $count_posts = wp_count_posts( 'appointment_team')->publish;
- $arg = array( 'post_type' => 'appointment_team','posts_per_page' =>$count_posts);
- $team = new WP_Query( $arg );
- $i=1;
- if($team->have_posts())
- { while($team->have_posts() ) : $team->the_post();
- $designation_meta_save = sanitize_text_field( get_post_meta( get_the_ID(), 'designation_meta_save', true ));
- $description_meta_save = sanitize_text_field( get_post_meta( get_the_ID(), 'description_meta_save', true ));
- $fb_meta_save = sanitize_text_field( get_post_meta( get_the_ID(), 'fb_meta_save', true ));
- $fb_meta_save_chkbx = sanitize_text_field( get_post_meta( get_the_ID(), 'fb_meta_save_chkbx', true ));
- $lnkd_meta_save = sanitize_text_field( get_post_meta( get_the_ID(), 'lnkd_meta_save', true ));
- $lnkd_meta_save_chkbx = sanitize_text_field( get_post_meta( get_the_ID(), 'lnkd_meta_save_chkbx', true ));
- $twt_meta_save = sanitize_text_field( get_post_meta( get_the_ID(), 'twt_meta_save', true ));
- $twt_meta_save_chkbx = sanitize_text_field( get_post_meta( get_the_ID(), 'twt_meta_save_chkbx', true ));
- ?>
- <div class="col-md-3 team-area">
- <?php
- $defalt_arg =array('class' => "img-responsive");
- if(has_post_thumbnail()){
- ?>
- <div class="team-image">
- <?php the_post_thumbnail('', $defalt_arg); ?>
- <?php } else { echo '<div class="team-image">'; } ?>
- <div class="team-showcase-overlay">
- <div class="team-showcase-overlay-inner">
- <div class="team-showcase-icons">
- <?php
- if($fb_meta_save){
- if($fb_meta_save_chkbx)
- { $target ="_blank"; } else { $target ="_self"; } ?>
- <a href="<?php if($fb_meta_save){ echo esc_html($fb_meta_save); } ?>" target="<?php echo $target; ?>" class="hover_thumb"><i class="fa fa-facebook"></i></a>
- <?php } ?>
- <?php
- if($twt_meta_save){
- if($twt_meta_save_chkbx)
- { $target ="_blank"; } else { $target ="_self"; } ?>
- <a href="<?php if($twt_meta_save){ echo esc_html($twt_meta_save); } ?>" target="<?php echo $target; ?>" class="hover_thumb" ><i class="fa fa-twitter"></i></a>
- <?php } ?>
- <?php
- if($lnkd_meta_save){
- if($lnkd_meta_save_chkbx)
- { $target ="_blank"; } else { $target ="_self"; } ?>
- <a href="<?php if($lnkd_meta_save){ echo esc_html($lnkd_meta_save); } ?>" target="<?php echo $target; ?>" class="hover_thumb"><i class="fa fa-linkedin"></i></a> <?php } ?>
- </div>
- </div>
- </div>
- <?php
- if(has_post_thumbnail()){
- ?>
- </div> <?php } ?>
- <div class="team-caption"><h5><?php if(!empty($designation_meta_save)){
- echo $designation_meta_save; } ?></h5><h3><?php the_title(); ?></h3></div>
- </div> <?php if(!has_post_thumbnail()) { echo '</div>'; } ?>
- <?php if($i%4==0)
- { echo "<div class='clearfix'></div>"; }
- $i++; endwhile;
- } else {
- $team_title = array('John Doe', 'Sarah Culan', 'Chao Kang', 'Megan Sheryl');
- $team_designation = array(__('FOUNDER','appointment'), __('DESIGNER','appointment'),__('DEVELOPER','appointment'),__('DESIGNER'));
- for($i=1 ; $i<=4 ; $i++ )
- { ?>
- <div class="col-md-3 team-area">
- <div class="team-image">
- <img class="img-responsive" src="<?php echo WEBRITI_TEMPLATE_DIR_URI; ?>/images/team/team<?php echo $i; ?>.jpg">
- <div class="team-showcase-overlay">
- <div class="team-showcase-overlay-inner">
- <div class="team-showcase-icons">
- <a href="#" title="Facebook" class="hover_thumb"><i class="fa fa-facebook"></i></a>
- <a href="#" title="Twitter" class="hover_thumb"><i class="fa fa-twitter"></i></a>
- <a href="#" title="Linkedin" class="hover_thumb"><i class="fa fa-linkedin"></i></a>
- </div>
- </div>
- </div>
- </div>
- <div class="team-caption"><h5><?php echo $team_designation[$i-1];?></h5><h3><?php echo $team_title[$i-1];?></h3></div>
- </div>
- <?php } } ?>
- </div>
- <!-- /Team Area -->
- </div>
- </div>
- <!-- /Team Section -->
- <div class="clearfix"></div>
- <?php } ?>
- <div class="clearfix"></div>
- <!-- Footer Section -->
- <?php get_footer(); ?>
- <!-- /Footer Section -->
Add Comment
Please, Sign In to add comment