Deprecated: Creation of dynamic property W3_Db::$processors is deprecated in /var/www/vhosts/dev.hartzellprop.com/www/wp-includes/wp-db.php on line 704
Deprecated: Creation of dynamic property W3_Db::$processor is deprecated in /var/www/vhosts/dev.hartzellprop.com/www/wp-includes/wp-db.php on line 704
Deprecated: Creation of dynamic property W3_Db::$processor_number is deprecated in /var/www/vhosts/dev.hartzellprop.com/www/wp-includes/wp-db.php on line 704
Deprecated: Creation of dynamic property W3_DbCallUnderlying::$manager is deprecated in /var/www/vhosts/dev.hartzellprop.com/www/wp-content/plugins/w3-total-cache/lib/W3/Db.php on line 390
Deprecated: Creation of dynamic property W3_Db::$categories is deprecated in /var/www/vhosts/dev.hartzellprop.com/www/wp-includes/wp-db.php on line 704
Deprecated: Creation of dynamic property W3_Db::$post2cat is deprecated in /var/www/vhosts/dev.hartzellprop.com/www/wp-includes/wp-db.php on line 704
Deprecated: Creation of dynamic property W3_Db::$link2cat is deprecated in /var/www/vhosts/dev.hartzellprop.com/www/wp-includes/wp-db.php on line 704
Deprecated: Return type of WP_Theme::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/dev.hartzellprop.com/www/wp-includes/class-wp-theme.php on line 414
Deprecated: Return type of WP_Theme::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/dev.hartzellprop.com/www/wp-includes/class-wp-theme.php on line 437
Deprecated: Return type of WP_Theme::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/dev.hartzellprop.com/www/wp-includes/class-wp-theme.php on line 397
Deprecated: Return type of WP_Theme::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/dev.hartzellprop.com/www/wp-includes/class-wp-theme.php on line 404
Deprecated: Return type of WP_REST_Request::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/dev.hartzellprop.com/www/wp-includes/rest-api/class-wp-rest-request.php on line 876
Deprecated: Return type of WP_REST_Request::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/dev.hartzellprop.com/www/wp-includes/rest-api/class-wp-rest-request.php on line 897
Deprecated: Return type of WP_REST_Request::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/dev.hartzellprop.com/www/wp-includes/rest-api/class-wp-rest-request.php on line 910
Deprecated: Return type of WP_REST_Request::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/dev.hartzellprop.com/www/wp-includes/rest-api/class-wp-rest-request.php on line 922
class TogPartsApi {
public function registerRoutes( $routes ); void {
//TOP PROP //
register_rest_route( 'tog-parts/v1', '/top-prop-count', array(
'callback' => array( $this, 'get_top_prop_count' ),
'methods' => WP_REST_Server::READABLE,
'permission_callback' => function () {
return true;
},
) );
register_rest_route( 'tog-parts/v1', '/top-prop', array(
'callback' => array( $this, 'get_top_props' ),
'methods' => WP_REST_Server::READABLE,
'permission_callback' => function () {
return true;
},
) );
register_rest_route( 'tog-parts/v1', '/add-top-prop', array(
'callback' => array( $this, 'add_top_prop' ),
'methods' => WP_REST_Server::READABLE,
'permission_callback' => function () {
return true;
},
) );
register_rest_route( 'tog-parts/v1', '/delete-top-prop', array(
'callback' => array( $this, 'delete_top_prop' ),
'methods' => WP_REST_Server::READABLE,
'permission_callback' => function () {
return true;
},
) );
}
// TOP PROP
public function get_top_prop_count(WP_REST_Request $request) : void{
//SELECT Count(id) as page_count FROM `wp_used_parts`
$manufacturer = '';
$manufacturer = $request['part_number'];
global $wpdb;
$queryme = 'SELECT Count(id) as page_count FROM wp_top_prop ';
if(strlen($manufacturer) > 0){
$queryme .= "where manufacturer like '%". $manufacturer . "%'";
$queryme .= "or kit_number like '%" . $manufacturer . "%'";
$queryme .= "or stc_tc like '%" . $manufacturer . "%'";
}
$sqlquery = $wpdb->get_results( $queryme, ARRAY_A );
return new WP_REST_Response( $sqlquery, 200 );
}
public function get_top_props(WP_REST_Request $request): void {
global $wpdb;
$page_limit = 20;
$part_number = '';
$page_num = $request['page_num'];
$manufacturer = $request['manufacturer'];
$offset = 0;
if($page_num){
if($page_num > 1){
$offset = ($page_num - 1) * $page_limit;
}
}
$queryme = 'SELECT * FROM wp_top_prop ';
if(strlen($manufacturer) > 0){
$queryme .= "where manufacturer like '%". $manufacturer . "%'";
$queryme .= "or kit_number like '%" . $manufacturer . "%'";
$queryme .= "or stc_tc like '%" . $manufacturer . "%'";
}
$queryme .= 'order by manufacturer LIMIT '. $page_limit;
if($offset > 0){
$queryme .= ' OFFSET ' . $offset;
}
$sqlquery = $wpdb->get_results( $queryme, ARRAY_A );
//$sqlquery = "SELECT * FROM `wp_used_parts` where part_number = '" . $part_numberclean. "' order by part_number asc";
return new WP_REST_Response( $sqlquery, 200 );
}
public function delete_top_prop(WP_REST_Request $request): void{
global $wpdb;
$id = $request['prop_id'];
$sqlquery = '';
if($id){
if($id > 0){
$sqlquery = $wpdb->get_results("DELETE FROM wp_top_prop WHERE id = ".$id);
}
}
return new WP_REST_Response( $sqlquery, 200 );
}
//Manufacturer, Model, STC_TC, Kit_Number, Quantity, Application, Engine_Model, Prop_Description, Blade_Model, Notes
public function add_top_prop(WP_REST_Request $request): void{
global $wpdb;
$id = $request['prop_id'];
$manufacturer = $request['manufacturer'];
$model = $request['model'];
$stc_tc = $request['stc_tc'];
$kit_number = $request['kit_number'];
$quantity = $request['quantity'];
$application = $request['application'];
$engine_model = $request['engine_model'];
$prop_description = $request['prop_description'];
$blade_model =$request['blade_model'];
$notes = $request['notes'];
$url = $request['url'];
$prop_order = $request['prop_order'];
$sqlquery = '';
if($id > 0){
//UPDATE
$sqlquery = $wpdb->get_results("UPDATE wp_top_prop set Manufacturer = '".$manufacturer."', Model = '".$model."', STC_TC = '".$stc_tc."', Kit_Number = '".$kit_number."', Quantity = '".$quantity."', Application = '".$application."', Engine_Model = '".$engine_model."', Prop_Description = '".$prop_description."', Blade_Model = '".$blade_model."', Notes = '".$notes."', url = '".$url."', prop_order = '".$prop_order."' WHERE id = ".$id." ");
}else{
$sqlquery = $wpdb->get_results( "INSERT INTO wp_top_prop (Manufacturer, Model, STC_TC, Kit_Number, Quantity, Application, Engine_Model, Prop_Description, Blade_Model, Notes, url, prop_order) VALUE('".$manufacturer."', '". $model."', '".$stc_tc."', '".$kit_number."', '".$quantity."', '".$application."', '".$engine_model."', '".$prop_description."', '".$blade_model."', '".$notes."', '".$url."', '".$prop_order."')");
}
if(is_null($sqlquery)){
//error
return new WP_REST_Response( $sqlquery, 500 );
}
return new WP_REST_Response( $sqlquery, 200 );
}
// TOP PROP
}
?>
Parse error: syntax error, unexpected token "{" in /var/www/vhosts/dev.hartzellprop.com/www/wp-content/plugins/gravityforms/common.php on line 3293