-
-
Save sinyo1015/9bbb03a3a742fbed6148eafeb34e2127 to your computer and use it in GitHub Desktop.
<?php | |
class AutoNumber{ | |
protected $prefix; | |
protected $lastIndex; | |
protected $indexNext; | |
public function __construct($data){ | |
$this->prefix = $data[0]; | |
$this->lastIndex = $data[1]; | |
$this->indexNext = $data[2]; | |
} | |
public function make($existing){ | |
$number = (int) substr($existing, $this->indexNext, $this->lastIndex); | |
$newNumber = $number + 1; | |
$realLength = ($this->lastIndex - $this->indexNext); | |
$formatter = "%0" . $realLength . "s"; | |
return $this->prefix . sprintf($formatter, $newNumber); | |
} | |
} |
A PHP Error was encountered
Severity: Notice
Message: Trying to get property 'total_harga' of non-object
Filename: api/Booking.php
Line Number: 27
Backtrace:
File: C:\xampp\htdocs\temp\application\controllers\api\Booking.php
Line: 27
Function: _error_handler
File: C:\xampp\htdocs\temp\application\libraries\REST_Controller.php
Line: 742
Function: call_user_func_array
File: C:\xampp\htdocs\temp\index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Booking::$AutoNumber
Filename: api/Booking.php
Line Number: 35
Backtrace:
File: C:\xampp\htdocs\temp\application\controllers\api\Booking.php
Line: 35
Function: _error_handler
File: C:\xampp\htdocs\temp\application\libraries\REST_Controller.php
Line: 742
Function: call_user_func_array
File: C:\xampp\htdocs\temp\index.php
Line: 315
Function: require_once
An uncaught Exception was encountered
Type: Error
Message: Call to a member function make() on null
Filename: C:\xampp\htdocs\temp\application\controllers\api\Booking.php
Line Number: 35
Backtrace:
File: C:\xampp\htdocs\temp\application\libraries\REST_Controller.php
Line: 742
Function: call_user_func_array
File: C:\xampp\htdocs\temp\index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Notice
Message: Undefined index: harga_lapangan
Filename: api/Booking.php
Line Number: 27
Backtrace:
File: C:\xampp\htdocs\temp\application\controllers\api\Booking.php
Line: 27
Function: _error_handler
File: C:\xampp\htdocs\temp\application\libraries\REST_Controller.php
Line: 742
Function: call_user_func_array
File: C:\xampp\htdocs\temp\index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Booking::$AutoNumber
Filename: api/Booking.php
Line Number: 35
Backtrace:
File: C:\xampp\htdocs\temp\application\controllers\api\Booking.php
Line: 35
Function: _error_handler
File: C:\xampp\htdocs\temp\application\libraries\REST_Controller.php
Line: 742
Function: call_user_func_array
File: C:\xampp\htdocs\temp\index.php
Line: 315
Function: require_once
An uncaught Exception was encountered
Type: Error
Message: Call to a member function make() on null
Filename: C:\xampp\htdocs\temp\application\controllers\api\Booking.php
Line Number: 35
Backtrace:
File: C:\xampp\htdocs\temp\application\libraries\REST_Controller.php
Line: 742
Function: call_user_func_array
File: C:\xampp\htdocs\temp\index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: id_futsal
Filename: api/Booking.php
Line Number: 27
Backtrace:
File: C:\xampp\htdocs\temp\application\controllers\api\Booking.php
Line: 27
Function: _error_handler
File: C:\xampp\htdocs\temp\application\libraries\REST_Controller.php
Line: 742
Function: call_user_func_array
File: C:\xampp\htdocs\temp\index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Notice
Message: Trying to get property 'total_harga' of non-object
Filename: api/Booking.php
Line Number: 27
Backtrace:
File: C:\xampp\htdocs\temp\application\controllers\api\Booking.php
Line: 27
Function: _error_handler
File: C:\xampp\htdocs\temp\application\libraries\REST_Controller.php
Line: 742
Function: call_user_func_array
File: C:\xampp\htdocs\temp\index.php
Line: 315
Function: require_once
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Booking::$AutoNumber
Filename: api/Booking.php
Line Number: 35
Backtrace:
File: C:\xampp\htdocs\temp\application\controllers\api\Booking.php
Line: 35
Function: _error_handler
File: C:\xampp\htdocs\temp\application\libraries\REST_Controller.php
Line: 742
Function: call_user_func_array
File: C:\xampp\htdocs\temp\index.php
Line: 315
Function: require_once
An uncaught Exception was encountered
Type: Error
Message: Call to a member function make() on null
Filename: C:\xampp\htdocs\temp\application\controllers\api\Booking.php
Line Number: 35
Backtrace:
File: C:\xampp\htdocs\temp\application\libraries\REST_Controller.php
Line: 742
Function: call_user_func_array
File: C:\xampp\htdocs\temp\index.php
Line: 315
Function: require_once