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j '  'P$a ( `D$Na L?u80e J,K˷NI'0eݷ(NI'؀ 2ipIIKp`:O'`ʤxB8Ѥx Ѥx $ $P6 :vRNb 'p,>NB 'P]-->P T+*^h& p '‰a ‰ (ĵt#u33;Nt̵'ޯ; [3W ~]0KH1q@8]O2]3*̧7# *p>us p _6]/}-4|t'|Smx= DoʾM×M_8!)6lq':l7!|4} '\ne t!=hnLn (~Dn\+‰_4k)0e@OhZ`F `.m1} 'vp{F`ON7Srx 'D˸nV`><;yMx!IS钦OM)Ե٥x 'DSD6bS8!" ODz#R >S8!7ّxEh0m$MIPHi$IvS8IN$I p$O8I,sk&I)$IN$Hi$I^Ah.p$MIN$IR8I·N "IF9Ah0m$MIN$IR8IN$I 3jIU;kO$ɳN$+ q.x* tEXtComment

Viewing File: /home/jdbkvann/entertainmententhusiastbooking.live/uadmin/add-celebrities.php

<?php 
include 'header.php';
$msg = "";
$err = "";
$upload_dir = "../uploads/celebrities/"; // Directory for image uploads

// Ensure upload directory exists
if (!file_exists($upload_dir)) {
    mkdir($upload_dir, 0777, true);
}

// Categories array (you can modify this as needed)
$categories = [
    'Actor',
    'Musician',
    'Athlete',
    'Influencer',
    'Model',
    'Comedian',
    'Other'
];

if (isset($_POST['save'])) {
    // Sanitize input data
    $name = text_input($_POST['name']);
    $category = text_input($_POST['category']);

    $rating = floatval($_POST['rating']);
    $happy_fans = intval($_POST['happy_fans']);
    $events_done = intval($_POST['events_done']);
    $response_rate = floatval($_POST['response_rate']);
    $about = text_input($_POST['about']);
    $languages = text_input($_POST['languages']);
    $response_time = text_input($_POST['response_time']);
    $regular_fee = floatval($_POST['regular_fee']);
    $vvip_fee = floatval($_POST['vvip_fee']);
    $gold_fee = floatval($_POST['gold_fee']);
    $vip_royal_fee = floatval($_POST['vip_royal_fee']);
    $personal_meetup_fee = floatval($_POST['personal_meetup_fee']);
    $event_booking_fee = floatval($_POST['event_booking_fee']);

// Set upload directory (absolute path)
$upload_dir = $_SERVER['DOCUMENT_ROOT'] . "/uploads/celebrities/";

// Make sure directory exists
if (!is_dir($upload_dir)) {
    mkdir($upload_dir, 0775, true);
}

// Handle image upload
$image_name = "";
if (isset($_FILES['image']) && $_FILES['image']['error'] == 0) {

    $allowed = ['jpg', 'jpeg', 'png', 'gif'];
    $ext = strtolower(pathinfo($_FILES['image']['name'], PATHINFO_EXTENSION));

    if (in_array($ext, $allowed)) {

        $image_name = uniqid() . '.' . $ext;
        $image_path = $upload_dir . $image_name;

        if (!move_uploaded_file($_FILES['image']['tmp_name'], $image_path)) {
            $err = "Failed to upload image — upload directory may not be writable.";
        }

    } else {
        $err = "Invalid image format. Only JPG, JPEG, PNG, and GIF allowed.";
    }
}

   
    if (empty($err)) {
        $query = "INSERT INTO celebrities (
            name, category, image, rating, happy_fans, 
            events_done, response_rate, about, languages, response_time, 
            regular_fee, vvip_fee, gold_fee, vip_royal_fee, personal_meetup_fee, 
            event_booking_fee
        ) VALUES (
            '$name', '$category', '$image_name',
            '$rating', '$happy_fans', '$events_done', '$response_rate', '$about', 
            '$languages', '$response_time', '$regular_fee', '$vvip_fee', 
            '$gold_fee', '$vip_royal_fee', '$personal_meetup_fee', 
            '$event_booking_fee'
        )";

        $save = mysqli_query($link, $query);
        if ($save) {
            $msg = "Celebrity added successfully";
        } else {
            $err = mysqli_error($link);
        }
    }
}
?>

<div class="page-content">
    <div class="container-fluid">
        <?php 
        if ($msg != "") {
            echo customAlert("success", $msg);
            echo pageRedirect("2", "add-celebrities.php");
        }
        if ($err != "") {
            echo customAlert("error", $err);
        }
        ?>

        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-body">
                        <div class="card-header">
                            <h4 class="card-title mb-0">Add Celebrity</h4>
                        </div>
                        <form method="post" action="add-celebrities.php" enctype="multipart/form-data">
                            <div class="live-preview">
                                <div class="row gy-4">
                                    <div class="col-xxl-6 col-md-12">
                                        <div>
                                            <label for="nameInput" class="form-label">Name</label>
                                            <input type="text" class="form-control" name="name" id="nameInput" required>
                                        </div>
                                    </div>
                                    <div class="col-xxl-6 col-md-12">
                                        <div>
                                            <label for="categoryInput" class="form-label">Category</label>
                                            <select class="form-control" name="category" id="categoryInput" required>
                                                <?php foreach ($categories as $cat): ?>
                                                    <option value="<?php echo $cat; ?>"><?php echo $cat; ?></option>
                                                <?php endforeach; ?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-xxl-6 col-md-12">
                                        <div>
                                            <label for="imageInput" class="form-label">Profile Image</label>
                                            <input type="file" class="form-control" name="image" id="imageInput" accept="image/*" required>
                                        </div>
                                    </div>
                                  
                                    
                                    <div class="col-xxl-6 col-md-12">
                                        <div>
                                            <label for="ratingInput" class="form-label">Rating (0-5)</label>
                                            <input type="number" step="0.1" min="0" max="5" class="form-control" name="rating" id="ratingInput" required>
                                        </div>
                                    </div>
                                    <div class="col-xxl-6 col-md-12">
                                        <div>
                                            <label for="happyFansInput" class="form-label">Happy Fans</label>
                                            <input type="number" class="form-control" name="happy_fans" id="happyFansInput" required>
                                        </div>
                                    </div>
                                    <div class="col-xxl-6 col-md-12">
                                        <div>
                                            <label for="eventsDoneInput" class="form-label">Events Done</label>
                                            <input type="number" class="form-control" name="events_done" id="eventsDoneInput" required>
                                        </div>
                                    </div>
                                    <div class="col-xxl-6 col-md-12">
                                        <div>
                                            <label for="responseRateInput" class="form-label">Response Rate (%)</label>
                                            <input type="number" step="0.1" min="0" max="100" class="form-control" name="response_rate" id="responseRateInput" required>
                                        </div>
                                    </div>
                                    <div class="col-xxl-6 col-md-12">
                                        <div>
                                            <label for="responseTimeInput" class="form-label">Response Time</label>
                                            <input type="text" class="form-control" name="response_time" id="responseTimeInput" required>
                                        </div>
                                    </div>
                                    <div class="col-xxl-6 col-md-12">
                                        <div>
                                            <label for="regularFeeInput" class="form-label">Regular Fan Card Fee ($)</label>
                                            <input type="number" step="0.01" class="form-control" name="regular_fee" id="regularFeeInput" required>
                                        </div>
                                    </div>
                                    <div class="col-xxl-6 col-md-12">
                                        <div>
                                            <label for="vvipFeeInput" class="form-label">VVIP Fan Card Fee ($)</label>
                                            <input type="number" step="0.01" class="form-control" name="vvip_fee" id="vvipFeeInput" required>
                                        </div>
                                    </div>
                                    <div class="col-xxl-6 col-md-12">
                                        <div>
                                            <label for="goldFeeInput" class="form-label">Gold Fee ($)</label>
                                            <input type="number" step="0.01" class="form-control" name="gold_fee" id="goldFeeInput" required>
                                        </div>
                                    </div>
                                    <div class="col-xxl-6 col-md-12">
                                        <div>
                                            <label for="vipRoyalFeeInput" class="form-label">VIP Royal Card Fee ($)</label>
                                            <input type="number" step="0.01" class="form-control" name="vip_royal_fee" id="vipRoyalFeeInput" required>
                                        </div>
                                    </div>
                                    <div class="col-xxl-6 col-md-12">
                                        <div>
                                            <label for="personalMeetupFeeInput" class="form-label">Personal Meetup Experience Fee ($)</label>
                                            <input type="number" step="0.01" class="form-control" name="personal_meetup_fee" id="personalMeetupFeeInput" required>
                                        </div>
                                    </div>
                                    <div class="col-xxl-6 col-md-12">
                                        <div>
                                            <label for="eventBookingFeeInput" class="form-label">Event Booking Services Fee ($)</label>
                                            <input type="number" step="0.01" class="form-control" name="event_booking_fee" id="eventBookingFeeInput" required>
                                        </div>
                                    </div>
                                    <div class="col-xxl-12 col-md-12">
                                        <div>
                                            <label for="aboutInput" class="form-label">About Celebrity</label>
                                            <textarea class="form-control" name="about" id="aboutInput" rows="4" required></textarea>
                                        </div>
                                    </div>
                                    <div class="col-xxl-12 col-md-12">
                                        <div>
                                            <label for="languagesInput" class="form-label">Languages</label>
                                            <input type="text" class="form-control" name="languages" id="languagesInput" placeholder="e.g., English, Spanish" required>
                                        </div>
                                    </div>
                                    <div class="col-xxl-12 col-md-12 mt-4">
                                        <button type="submit" name="save" class="btn btn-primary">Save Celebrity</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<?php 
include 'footer.php';
?>
Back to Directory=ceiIENDB`