Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $table_name = 'test_email_notification';
- $sql = <<<END
- CREATE TABLE
- {$table_name}
- (
- notification_id NUMBER,
- title VARCHAR(250),
- incident_type_id NUMBER,
- status_id NUMBER,
- notify_email CLOB,
- notify_user_id NUMBER,
- notify_user_coverage_yn CHAR(1),
- notify_status_id NUMBER,
- notify_group_id NUMBER,
- notify_group_coverage_yn CHAR(1),
- email_subject VARCHAR(250),
- email_body CLOB,
- email_yn CHAR(1),
- bulletin_yn CHAR(1),
- auto_send_yn CHAR(1),
- PRIMARY KEY (notification_id)
- )
- END;
- db()->query($sql);
- $params_insert = array
- (
- 'notification_id' => 145,
- 'title' => 'Pemberton Flight',
- 'incident_type_id' => 1,
- 'status_id' => 1,
- 'notify_email' => 'hello@world.com',
- 'notify_user_id' => 1,
- 'notify_user_coverage_yn' => 'Y',
- 'notify_status_id' => 123,
- 'notify_group_id' => null,
- 'notify_group_coverage_yn' => 'Y',
- 'email_subject' => 'Safe landing',
- 'email_body' => 'There were 14 flights made today. No major incidents. All pilots made to LZ safe',
- 'email_yn' => 'N',
- 'bulletin_yn' => 'N',
- 'auto_send_yn' => 'Y'
- );
- $params_update = array
- (
- 'title' => 'Pemberton Flight',
- 'incident_type_id' => 1,
- 'status_id' => 1,
- 'notify_email' => 'hello@world.com',
- 'notify_user_id' => 1,
- 'notify_user_coverage_yn' => 'Y',
- 'notify_status_id' => 123,
- 'notify_group_id' => null,
- 'notify_group_coverage_yn' => 'Y',
- 'email_subject' => 'Safe landing',
- 'email_body' => 'There were 14 flights made today. No major incidents. All pilots made to LZ safe',
- 'email_yn' => 'N',
- 'bulletin_yn' => 'N',
- 'auto_send_yn' => 'Y'
- );
- $where = "notification_id=145";
- $types_insert = array
- (
- 0 => 'integer',
- 1 => 'text',
- 2 => 'integer',
- 3 => 'integer',
- 4 => 'clob',
- 5 => 'integer',
- 6 => 'text',
- 7 => 'integer',
- 8 => 'integer',
- 9 => 'text',
- 10 => 'text',
- 11 => 'clob',
- 12 => 'text',
- 13 => 'text',
- 14 => 'text'
- );
- $types_update = array
- (
- 0 => 'text',
- 1 => 'integer',
- 2 => 'integer',
- 3 => 'clob',
- 4 => 'integer',
- 5 => 'text',
- 6 => 'integer',
- 7 => 'integer',
- 8 => 'text',
- 9 => 'text',
- 10 => 'clob',
- 11 => 'text',
- 12 => 'text',
- 13 => 'text'
- );
- $this->notify = db()->autoExecute($table_name, $params_insert,
- MDB2_AUTOQUERY_INSERT,
- $types_insert);
- $this->notify = db()->autoExecute($table_name, $params_update,
- MDB2_AUTOQUERY_UPDATE,
- $where, $types_update);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement