Skip to content
Browse files

fix

  • Loading branch information...
1 parent 85c7a6d commit 67e00905eaa60bccd310c4674c42f7024d8fdbe8 @tedch tedch committed Jun 13, 2011
Showing with 44 additions and 29 deletions.
  1. +1 −1 application/controllers/main.php
  2. +10 −21 application/models/mainmodel.php
  3. +0 −3 application/views/ivpform.php
  4. +11 −2 application/views/main.php
  5. +22 −2 htdocs/cpf.css
View
2 application/controllers/main.php
@@ -1,7 +1,7 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Main extends CI_Controller {
- const ITEMS_PER_PAGE = 10;
+ const ITEMS_PER_PAGE = 8;
function __construct() {
parent::__construct();
View
31 application/models/mainmodel.php
@@ -6,7 +6,14 @@ function __construct() {
parent::__construct();
}
- function get_all_patients($offset, $ipp) {
+ function get_all_patients($offset, $ipp, $all = FALSE) {
+/* $lists = $this->db
+ ->select('lists.id as list')
+ ->from('lists')
+ ->join('idops', 'idops.id = idop', 'inner')
+ ->join('vcs', 'vcs.id = idops.vc');
+*/
+
$total = $this->db
->select('responses.patient as patient')
->from('responses')
@@ -34,29 +41,11 @@ function get_all_patients($offset, $ipp) {
->get();
if ($prs->num_rows() > 0) {
foreach ($prs->result_array() as $pr) {
- $table[$pr['patient']] = array(
+ $table[/*$pr['patient']*/] = array(
'token' => $pr['patient'],
'list' => $pr['name'] . ' ' . $pr['num'],
'vc' => $pr['vc'],
- 'dalby1' => $pr['dalby1'],
- 'crfs' => array());
-
- $crs = $this->db
- ->select('crfs.id as id')
- ->select('crfs.date as date')
- ->from('crfs')
- ->where('patient', $pr['patient'])
- ->order_by('crfs.date', 'desc')
- ->get();
- $crfs = array();
- if ($crs->num_rows() > 0) {
- foreach ($crs->result_array() as $crf) {
- $crfs[] = array(
- 'id' => $crf['id'],
- 'date' => $crf['date']);
- }
- }
- $table[$pr['patient']]['crfs'] = $crfs;
+ 'dalby1' => $pr['dalby1']);
}
}
return array('total' => $total, 'patients' => $table);
View
3 application/views/ivpform.php
@@ -156,9 +156,6 @@
</table>
<h2>Yrkeskategori</h2>
-<!--div class='info'><p>Alla fem fälten måste fyllas i, eventuellt med en nolla. Det
-är en bugg, som kommer att rätas till så snart som möjligt. Utelämnat värde
-ska såklart snarare vara likvärdigt med 0.</p></div-->
<p>Utelämnat värde är likvärdigt med 0.</p>
<table>
<?php
View
13 application/views/main.php
@@ -25,12 +25,21 @@
<th>6-minuters gångtest</th>
</tr>
<?php $blink = 0; foreach ($patients as $pat) { ?>
- <tr class="<?php echo (($blink++ % 2 == 0) ? 'light' : 'dark'); ?>">
+<tr class="<?php
+if (isset($pat['warning'])) {
+ echo (($blink++ % 2 == 0) ? 'redlight' : 'reddark');
+} else if ($pat['vc'] == 'CPF') {
+ echo (($blink++ % 2 == 0) ? 'greenlight' : 'greendark');
+} else {
+ echo (($blink++ % 2 == 0) ? 'bluelight' : 'bluedark');
+} ?>">
<td class="frame"><tt><b><?=$pat['token']?></b></tt></td>
<td class="frameright"><small><?=$pat['list']?> (<?=$pat['vc']?>)</small></td>
+
<td class="frameleft"><?php echo list_surveys_by_date($pat['token'], 'Dalby 1');?></td>
<td class="frame"><?php echo list_surveys_by_date($pat['token'], 'Dalby 2');?></td>
<td class="frameright"><?php echo list_surveys_by_date($pat['token'], 'Dalby 3');?></td>
+
<td class="frameleft"><?php echo list_documents_by_date($pat['token'], 'crf');?></td>
<td class="frame"><?php echo list_documents_by_date($pat['token'], 'ivp');?></td>
<td class="frame"><?php echo list_documents_by_date($pat['token'], 'wtp');?></td>
@@ -45,7 +54,7 @@
<hr />
<address>
-DALICO-admin v0.99<br />
+DALICO-admin v0.95<br />
&copy;&nbsp;2011,&nbsp;<a href="mailto:Christian.LD.Andersson@gmail.com">Christian Andersson</a>
</address>
View
24 htdocs/cpf.css
@@ -5,6 +5,10 @@ body {
margin: 2em;
}
+address {
+ font-size: 75%;
+}
+
div#head {
color: inherit;
position: relative;
@@ -42,11 +46,27 @@ tt {
font-size: 108%;
}
-tr.light {
+tr.redlight {
+ background-color: #fdd;
+}
+
+tr.reddark {
+ background-color: #ecc;
+}
+
+tr.greenlight {
+ background-color: #dfd;
+}
+
+tr.greendark {
+ background-color: #cec;
+}
+
+tr.bluelight {
background-color: #ddf;
}
-tr.dark {
+tr.bluedark {
background-color: #cce;
}

0 comments on commit 67e0090

Please sign in to comment.
Something went wrong with that request. Please try again.