Question: PHP language just try. 1. a new item should be inserted into item table 2. a new order will put an entry in the order

1. a new item should be inserted into item table 2. a new order will put an entry in the "order" table and as many entries into the order_item" as the number of items being ordered 3. The submission of the "Inventory" will either add a new item into or updating existing items the "item" table depending on which option/button is submitted 4. You need to at least implement/(code it so it become functional) the Inventory interface. (a) an item id will be generated automatically by the database, you don't have to insert that field. (b) the form in the Inventory for updating the quantity of the existing items should be generated dynamically using the existing item data from the database. You can have the item id (lid) as a hidden field so when the user submit. you know new qty is corresponding which which item. The form data will come in as an array because the user is updating more than 1 items. If you don't use item id. then the item's name can be used because it is set with unique constraint in the item table CREATE TABLE item(lid INT NOT NULL AUTO INCREMENT, name VARCHAR(10) description VARCHAR (200), qty INT) UNIQUE (name), PRIMARY KEY(id) ENGINE MYISAM; CREATE TABLE location lid INT(5) NOT NULL AUTO_INCREMENT name VARCHAR(40) NOT NULL UNIQUE, arrival VARCHAR(40) NOT NULL) PRIMARY KEY (lid) 9 ENGINE MYISAM; CREATE TABLE orders oid INT NOT NULL AUTO_INCREMENT, status INT NOT NULL DEFAULT O, # 0 open order, 1H ready order 2 H completed order lid INT NOT NULL, #or varchar(40) if location table is not used cname VARCHAR(20), odate DATETIME NOT NULL DEFAULT CURRENT TIMESTAMP PRIMARY KEY (oid), FOREIGN KEY (lid) REFERENCES location (11) ON DELETE CASCADE ENGINE MYISAM; CREATE TABLE order items oid INT NOT NULL iid INT NOT NULL qty ant NOT JLL DEFAULT 1 cost double not null FOREIGN KEY (iid) REFERENCES item(11d) ON DELETE CASCADE, FOREIGN KEY Coid) REFERENCES orders (oid) ON DELETE CASCADE > ENGINE MYISAM; 1. a new item should be inserted into item table 2. a new order will put an entry in the "order" table and as many entries into the order_item" as the number of items being ordered 3. The submission of the "Inventory" will either add a new item into or updating existing items the "item" table depending on which option/button is submitted 4. You need to at least implement/(code it so it become functional) the Inventory interface. (a) an item id will be generated automatically by the database, you don't have to insert that field. (b) the form in the Inventory for updating the quantity of the existing items should be generated dynamically using the existing item data from the database. You can have the item id (lid) as a hidden field so when the user submit. you know new qty is corresponding which which item. The form data will come in as an array because the user is updating more than 1 items. If you don't use item id. then the item's name can be used because it is set with unique constraint in the item table CREATE TABLE item(lid INT NOT NULL AUTO INCREMENT, name VARCHAR(10) description VARCHAR (200), qty INT) UNIQUE (name), PRIMARY KEY(id) ENGINE MYISAM; CREATE TABLE location lid INT(5) NOT NULL AUTO_INCREMENT name VARCHAR(40) NOT NULL UNIQUE, arrival VARCHAR(40) NOT NULL) PRIMARY KEY (lid) 9 ENGINE MYISAM; CREATE TABLE orders oid INT NOT NULL AUTO_INCREMENT, status INT NOT NULL DEFAULT O, # 0 open order, 1H ready order 2 H completed order lid INT NOT NULL, #or varchar(40) if location table is not used cname VARCHAR(20), odate DATETIME NOT NULL DEFAULT CURRENT TIMESTAMP PRIMARY KEY (oid), FOREIGN KEY (lid) REFERENCES location (11) ON DELETE CASCADE ENGINE MYISAM; CREATE TABLE order items oid INT NOT NULL iid INT NOT NULL qty ant NOT JLL DEFAULT 1 cost double not null FOREIGN KEY (iid) REFERENCES item(11d) ON DELETE CASCADE, FOREIGN KEY Coid) REFERENCES orders (oid) ON DELETE CASCADE > ENGINE MYISAM
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
