Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Headers
- header('Access-Control-Allow-Origin: *');
- header('Content-Type: application/json');
- include_once '../../config/Database.php';
- include_once '../../models/Trades.php';
- // Instantiate DB & connect
- $database = new Database();
- $db = $database->connect();
- // Instantiate blog trades object
- $trades = new Trades($db);
- // Get ID
- $data = json_decode(file_get_contents("php://input"));
- $trades->id = $data->id;
- // Get trades
- $trades->single_trade_info();
- // Create array
- $post_arr = array(
- 'plant_type' => $trades->plant_type,
- 'owner_id' => $trades->owner_id,
- 'name' => $trades->name,
- 'town' => $trades->town,
- 'phone' => $trades->phone,
- 'descryption' => $trades->descryption,
- 'transaction_type' => $trades->transaction_type
- );
- // Make JSON
- print_r(json_encode($post_arr));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement