Exemplo n.º 1
0
function add_house()
{
    $premises_id = empty($_GET['pid']) ? 0 : $_GET['pid'];
    $house = array();
    $house['id'] = empty($_POST['hid']) ? 0 : $_POST['hid'];
    $house['number'] = empty($_POST['number']) ? '' : $_POST['number'];
    $house['type'] = empty($_POST['type']) ? '' : $_POST['type'];
    $house['state'] = empty($_POST['state']) ? '' : $_POST['state'];
    $house['area'] = empty($_POST['area']) ? 0 : $_POST['area'];
    $house['structure'] = empty($_POST['structure']) ? '' : $_POST['structure'];
    $house['remark'] = empty($_POST['remark']) ? '' : $_POST['remark'];
    $house['premises_id'] = empty($_POST['premises_id']) ? 0 : $_POST['premises_id'];
    $_house = new House();
    $_house->add($house);
    echo "success";
}