*/ /** * Description of inject_record * * @author penguin */ require_once 'connection.php'; //if(isset($_POST['id'])){ // //$obj=new inject_record; // $result=array('a','b','c'); // echo json_encode($result); // exit; //} if (isset($_POST['id'])) { $obj = new inject_record(); $result = $obj->get_area($_POST['id']); while ($row = mysqli_fetch_array($result)) { $data[] = array($row['number'], $row['name'], $row['hw_name']); } if (is_null($data)) { $result = array('a'); echo json_encode($result); } else { echo json_encode($data); } exit; } if (isset($_POST['mcard'])) { $obj = new inject_record(); $result = $obj->get_info($_POST['mcard']); while ($row = mysqli_fetch_array($result)) {
print_r($_POST); foreach ($_POST as $key => $value) { if (empty($_POST[$key])) { $error = 'Fill empty fields first.'; } else { $data[$key] = $value; } } if (!isset($error)) { $obj = new inject_record(); $add_result = $obj->add_area(); } } $obj = new inject_record(); $uc_result = $obj->get_uc(); $result = $obj->get_area(null); //print_r($result); ?> <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <title>Add Area</title> <?php require 'inc/head.php'; ?> </head>