root/modules/branches/2.3/parking/install.php

Revision 4767, 0.7 kB (checked in by gregmac, 6 years ago)

Change all freepbx die() calls to die_freepbx()

  • Property svn:mime-type set to text/plain
  • Property svn:eol-style set to native
Line 
1 <?php
2
3 global $db;
4 global $amp_conf;
5
6 $results = array();
7 $sql = "SELECT id, keyword, data FROM parkinglot WHERE keyword = 'goto'";
8 $results = $db->getAll($sql, DB_FETCHMODE_ASSOC);
9 if (!DB::IsError($results)) { // error - table must not be there
10   foreach ($results as $result) {
11     $old_dest  = $result['data'];
12     $id        = $result['id'];
13     $keyword   = $result['keyword'];
14
15     $new_dest = merge_ext_followme(trim($old_dest));
16     if ($new_dest != $old_dest) {
17       $sql = "UPDATE parkinglot SET data = '$new_dest' WHERE id = '$id'  AND keyword = '$keyword' AND data = '$old_dest'";
18       $results = $db->query($sql);
19       if(DB::IsError($results)) {
20         die_freepbx($results->getMessage());
21       }
22     }
23   }
24 }
25
26 ?>
Note: See TracBrowser for help on using the browser.