} $row = mysqli_fetch_array($result); $pt_id = $row['pt_id']; if (mysqli_num_rows($result) == 0) { include $_SERVER['DOCUMENT_ROOT'] . '/includes/404.html.php'; } else { $sql = "SELECT pt_nm_yr, pt_sffx_num, pt_nm, pt_sbnm, pt_yr_strtd, pt_yr_strtd_c, pt_yr_wrttn, pt_yr_wrttn_c, CASE WHEN pt_pub_dt_frmt=1 THEN DATE_FORMAT(pt_pub_dt, '%d %b %Y') WHEN pt_pub_dt_frmt=2 THEN DATE_FORMAT(pt_pub_dt, '%b %Y') WHEN pt_pub_dt_frmt=3 THEN DATE_FORMAT(pt_pub_dt, '%Y') ELSE NULL END AS pt_pub_dt, pt_coll, cst_m, cst_f, cst_non_spc, cst_ttl, cst_addt, cst_nt, char_ttl, char_m, char_f, char_non_spc, char_na, char_addt\n FROM pt\n WHERE pt_id='{$pt_id}'"; $result = mysqli_query($link, $sql); if (!$result) { $error = 'Error acquiring playtext data: ' . mysqli_error($link); include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php'; exit; } $row = mysqli_fetch_array($result); if ($row['pt_sffx_num']) { $pt_sffx_rmn = ' (' . romannumeral($row['pt_sffx_num']) . ')'; } else { $pt_sffx_rmn = ''; } $pagetab = html($row['pt_nm_yr'] . $pt_sffx_rmn); $pagetitle = html($row['pt_nm']); $pt_sbnm = html($row['pt_sbnm']); $pt_pub_dt = html($row['pt_pub_dt']); if ($row['pt_coll'] == '2') { $coll_dsply = ' [COLLECTED WORKS]'; $coll_wrks = '1'; $coll_ov = ''; $coll_sg = ''; $pt_wrttn_compld = ' compiled'; } elseif ($row['pt_coll'] == '3') { $coll_dsply = ' [COLLECTION]';
} $row = mysqli_fetch_array($result); $comp_id = $row['comp_id']; if (mysqli_num_rows($result) == 0) { include $_SERVER['DOCUMENT_ROOT'] . '/includes/404.html.php'; } else { $sql = "SELECT comp_nm, comp_sffx_num, comp_url, comp_reg_nm, comp_reg_adrs,\n CASE WHEN comp_est_dt_frmt=1 THEN DATE_FORMAT(comp_est_dt, '%d %b %Y') WHEN comp_est_dt_frmt=2 THEN DATE_FORMAT(comp_est_dt, '%b %Y')\n WHEN comp_est_dt_frmt=3 THEN DATE_FORMAT(comp_est_dt, '%Y') ELSE NULL END AS comp_est_dt,\n CASE WHEN comp_dslv_dt_frmt=1 THEN DATE_FORMAT(comp_dslv_dt, '%d %b %Y') WHEN comp_dslv_dt_frmt=2 THEN DATE_FORMAT(comp_dslv_dt, '%b %Y')\n WHEN comp_dslv_dt_frmt=3 THEN DATE_FORMAT(comp_dslv_dt, '%Y') ELSE NULL END AS comp_dslv_dt\n FROM comp\n WHERE comp_id='{$comp_id}'"; $result = mysqli_query($link, $sql); if (!$result) { $error = 'Error acquiring company data: ' . mysqli_error($link); include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php'; exit; } $row = mysqli_fetch_array($result); if ($row['comp_sffx_num']) { $comp_sffx_rmn = ' (' . romannumeral($row['comp_sffx_num']) . ')'; } else { $comp_sffx_rmn = ''; } $pagetab = html($row['comp_nm'] . $comp_sffx_rmn); $pagetitle = html($row['comp_nm']); $comp_nm = html($row['comp_nm']); $comp_url = html($row['comp_url']); $comp_reg_nm = html($row['comp_reg_nm']); $comp_reg_adrs = preg_replace('/,,/', ', ', html($row['comp_reg_adrs'])); $comp_est_dt = html($row['comp_est_dt']); $comp_dslv_dt = html($row['comp_dslv_dt']); $sql = "SELECT comp_adrs, comp_adrs_ttl FROM compadrs WHERE compid='{$comp_id}' ORDER BY comp_adrs_ordr ASC"; $result = mysqli_query($link, $sql); if (!$result) { $error = 'Error acquiring company address data: ' . mysqli_error($link);
if (!$result) { $error = 'Error acquiring course data: ' . mysqli_error($link); include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php'; exit; } $row = mysqli_fetch_array($result); if ($row['comp_sffx_num']) { $crs_schl_sffx_num = $row['comp_sffx_num']; $crs_schl_sffx_rmn = ' (' . romannumeral($row['comp_sffx_num']) . ')'; } else { $crs_schl_sffx_num = ''; $crs_schl_sffx_rmn = ''; } if ($row['crs_sffx_num']) { $crs_sffx_num = $row['crs_sffx_num']; $crs_sffx_rmn = ' (' . romannumeral($row['crs_sffx_num']) . ')'; } else { $crs_sffx_num = ''; $crs_sffx_rmn = ''; } if ($row['crs_yr_strt'] !== $row['crs_yr_end']) { $crs_yr = $row['crs_yr_strt'] . preg_replace('/([0-9]{2})([0-9]{2})$/', '-$2', $row['crs_yr_end']); $crs_yr_strt = '<a href="/course/year/' . html($row['crs_yr_strt']) . '">' . html($row['crs_yr_strt']) . '</a>'; $crs_yr_end = '<a href="/course/year/' . html($row['crs_yr_end']) . '">' . html($row['crs_yr_end']) . '</a>'; } else { $crs_yr = $row['crs_yr_strt']; $crs_yr_strt = '<a href="/course/year/' . html($row['crs_yr_strt']) . '">' . html($row['crs_yr_strt']) . '</a>'; $crs_yr_end = ''; } $pagetab = html($row['comp_nm'] . $crs_schl_sffx_rmn . ': ' . $row['crs_typ_nm'] . ' (' . $crs_yr . ')' . $crs_sffx_rmn); $pagetitle = html($row['comp_nm']) . ':</br>' . html($row['crs_typ_nm'] . ' (' . $crs_yr . ')');
$rvw_crtc_errors++; $rvw_crtc_sffx_num = '0'; $rvw_crtc_sffx_err_arr[] = $rvw_crtc; $errors['rvw_crtc_sffx'] = '</br>**Review critic (person) suffix must be a positive integer (between 1 and 99 with no leading 0). Please amend: ' . html(implode(' / ', $rvw_crtc_sffx_err_arr)) . '**'; } $rvw_crtc = $rvw_crtc_no_sffx; } elseif (substr_count($rvw_crtc, '--') == 1) { $rvw_crtc_errors++; $rvw_crtc_sffx_num = '0'; $rvw_crtc_hyphn_err_arr[] = $rvw_crtc; $errors['rvw_crtc_hyphn'] = '</br>**Review critic (person) suffix assignation must use [--] in the correct format. Please amend: ' . html(implode(' / ', $rvw_crtc_hyphn_err_arr)) . '**'; } else { $rvw_crtc_sffx_num = '0'; } if ($rvw_crtc_sffx_num) { $rvw_crtc_sffx_rmn = ' (' . romannumeral($rvw_crtc_sffx_num) . ')'; } else { $rvw_crtc_sffx_rmn = ''; } if (substr_count($rvw_crtc, ';;') > 1) { $rvw_crtc_errors++; $rvw_crtc_smcln_excss_err_arr[] = $rvw_crtc; $errors['rvw_crtc_smcln_excss'] = '</br>**You may only use [;;] once per given-family name coupling. Please amend: ' . html(implode(' / ', $rvw_crtc_smcln_excss_err_arr)) . '.**'; } elseif (preg_match('/\\S+.*;;(.*\\S+)?/', $rvw_crtc)) { list($rvw_crtc_frst_nm, $rvw_crtc_lst_nm) = explode(';;', $rvw_crtc); $rvw_crtc_frst_nm = trim($rvw_crtc_frst_nm); $rvw_crtc_lst_nm = trim($rvw_crtc_lst_nm); if (preg_match('/\\S+/', $rvw_crtc_lst_nm)) { $rvw_crtc_lst_nm_dsply = ' ' . $rvw_crtc_lst_nm; } else { $rvw_crtc_lst_nm_dsply = '';
exit; } } if (isset($_POST['delete']) and $_POST['delete'] == 'Delete') { include $_SERVER['DOCUMENT_ROOT'] . '/includes/db.inc.php'; $lctn_id = cln($_POST['lctn_id']); $sql = "SELECT lctn_nm, lctn_sffx_num\n FROM lctn\n WHERE lctn_id='{$lctn_id}'"; $result = mysqli_query($link, $sql); if (!$result) { $error = 'Error acquiring location details: ' . mysqli_error($link); include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php'; exit; } $row = mysqli_fetch_array($result); if ($row['lctn_sffx_num']) { $lctn_sffx_rmn = ' (' . romannumeral($row['lctn_sffx_num']) . ')'; } else { $lctn_sffx_rmn = ''; } $lctn_nm_session = $row['lctn_nm'] . $lctn_sffx_rmn; $sql = "DELETE FROM prdsttng_lctn WHERE sttng_lctnid='{$lctn_id}'"; if (!mysqli_query($link, $sql)) { $error = 'Error deleting setting (location)-production associations: ' . mysqli_error($link); include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php'; exit; } $sql = "DELETE FROM prdsttng_lctn_alt WHERE sttng_lctnid='{$lctn_id}' OR sttng_lctn_altid='{$lctn_id}'"; if (!mysqli_query($link, $sql)) { $error = 'Error deleting location-alternate location (production) associations: ' . mysqli_error($link); include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php'; exit;
$wri_prsn_errors++; $wri_prsn_sffx_num = '0'; $wri_prsn_sffx_err_arr[] = $wri_prsn_nm; $errors['wri_prsn_sffx'] = '</br>**Writer (person) suffix must be a positive integer (between 1 and 99 with no leading 0). Please amend: ' . html(implode(' / ', $wri_prsn_sffx_err_arr)) . '**'; } $wri_prsn_nm = $wri_prsn_nm_no_sffx; } elseif (substr_count($wri_prsn_nm, '--') == 1) { $wri_prsn_errors++; $wri_prsn_sffx_num = '0'; $wri_prsn_hyphn_err_arr[] = $wri_prsn_nm; $errors['wri_prsn_hyphn'] = '</br>**Writer (person) suffix assignation must use [--] in the correct format. Please amend: ' . html(implode(' / ', $wri_prsn_hyphn_err_arr)) . '**'; } else { $wri_prsn_sffx_num = '0'; } if ($wri_prsn_sffx_num) { $wri_prsn_sffx_rmn = ' (' . romannumeral($wri_prsn_sffx_num) . ')'; } else { $wri_prsn_sffx_rmn = ''; } if (substr_count($wri_prsn_nm, ';;') > 1) { $wri_prsn_errors++; $wri_prsn_smcln_excss_err_arr[] = $wri_prsn_nm; $errors['wri_prsn_smcln_excss'] = '</br>**You may only use [;;] once per given-family name coupling. Please amend: ' . html(implode(' / ', $wri_prsn_smcln_excss_err_arr)) . '.**'; } elseif (preg_match('/\\S+.*;;(.*\\S+)?/', $wri_prsn_nm)) { list($wri_prsn_frst_nm, $wri_prsn_lst_nm) = explode(';;', $wri_prsn_nm); $wri_prsn_frst_nm = trim($wri_prsn_frst_nm); $wri_prsn_lst_nm = trim($wri_prsn_lst_nm); if (preg_match('/\\S+/', $wri_prsn_lst_nm)) { $wri_prsn_lst_nm_dsply = ' ' . $wri_prsn_lst_nm; } else { $wri_prsn_lst_nm_dsply = '';
} } if ($awrd_prsn_nm2) { $awrd_prsn_nm = trim($awrd_prsn_nm2); if (preg_match('/\\S+.*~~.*\\S+/', $awrd_prsn_nm2)) { list($awrd_prsn_nm, $awrd_prsn_rl) = explode('~~', $awrd_prsn_nm2); $awrd_prsn_nm = trim($awrd_prsn_nm); $awrd_prsn_rl = trim($awrd_prsn_rl); } else { $awrd_prsn_rl = ''; } if (preg_match('/^\\S+.*--[1-9][0-9]{0,1}$/', $awrd_prsn_nm)) { list($awrd_prsn_nm, $awrd_prsn_sffx_num) = explode('--', $awrd_prsn_nm); $awrd_prsn_nm = trim($awrd_prsn_nm); $awrd_prsn_sffx_num = trim($awrd_prsn_sffx_num); $awrd_prsn_sffx_rmn = ' (' . romannumeral($awrd_prsn_sffx_num) . ')'; } else { $awrd_prsn_sffx_num = '0'; $awrd_prsn_sffx_rmn = ''; } list($awrd_prsn_frst_nm, $awrd_prsn_lst_nm) = explode(';;', $awrd_prsn_nm); $awrd_prsn_frst_nm = trim($awrd_prsn_frst_nm); $awrd_prsn_lst_nm = trim($awrd_prsn_lst_nm); if (preg_match('/\\S+/', $awrd_prsn_lst_nm)) { $awrd_prsn_lst_nm_dsply = ' ' . $awrd_prsn_lst_nm; } else { $awrd_prsn_lst_nm_dsply = ''; } $awrd_prsn_fll_nm = $awrd_prsn_frst_nm . $awrd_prsn_lst_nm_dsply; $awrd_prsn_url = generateurl($awrd_prsn_fll_nm . $awrd_prsn_sffx_rmn); $sql = "SELECT 1 FROM prsn WHERE prsn_url='{$awrd_prsn_url}'";
exit; } } if (isset($_POST['delete']) and $_POST['delete'] == 'Delete') { include $_SERVER['DOCUMENT_ROOT'] . '/includes/db.inc.php'; $thtr_id = cln($_POST['thtr_id']); $sql = "SELECT thtr_fll_nm, thtr_sffx_num, thtr_tr_ov FROM thtr WHERE thtr_id='{$thtr_id}'"; $result = mysqli_query($link, $sql); if (!$result) { $error = 'Error acquiring theatre details: ' . mysqli_error($link); include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php'; exit; } $row = mysqli_fetch_array($result); if ($row['thtr_sffx_num']) { $thtr_sffx_rmn = ' (' . romannumeral($row['thtr_sffx_num']) . ')'; } else { $thtr_sffx_rmn = ''; } $thtr_session = $row['thtr_fll_nm'] . $thtr_sffx_rmn; $sql = "UPDATE prd SET thtrid=NULL WHERE thtrid='{$thtr_id}'"; if (!mysqli_query($link, $sql)) { $error = 'Error nullifying theatre-production associations: ' . mysqli_error($link); include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php'; exit; } $sql = "DELETE FROM thtrtyp WHERE thtrid='{$thtr_id}'"; if (!mysqli_query($link, $sql)) { $error = 'Error deleting theatre-type associations: ' . mysqli_error($link); include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php'; exit;
} $row = mysqli_fetch_array($result); $char_id = $row['char_id']; if (mysqli_num_rows($result) == 0) { include $_SERVER['DOCUMENT_ROOT'] . '/includes/404.html.php'; } else { $sql = "SELECT char_nm, char_sffx_num, char_sx, char_age_frm, char_age_to, char_dscr, char_amnt, char_mlti\n FROM role\n WHERE char_id='{$char_id}'"; $result = mysqli_query($link, $sql); if (!$result) { $error = 'Error acquiring character data: ' . mysqli_error($link); include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php'; exit; } $row = mysqli_fetch_array($result); if ($row['char_sffx_num']) { $char_sffx_rmn = ' (' . romannumeral($row['char_sffx_num']) . ')'; } else { $char_sffx_rmn = ''; } $pagetab = html($row['char_nm'] . $char_sffx_rmn); $pagetitle = html($row['char_nm']); $char_nm = html($row['char_nm']); if ($row['char_sx'] == '2') { $char_sx = 'Male'; } elseif ($row['char_sx'] == '3') { $char_sx = 'Female'; } elseif ($row['char_sx'] == '4') { $char_sx = 'Non-specific'; } else { $char_sx = NULL; }