[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property/inc/custom kalkuler_risiko_for_ros.php
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] property/inc/custom kalkuler_risiko_for_ros.php |
Date: |
Tue, 17 Oct 2006 12:03:46 +0000 |
CVSROOT: /sources/phpgroupware
Module name: property
Changes by: Sigurd Nes <sigurdne> 06/10/17 12:03:46
Added files:
inc/custom : kalkuler_risiko_for_ros.php
Log message:
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/inc/custom/kalkuler_risiko_for_ros.php?cvsroot=phpgroupware&rev=1.1
Patches:
Index: kalkuler_risiko_for_ros.php
===================================================================
RCS file: kalkuler_risiko_for_ros.php
diff -N kalkuler_risiko_for_ros.php
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ kalkuler_risiko_for_ros.php 17 Oct 2006 12:03:45 -0000 1.1
@@ -0,0 +1,59 @@
+<?php
+
+//_debug_array($values);
+//_debug_array($values_attribute);
+//_debug_array($action);
+
+ // this routine will only work with the exact configuration of
Bergen Bolig og Byfornyelse - but can serve as an example
+
+ $db = $this->bocommon->new_db();
+
+
+ if (isSet($values_attribute) AND is_array($values_attribute))
+ {
+
+ foreach($values_attribute as $entry)
+ {
+ switch($entry['name'])
+ {
+ case 'sansynlighet':
+ $sansynlighet =
(int)$entry['value'];
+ break;
+ }
+ }
+
+ reset($values_attribute);
+
+ foreach($values_attribute as $entry)
+ {
+ switch($entry['name'])
+ {
+ case 'k_beboer':
+ $value_set['r_beboer'] =
$entry['value'] * $sansynlighet;
+ break;
+ case 'k_miljo':
+ $value_set['r_miljo'] =
$entry['value'] * $sansynlighet;
+ break;
+ case 'k_ok_verdier':
+ $value_set['r_ok_verdier']
= $entry['value'] * $sansynlighet;
+ break;
+ case 'k_drift':
+ $value_set['r_drift'] =
$entry['value'] * $sansynlighet;
+ break;
+ case 'k_ansatte':
+ $value_set['r_ansatte'] =
$entry['value'] * $sansynlighet;
+ break;
+ case 'k_annet':
+ $value_set['r_annet'] =
$entry['value'] * $sansynlighet;
+ break;
+ }
+ }
+
+ $value_set =
$this->bocommon->validate_db_update($value_set);
+ $db->transaction_begin();
+ $db->query("UPDATE fm_entity_2_6 set $value_set WHERE
id=" . $values['id'],__LINE__,__FILE__);
+ $db->transaction_commit();
+
+ }
+
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] property/inc/custom kalkuler_risiko_for_ros.php,
Sigurd Nes <=