$b = $db->fetch_row($check_two); $fetch_business = $db->query(sprintf("SELECT * FROM `businesses` LEFT JOIN `businesses_classes` ON (`classId` = `busClass`) WHERE (`busId` = '%u') OR (`busId` = '%u')", $r['bmembBusiness'], $b['busId'])); if (!$db->num_rows($fetch_business)) { echo 'This Company does not exist at this time, please come back later.'; $h->endpage(); exit; } else { $inf = $db->fetch_row($fetch_business); } } switch ($_GET['p']) { case 'leave_business': leave_business(); break; case 'view_members': view_members(); break; case 'donate_cash': donate_cash(); break; case 'view_vault': view_vault(); break; default: business_index(); break; } function business_index() { global $ir, $inf, $db; echo '
} } if (isset($_GET['_type']) && $_GET['_type'] === 'json') { // 名簿情報を取得 header('Content-Type: application/json; charset=' . MAIN_CHARSET); echo json_encode(array('status' => 'OK', 'data' => $_view, 'files' => array('image_01' => $_view['member']['image_01'] ? file_mimetype($_view['member']['image_01']) : null, 'image_02' => $_view['member']['image_02'] ? file_mimetype($_view['member']['image_02']) : null))); exit; } else { // 投稿セッションを初期化 unset($_SESSION['post']); unset($_SESSION['file']); } // 編集開始日時を記録 if (!empty($_GET['id'])) { $_SESSION['update']['member'] = localdate('Y-m-d H:i:s'); } } if (empty($_POST['view']) || $_POST['view'] !== 'preview') { // 名簿の表示用データ作成 $_view['member'] = view_members($_view['member']); } // 教室を取得 $_view['classes'] = select_classes(array('order_by' => 'sort, id')); // 分類を取得 $_view['categories'] = select_categories(array('order_by' => 'sort, id')); // タイトル if (empty($_GET['id'])) { $_view['title'] = '名簿登録'; } else { $_view['title'] = '名簿編集'; }