Skip to content

@priithansen /page_graafik
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
atk4 page
<?php
class page_graafik extends Page {
function initMainPage(){
$this->api->stickyGET('mac');
//Get the maja id from maja table based on mac
$maja = $this->setModel('maja');
$maja->tryLoadBy('mac','=',$_GET['mac']);
$jobs = $this->add('Grid');
$model= $this->add('Model_too');
$filter = $jobs->setModel($model,array('tahtaeg','firma','kirjeldus','file_id','tehtud'))->setOrder('tahtaeg', false);
// Only show current if mac set
if($_GET['mac'] != "") {
$filter->addCondition('maja_id', $maja['id']);
}
// Add button to show file
$jobs->addColumn('button','file_id','Joonis');
$jobs->addColumn('confirm','valmis');
$jobs->addColumn('html,wrap','kirjeldus');
// Mark job as complete
if($_GET['valmis']){
$model = $jobs->getModel()->loadData($_GET['valmis']);
$model->set('tehtud','Y')->update();
$this->js(null,$this->js()->univ()->successMessage($model->get('firma').' valmis!'))->reload()->execute();
}
// Open the file somehow???
if($_GET['file_id']){
$pdf = $this->add('filestore/Model_File');
}
// Quicksearch and automatic refresh
$jobs->addQuickSearch(array('firma','kirjeldus'));
$jobs->js(true)->univ()->setTimeout($jobs->js()->_enclose()->reload(), 15000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.