function GetPropertyCategoriesList($SelectedId) { App::import('Model', 'PropertyCategory'); $objPropertyCat = new PropertyCategory(); $this->PropertyCategory->recursive = -1; $arrData = $objPropertyCat->find("all", array('order' => array('PropertyCategory.name' => 'ASC'))); $selectOption = ""; foreach ($arrData as $data) { if ($SelectedId == $data['PropertyCategory']['slug']) { $select = "selected='selected'"; } else { $select = ""; } $selectOption .= '<option value="' . $data['PropertyCategory']['slug'] . '" ' . $select . '>' . $data['PropertyCategory']['name'] . '</option>'; } return $selectOption; }
<tr> <th class="info" >Property Number: </th> <td>{{ $prop->id }}</td> </tr> <tr> <th class="info" >Property Acct. Receipt: </th> @if(!empty($prop->par)) <td>{{ $prop->par }}</td> @else <td>None</td> @endif </tr> <tr> <th class="info">Category: </th> <?php $category = PropertyCategory::find($prop->prop_category); ?> <td>{{$category->catname}}</td> </tr> <tr> <th class="info">Serial Number: </th> <td>{{ $prop->serialno }}</td> </tr> <tr> <th class="info">Property Description </th> <td>{{ $prop->propdesc }}</td> </tr> <tr> <th class="info">Property Cost </th>
<th>Condition</th> <th>Assigned Employee</th> <th>From Department</th> <th>PAR</th> <th>Date Assigned</th> <th>Action</th> </thead> <tbody> @foreach ($query as $property) <tr> <td>{{ $property->properties->id }}</td> <td><a href="{{ route('view-property', $property->properties_id) }}">{{ $property->properties->propname }} </a></td> <td> <?php $cat = PropertyCategory::find($property->cat_id); ?> {{ $cat->catname }} </td> <td>{{ $property->properties->propcondition }}</td> <td>{{ $property->user->formatName(':fn :ln') }}</td> <td> <?php $dept = Department::find($property->dept_id); ?> {{ $dept->name }}
public function getListPropReportsPdf() { $cat = Session::get('catid'); if ($cat == "*") { $props = Properties::all(); $catid = "*"; } else { $props = Properties::where('prop_category', $cat)->get(); $catid = PropertyCategory::where('id', $cat)->pluck('id'); } Fpdf::AddPage(); Fpdf::Image('img/dap.jpg', 10, 5, 150); Fpdf::SetFont('Arial', 'B', 12); Fpdf::Ln(20.6); Fpdf::Cell(40, 27, 'List of Properties', 0, 2, 'C', 0); Fpdf::SetFont('Arial', 'B', 9.5); Fpdf::Cell(27, 5, 'Property ID', 1, 0, 'C', 0); Fpdf::Cell(27, 5, 'Serial No', 1, 0, 'C', 0); Fpdf::Cell(27, 5, 'Property Name', 1, 0, 'C', 0); Fpdf::Cell(27, 5, 'Category', 1, 0, 'C', 0); Fpdf::Cell(27, 5, 'Status', 1, 0, 'C', 0); Fpdf::Cell(27, 5, 'Cost', 1, 0, 'C', 0); Fpdf::Cell(27, 5, 'Date Acquired', 1, 0, 'C', 0); Fpdf::Ln(); foreach ($props as $prop) { Fpdf::SetFont('Arial', 'B', 6); Fpdf::Cell(27, 4, $prop->propname, 1, 0, 'C', 0); Fpdf::Cell(27, 4, $prop->serialno, 1, 0, 'C', 0); Fpdf::Cell(27, 4, $prop->propname, 1, 0, 'C', 0); $category = PropertyCategory::find($prop->prop_category); Fpdf::Cell(27, 4, $category->catname, 1, 0, 'C', 0); Fpdf::Cell(27, 4, $prop->propstatus, 1, 0, 'C', 0); Fpdf::Cell(27, 4, $prop->propcost, 1, 0, 'C', 0); Fpdf::Cell(27, 4, $prop->formatDateAcquired(), 1, 0, 'C', 0); Fpdf::Ln(); } Fpdf::Output(); exit; }