$values["fourth_level"] = $locationset["fourth_level"];
        $values["fifth_level"] = $locationset["fifth_level"];
        $values["sixth_level"] = $locationset["sixth_level"];
        $values["seventh_level"] = $locationset["seventh_level"];
        $values["location_id"] = $loc_id;
        $xTemplate = $common->direct_replace($common, $xTemplate, $values);
        echo $xTemplate;
    }
    function add_location($common, $db_object, $form_array)
    {
        while (list($kk, $vv) = @each($form_array)) {
            ${$kk} = $vv;
        }
        $location_table = $common->prefix_table("location_table");
        if ($fLocation_id != "") {
            $insqry = "update {$location_table} set first_level='{$fFirst_level}',second_level='{$fSecond_level}',third_level='{$fThird_level}',fourth_level='{$fFourth_level}',fifth_level='{$fFifth_level}',sixth_level='{$fSixth_level}',seventh_level='{$fSeventh_level}' where location_id='{$fLocation_id}'";
        } else {
            $insqry = "insert into {$location_table} set first_level='{$fFirst_level}',second_level='{$fSecond_level}',third_level='{$fThird_level}',fourth_level='{$fFourth_level}',fifth_level='{$fFifth_level}',sixth_level='{$fSixth_level}',seventh_level='{$fSeventh_level}'";
        }
        $db_object->insert($insqry);
    }
}
$locobj = new AddLocation();
if ($fSave) {
    $locobj->add_location($common, $db_object, $post_var);
    header("Location:locationsetting.php");
} else {
    include "header.php";
    $locobj->add_locationdisplay($common, $db_object, $post_var, $error_msg);
}
include "footer.php";
Example #2
0
    public function addOneEntryLocation()
    {
        global $entityManager;
        try {
            $entityManager->persist($this->Location);
        } catch (Exception $e) {
            print_r($e);
        }
    }
    public function addOneEntrySpecialty()
    {
        global $entityManager;
        try {
            $entityManager->persist($this->specialty);
        } catch (Exception $e) {
            // print_r($e);
        }
    }
    public function __destruct()
    {
        global $entityManager;
        try {
            $entityManager->flush();
        } catch (Exception $e) {
            print_r($e);
        }
    }
}
$obj = new AddLocation();
//$obj->addOneEntrySpecialty();
$obj->addOneEntryLocation();