Advertisement
Guest User

Tonya Torshin

a guest
Jul 21st, 2008
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.87 KB | None | 0 0
  1.         $table_name = 'test_email_notification';
  2.  
  3.         $sql = <<<END
  4.             CREATE TABLE
  5.                 {$table_name}
  6.             (
  7.                 notification_id NUMBER,
  8.                 title VARCHAR(250),
  9.                      incident_type_id NUMBER,
  10.                      status_id NUMBER,
  11.                 notify_email CLOB,
  12.                 notify_user_id NUMBER,
  13.                 notify_user_coverage_yn CHAR(1),
  14.                 notify_status_id NUMBER,
  15.                 notify_group_id NUMBER,
  16.                 notify_group_coverage_yn CHAR(1),
  17.                 email_subject VARCHAR(250),
  18.                 email_body CLOB,
  19.                 email_yn CHAR(1),
  20.                 bulletin_yn CHAR(1),
  21.                 auto_send_yn CHAR(1),
  22.                           PRIMARY KEY (notification_id)
  23.             )
  24. END;
  25.         db()->query($sql);
  26.  
  27.         $params_insert = array 
  28.         (
  29.             'notification_id' => 145,
  30.             'title' => 'Pemberton Flight',
  31.             'incident_type_id'  => 1,
  32.             'status_id' => 1,
  33.             'notify_email' => 'hello@world.com',
  34.             'notify_user_id' => 1,
  35.             'notify_user_coverage_yn' => 'Y',
  36.             'notify_status_id' => 123,
  37.             'notify_group_id' => null,
  38.             'notify_group_coverage_yn' => 'Y',
  39.             'email_subject' => 'Safe landing',
  40.             'email_body' => 'There were 14 flights made today. No major incidents. All pilots made to LZ safe',
  41.             'email_yn' => 'N',
  42.             'bulletin_yn' => 'N',
  43.             'auto_send_yn' => 'Y'
  44.         );
  45.         $params_update = array
  46.         (
  47.             'title' => 'Pemberton Flight',
  48.             'incident_type_id'  => 1,
  49.                     'status_id' => 1,
  50.             'notify_email' => 'hello@world.com',
  51.             'notify_user_id' => 1,
  52.             'notify_user_coverage_yn' => 'Y',
  53.             'notify_status_id' => 123,
  54.             'notify_group_id' => null,
  55.             'notify_group_coverage_yn' => 'Y',
  56.             'email_subject' => 'Safe landing',
  57.             'email_body' => 'There were 14 flights made today. No major incidents. All pilots made to LZ safe',
  58.             'email_yn' => 'N',
  59.             'bulletin_yn' => 'N',
  60.             'auto_send_yn' => 'Y'
  61.         );
  62.  
  63.  
  64.         $where = "notification_id=145";
  65.  
  66.         $types_insert = array
  67.         (
  68.             0 => 'integer',
  69.             1 => 'text',
  70.             2 => 'integer',
  71.             3 => 'integer',
  72.             4 => 'clob',
  73.             5 => 'integer',
  74.             6 => 'text',
  75.             7 => 'integer',
  76.             8 => 'integer',
  77.             9 => 'text',
  78.             10 => 'text',
  79.             11 => 'clob',
  80.             12 => 'text',
  81.             13 => 'text',
  82.             14 => 'text'
  83.         );
  84.         $types_update = array
  85.         (
  86.             0 => 'text',
  87.             1 => 'integer',
  88.             2 => 'integer',
  89.             3 => 'clob',
  90.             4 => 'integer',
  91.             5 => 'text',
  92.             6 => 'integer',
  93.             7 => 'integer',
  94.             8 => 'text',
  95.             9 => 'text',
  96.             10 => 'clob',
  97.             11 => 'text',
  98.             12 => 'text',
  99.             13 => 'text'
  100.         );
  101.  
  102.  
  103.         $this->notify = db()->autoExecute($table_name, $params_insert,
  104.                                     MDB2_AUTOQUERY_INSERT,
  105.                                     $types_insert);
  106.  
  107.         $this->notify = db()->autoExecute($table_name, $params_update,
  108.                                     MDB2_AUTOQUERY_UPDATE,
  109.                                     $where, $types_update);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement