Renamed firstname and lastname to firstName and lastName, also made some other corrections.
This commit is contained in:
parent
652ccbe286
commit
ed7e40720e
12 changed files with 35 additions and 43 deletions
|
@ -158,8 +158,8 @@ You can also try the GET requests with your browser by navigating to the respect
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
"id": 97,
|
"id": 97,
|
||||||
"firstname": "John",
|
"firstName": "John",
|
||||||
"lastname": "Doe",
|
"lastName": "Doe",
|
||||||
"email": "john@doe.com",
|
"email": "john@doe.com",
|
||||||
"phone": "0123456789",
|
"phone": "0123456789",
|
||||||
"address": "Some Str. 123",
|
"address": "Some Str. 123",
|
||||||
|
@ -223,8 +223,8 @@ You can also try the GET requests with your browser by navigating to the respect
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
"id": 143,
|
"id": 143,
|
||||||
"firstname": "Chris",
|
"firstName": "Chris",
|
||||||
"lastname": "Doe",
|
"lastName": "Doe",
|
||||||
"email": "chris@doe.com",
|
"email": "chris@doe.com",
|
||||||
"mobile": "012345679-0",
|
"mobile": "012345679-0",
|
||||||
"phone": "0123456789-1",
|
"phone": "0123456789-1",
|
||||||
|
@ -253,8 +253,8 @@ You can also try the GET requests with your browser by navigating to the respect
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
"id": 143,
|
"id": 143,
|
||||||
"firstname": "Chloe",
|
"firstName": "Chloe",
|
||||||
"lastname": "Doe",
|
"lastName": "Doe",
|
||||||
"email": "chloe@doe.com",
|
"email": "chloe@doe.com",
|
||||||
"mobile": "012345679-0",
|
"mobile": "012345679-0",
|
||||||
"phone": "0123456789-1",
|
"phone": "0123456789-1",
|
||||||
|
@ -338,8 +338,8 @@ You can also try the GET requests with your browser by navigating to the respect
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
"id": 143,
|
"id": 143,
|
||||||
"firstname": "Chris",
|
"firstName": "Chris",
|
||||||
"lastname": "Doe",
|
"lastName": "Doe",
|
||||||
"email": "chris@doe.com",
|
"email": "chris@doe.com",
|
||||||
"mobile": "012345679-0",
|
"mobile": "012345679-0",
|
||||||
"phone": "0123456789-1",
|
"phone": "0123456789-1",
|
||||||
|
|
|
@ -872,8 +872,6 @@ class Appointments extends CI_Controller {
|
||||||
'id_services = ' . $this->db->escape($service_id) . ' AND DATE(start_datetime) = DATE('
|
'id_services = ' . $this->db->escape($service_id) . ' AND DATE(start_datetime) = DATE('
|
||||||
. $this->db->escape(date('Y-m-d', strtotime($selected_date))) . ')');
|
. $this->db->escape(date('Y-m-d', strtotime($selected_date))) . ')');
|
||||||
|
|
||||||
$hours = [];
|
|
||||||
|
|
||||||
foreach($appointments as $appointment) {
|
foreach($appointments as $appointment) {
|
||||||
$hour = date('H:i', strtotime($appointment['start_datetime']));
|
$hour = date('H:i', strtotime($appointment['start_datetime']));
|
||||||
$current_attendants_number = $this->appointments_model->appointment_count_for_hour($service_id,
|
$current_attendants_number = $this->appointments_model->appointment_count_for_hour($service_id,
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
* @since v1.0.0
|
* @since v1.0.0
|
||||||
* ---------------------------------------------------------------------------- */
|
* ---------------------------------------------------------------------------- */
|
||||||
|
|
||||||
use \EA\Engine\Types\Decimal;
|
|
||||||
use \EA\Engine\Types\Alphanumeric;
|
use \EA\Engine\Types\Alphanumeric;
|
||||||
use \EA\Engine\Types\Email;
|
use \EA\Engine\Types\Email;
|
||||||
use \EA\Engine\Types\Url;
|
use \EA\Engine\Types\Url;
|
||||||
|
|
|
@ -132,7 +132,7 @@ class Admins extends API_V1_Controller {
|
||||||
*/
|
*/
|
||||||
public function delete($id) {
|
public function delete($id) {
|
||||||
try {
|
try {
|
||||||
$result = $this->admins_model->delete($id);
|
$this->admins_model->delete($id);
|
||||||
|
|
||||||
$response = new Response([
|
$response = new Response([
|
||||||
'code' => 200,
|
'code' => 200,
|
||||||
|
|
|
@ -132,7 +132,7 @@ class Appointments extends API_V1_Controller {
|
||||||
*/
|
*/
|
||||||
public function delete($id) {
|
public function delete($id) {
|
||||||
try {
|
try {
|
||||||
$result = $this->appointments_model->delete($id);
|
$this->appointments_model->delete($id);
|
||||||
|
|
||||||
$response = new Response([
|
$response = new Response([
|
||||||
'code' => 200,
|
'code' => 200,
|
||||||
|
|
|
@ -14,8 +14,6 @@
|
||||||
require_once __DIR__ . '/API_V1_Controller.php';
|
require_once __DIR__ . '/API_V1_Controller.php';
|
||||||
require_once __DIR__ . '/../../Appointments.php';
|
require_once __DIR__ . '/../../Appointments.php';
|
||||||
|
|
||||||
use \EA\Engine\Api\V1\Response;
|
|
||||||
use \EA\Engine\Api\V1\Request;
|
|
||||||
use \EA\Engine\Types\UnsignedInteger;
|
use \EA\Engine\Types\UnsignedInteger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -301,8 +299,6 @@ class Availabilities extends API_V1_Controller {
|
||||||
'id_services = ' . $this->db->escape($service_id) . ' AND DATE(start_datetime) = DATE('
|
'id_services = ' . $this->db->escape($service_id) . ' AND DATE(start_datetime) = DATE('
|
||||||
. $this->db->escape(date('Y-m-d', strtotime($selected_date))) . ')');
|
. $this->db->escape(date('Y-m-d', strtotime($selected_date))) . ')');
|
||||||
|
|
||||||
$hours = [];
|
|
||||||
|
|
||||||
foreach($appointments as $appointment) {
|
foreach($appointments as $appointment) {
|
||||||
$hour = date('H:i', strtotime($appointment['start_datetime']));
|
$hour = date('H:i', strtotime($appointment['start_datetime']));
|
||||||
$current_attendants_number = $this->appointments_model->appointment_count_for_hour($service_id,
|
$current_attendants_number = $this->appointments_model->appointment_count_for_hour($service_id,
|
||||||
|
|
|
@ -15,7 +15,6 @@ require_once __DIR__ . '/API_V1_Controller.php';
|
||||||
|
|
||||||
use \EA\Engine\Api\V1\Response;
|
use \EA\Engine\Api\V1\Response;
|
||||||
use \EA\Engine\Api\V1\Request;
|
use \EA\Engine\Api\V1\Request;
|
||||||
use \EA\Engine\Types\NonEmptyAlphanumeric;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Settings Controller
|
* Settings Controller
|
||||||
|
|
|
@ -27,8 +27,8 @@ class Admins implements ParsersInterface {
|
||||||
public function encode(array &$response) {
|
public function encode(array &$response) {
|
||||||
$encodedResponse = [
|
$encodedResponse = [
|
||||||
'id' => $response['id'] !== null ? (int)$response['id'] : null,
|
'id' => $response['id'] !== null ? (int)$response['id'] : null,
|
||||||
'firstname' => $response['first_name'],
|
'firstName' => $response['first_name'],
|
||||||
'lastname' => $response['last_name'],
|
'lastName' => $response['last_name'],
|
||||||
'email' => $response['email'],
|
'email' => $response['email'],
|
||||||
'mobile' => $response['mobile_number'],
|
'mobile' => $response['mobile_number'],
|
||||||
'phone' => $response['phone_number'],
|
'phone' => $response['phone_number'],
|
||||||
|
@ -60,12 +60,12 @@ class Admins implements ParsersInterface {
|
||||||
$decodedRequest['id'] = $request['id'];
|
$decodedRequest['id'] = $request['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($request['firstname'])) {
|
if (!empty($request['firstName'])) {
|
||||||
$decodedRequest['first_name'] = $request['firstname'];
|
$decodedRequest['first_name'] = $request['firstName'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($request['lastname'])) {
|
if (!empty($request['lastName'])) {
|
||||||
$decodedRequest['last_name'] = $request['lastname'];
|
$decodedRequest['last_name'] = $request['lastName'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($request['email'])) {
|
if (!empty($request['email'])) {
|
||||||
|
|
|
@ -27,8 +27,8 @@ class Customers implements ParsersInterface {
|
||||||
public function encode(array &$response) {
|
public function encode(array &$response) {
|
||||||
$encodedResponse = [
|
$encodedResponse = [
|
||||||
'id' => $response['id'] !== null ? (int)$response['id'] : null,
|
'id' => $response['id'] !== null ? (int)$response['id'] : null,
|
||||||
'firstname' => $response['first_name'],
|
'firstName' => $response['first_name'],
|
||||||
'lastname' => $response['last_name'],
|
'lastName' => $response['last_name'],
|
||||||
'email' => $response['email'],
|
'email' => $response['email'],
|
||||||
'phone' => $response['phone_number'],
|
'phone' => $response['phone_number'],
|
||||||
'address' => $response['address'],
|
'address' => $response['address'],
|
||||||
|
@ -53,12 +53,12 @@ class Customers implements ParsersInterface {
|
||||||
$decodedRequest['id'] = $request['id'];
|
$decodedRequest['id'] = $request['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($request['firstname'])) {
|
if (!empty($request['firstName'])) {
|
||||||
$decodedRequest['first_name'] = $request['firstname'];
|
$decodedRequest['first_name'] = $request['firstName'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($request['lastname'])) {
|
if (!empty($request['lastName'])) {
|
||||||
$decodedRequest['last_name'] = $request['lastname'];
|
$decodedRequest['last_name'] = $request['lastName'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($request['email'])) {
|
if (!empty($request['email'])) {
|
||||||
|
|
|
@ -27,8 +27,8 @@ class Providers implements ParsersInterface {
|
||||||
public function encode(array &$response) {
|
public function encode(array &$response) {
|
||||||
$encodedResponse = [
|
$encodedResponse = [
|
||||||
'id' => $response['id'] !== null ? (int)$response['id'] : null,
|
'id' => $response['id'] !== null ? (int)$response['id'] : null,
|
||||||
'firstname' => $response['first_name'],
|
'firstName' => $response['first_name'],
|
||||||
'lastname' => $response['last_name'],
|
'lastName' => $response['last_name'],
|
||||||
'email' => $response['email'],
|
'email' => $response['email'],
|
||||||
'mobile' => $response['mobile_number'],
|
'mobile' => $response['mobile_number'],
|
||||||
'phone' => $response['phone_number'],
|
'phone' => $response['phone_number'],
|
||||||
|
@ -67,12 +67,12 @@ class Providers implements ParsersInterface {
|
||||||
$decodedRequest['id'] = $request['id'];
|
$decodedRequest['id'] = $request['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($request['firstname'])) {
|
if (!empty($request['firstName'])) {
|
||||||
$decodedRequest['first_name'] = $request['firstname'];
|
$decodedRequest['first_name'] = $request['firstName'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($request['lastname'])) {
|
if (!empty($request['lastName'])) {
|
||||||
$decodedRequest['last_name'] = $request['lastname'];
|
$decodedRequest['last_name'] = $request['lastName'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($request['email'])) {
|
if (!empty($request['email'])) {
|
||||||
|
|
|
@ -27,8 +27,8 @@ class Secretaries implements ParsersInterface {
|
||||||
public function encode(array &$response) {
|
public function encode(array &$response) {
|
||||||
$encodedResponse = [
|
$encodedResponse = [
|
||||||
'id' => $response['id'] !== null ? (int)$response['id'] : null,
|
'id' => $response['id'] !== null ? (int)$response['id'] : null,
|
||||||
'firstname' => $response['first_name'],
|
'firstName' => $response['first_name'],
|
||||||
'lastname' => $response['last_name'],
|
'lastName' => $response['last_name'],
|
||||||
'email' => $response['email'],
|
'email' => $response['email'],
|
||||||
'mobile' => $response['mobile_number'],
|
'mobile' => $response['mobile_number'],
|
||||||
'phone' => $response['phone_number'],
|
'phone' => $response['phone_number'],
|
||||||
|
@ -61,12 +61,12 @@ class Secretaries implements ParsersInterface {
|
||||||
$decodedRequest['id'] = $request['id'];
|
$decodedRequest['id'] = $request['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($request['firstname'])) {
|
if (!empty($request['firstName'])) {
|
||||||
$decodedRequest['first_name'] = $request['firstname'];
|
$decodedRequest['first_name'] = $request['firstName'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($request['lastname'])) {
|
if (!empty($request['lastName'])) {
|
||||||
$decodedRequest['last_name'] = $request['lastname'];
|
$decodedRequest['last_name'] = $request['lastName'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($request['email'])) {
|
if (!empty($request['email'])) {
|
||||||
|
|
|
@ -49,7 +49,7 @@ class Search implements ProcessorsInterface {
|
||||||
* @param array $haystack Array to search in.
|
* @param array $haystack Array to search in.
|
||||||
* @param string $needle Keyword to be searched.
|
* @param string $needle Keyword to be searched.
|
||||||
*
|
*
|
||||||
* @return int|bool Returns the index of the search occurence or false it nothing was found.
|
* @return int|bool Returns the index of the search occurrence or false it nothing was found.
|
||||||
*/
|
*/
|
||||||
protected static function _recursiveArraySearch(array $haystack, $needle) {
|
protected static function _recursiveArraySearch(array $haystack, $needle) {
|
||||||
foreach ($haystack as $key => $value) {
|
foreach ($haystack as $key => $value) {
|
||||||
|
|
Loading…
Reference in a new issue