| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- Lib::loadClass('RouteBase');
- Lib::loadClass('ProjectKosztorysSchema');
- Lib::loadClass('ProjectKosztorysModel');
- Lib::loadClass('ProjectKosztorysCennik');
- Lib::loadClass('UI');
- Lib::loadClass('Response');
- Lib::loadClass('Route_ProjektyKosztorysBase');
- class Route_UrlAction_ProjektyPrzedmiarKosztorys extends Route_ProjektyKosztorysBase {
- public $_model = array();
- public function defaultAction() {
- // TODO: check if user is allowed to run this action
- UI::gora();
- if (1 != V::get('_print', '', $_GET)) UI::menu();
- try {
- $idProject = V::get('ID_PROJECT', 0, $_REQUEST, 'int');
- if (!$idProject) throw new Exception("Wrong param in 'ID_PROJECT' - expected integer!");
- $this->panel($idProject);
- if (1 != V::get('_print', '', $_GET)) {
- UI::startContainer(['style'=>'text-align:right']);
- UI::link('link', "<i class=\"glyphicon glyphicon-print\"></i> Drukuj", Request::getPathUri() . "index.php?_route=UrlAction_ProjektyPrzedmiarKosztorys&ID_PROJECT={$idProject}&_print=1");
- UI::endContainer();
- }
- $this->przedmiar($idProject);
- } catch (Exception $e) {
- UI::alert('danger', "Error #" . $e->getCode() . "|" . $e->getLine() . ": " . $e->getMessage());
- }
- UI::dol();
- }
- public function przedmiar($idProject) {
- $idCompany = 0;
- $admin = false;
- $companyAdmin = false;
- $model = $this->getModel($idProject);
- //DBG::table("subProjectList", $model->subProjectList, __CLASS__, __FUNCTION__, __LINE__);
- $schema = ProjectKosztorysSchema::getSchema();
- DBG::log($schema, 'array', "\$schema");
- $projCosts = $this->getProjectCostByCennik($idProject, $idCompany);
- //DBG::_(true, true, "projCosts", $projCosts, __CLASS__, __FUNCTION__, __LINE__);
- $hidePrices = true;
- $viewLayerDataArgs = compact('idProject', 'idCompany', 'admin', 'companyAdmin', 'hidePrices');
- UI::setTitleJsTag("Przedmiar robót telekomunikacyjnych [{$idProject}]");
- ?>
- <div class="container">
- <h1>Przedmiar robót telekomunikacyjnych</h1>
- <table class="table">
- <tr>
- <th><?php echo $schema['nr']; ?></th>
- <th><?php echo $schema['title']; ?></th>
- </tr>
- <tr>
- <td><?php echo $model->idProject; ?></td>
- <td><?php echo $model->title; ?></td>
- </tr>
- </table>
- <?php $this->viewLayersData($viewLayerDataArgs); ?>
- </div>
- <?php
- DBG::_('DBG', '>0', "schema", $schema, __CLASS__, __FUNCTION__, __LINE__);
- DBG::_('DBG', '>0', "projCosts", $projCosts, __CLASS__, __FUNCTION__, __LINE__);
- }
- }
|