/**
  * Add apartment page
  * @return \Illuminate\View\View
  */
 public function home()
 {
     $apartment = new ListApartment();
     //Hard code
     $apartment->username = Auth::user()->username;
     // Get all district
     $district = ListDistrict::lists('name_district', 'id_district');
     // Get all province
     $province = ListProvice::lists('name_province', 'id_province');
     // Get all project
     $projects = ListProject::lists('name', 'ID');
     //Get project
     $project_id = Input::get('project');
     $apartment->project = $project_id;
     // Get all furniture
     $furnitures = Furniture::lists('name', 'ID');
     // Get all management company
     $directions = Direction::lists('name', 'ID');
     // Get all floor material
     $floor_materials = FloorMaterial::lists('name', 'ID');
     // Clear Session
     for ($i = -2; $i < 8; $i++) {
         if (Session::has("image[{$i}]")) {
             Session::remove("image[{$i}]");
         }
     }
     return View::make('pages.apartment', compact('apartment', 'district', 'province', 'projects', 'project_id', 'furnitures', 'directions', 'floor_materials'));
 }
Beispiel #2
0
\Locale::setDefault($SESSION->lang);
$l10n->setLanguage($SESSION->lang);
//============================================================================================
// Model
//============================================================================================
require 'models/grouping.php';
require 'models/cpu.php';
require 'models/mon.php';
require 'models/per.php';
require 'models/key.php';
require 'models/furniture.php';
$cpu = new Cpu();
$mon = new Monitor();
$per = new Peripheral();
$key = new Key();
$furniture = new Furniture();
$equip = new Grouping();
//============================================================================================
// Load the page requested by the user
//============================================================================================
if (!isset($_GET['page'])) {
    $data = $equip->listItems();
    for ($i = 0; $i < count($data); $i++) {
        $z = $equip->countItems($data[$i]['group_id']);
        $data[$i]['noi'] = $z[0]['count'];
    }
    $employees = $equip->listEmployees();
    $allCpu = $equip->listcpuUG();
    $allMon = $equip->listmonUG();
    $allPer = $equip->listperUG();
    $allKey = $equip->listkeyUG();
Beispiel #3
0
//============================================================================================
// Session, configuration file, localization constructor
//============================================================================================
require '../includes/php/bootstrap.php';
$SESSION = new \Zend_Session_Namespace('internal', true);
if (!isset($SESSION->lang)) {
    $SESSION->lang = DEFAULT_LANGUAGE;
}
\Locale::setDefault($SESSION->lang);
$l10n->setLanguage($SESSION->lang);
//============================================================================================
// Model
//============================================================================================
require 'models/furniture.php';
$equip = new Furniture();
//============================================================================================
// Load the page requested by the user
//============================================================================================
if (!isset($_GET['page'])) {
    if (isset($_GET['discarded']) && $_GET['discarded'] === '1') {
        $equip->showDiscarded = true;
    }
    $data = $equip->listItems($SESSION->department);
    foreach ($data as $key => $d) {
        $data[$key]['tag'] = $equip->listTags($data[$key]['furn_id']);
    }
    $allTags = $equip->listAllTags();
    $types = $equip->listTypes();
    $departments = $equip->listDepartments();
    $allBuildings = $equip->listAllBuildings();