forked from FreePBX/setcid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.php
More file actions
22 lines (19 loc) · 722 Bytes
/
install.php
File metadata and controls
22 lines (19 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
global $db;
$autoincrement = (($amp_conf["AMPDBENGINE"] == "sqlite") || ($amp_conf["AMPDBENGINE"] == "sqlite3")) ? "AUTOINCREMENT":"AUTO_INCREMENT";
$sql[] = "CREATE TABLE IF NOT EXISTS setcid (
cid_id INTEGER NOT NULL PRIMARY KEY $autoincrement,
cid_name VARCHAR( 150 ) ,
cid_num VARCHAR( 150 ) ,
description VARCHAR( 50 ) ,
dest VARCHAR( 255 )
)";
$sql[] = 'alter table setcid change column cid_name cid_name varchar(150);';
$sql[] = 'alter table setcid change column cid_num cid_num varchar(150);';
foreach ($sql as $q) {
$check = $db->query($q);
if($db->IsError($check)) {
die_freepbx("Can not create setcid table\n");
}
}