<?php
/*
Template Name: Partner With Us
*/
get_header();

	include get_template_directory() . '/inc/menus/menu.php'; 

// Handle form submission
if (isset($_POST['partner_submitted'])) {
    $business_name = sanitize_text_field($_POST['business_name']);
    $contact_person = sanitize_text_field($_POST['contact_person']);
    $email = sanitize_email($_POST['partner_email']);
    $phone = sanitize_text_field($_POST['partner_phone']);
    $location = sanitize_text_field($_POST['partner_location']);
    $partnership_type = sanitize_text_field($_POST['partnership_type']);
    $business_type = sanitize_text_field($_POST['business_type']);
    $experience_years = sanitize_text_field($_POST['experience_years']);
    $services_offered = sanitize_textarea_field($_POST['services_offered']);
    $current_capacity = sanitize_text_field($_POST['current_capacity']);
    $target_markets = sanitize_textarea_field($_POST['target_markets']);
    $additional_info = sanitize_textarea_field($_POST['additional_info']);
    $website = sanitize_url($_POST['website']);
    
    $post_content = "Business Name: $business_name\n";
    $post_content .= "Contact Person: $contact_person\n";
    $post_content .= "Email: $email\n";
    $post_content .= "Phone: $phone\n";
    $post_content .= "Location: $location\n";
    $post_content .= "Partnership Type: $partnership_type\n";
    $post_content .= "Business Type: $business_type\n";
    $post_content .= "Years of Experience: $experience_years\n";
    $post_content .= "Website: $website\n";
    $post_content .= "Current Capacity: $current_capacity\n\n";
    $post_content .= "Services Offered:\n$services_offered\n\n";
    $post_content .= "Target Markets:\n$target_markets\n\n";
    $post_content .= "Additional Information:\n$additional_info";
    
    $partner_post = array(
        'post_title' => 'Partnership Application: ' . $business_name . ' - ' . $partnership_type,
        'post_content' => $post_content,
        'post_status' => 'private',
        'post_type' => 'partner_application',
    );
    
    $post_id = wp_insert_post($partner_post);
    
    if ($post_id) {
        $submission_success = true;
    }
}
?>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<main role="main">
    <?php 
    $backgroundImg = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
    if ($backgroundImg) : ?>
    <div class="header-wrap1" style="background: linear-gradient(90deg, rgba(6, 6, 5, 0.8), rgba(12, 12, 12, 0.5)), url('<?php echo $backgroundImg[0]; ?>') no-repeat; background-size: cover; background-position: center center;">
    <?php else : ?>
    <div class="header-wrap1" style="background: linear-gradient(90deg, rgba(6, 6, 5, 0.8), rgba(12, 12, 12, 0.5)), #333;">
    <?php endif; ?>
        <div class="container">
            <div class="row">
                <div class="col-lg-12 text-center">
                    <h1 class="default-title"><?php the_title(); ?></h1>
                </div>
            </div>
        </div>
    </div>
    
    <div class="fl-photo-content fl-photo-img-svg">
        <svg class="fl-photo-img wp-image-174 size-full fl-photo-img-svg replaced-svg svg-replaced-16 even" viewBox="0 0 1367 112.906" height="112.906" width="1300" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none">
            <g transform="translate(0 0)" data-name="Component 2 – 14">
                <path fill="#ffffff" transform="translate(0.5 340.405)" d="M1366.5-227.5s-243-212-909.24-55C179.788-217.113-.5-282.5-.5-282.5v55Z"></path>
            </g>
        </svg>
    </div>

    <div class="partner-container">
        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
            <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                <?php the_content(); ?>
                
                <?php if (isset($submission_success) && $submission_success) : ?>
                <div class="partner-success-popup">
                    <div class="partner-success-content">
                        <div class="partner-checkmark">
                            <svg viewBox="0 0 52 52">
                                <circle cx="26" cy="26" r="25" fill="var(--kpy-primary)"/>
                                <path fill="none" stroke="#fff" stroke-width="4" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
                            </svg>
                        </div>
                        <h3>Partnership Application Received!</h3>
                        <p>Thank you for your interest in partnering with us. We'll review your application and get back to you within 2-3 business days.</p>
                        <button class="partner-close-popup">Close</button>
                    </div>
                </div>
                <?php endif; ?>
            </article>
        <?php endwhile; endif; ?>

        <!-- Partnership Overview Section -->
        <div class="partnership-overview">
            <div class="partner-intro">
                <h2>Join Our Partnership Network</h2>
                <p>Expand your reach in Uganda and Rwanda's thriving tourism industry. Partner with us to create unforgettable experiences for travelers while growing your business.</p>
            </div>

            <div class="partnership-types">
                <div class="partnership-type-card">
                    <div class="partner-type-icon">
                        <i class="fas fa-handshake"></i>
                    </div>
                    <h3>Tour Agents & Operators</h3>
                    <p>Join our network of trusted tour agents. Promote our Uganda and Rwanda safari packages and earn competitive commissions on every booking.</p>
                    <ul class="partner-benefits">
                        <li>Up to 15% commission rates</li>
                        <li>Marketing support materials</li>
                        <li>Dedicated agent portal</li>
                        <li>Priority customer support</li>
                    </ul>
                </div>

                <div class="partnership-type-card">
                    <div class="partner-type-icon">
                        <i class="fas fa-bed"></i>
                    </div>
                    <h3>Accommodation Partners</h3>
                    <p>Hotels, lodges, campsites, and guesthouses in Uganda and Rwanda. Become part of our accommodation network for consistent bookings.</p>
                    <ul class="partner-benefits">
                        <li>Guaranteed monthly bookings</li>
                        <li>Online listing and promotion</li>
                        <li>Flexible payment terms</li>
                        <li>Quality assurance support</li>
                    </ul>
                </div>

                <div class="partnership-type-card">
                    <div class="partner-type-icon">
                        <i class="fas fa-map-marked-alt"></i>
                    </div>
                    <h3>Tourist Attractions & Activities</h3>
                    <p>National parks, cultural sites, adventure activities, and local experiences. Showcase your attraction to our international clientele.</p>
                    <ul class="partner-benefits">
                        <li>Featured in tour packages</li>
                        <li>Professional photography</li>
                        <li>International exposure</li>
                        <li>Sustainable tourism focus</li>
                    </ul>
                </div>

                <div class="partnership-type-card">
                    <div class="partner-type-icon">
                        <i class="fas fa-bus"></i>
                    </div>
                    <h3>Transport & Logistics</h3>
                    <p>Vehicle rental companies, airlines, boat operators, and transfer services. Provide reliable transport solutions for our guests.</p>
                    <ul class="partner-benefits">
                        <li>Regular transport contracts</li>
                        <li>Fleet management support</li>
                        <li>Insurance coordination</li>
                        <li>Route optimization</li>
                    </ul>
                </div>
            </div>
        </div>

        
        <!-- Partnership Application Form -->
        
            <div class="partner-form-section">
                <div class="partner-form-card">
                    <h3 class="partner-form-title">Partnership Application</h3>
                    <p class="partner-form-subtitle">Ready to join our network? Fill out the application below and we'll get back to you soon.</p>
                    
                    <form id="partner-application-form" method="post" class="partner-form">
                        <!-- Business Information -->
                        <div class="form-section">
                            <h4 class="section-title">Business Information</h4>
                            
                            <div class="partner-form-row">
                                <div class="partner-form-group partner-form-half">
                                    <label for="business_name">Business/Company Name <span>*</span></label>
                                    <input type="text" id="business_name" name="business_name" required>
                                </div>
                                <div class="partner-form-group partner-form-half">
                                    <label for="contact_person">Contact Person <span>*</span></label>
                                    <input type="text" id="contact_person" name="contact_person" required>
                                </div>
                            </div>
                            
                            <div class="partner-form-row">
                                <div class="partner-form-group partner-form-half">
                                    <label for="partner_email">Email Address <span>*</span></label>
                                    <input type="email" id="partner_email" name="partner_email" required>
                                </div>
                                <div class="partner-form-group partner-form-half">
                                    <label for="partner_phone">Phone Number <span>*</span></label>
                                    <input type="tel" id="partner_phone" name="partner_phone" required>
                                </div>
                            </div>
                            
                            <div class="partner-form-row">
                                <div class="partner-form-group partner-form-half">
                                    <label for="partner_location">Location (City, Country) <span>*</span></label>
                                    <input type="text" id="partner_location" name="partner_location" required>
                                </div>
                                <div class="partner-form-group partner-form-half">
                                    <label for="website">Website URL</label>
                                    <input type="url" id="website" name="website" placeholder="https://">
                                </div>
                            </div>
                        </div>

                        <!-- Partnership Details -->
                        <div class="form-section">
                            <h4 class="section-title">Partnership Details</h4>
                            
                            <div class="partner-form-row">
                                <div class="partner-form-group partner-form-half">
                                    <label for="partnership_type">Partnership Type <span>*</span></label>
                                    <select id="partnership_type" name="partnership_type" required>
                                        <option value="">Select Partnership Type</option>
                                        <option value="tour-agent">Tour Agent/Operator</option>
                                        <option value="accommodation">Accommodation Partner</option>
                                        <option value="attraction">Tourist Attraction/Activity</option>
                                        <option value="transport">Transport & Logistics</option>
                                        <option value="other">Other</option>
                                    </select>
                                </div>
                                <div class="partner-form-group partner-form-half">
                                    <label for="business_type">Business Type <span>*</span></label>
                                    <select id="business_type" name="business_type" required>
                                        <option value="">Select Business Type</option>
                                        <option value="individual">Individual</option>
                                        <option value="small-business">Small Business</option>
                                        <option value="medium-enterprise">Medium Enterprise</option>
                                        <option value="large-corporation">Large Corporation</option>
                                        <option value="ngo">NGO/Non-Profit</option>
                                    </select>
                                </div>
                            </div>
                            
                            <div class="partner-form-row">
                                <div class="partner-form-group partner-form-half">
                                    <label for="experience_years">Years in Tourism Industry <span>*</span></label>
                                    <select id="experience_years" name="experience_years" required>
                                        <option value="">Select Experience</option>
                                        <option value="less-than-1">Less than 1 year</option>
                                        <option value="1-2">1-2 years</option>
                                        <option value="3-5">3-5 years</option>
                                        <option value="6-10">6-10 years</option>
                                        <option value="more-than-10">More than 10 years</option>
                                    </select>
                                </div>
                                <div class="partner-form-group partner-form-half">
                                    <label for="current_capacity">Current Monthly Capacity</label>
                                    <input type="text" id="current_capacity" name="current_capacity" placeholder="e.g., 50 guests, 20 bookings">
                                </div>
                            </div>
                        </div>

                        <!-- Services & Additional Information -->
                        <div class="form-section">
                            <h4 class="section-title">Services & Additional Information</h4>
                            
                            <div class="partner-form-group">
                                <label for="services_offered">Services/Products Offered <span>*</span></label>
                                <textarea id="services_offered" name="services_offered" rows="4" required placeholder="Describe the services or products you offer..."></textarea>
                            </div>
                            
                            <div class="partner-form-group">
                                <label for="target_markets">Target Markets & Customer Base</label>
                                <textarea id="target_markets" name="target_markets" rows="3" placeholder="Describe your typical customers and target markets..."></textarea>
                            </div>
                            
                            <div class="partner-form-group">
                                <label for="additional_info">Additional Information</label>
                                <textarea id="additional_info" name="additional_info" rows="4" placeholder="Any additional information about your business, special offers, certifications, etc."></textarea>
                            </div>
                        </div>
                        
                        <div class="partner-form-submit">
                            <button type="submit" name="partner_submitted" class="partner-submit-btn">
                                Submit Partnership Application
                                <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                                    <path d="M5 12H19M19 12L12 5M19 12L12 19" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
                                </svg>
                            </button>
                        </div>
                    </form>
                </div>
            </div>
            
            <!-- Partnership Benefits Sidebar -->
            <div class="partner-sections-wrapper">
            <div class="partner-benefits-section">
                <div class="partner-benefits-card">
                    <div class="benefits-header">
                        <h3 class="benefits-title">Partnership Benefits</h3>
                        <div class="benefits-image">
                            <img src="https://lwegatech.net/brecosafaris/wp-content/uploads/2025/08/The-land-of-a-thousand-hills.jpg" alt="Partnership Benefits" onerror="this.style.display='none'">
                        </div>
                    </div>
                    
                    <div class="benefit-item">
                        <div class="benefit-icon">
                            <i class="fas fa-dollar-sign"></i>
                        </div>
                        <div class="benefit-text">
                            <h4>Competitive Commissions</h4>
                            <p>Earn attractive commission rates based on your partnership type and performance.</p>
                        </div>
                    </div>
                    
                    <div class="benefit-item">
                        <div class="benefit-icon">
                            <i class="fas fa-rocket"></i>
                        </div>
                        <div class="benefit-text">
                            <h4>Marketing Support</h4>
                            <p>Get access to professional marketing materials and co-marketing opportunities.</p>
                        </div>
                    </div>
                    
                    <div class="benefit-item">
                        <div class="benefit-icon">
                            <i class="fas fa-graduation-cap"></i>
                        </div>
                        <div class="benefit-text">
                            <h4>Training & Development</h4>
                            <p>Regular training sessions and workshops to enhance your tourism knowledge.</p>
                        </div>
                    </div>
                    
                    <div class="benefit-item">
                        <div class="benefit-icon">
                            <i class="fas fa-network-wired"></i>
                        </div>
                        <div class="benefit-text">
                            <h4>Network Access</h4>
                            <p>Connect with other partners in our network for collaborative opportunities.</p>
                        </div>
                    </div>
                </div>
                
            </div>
            
            <!-- Why Partner With Us Section -->
        <div class="why-partner-section">
            <div class="why-partner-content">
                <div class="why-partner-text">
                    <h2>Why Partner With Breco Safaris?</h2>
                    <div class="partner-image-main">
                        <img src="https://lwegatech.net/brecosafaris/wp-content/uploads/2025/08/Primate-tours-scaled.jpg" alt="Why Partner With Breco Safaris" onerror="this.style.display='none'">
                    </div>
                    <div class="partner-reasons">
                        <div class="partner-reason">
                            <div class="reason-icon">
                                <i class="fas fa-chart-line"></i>
                            </div>
                            <div class="reason-content">
                                <h4>Growing Market Reach</h4>
                                <p>Access to international markets with proven track record in Uganda and Rwanda tourism.</p>
                            </div>
                        </div>
                        
                        <div class="partner-reason">
                            <div class="reason-icon">
                                <i class="fas fa-users"></i>
                            </div>
                            <div class="reason-content">
                                <h4>Established Client Base</h4>
                                <p>Benefit from our extensive network of repeat customers and referral partnerships.</p>
                            </div>
                        </div>
                        
                        <div class="partner-reason">
                            <div class="reason-icon">
                                <i class="fas fa-leaf"></i>
                            </div>
                            <div class="reason-content">
                                <h4>Sustainable Tourism</h4>
                                <p>Join our commitment to responsible tourism that benefits local communities and conservation.</p>
                            </div>
                        </div>
                        
                        
                    </div>
                </div>
            </div>
        </div>
        
            
            </div>
        
    </div>
</main>

<script>
jQuery(document).ready(function($) {
    // Show success popup if submission was successful
    <?php if (isset($submission_success) && $submission_success): ?>
        $('.partner-success-popup').addClass('active');
    <?php endif; ?>
    
    // Close popup handler
    $('.partner-close-popup').on('click', function() {
        $('.partner-success-popup').removeClass('active');
    });
    
    // Form validation and enhancement
    $('#partner-application-form').on('submit', function(e) {
        var isValid = true;
        
        // Check required fields
        $(this).find('input[required], select[required], textarea[required]').each(function() {
            if (!$(this).val()) {
                $(this).addClass('error');
                isValid = false;
            } else {
                $(this).removeClass('error');
            }
        });
        
        if (!isValid) {
            e.preventDefault();
            alert('Please fill in all required fields.');
        }
    });
    
    // Remove error class on input
    $('input, select, textarea').on('input change', function() {
        $(this).removeClass('error');
    });
});
</script>


<?php get_footer(); ?>