Пример #1
0
        }
        ?>
>
                      <td><input  type="checkbox" name="allselect[]" class="case" id="allselect<?php 
        echo $getPageData->id;
        ?>
" value="<?php 
        echo $getPageData->id;
        ?>
"/></td>
                      <td><?php 
        echo $getPageData->name;
        ?>
</td>
                      <td><?php 
        echo pageStatus($getPageData->publish);
        ?>
</td>
                      <td><?php 
        echo trim(str_replace('&nbsp;', '', substr(strip_tags($getPageData->desc), 0, 100))) . '....';
        ?>
</td>
                      <td><?php 
        echo date(DEFAULT_DATE_FORMAT, $getPageData->creation_date);
        ?>
</td>
                      <td><a href="edit.php?id=<?php 
        echo $getPageData->id . $addToPagging;
        ?>
" title="Edit" class="icon-1 info-tooltip"></a>
                        <?php 
Пример #2
0
}
//Edit request
if (isset($_POST['action']) and $_POST['action'] == 'Edit') {
    $requestDetails = $requests->fetch_request($_POST['id']);
    if (!$requestDetails) {
        $error = 'Error fetching users .';
        include CMS_ERROR;
        exit;
    }
    foreach ($requestDetails as $row) {
        $requestTitle = $row['title'];
        $id = $row['id'];
        $requestContent = $row['content'];
        $status = $row['status'];
    }
    $pageStatus = pageStatus();
    //Get post categories
    $requestCategories = $requests->get_categories();
    //Get selected categories
    $requestCategoriesSelected = $requests->get_selected_categories($_POST['id']);
    //Use in_array
    foreach ($requestCategories as $row) {
        if ($requestCategoriesSelected) {
            $categoriesList[] = array('id' => $row['id'], 'category' => $row['category'], 'selected' => in_array($row['id'], $requestCategoriesSelected));
        } else {
            $categoriesList[] = array('id' => $row['id'], 'category' => $row['category'], 'selected' => FALSE);
        }
    }
    $pageTitle = 'Edit request';
    $action = 'editRequest';
    $button = 'Update request';