function __autoload($class) { // $class = strtolower($class); // $class = str_replace('A\\',DIRECTORY_SEPARATOR,$class); $name = $class . '.class.php'; // echo $name; get_extension($name); get_exist($name); require_once $name; }
$data = "branch_name = '{$i_name}',\n\t\t\t\t\t\t\tbranch_desc = '{$i_desc}',\n\t\t\t\t\t\t\tbranch_address = '{$i_address}',\n\t\t\t\t\t\t\tbranch_phone = '{$i_phone}',\n\t\t\t\t\t\t\tbranch_city = '{$i_city}',\n\t\t\t\t\t\t\tbranch_type_id = '{$i_type_id}'\n\t\t\t\t\t"; } update($data, $id); $data_building = "building_name = '{$i_name}'"; update_building($data_building, $id); // edit list menu $query_menu = mysql_query("select a.*, b.menu_type_name\n from menus a \n join menu_types b on b.menu_type_id = a.menu_type_id\n order by menu_id"); while ($row_menu = mysql_fetch_array($query_menu)) { $i_check = isset($_POST['i_check_' . $row_menu['menu_id']]) ? $_POST['i_check_' . $row_menu['menu_id']] : ""; if ($i_check) { $check_exist = check_exist($id, $row_menu['menu_id']); if ($check_exist == 0) { $data = "'',\n\t\t\t\t\t\t\t\t\t'{$id}',\n\t\t\t\t\t\t\t\t\t'" . $row_menu['menu_id'] . "',\n\t\t\t\t\t\t\t\t\t'" . $_POST['i_branch_menu_price_' . $row_menu['menu_id']] . "'\n\t\t\t\t\t\t\t"; create_item($data); } else { $get_exist = get_exist($id, $row_menu['menu_id']); update_item($_POST['i_branch_menu_price_' . $row_menu['menu_id']], $get_exist); } } else { //echo "gagal"."<br>"; delete_item($id, $row_menu['menu_id']); } } header('Location: branch.php?page=list&did=2'); break; case 'delete': $id = get_isset($_GET['id']); $path = "../img/branch/"; $get_img_old = get_img_old($id); if ($get_img_old) { if (file_exists($path . $get_img_old)) {