query(" SELECT * FROM services WHERE status='active' ORDER BY id DESC LIMIT 8 ")->fetchAll(PDO::FETCH_ASSOC); } catch(Exception $e) { $services = []; } // Get slider images from database try { $sliders = $db->query(" SELECT * FROM slider_images WHERE status='active' ORDER BY order_position ASC, id DESC ")->fetchAll(PDO::FETCH_ASSOC); } catch(Exception $e) { $sliders = []; } // Get testimonials from database with error handling try { $testimonials = $db->query(" SELECT t.*, u.name as user_name, u.image as user_image FROM testimonials t JOIN users u ON t.user_id = u.id WHERE t.status='active' ORDER BY t.id DESC LIMIT 3 ")->fetchAll(PDO::FETCH_ASSOC); // If no testimonials, use default if(empty($testimonials)) { throw new Exception('No testimonials found'); } } catch(Exception $e) { // Default testimonials $testimonials = [ [ 'id' => 1, 'user_name' => 'Rahul Sharma', 'user_image' => 'https://randomuser.me/api/portraits/men/1.jpg', 'rating' => 5, 'comment' => 'Excellent service! The electrician was very professional and fixed my AC quickly. Highly recommended!', 'service_name' => 'AC Repair' ], [ 'id' => 2, 'user_name' => 'Priya Patel', 'user_image' => 'https://randomuser.me/api/portraits/women/2.jpg', 'rating' => 5, 'comment' => 'Very satisfied with the service. They came on time and did a great job with my fridge repair.', 'service_name' => 'Fridge Repair' ], [ 'id' => 3, 'user_name' => 'Amit Kumar', 'user_image' => 'https://randomuser.me/api/portraits/men/3.jpg', 'rating' => 4, 'comment' => 'Good workmanship and reasonable prices. Will definitely use their services again.', 'service_name' => 'Wiring' ] ]; } // ===== GET ELECTRICIANS FOR SLIDER ===== try { // Fetch active electricians with profile images $electricians = $db->query(" SELECT id, name, phone, email, profile_image, specialization, city, state, experience_years, rating, total_reviews, availability, status FROM electricians WHERE status = 'active' AND profile_image IS NOT NULL AND profile_image != '' ORDER BY rating DESC, experience_years DESC LIMIT 10 ")->fetchAll(PDO::FETCH_ASSOC); } catch(Exception $e) { $electricians = []; } $totalServices = count($services); ?>
Expert in electrical services
Satisfied clients
Emergency support available
Quality work guaranteed
Professional electrical services for your home and office
Please check back later. Services will be added soon.
Available round the clock for all emergencies with quick response time.
Experienced and certified professionals with years of hands-on expertise.
Transparent pricing with no hidden costs. Quality service at fair rates.
Real feedback from our valued customers
""
Verified Customer