> For the complete documentation index, see [llms.txt](https://1019apps.gitbook.io/vetpro-depo/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://1019apps.gitbook.io/vetpro-depo/warehouses.md).

# Warehouses

## List All Warehouses

{% hint style="info" %}
All pages and components use BasicDB classes.
{% endhint %}

### BasicDB Parameters

| Property | Desc                                     | for warehouse                                           |
| -------- | ---------------------------------------- | ------------------------------------------------------- |
| select   | Select any table from database           | warehouses                                              |
| insert   | Insert any record a table                | warehouses                                              |
| update   | Update any record a table                | warehouses                                              |
| delete   | Delete any record a table                | warehouses                                              |
| where    | SQL Where command and use 2 parameters   | company\_id, session('COMPANY\_ID')                     |
| orderby  | SQL Orderby command and use 2 parameters | name, ASC                                               |
| run      | Execute sql command                      | If send true only 1 rows affected, else all rows return |

![Get warehouses](https://1519980168-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LxLHRiVy8YAmpbeAMtc%2F-LxLHUv-joki97wmRgFa%2F-LxLIpVUHkmlqmQqBhrF%2FScreen%20Shot%202019-12-30%20at%2013.17.15.png?alt=media\&token=7963e609-e68d-44bb-a1cf-830fd5bd6ed2)

VeterinerPro use **DataTable** plugin all pages.

![List warehouses item by item inside a table](https://1519980168-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LxLHRiVy8YAmpbeAMtc%2F-LxLHUv-joki97wmRgFa%2F-LxLJ49yXzQ-Mhn-W8g4%2FScreen%20Shot%202019-12-30%20at%2013.18.17.png?alt=media\&token=850b8775-1307-46a7-b1aa-1e91ece5de0a)

## Create a warehouse

/app/view/warehouses.php has a modal by id: **newModal**

![ajaxForm class](https://1519980168-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LxLHRiVy8YAmpbeAMtc%2F-LxLHUv-joki97wmRgFa%2F-LxLJfQq9D-fz1x-Vimq%2FScreen%20Shot%202019-12-30%20at%2013.20.56.png?alt=media\&token=edacb83d-26a5-41fa-8e0b-d57e12ac5d45)

Ajax requests are inside a file (app/controller/ajax.php) decomposition from **type** parameter.

This request send app/ajax/newwarehouse.ajax.php

This file (app/ajax/newwarehouse.ajax.php) has 4 properties.&#x20;

* name
* address
* contact\_phone
* contact\_name

Contact name is required field.&#x20;

![app/ajax/newwarehouse.ajax.php](https://1519980168-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LxLHRiVy8YAmpbeAMtc%2F-LxLHUv-joki97wmRgFa%2F-LxLKcaGmNbKWsu7Ly1U%2FScreen%20Shot%202019-12-30%20at%2013.25.05.png?alt=media\&token=c7a23c91-8b68-4d3f-9598-433231447b4b)

## Update A Warehouse

This file is (app/gets/warehouseupdate.php) is a modal page.&#x20;

This file has a property: ID.&#x20;

Identifier help find true warehouse.

![app/gets/warehouseupdate.php](https://1519980168-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LxLHRiVy8YAmpbeAMtc%2F-LxLKpuJ2hq_VtO6mN-Z%2F-LxLLdCYjWc_n_lRRmHw%2FScreen%20Shot%202019-12-30%20at%2013.27.47.png?alt=media\&token=a5a02e03-8467-4691-b941-0797518fd2a8)

This file has **ajaxForm** class and send app/ajax/updatewarehouse.ajax.php.

Updatewarehouse.ajax.php has 5 property:

* Id
* Name
* Address
* Contact Phone
* Contact Name

![Updatewarehouse.ajax.php](https://1519980168-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LxLHRiVy8YAmpbeAMtc%2F-LxLKpuJ2hq_VtO6mN-Z%2F-LxLMSwepLt7A3gg0wdG%2FScreen%20Shot%202019-12-30%20at%2013.33.06.png?alt=media\&token=9d7b76cc-a867-4782-aad4-a25ebcc032f5)

Identifier help find true warehouse.

## Delete Warehouse

Delete process started in view/warehouses.php

![view/warehouses.php](https://1519980168-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LxLHRiVy8YAmpbeAMtc%2F-LxLKpuJ2hq_VtO6mN-Z%2F-LxLPFckmdxnVF8_Nd8U%2FScreen%20Shot%202019-12-30%20at%2013.45.19.png?alt=media\&token=97a38b22-4f18-4174-9e01-69f9b59e7a64)

Delete call /ajax/**warehousedelete.ajax.php**

**Warehousedelete.ajax.php** has 1 property

* ID

Identifier help find true warehouse.

BasicDB delete method call sql "DELETE FROM *tablename*"
