<?php
    $GLOBALS['img']='contact';
    get_header();
    the_post();
?>

<?php if(of_get_option('show_contact')){?>

    <div class="container top">
	
        <div class="row-fluid">
	   
            <?php if(of_get_option('show_contact_left')){?>
	   
            <div class="span8">
		
                <div class="contact">
		  
                    <h3 <?php echo colors('h3');?> ><?php echo of_get_option('contact_left_title');?></h3>
			 
                    <p <?php echo colors('p');?> ><?php echo of_get_option('contact_left_desc');?></p>
			
                    <?php
                        if (isset($_REQUEST['email'])){
                        $name = $_REQUEST['name'] ;
                        $email = $_REQUEST['email'] ;
                        $phone = $_REQUEST['web'] ;
                        $message = $_REQUEST['message'] ;
                        $sub   =  'Contact Us';
                        $msg   =  'Dear Admin,<br /><br />';  
                        $msg  .=  'Name: '.$name.'<br /><br />';  
                        $msg  .=  'Email: '.$email.'<br /><br />';      
                        $msg  .=  'Web: '.$phone.'<br /><br />';  
                        $msg  .=  'Message: '.$message.'<br /><br />';              
                        $msg  .=  '<br /><br />Best Regards<br />'.$name."&nbsp;";      
                        $subject = $sub;
                        $mailheader = "From: <".$email.">\r\n"; 
                        $mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n"; 
                        $MESSAGE_BODY = $msg; 
                        @mail("test@test.com", $subject, $MESSAGE_BODY, $mailheader);
                        echo '<div class="success">Email has submited.</div>';
                        }
                    ?>
					
                    <form id="form" action="<?php echo get_template_directory_uri();?>/send_mail.php">
                        
						<label><?php echo of_get_option('contact_left_name');?></label>
                        <input type="text" placeholder="<?php echo of_get_option('contact_left_name');?>" name="name" required="">
                        <label><?php echo of_get_option('contact_left_web');?></label>
                        <input type="text" placeholder="<?php echo of_get_option('contact_left_web');?>" name="web" required="">
                        <label><?php echo of_get_option('contact_left_mail');?></label>
                        <input type="email" placeholder="<?php echo of_get_option('contact_left_mail');?>" name="email" required="">
                        <label><?php echo of_get_option('contact_left_mess');?></label>
                        <textarea placeholder="<?php echo of_get_option('contact_left_mess');?>" name="message" required=""></textarea>
                        <input type="submit" <?php echo colors('btn');?> name="Submit" value="<?php echo of_get_option('contact_left_btn');?>" class="botton">
                    
					</form>
					
                    <div id="result"></div>
            </div>
			
        </div>
		
        <?php }?>
		
        <?php if(of_get_option('show_contact_last_right')){?>
		
        <div class="span4">
	  
            <!-- info -->
		
            <div class="info">
		
                <?php if(of_get_option('show_contact_last_right')){?>
		  
                <h4 <?php echo colors('h4');?> ><?php echo of_get_option('contact_zone1_title');?></h4>
		  
                <div class="row-fluid">
		  
                    <?php for($i=1; $i<=of_get_option('contact_zone1_pay_num'); $i++){?>
		  
                    <div class="span2">
			
                        <img src="<?php echo of_get_option('contact_zone1_card'.$i);?>" alt="">
			  
                    </div>
			
                    <?php }?>
		  
                </div>

                <div class="clearfix"></div>

                <div class="support">
		  
                    <div class="row-fluid">
			
                        <div class="span3">
			  
                            <img src="<?php echo of_get_option('contact_zone1_call_img');?>" alt="">
				
                        </div>

                        <div class="span9">
			  
                            <p <?php echo colors('p');?> ><?php echo of_get_option('contact_zone1_title_call');?></p>
				
                            <?php for($i=1; $i<=of_get_option('contact_zone1_call_num'); $i++){?>
				
                            <p <?php echo colors('p');?> ><?php echo of_get_option('contact_zone1_call_title'.$i);?>: <span <?php echo colors('h1s');?> ><?php echo of_get_option('contact_zone1_call_phone'.$i);?></span></p>
                
				            <?php }?> 
              
			            </div>
            
			        </div>           
          
		        </div>
                
				<?php }?>
				
                <div class="clearfix"></div>
		  
                <?php if(of_get_option('show_contact_zone2')){?>
		  
                <h4 <?php echo colors('h4');?> ><?php echo of_get_option('contact_zone2_title');?></h4>
		  
                <p <?php echo colors('p');?> ><?php echo of_get_option('contact_zone2_desc');?></p>
		  
                <ul class="list list_support">
		  
                    <?php for($i=1; $i<=of_get_option('contact_zone2_tran_num'); $i++){?>
		  
                    <li><a <?php echo colors('a');?> href="<?php echo of_get_option('contact_zone2_tran_link'.$i);?>"><i <?php echo font_awesome_icon_style('contact_tran');?>></i><?php echo of_get_option('contact_zone2_tran_title'.$i);?></a></li>
          
		            <?php }?>
		  
                </ul>
		  
                <?php }?>
		  
            </div>
		
            <!-- info -->
		
        </div>
	  
        <?php }?> 

    </div>

    <div class="clearfix"></div>
	  
    <!-- divisor -->
	  
    <div class="divisor">
	  
        <div class="circle_left"></div>
		
        <div class="circle_right"></div>
		
    </div>
	  
    <!-- divisor -->

    <!-- Info error Page -->
	  
    <?php if(of_get_option('show_contact_btn_free')){?>
	  
    <div class="row-fluid top">
	  
        <?php for($i=1; $i<=of_get_option('contact_btn_num_free'); $i++){?>
	  
        <div class="span3">
		
            <h5 <?php echo colors('h5');?> ><?php echo of_get_option('contact_btn_opt_title'.$i);?></h5>
		  
            <ul class="infor_error">
			
                <?php for($j=1; $j<=of_get_option('contact_btn_num_opt'.$i); $j++){?>
			
                    <li><i <?php echo font_awesome_icon_style('contact_vig'.$i);?>></i><a <?php echo colors('a');?>  href="<?php echo of_get_option('contact_btn_opt_link'.$i.$j);?>"><?php echo of_get_option('contact_btn_opt_title'.$i.$j);?></a></li>
            
			    <?php }?>

            </ul>
			
        </div>
		
        <?php }?>
	  
        <!-- Info error Page -->
		
    </div>
	  
    <?php }?>
	  
    </div>
	
	</div>
	
<?php } get_footer(); ?>