Esempio n. 1
0
<?php

/* -- DEFINED VARIABLE -- */
// REQUEST
$category_id = $_REQUEST['cat_id'];
// CALL FUNCTION
$category = get_city($category_id);
$check = count_job($category_id);
$city = get_cities();
//$category_name =
if (isset($_POST['btn_detail_store_job'])) {
    // DEFINED VARIABLE
    $active = '1';
    $visibility = $_POST['visibility_status'];
    $city_name = stripslashes($_POST['category_name']);
    $cat_id = $_POST['cat_id'];
    $category = $_POST['category_department'];
    $desc = stripslashes($_POST['career_description']);
    $map = stripslashes($_POST['category_maps']);
    if ($_POST['btn_detail_job'] == 'Delete') {
        delete($cat_id);
        $_SESSION['alert'] = 'success';
        $_SESSION['msg'] = 'Item has been successfully deleted.';
    } else {
        update($city_name, $category, $desc, $map, $visibility, $cat_id);
        $_SESSION['alert'] = 'success';
        $_SESSION['msg'] = 'Item has been successfully saved.';
    }
}
Esempio n. 2
0
echo "<input type=\"hidden\" name=\"sort_by\" id=\"sort_by\" class=\"hidden\" value=\"" . $sort_by . "\" /> \n";
echo "<input type=\"hidden\" name=\"search\" id=\"search\" class=\"hidden\" value=\"" . $search_parameter . "-" . $search_value . "\" /> \n";
/* -- BUTTON RESET -- */
if (empty($search_parameter)) {
    $reset = "hidden";
} else {
    $reset = "";
}
if (isset($_POST['btn_index_store_city'])) {
    // DEFINED VARIABLE
    $id = $_POST['category_id'];
    $action = $_POST['option-action'];
    $option = $_POST['option-option'];
    if ($action == 'delete') {
        foreach ($id as $id) {
            $check = count_job($id);
            if ($check['rows'] > 0) {
                $_SESSION['alert'] = 'error';
                $_SESSION['msg'] = "Can't delete item(s) because it contains one or more item(s)";
            } else {
                delete($id);
                $_SESSION['alert'] = 'success';
                $_SESSION['msg'] = "Item(s) has been successfully removed";
            }
        }
    } else {
        if ($action == 'visibility') {
            foreach ($id as $id) {
                if ($option == 'yes') {
                    update_visibility(1, $id);
                } else {
Esempio n. 3
0
$pgdata = page_init($equal_search, $default_sort_by);
// static/general.php
$page = $pgdata['page'];
$query_per_page = $pgdata['query_per_page'];
$sort_by = $pgdata['sort_by'];
$first_record = $pgdata['first_record'];
$search_parameter = $pgdata['search_parameter'];
$search_value = $pgdata['search_value'];
$search_query = $pgdata['search_query'];
$search = $pgdata['search'];
if (empty($_REQUEST['cat']) || $_REQUEST['cat'] == 'all') {
    $cat = '';
} else {
    $cat = "AND category_name = '" . $_REQUEST['cat'] . "' ";
}
$full_order = count_job($search_query, $sort_by, $query_per_page, $cat);
$total_query = $full_order['total_query'];
$total_page = ceil($full_order['total_query'] / $query_per_page);
// CALL FUNCTION
$listing_order = get_job($search_query, $sort_by, $first_record, $query_per_page, $cat);
// OPTION CATEGORY
$category = get_category();
// HANDLING ARROW SORTING
if ($_REQUEST['srt'] == "category_name DESC") {
    $arr_order_number = "<span class=\"sort-arrow-up\"></span>";
} else {
    if ($_REQUEST['srt'] == "category_name") {
        $arr_order_number = "<span class=\"sort-arrow-down\"></span>";
    } else {
        $arr_order_number = "<span class=\"sort-arrow-down\"></span>";
    }
Esempio n. 4
0
                           <option value="1">Yes</option>
                           <option value="0">No</option>
                         </select>
                       </th>
                     </tr>
                   </thead>
                   
                   <tbody>
                     <?php 
if ($total_query < 1) {
    echo '<tr><td class="no-record" colspan="8">No records found.</td></tr>';
}
$row = 0;
foreach ($listing_order as $all_category) {
    $row++;
    $getTotal = count_job($all_category['category_id']);
    ?>
                     
                     <tr id="<?php 
    echo "row_" . $row;
    ?>
" onclick="selectRow('<?php 
    echo $row;
    ?>
')">
                       <td><input type="checkbox" name="category_id[]" value="<?php 
    echo $all_category['category_id'];
    ?>
" id="<?php 
    echo "check_" . $row;
    ?>
Esempio n. 5
0
|      SORTING       |
|--------------------|
*/
$equal_search = array('visibility');
$default_sort_by = "filter_name";
$pgdata = page_init($equal_search, $default_sort_by);
// static/general.php
$page = $pgdata['page'];
$query_per_page = $pgdata['query_per_page'];
$sort_by = $pgdata['sort_by'];
$first_record = $pgdata['first_record'];
$search_parameter = $pgdata['search_parameter'];
$search_value = $pgdata['search_value'];
$search_query = $pgdata['search_query'];
$search = $pgdata['search'];
$full_order = count_job($search_query, $query_per_page);
$total_query = $full_order['total_query'];
$total_page = ceil($full_order['total_query'] / $query_per_page);
// CALL FUNCTION
$listing_order = get_job($search_query, $sort_by, $first_record, $query_per_page);
// OPTION CATEGORY
$category = get_category();
// HANDLING ARROW SORTING
if ($_REQUEST['srt'] == "category_name DESC") {
    $arr_order_number = "<span class=\"sort-arrow-up\"></span>";
} else {
    if ($_REQUEST['srt'] == "category_name") {
        $arr_order_number = "<span class=\"sort-arrow-down\"></span>";
    } else {
        $arr_order_number = "<span class=\"sort-arrow-down\"></span>";
    }