[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] sms/bin log_firealarm.php
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] sms/bin log_firealarm.php |
Date: |
Thu, 21 Sep 2006 13:11:25 +0000 |
CVSROOT: /sources/phpgroupware
Module name: sms
Changes by: Sigurd Nes <sigurdne> 06/09/21 13:11:25
Added files:
bin : log_firealarm.php
Log message:
log firealarms by sms
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/sms/bin/log_firealarm.php?cvsroot=phpgroupware&rev=1.1
Patches:
Index: log_firealarm.php
===================================================================
RCS file: log_firealarm.php
diff -N log_firealarm.php
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ log_firealarm.php 21 Sep 2006 13:11:25 -0000 1.1
@@ -0,0 +1,46 @@
+<?php
+ /**
+ * phpGroupWare - sms: A SMS Gateway
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
+ * @package sms
+ * @subpackage sms
+ * @version $Id: log_firealarm.php,v 1.1 2006/09/21 13:11:25 sigurdne
Exp $
+ */
+
+ /**
+ * Description
+ * @package sms
+ */
+
+ $entity_id = 1;
+ $cat_id = 2;
+ $id_field ='securitnet_nr';
+
+ $entity_table = 'fm_entity_' . $entity_id .'_' . $cat_id;
+
+ $this->db->query("SELECT id FROM fm_entity_attribute where entity_id =
'$entity_id' AND cat_id = '$cat_id' AND column_name =
$id_field",__LINE__,__FILE__);
+ $this->db->next_record();
+ $attrib_id = $this->db->f('id');
+
+ $param = explode(' ' , $command_param);
+
+ if (ctype_digit($param[0]))
+ {
+ $id = $param[0];
+ // $status = $status_code[$param[1]];
+
+ $this->db->query("SELECT $id_field FROM $entity_table where
$id_field='$id'",__LINE__,__FILE__);
+ if($this->db->next_record())
+ {
+ $this->db->query("UPDATE $entity_table set last_alarm
='" . time() . "' WHERE $id_field='$id'" ,__LINE__,__FILE__);
+ $historylog =
CreateObject('property.historylog','entity_' . $entity_id .'_' . $cat_id);
+ // temporary - fix this
+ $historylog->account = 6;
+ $historylog->add('SO',$id,time(),False, $attrib_id);
+ $command_output = 'success';
+ }
+ }
- [Phpgroupware-cvs] sms/bin log_firealarm.php,
Sigurd Nes <=