Loans are no longer displayed as a unified table, but instead each loan gets a "card" that contains the relevant data for the loan. This has had a fairly major html/css re-work as a side effect. Most views are now structured with two div-based columns so as to avoid the large blank areas that pure grid can lead to when elements are very different in height.
58 lines
2.0 KiB
PHP
58 lines
2.0 KiB
PHP
<?php
|
|
class NewPage extends Page {
|
|
private $template = null;
|
|
|
|
public function __construct() {
|
|
parent::__construct();
|
|
if(isset($_GET['template'])) {
|
|
$template = $_GET['template'];
|
|
if($template) {
|
|
try {
|
|
$this->template = new Template($template, 'name');
|
|
} catch(Exception $e) {
|
|
$this->template = null;
|
|
$this->error = 'Det finns ingen mall med det namnet.';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
protected function render_body() {
|
|
print($this->build_new_page());
|
|
}
|
|
|
|
private function build_new_page() {
|
|
$template = '';
|
|
$fields = '';
|
|
$tags = '';
|
|
if($this->template) {
|
|
$template = $this->template->get_name();
|
|
foreach($this->template->get_fields() as $field) {
|
|
$fields .= replace(array('name' => ucfirst($field),
|
|
'key' => $field,
|
|
'value' => ''),
|
|
$this->fragments['info_item']);
|
|
}
|
|
foreach($this->template->get_tags() as $tag) {
|
|
$tags .= replace(array('tag' => ucfirst($tag)),
|
|
$this->fragments['tag']);
|
|
}
|
|
}
|
|
$out = replace(array('id' => '',
|
|
'name' => '',
|
|
'brand' => '',
|
|
'serial' => '',
|
|
'invoice' => '',
|
|
'tags' => $tags,
|
|
'info' => $fields,
|
|
'label' => '',
|
|
'label_hidden' => 'hidden',
|
|
'hidden' => 'hidden'),
|
|
$this->fragments['product_details']);
|
|
$out .= replace(array('template' => $template),
|
|
$this->fragments['template_management']);
|
|
return $out;
|
|
}
|
|
}
|
|
?>
|