phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: property building_value_history.php,1.1,1.2 list


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property building_value_history.php,1.1,1.2 list_building_value.php,1.1,1.2
Date: Sat, 07 Sep 2002 09:38:05 -0400

Update of /cvsroot/phpgroupware/property
In directory subversions:/tmp/cvs-serv27822

Modified Files:
        building_value_history.php list_building_value.php 
Log Message:
no message

Index: building_value_history.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/building_value_history.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** building_value_history.php  7 Sep 2002 00:34:47 -0000       1.1
--- building_value_history.php  7 Sep 2002 13:38:03 -0000       1.2
***************
*** 240,244 ****
  
                $current_index = 
$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('current_index'));
!               if ($current_index)
                {
                        $old_value= '<input type="hidden" name="old_value" 
value="' . $value . '">';
--- 240,244 ----
  
                $current_index = 
$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('current_index'));
!               if ($current_index && $this_index )
                {
                        $old_value= '<input type="hidden" name="old_value" 
value="' . $value . '">';
***************
*** 264,268 ****
  
  
!               if (!$date)
                {
                        $new_index= '<input type="hidden" name="new_index" 
value="1" size="5" readonly >';
--- 264,268 ----
  
  
!               if (!$this_index)
                {
                        $new_index= '<input type="hidden" name="new_index" 
value="1" size="5" readonly >';

Index: list_building_value.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/list_building_value.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** list_building_value.php     7 Sep 2002 00:34:47 -0000       1.1
--- list_building_value.php     7 Sep 2002 13:38:03 -0000       1.2
***************
*** 40,51 ****
        $t->set_var('dateformat',$dateformat);
  
!       if ($submit)
        {
- 
-               $new_index=str_replace(",",".",$new_index);
-               $new_m_cost=str_replace(",",".",$new_m_cost);
-               $new_w_cost=str_replace(",",".",$new_w_cost);
-               $new_total_cost=str_replace(",",".",$new_total_cost);
- 
  //--------- eksperiment - dato
                $dateformat = 
strtolower($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
--- 40,45 ----
        $t->set_var('dateformat',$dateformat);
  
!       if ($submit || $add)
        {
  //--------- eksperiment - dato
                $dateformat = 
strtolower($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
***************
*** 57,60 ****
--- 51,59 ----
                $m=strpos($dateformat,'m');
  
+ 
+ //----------
+       }
+       if ($submit)
+       {
                $dateparts = explode('/', $new_date);
                $day = $dateparts[$d];
***************
*** 63,75 ****
                $new_date = mktime (2,0,0,$month,$day,$year);
  
! //----------
                if ($select)
                {
                        while($entry=each($select))
                                {
- 
-                                       $n=$entry[0];
                                        $new_value=$value_h[$n]*$new_index;
!                                       echo 'new_value: '.$new_value .'<BR>';
  
                                        $GLOBALS['phpgw']->db->query("select 
max(index_count) as max_index_count from fm_building_value_index Where 
objekt_id= '$objekt_id_h[$n]' and bygg_id= '$bygg_id_h[$n]'");
--- 62,79 ----
                $new_date = mktime (2,0,0,$month,$day,$year);
  
!               $new_index=str_replace(",",".",$new_index);
!               $new_m_cost=str_replace(",",".",$new_m_cost);
!               $new_w_cost=str_replace(",",".",$new_w_cost);
!               $new_total_cost=str_replace(",",".",$new_total_cost);
! 
                if ($select)
                {
                        while($entry=each($select))
+                       {
+                               $n=$entry[0];
+                               if ($value_h[$n])
                                {
                                        $new_value=$value_h[$n]*$new_index;
!       //                              echo 'new_value: '.$new_value .'<BR>';
  
                                        $GLOBALS['phpgw']->db->query("select 
max(index_count) as max_index_count from fm_building_value_index Where 
objekt_id= '$objekt_id_h[$n]' and bygg_id= '$bygg_id_h[$n]'");
***************
*** 82,96 ****
                                        $GLOBALS['phpgw']->db->query("insert 
into fm_building_value_index (objekt_id, bygg_id, index_count, this_index, 
value, date,current_index) "
                                        . " values ('$objekt_id_h[$n]', 
'$bygg_id_h[$n]','$next_index_count', '$new_index', '$new_value','$new_date', 
'1')");
- 
                                }
                }
        }
  
  //----------------------- bydel_list
  
  
        $GLOBALS['phpgw']->db->query("SELECT bydel ,bydel_id "
!               . " FROM boei_bydel "
!               . " ORDER BY bydel ");
                while ($GLOBALS['phpgw']->db->next_record())
                {
--- 86,121 ----
                                        $GLOBALS['phpgw']->db->query("insert 
into fm_building_value_index (objekt_id, bygg_id, index_count, this_index, 
value, date,current_index) "
                                        . " values ('$objekt_id_h[$n]', 
'$bygg_id_h[$n]','$next_index_count', '$new_index', '$new_value','$new_date', 
'1')");
                                }
+                       }
                }
        }
  
+ 
+       if ($add && $initial_value)
+       {
+               $dateparts = explode('/', $initial_date);
+               $day = $dateparts[$d];
+               $month = $dateparts[$m];
+               $year = $dateparts[$y];
+               $initial_date = mktime (2,0,0,$month,$day,$year);
+ 
+ 
+               $GLOBALS['phpgw']->db->query("insert into 
fm_building_value_index (objekt_id, bygg_id, index_count, this_index, 
current_index, value, date) "
+               . " values ('$objekt_id', '$bygg_id','1', '1', 
'1','$initial_value', '$initial_date')");
+       }
+ 
+ 
  //----------------------- bydel_list
  
  
        $GLOBALS['phpgw']->db->query("SELECT bydel ,bydel_id "
!               . " FROM boei_bydel ORDER BY bydel ");
! 
! 
!       $bydel_list = '<option value="all"';
!                       if ('all' == $bydel_id)
!                       $bydel_list .= ' selected';
!                       $bydel_list .= '>'
!                               . lang(select_all) . '</option>';
                while ($GLOBALS['phpgw']->db->next_record())
                {
***************
*** 134,137 ****
--- 159,167 ----
        $t->set_var('lang_search',lang('Search'));
        
$t->set_var('searchurl',$GLOBALS['phpgw']->link('/property/list_building_value.php'));
+       $t->set_var('lang_select_part_of_town',lang('Select part of town'));
+       
$t->set_var('building_link',$GLOBALS['phpgw']->link('/property/search_building.php','query='));
+       $t->set_var('lang_building',lang('Building'));
+       $t->set_var('lang_initial_value',lang('Initial value'));
+ 
  
        if (! $start)
***************
*** 160,167 ****
        else { $limit = 15; }
  
        if ($query)
        {
!               $querymethod = " where (boei_bygg.byggnavn like '%$query%' or 
boei_bydel.bydel like '%$query%' or boei_bygg.objekt_id like '%$query%') ";
        }
  
        $db2 = $GLOBALS['phpgw']->db;
--- 190,217 ----
        else { $limit = 15; }
  
+ 
+       if ($bydel_id)
+       {
+               if ($bydel_id=='all')
+               {
+ //                    $where_1= 'where';
+               }
+               else
+               {
+                       $querymethod = "and boei_bydel.bydel_id ='$bydel_id'";
+ //                    $where_1= 'and';
+               }
+       }
+       else
+       {
+               $querymethod = "and boei_bydel.bydel_id ='101'";
+       }
+ 
        if ($query)
        {
!               $querymethod .= " and (boei_bygg.byggnavn like '%$query%' or 
boei_bydel.bydel like '%$query%' or boei_bygg.objekt_id like '%$query%') ";
        }
+ //    echo 'querymethod: '.$querymethod .'<BR>';
+ 
  
        $db2 = $GLOBALS['phpgw']->db;
***************
*** 175,181 ****
                . " fm_building_value_index ON boei_bygg.objekt_id = 
fm_building_value_index.objekt_id AND "
                . " boei_bygg.bygg_id = fm_building_value_index.bygg_id "
!               . " WHERE  boei_bydel.bydel_id ='$bydel_id' and current_index = 
'1'"
                . " ORDER BY boei_bydel.bydel,boei_bygg.objekt_id ";
  
        $db2->query($sql,__LINE__,__FILE__);
        $db2->next_record();
--- 225,233 ----
                . " fm_building_value_index ON boei_bygg.objekt_id = 
fm_building_value_index.objekt_id AND "
                . " boei_bygg.bygg_id = fm_building_value_index.bygg_id "
!               . " WHERE ( current_index = '1'  or (this_index = NULL and 
index_count= '1')) $querymethod "
                . " ORDER BY boei_bydel.bydel,boei_bygg.objekt_id ";
  
+ //    echo 'sql: '.$sql .'<BR>';
+ 
        $db2->query($sql,__LINE__,__FILE__);
        $db2->next_record();
***************
*** 221,224 ****
--- 273,277 ----
        $t->set_var('lang_index_count',lang('Index Count'));
        $t->set_var('lang_omraade_id',lang('District'));
+       $t->set_var('lang_bydel',lang('P ofTown'));
        $t->set_var('lang_objekt_id',lang('Property'));
        $t->set_var('lang_bygg_id',lang('Building'));
***************
*** 256,266 ****
                $bygg_id_h ='<input type="hidden" name="bygg_id_h[' . $j . ']" 
value="'. $bygg_id . '">';
                $byggnavn = 
$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('byggnavn'));
! 
                $this_index = 
$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('this_index'));
  
                $value = 
$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('value'));
                $value_h ='<input type="hidden" name="value_h[' . $j . ']" 
value="'. $value . '">';
  
-               $index_count = 
$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('index_count'));
  
                
$t->set_var('history',$GLOBALS['phpgw']->link('/property/building_value_history.php','objekt_id='
 . $objekt_id . '&bygg_id=' . $bygg_id 
."&order=$order&query=$query&start=$start&filter=$filter"));
--- 309,325 ----
                $bygg_id_h ='<input type="hidden" name="bygg_id_h[' . $j . ']" 
value="'. $bygg_id . '">';
                $byggnavn = 
$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('byggnavn'));
!               $index_count = 
$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('index_count'));
                $this_index = 
$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('this_index'));
+               if(!$this_index)
+               {
+                       $index_count=0;
+ //                    $this_index  = '&nbsp;';
+                       $this_index  = '';
+               }
+ 
  
                $value = 
$GLOBALS['phpgw']->strip_html($GLOBALS['phpgw']->db->f('value'));
                $value_h ='<input type="hidden" name="value_h[' . $j . ']" 
value="'. $value . '">';
  
  
                
$t->set_var('history',$GLOBALS['phpgw']->link('/property/building_value_history.php','objekt_id='
 . $objekt_id . '&bygg_id=' . $bygg_id 
."&order=$order&query=$query&start=$start&filter=$filter"));
***************
*** 268,272 ****
                $t->set_var(array('select' => $select,
                        'omraade_id' => $omraade_id,
!                       'this_index' => $this_index,
                        'objekt_id' => $objekt_id,
                        'objekt_id_h' => $objekt_id_h,
--- 327,331 ----
                $t->set_var(array('select' => $select,
                        'omraade_id' => $omraade_id,
!                       'bydel' => $bydel,
                        'objekt_id' => $objekt_id,
                        'objekt_id_h' => $objekt_id_h,
***************
*** 274,277 ****
--- 333,337 ----
                        'bygg_id_h' => $bygg_id_h,
                        'byggnavn' => $byggnavn,
+                       'this_index' => $this_index,
                        'value' => $value,
                        'value_h' => $value_h,
***************
*** 289,294 ****
        $t->set_var('lang_new_date',lang('Date:'));
        $dateout = 
$GLOBALS['phpgw']->common->show_date(mktime(),$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
!       $new_date= '<input type="text" name="new_date" value="' . $dateout . '" 
size="12" readonly >';
!       $t->set_var('new_date',$new_date);
        $t->set_var('lang_popup_calendar',lang('Popup Calendar'));
  
--- 349,354 ----
        $t->set_var('lang_new_date',lang('Date:'));
        $dateout = 
$GLOBALS['phpgw']->common->show_date(mktime(),$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
! //    $new_date= '<input type="text" name="new_date" value="' . $dateout . '" 
size="12" readonly >';
!       $t->set_var('new_date',$dateout);
        $t->set_var('lang_popup_calendar',lang('Popup Calendar'));
  
***************
*** 296,299 ****
--- 356,361 ----
  
        $t->set_var('lang_add',lang('Add'));
+       $t->set_var('lang_update',lang('Update'));
+ 
        $t->parse('out','building_list_t',True);
        $t->p('out');





reply via email to

[Prev in Thread] Current Thread [Next in Thread]