-
❓ 10 Customers.dscUnknown, 102 B⬇
-
🌐 10 Customers.htmlWeb, 128 B⬇
-
🌐 10 Customers.phpWeb, 11.57 kB⬇
-
❓ 20 Orders.dscUnknown, 96 B⬇
-
🌐 20 Orders.htmlWeb, 119 B⬇
-
🌐 20 Orders.phpWeb, 10.41 kB⬇
-
❓ 90 Reset Demo.dscUnknown, 56 B⬇
-
🌐 90 Reset Demo.htmlWeb, 144 B⬇
-
🌐 90 Reset Demo.phpWeb, 1.82 kB⬇
-
🌐 Demo CRM.cssWeb, 1.71 kB⬇
-
❓ Demo CRM.dscUnknown, 33 B⬇
-
❓ Demo CRM.initUnknown, 1.48 kB⬇
-
🌐 Demo CRM.phpWeb, 37 B⬇
<?php
class DemoCRM {
static $pDB;
function __construct() {
self::$pDB = $GLOBALS['PHYLOBYTEDB'];
$this->create_tables();
}
function create_tables() {
$driver = self::$pDB->getAttribute(PDO::ATTR_DRIVER_NAME);
$customer_table_sql = "
CREATE TABLE IF NOT EXISTS dcrm_customers (
id " . ($driver == 'sqlite' ? 'INTEGER PRIMARY KEY AUTOINCREMENT' : 'INT PRIMARY KEY AUTO_INCREMENT') . ",
customer_name VARCHAR(255) NOT NULL,
customer_state VARCHAR(255),
customer_city VARCHAR(255),
customer_zipcode VARCHAR(10),
customer_email VARCHAR(255),
customer_phone VARCHAR(20)
);
";
$order_table_sql = "
CREATE TABLE IF NOT EXISTS dcrm_orders (
id " . ($driver == 'sqlite' ? 'INTEGER PRIMARY KEY AUTOINCREMENT' : 'INT PRIMARY KEY AUTO_INCREMENT') . ",
key_customer_id INT NOT NULL,
date_placed DATE,
order_description TEXT,
order_amount DECIMAL(10, 2),
FOREIGN KEY (key_customer_id) REFERENCES dcrm_customers(id)
);
";
try {
self::$pDB->exec($customer_table_sql);
self::$pDB->exec($order_table_sql);
} catch (PDOException $e) {
phylobyte::messageAddError('Error creating tables: ' . $e->getMessage());
}
}
}
new DemoCRM();
?>
Demo CRM.init
×
Type: Unknown, text/x-php
1.48 Kilobytes
Last Modified 2026-06-02 03:10:33
⬇ Download File
Type: Unknown, text/x-php
1.48 Kilobytes
Last Modified 2026-06-02 03:10:33
⬇ Download File