Example #1
0
<?php

include_once 'config.php';
include_once '../checkAdminPagePermissions.php';
$dbBean = new DatabaseBean();
$general = new General($dbBean);
$menu_id = empty($_REQUEST['menu_id']) ? $_SESSION['menu_id'] : $_REQUEST['menu_id'];
$heading = $general->getPageHeading($menu_id);
$Servicecategory = new Servicecategory($dbBean);
$rows = $Servicecategory->getServicecategoryById($_REQUEST['id']);
?>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<?php 
include '../common.php';
?>
<!-- BEGIN PAGE LEVEL STYLES -->

<link rel="stylesheet" type="text/css" href="<?php 
echo ADMIN_URL;
?>
/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css"/>

<!-- END PAGE LEVEL STYLES -->
<?php 
Example #2
0
/servicecategories/DB.php?FLAG=DELSELECT">
                    <table class="table table-striped table-bordered table-hover" id="sample_1">
                    <thead>
                    <tr>
                        <th class="table-checkbox"><input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes"/></th>
                        <th>Image</th>
                        <th>Name</th>
                        <th>Description</th>
                        <th>Remark</th>
                        <th>Date Created</th>
                        <th>Action</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php 
$results = Servicecategory::getServicecategory();
if (count($results) > 0) {
    for ($index = 0; $index < count($results); $index++) {
        $rows = $results[$index];
        $img = UPLOAD_URL . SERVICECAT_THUMB_IMG . $rows['image'];
        ?>
                        <tr class="<?php 
        echo ($index + 1) % 2 == 0 ? 'even' : 'odd';
        ?>
 gradeX">
                            <td> <input  name="delete[]" type="checkbox" id="delete[]" value="<?php 
        echo $rows['id'];
        ?>
" class="checkboxes" /> </td>
                            <td><img src="<?php 
        echo $img;
 public static function deleteServicecategory($large_img_path, $thumb_img_path, $idsToDelete)
 {
     global $dbBean;
     if (count($idsToDelete) <= 0) {
         return false;
     }
     $edited = false;
     foreach ($idsToDelete as $ids) {
         $s = Servicecategory::getServicecategoryById($ids);
         $image = $s->image;
         $cond = array("id" => $ids);
         $fieldvalues = array('is_deleted' => '1');
         if (!($edited = $dbBean->UpdateRows("servicecategory", $fieldvalues, $cond))) {
             break;
         }
         if ($image != '') {
             if (file_exists($large_img_path . $image)) {
                 unlink($large_img_path . $image);
             }
             if (file_exists($thumb_img_path . $image)) {
                 unlink($thumb_img_path . $image);
             }
         }
     }
     return $edited;
 }
Example #4
0
<?php

include 'config.php';
$dbBean = new DatabaseBean();
$general = new General($dbBean);
$Servicecategory = new Servicecategory($dbBean);
if ($_REQUEST['FLAG'] == 'ADD_SERVICECAT') {
    if (trim($_REQUEST['categoryname']) == "") {
        $_SESSION['msg'] = 'Please enter category name';
        $num = 'danger';
        $url = ADMIN_URL . "/servicecategories/add.php";
        $general->redirectUrl($url, $num);
        exit;
    }
    if (trim($_REQUEST['description']) == "") {
        $_SESSION['msg'] = 'Please enter description';
        $num = 'danger';
        $url = ADMIN_URL . "/servicecategories/add.php";
        $general->redirectUrl($url, $num);
        exit;
    }
    if ($_FILES['categoryimg']['name'] == "") {
        $_SESSION['msg'] = 'Please select image';
        $num = 'danger';
        $url = ADMIN_URL . "/servicecategories/add.php";
        $general->redirectUrl($url, $num);
        exit;
    }
    $resizeImage = new ResizeImage();
    if ($Servicecategory->addServicecategory($resizeImage, TEMP_STORAGE, UPLOAD_PATH . SERVICECAT_LARGE_IMG, SERVICECAT_WIDTH, SERVICECAT_HEIGHT, UPLOAD_PATH . SERVICECAT_THUMB_IMG, SERVICECAT_IMG_THUMB_WIDTH, SERVICECAT_IMG_THUMB_HEIGHT, $_REQUEST)) {
        $general->addLogAction($_SESSION['adm_user_id'], 'Added', $_REQUEST, 'Service Category Management', $_SESSION['adm_status']);