[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property/inc/cron export_info_as_files.php
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] property/inc/cron export_info_as_files.php |
Date: |
Thu, 16 Aug 2007 08:21:49 +0000 |
CVSROOT: /sources/phpgroupware
Module name: property
Changes by: Sigurd Nes <sigurdne> 07/08/16 08:21:49
Modified files:
inc/cron : export_info_as_files.php
Log message:
Add list of tenants
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/inc/cron/export_info_as_files.php?cvsroot=phpgroupware&r1=1.2&r2=1.3
Patches:
Index: export_info_as_files.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/cron/export_info_as_files.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- export_info_as_files.php 15 Aug 2007 19:29:04 -0000 1.2
+++ export_info_as_files.php 16 Aug 2007 08:21:49 -0000 1.3
@@ -24,7 +24,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage custom
- * @version $Id: export_info_as_files.php,v 1.2 2007/08/15 19:29:04
sigurdne Exp $
+ * @version $Id: export_info_as_files.php,v 1.3 2007/08/16 08:21:49
sigurdne Exp $
*/
/**
@@ -47,11 +47,11 @@
$this->join =
$this->db->join;
$this->like =
$this->db->like;
$this->left_join = " LEFT JOIN ";
- // $this->saveto =
'/mnt/filer2/VaktPC_filer';
- $this->saveto = '/tmp';
- // $this->export_method = 'csv';
+ $this->saveto =
'/mnt/filer2/VaktPC_filer';
+ // $this->saveto = '/tmp';
+ $this->export_method = 'csv';
// $this->export_method = 'excel';
- $this->export_method = 'xml';
+ // $this->export_method = 'xml';
}
@@ -132,7 +132,7 @@
$this->export_kabeltv();
$this->export_sprinkler();
$this->export_smokevent();
-
+ $this->export_tenants();
if(!$cron)
{
@@ -242,6 +242,17 @@
$this->export_to_file($name,$descr,$filename, $sql);
}
+ function export_tenants()
+ {
+ $descr = array('Objekt', 'Bygg','Inngang', 'Objekt
Navn', 'Etternavn', 'Fornavn', 'Kontakt
tlf','Gatenavn','GateNr','Etasje','Antall
Rom','Boareal','Ferdigdato','klargjøringsstatus');
+ $name = array('loc1', 'loc2', 'loc3','loc1_name',
'last_name', 'first_name',
'contact_phone','street_name','street_id','etasje','antallrom','boareal','finnish_date','klargj_st');
+
+ $filename= 'LEIETAKER';
+ $sql = "SELECT
fm_location4.location_code,fm_location4.loc1,fm_location4.loc2,fm_location4.loc3,fm_location4.loc4,fm_location1.loc1_name,fm_tenant.id
as
tenant_id,fm_tenant.last_name,fm_tenant.first_name,fm_tenant.contact_phone,fm_streetaddress.descr
as
street_name,street_number,fm_location4.street_id,fm_location4.etasje,fm_location4.antallrom,fm_location4.boareal,fm_location4.finnish_date,fm_location4.klargj_st
FROM ((((((( fm_location4 JOIN fm_location3 ON (fm_location4.loc3 =
fm_location3.loc3) AND (fm_location4.loc2 = fm_location3.loc2) AND
(fm_location4.loc1 = fm_location3.loc1)) JOIN fm_location2 ON
(fm_location3.loc2 = fm_location2.loc2) AND (fm_location3.loc1 =
fm_location2.loc1)) JOIN fm_location1 ON (fm_location2.loc1 =
fm_location1.loc1)) JOIN fm_owner ON ( fm_location1.owner_id=fm_owner.id)) JOIN
fm_part_of_town ON (
fm_location1.part_of_town_id=fm_part_of_town.part_of_town_id)) JOIN
fm_streetaddress ON ( fm_location4.street_id=fm_streetaddress.id)) JOIN
fm_tenant ON ( fm_location4.tenant_id=fm_tenant.id)) WHERE
(fm_location4.category !=99 OR fm_location4.category IS NULL) ORDER BY
last_name ASC";
+
+ $this->export_to_file($name,$descr,$filename, $sql);
+ }
+
function export_as_excel($name,$descr,$filename, $sql)
{
@@ -276,9 +287,9 @@
function export_as_csv($name,$descr,$filename, $sql)
{
- $fp = fopen($this->saveto . SEP . $filename .
'.csv','w');
+ $fp = fopen($this->saveto . SEP . $filename .
'.txt','wb');
- $descr[] = lang('date');
+ $descr[] = 'Dato';
fputcsv($fp, $descr, ';');
$this->db->query($sql,__LINE__,__FILE__);
@@ -304,7 +315,7 @@
function export_as_xml($name,$descr,$filename, $sql)
{
- $descr[] = lang('date');
+ $descr[] = 'Dato';
$this->db->query($sql,__LINE__,__FILE__);
$j=0;