Exemplo n.º 1
0
     include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
     exit;
 }
 $sql = "DELETE FROM rel_thm WHERE rel_thm1='{$thm_id}'";
 if (!mysqli_query($link, $sql)) {
     $error = 'Error deleting theme-related theme associations: ' . mysqli_error($link);
     include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
     exit;
 }
 if (preg_match('/\\S+/', $rel_thm_list)) {
     $rel_thm_nms = explode(',,', $rel_thm_list);
     $n = 0;
     foreach ($rel_thm_nms as $rel_thm_nm) {
         $rel_thm_ordr = ++$n;
         $rel_thm_url = generateurl($rel_thm_nm);
         $rel_thm_alph = alph($rel_thm_nm);
         $sql = "SELECT 1 FROM thm WHERE thm_url='{$rel_thm_url}'";
         $result = mysqli_query($link, $sql);
         if (!$result) {
             $error = 'Error checking for existence of theme: ' . mysqli_error($link);
             include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
             exit;
         }
         if (mysqli_num_rows($result) == 0) {
             $sql = "INSERT INTO thm(thm_nm, thm_alph, thm_url)\n                  VALUES('{$rel_thm_nm}', CASE WHEN '{$rel_thm_alph}'!='' THEN '{$rel_thm_alph}' END, '{$rel_thm_url}')";
             if (!mysqli_query($link, $sql)) {
                 $error = 'Error adding theme data: ' . mysqli_error($link);
                 include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
                 exit;
             }
         }
Exemplo n.º 2
0
 if (preg_match('/\\S+/', $lcnsr_comp_nm_rl)) {
     list($lcnsr_comp_nm, $lcnsr_comp_rl) = explode('::', $lcnsr_comp_nm_rl);
     $lcnsr_comp_nm = trim($lcnsr_comp_nm);
     $lcnsr_comp_rl = trim($lcnsr_comp_rl);
     if (preg_match('/^\\S+.*--[1-9][0-9]{0,1}$/', $lcnsr_comp_nm)) {
         list($lcnsr_comp_nm, $lcnsr_comp_sffx_num) = explode('--', $lcnsr_comp_nm);
         $lcnsr_comp_nm = trim($lcnsr_comp_nm);
         $lcnsr_comp_sffx_num = trim($lcnsr_comp_sffx_num);
         $lcnsr_comp_sffx_rmn = ' (' . romannumeral($lcnsr_comp_sffx_num) . ')';
     } else {
         $lcnsr_comp_sffx_num = '0';
         $lcnsr_comp_sffx_rmn = '';
     }
     $lcnsr_ordr = ++$n;
     $lcnsr_comp_url = generateurl($lcnsr_comp_nm . $lcnsr_comp_sffx_rmn);
     $lcnsr_comp_alph = alph($lcnsr_comp_nm);
     $sql = "SELECT 1 FROM comp WHERE comp_url='{$lcnsr_comp_url}'";
     $result = mysqli_query($link, $sql);
     if (!$result) {
         $error = 'Error checking for existence of licensor (company): ' . mysqli_error($link);
         include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
         exit;
     }
     if (mysqli_num_rows($result) == 0) {
         $sql = "INSERT INTO comp(comp_nm, comp_alph, comp_sffx_num, comp_url, comp_bool)\n                    VALUES('{$lcnsr_comp_nm}', CASE WHEN '{$lcnsr_comp_alph}'!='' THEN '{$lcnsr_comp_alph}' END, '{$lcnsr_comp_sffx_num}', '{$lcnsr_comp_url}', 1, 0, 0)";
         if (!mysqli_query($link, $sql)) {
             $error = 'Error adding licensor (company) data: ' . mysqli_error($link);
             include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
             exit;
         }
     }
Exemplo n.º 3
0
$crs_list = cln($_POST['crs_list']);
$rvw_list = cln($_POST['rvw_list']);
$alt_nm_list = cln($_POST['alt_nm_list']);
$pt = NULL;
$coll_wrks = NULL;
$prd_nm_session = $_POST['prd_nm'];
$errors = array();
if (!preg_match('/\\S+/', $prd_nm)) {
    $errors['prd_nm'] = '**You must enter a production name.**';
} elseif (strlen($prd_nm) > 255) {
    $errors['prd_nm'] = '**Production name is allowed a maximum of 255 characters.**';
} elseif (preg_match('/,,/', $prd_nm)) {
    $errors['prd_nm'] = '**Production name cannot include the following [,,].**';
} else {
    $prd_url = generateurl($prd_nm);
    $prd_alph = alph($prd_nm);
}
if (preg_match('/\\S+/', $prd_sbnm)) {
    if (strlen($prd_sbnm) > 255) {
        $errors['prd_sbnm_excss_lngth'] = '</br>**Production sub-name is allowed a maximum of 255 characters.**';
    }
}
include $_SERVER['DOCUMENT_ROOT'] . '/includes/includes_indexes/prd_pt_vldtn.inc.php';
//FILE COMPRISES: sbnm / mat_list / txt_vrsn_list / ctgry_list / gnr_list / ftr_list / thm_list / sttng_list / wri_list / alt_nm_list
if (preg_match('/\\S+/', $pt_list)) {
    if ($tr_lg) {
        $errors['pt_tr_lg_chckd'] = '**This field must be empty if tour leg button is applied.**';
    } else {
        $pt_nm_yrs = explode(',,', $_POST['pt_list']);
        if (count($pt_nm_yrs) > 250) {
            $errors['pt_list_array_excss'] = '**Maximum of 250 entries allowed.**';
Exemplo n.º 4
0
    include 'editform.html.php';
    exit;
}
if (isset($_POST['edit']) and $_POST['edit'] == 'Submit') {
    include $_SERVER['DOCUMENT_ROOT'] . '/includes/db.inc.php';
    $awrds_id = cln($_POST['awrds_id']);
    $awrds_nm = trim(cln($_POST['awrds_nm']));
    $awrds_session = $_POST['awrds_nm'];
    $errors = array();
    if (!preg_match('/\\S+/', $awrds_nm)) {
        $errors['awrds_nm'] = '**You must enter an awards name.**';
    } elseif (strlen($awrds_nm) > 255) {
        $errors['awrds_nm'] = '</br>**Awards name is allowed a maximum of 255 characters.**';
    } else {
        $awrds_url = generateurl($awrds_nm);
        $awrds_alph = alph($awrds_nm);
        $sql = "SELECT awrds_id, awrds_nm FROM awrds WHERE awrds_url='{$awrds_url}'";
        $result = mysqli_query($link, $sql);
        if (!$result) {
            $error = 'Error checking for existing awards URL: ' . mysqli_error($link);
            include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
            exit;
        }
        $row = mysqli_fetch_array($result);
        if (mysqli_num_rows($result) > 0 && $row['awrds_id'] !== $awrds_id) {
            $errors['awrds_nm'] = '</br>**Duplicate URL exists for: ' . html($row['awrds_nm']) . '. You must keep the original name or assign an awards name without an existing URL.**';
        }
    }
    if (count($errors) > 0) {
        include $_SERVER['DOCUMENT_ROOT'] . '/includes/db.inc.php';
        $awrds_id = cln($_POST['awrds_id']);
Exemplo n.º 5
0
     list($cdntr_comp_sb_rl, $cdntr_comp_nm) = explode('~~', $cdntr_comp_nm);
     $cdntr_comp_sb_rl = trim($cdntr_comp_sb_rl);
     $cdntr_comp_nm = trim($cdntr_comp_nm);
 } else {
     $cdntr_comp_sb_rl = '';
 }
 if (preg_match('/^\\S+.*--[1-9][0-9]{0,1}$/', $cdntr_comp_nm)) {
     list($cdntr_comp_nm, $cdntr_comp_sffx_num) = explode('--', $cdntr_comp_nm);
     $cdntr_comp_nm = trim($cdntr_comp_nm);
     $cdntr_comp_sffx_num = trim($cdntr_comp_sffx_num);
     $cdntr_comp_sffx_rmn = ' (' . romannumeral($cdntr_comp_sffx_num) . ')';
 } else {
     $cdntr_comp_sffx_num = '0';
     $cdntr_comp_sffx_rmn = '';
 }
 $cdntr_comp_alph = alph($cdntr_comp_alph);
 $cdntr_comp_url = generateurl($cdntr_comp_nm . $cdntr_comp_sffx_rmn);
 $cdntr_ordr = ++$o;
 $sql = "SELECT 1 FROM comp WHERE comp_url='{$cdntr_comp_url}'";
 $result = mysqli_query($link, $sql);
 if (!$result) {
     $error = 'Error checking for existence of coordinator (company): ' . mysqli_error($link);
     include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
     exit;
 }
 if (mysqli_num_rows($result) == 0) {
     $sql = "INSERT INTO comp(comp_nm, comp_alph, comp_sffx_num, comp_url, comp_bool, comp_dslv, comp_nm_exp)\n                        VALUES('{$cdntr_comp_nm}', CASE WHEN '{$cdntr_comp_alph}'!='' THEN '{$cdntr_comp_alph}' END, '{$cdntr_comp_sffx_num}', '{$cdntr_comp_url}', 1, 0, 0)";
     if (!mysqli_query($link, $sql)) {
         $error = 'Error adding coordinator (company) data: ' . mysqli_error($link);
         include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
         exit;
Exemplo n.º 6
0
     $mat_sffx_num = '0';
     $mat_sffx_rmn = '';
     $mat_sffx_rmn_session = '';
 } elseif (preg_match('/^[1-9][0-9]{0,1}$/', $mat_sffx_num)) {
     $mat_sffx_rmn = ' (' . romannumeral($mat_sffx_num) . ')';
     $mat_sffx_rmn_session = ' (' . romannumeral($_POST['mat_sffx_num']) . ')';
 } else {
     $errors['mat_sffx'] = '**The suffix must be a valid integer between 1 and 99 (with no leading 0) or left blank (or as 0).**';
     $mat_sffx_rmn = '';
     $mat_sffx_rmn_session = '';
 }
 $mat_url = generateurl($mat_nm . $mat_sffx_rmn);
 if (strlen($mat_nm) > 255 || strlen($mat_url) > 255) {
     $errors['mat_nm_excss_lngth'] = '</br>**Material name and its URL are allowed a maximum of 255 characters each.**';
 }
 $mat_alph = alph($mat_nm);
 if (!preg_match('/\\S+/', $frmt_nm)) {
     $errors['frmt_nm'] = '**You must enter a format name.**';
 } elseif (strlen($frmt_nm) > 255) {
     $errors['frmt_nm'] = '</br>**Format name is allowed a maximum of 255 characters.**';
 } elseif (preg_match('/--/', $frmt_nm) || preg_match('/;;/', $frmt_nm) || preg_match('/::/', $frmt_nm) || preg_match('/,,/', $frmt_nm)) {
     $errors['frmt_nm'] = '**Format name cannot include any of the following: [--], [;;], [::], [,,].**';
 } else {
     $frmt_url = generateurl($frmt_nm);
     $sql = "SELECT frmt_nm FROM frmt WHERE NOT EXISTS (SELECT 1 FROM frmt WHERE frmt_nm='{$frmt_nm}') AND frmt_url='{$frmt_url}'";
     $result = mysqli_query($link, $sql);
     if (!$result) {
         $error = 'Error checking for existing course-type URL: ' . mysqli_error($link);
         include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
         exit;
     }
Exemplo n.º 7
0
 if (preg_match('/\\S+/', $agnt_comp_nm_rl)) {
     list($agnt_comp_nm, $agnt_comp_rl) = explode('::', $agnt_comp_nm_rl);
     $agnt_comp_nm = trim($agnt_comp_nm);
     $agnt_comp_rl = trim($agnt_comp_rl);
     if (preg_match('/^\\S+.*--[1-9][0-9]{0,1}$/', $agnt_comp_nm)) {
         list($agnt_comp_nm, $agnt_comp_sffx_num) = explode('--', $agnt_comp_nm);
         $agnt_comp_nm = trim($agnt_comp_nm);
         $agnt_comp_sffx_num = trim($agnt_comp_sffx_num);
         $agnt_comp_sffx_rmn = ' (' . romannumeral($agnt_comp_sffx_num) . ')';
     } else {
         $agnt_comp_sffx_num = '0';
         $agnt_comp_sffx_rmn = '';
     }
     $agnt_ordr = ++$n;
     $agnt_comp_url = generateurl($agnt_comp_nm . $agnt_comp_sffx_rmn);
     $agnt_comp_alph = alph($agnt_comp_nm);
     $sql = "SELECT 1 FROM comp WHERE comp_url='{$agnt_comp_url}'";
     $result = mysqli_query($link, $sql);
     if (!$result) {
         $error = 'Error checking for existence of agency (company): ' . mysqli_error($link);
         include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
         exit;
     }
     if (mysqli_num_rows($result) == 0) {
         $sql = "INSERT INTO comp(comp_nm, comp_alph, comp_sffx_num, comp_url, comp_bool, comp_dslv, comp_nm_exp)\n                    VALUES('{$agnt_comp_nm}', CASE WHEN '{$agnt_comp_alph}'!='' THEN '{$agnt_comp_alph}' END, '{$agnt_comp_sffx_num}', '{$agnt_comp_url}', 1, 0, 0)";
         if (!mysqli_query($link, $sql)) {
             $error = 'Error adding agency (company) data: ' . mysqli_error($link);
             include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
             exit;
         }
     }
Exemplo n.º 8
0
}
if (isset($_POST['edit']) and $_POST['edit'] == 'Submit') {
    include $_SERVER['DOCUMENT_ROOT'] . '/includes/db.inc.php';
    $awrd_ctgry_id = cln($_POST['awrd_ctgry_id']);
    $awrd_ctgry_nm = trim(cln($_POST['awrd_ctgry_nm']));
    $awrd_ctgry_session = $_POST['awrd_ctgry_nm'];
    $errors = array();
    if (!preg_match('/\\S+/', $awrd_ctgry_nm)) {
        $errors['awrd_ctgry_nm'] = '**You must enter an award category name.**';
    } elseif (strlen($awrd_ctgry_nm) > 255) {
        $errors['awrd_ctgry_nm'] = '</br>**Award category name is allowed a maximum of 255 characters.**';
    } elseif (preg_match('/@@/', $awrd_ctgry_nm) || preg_match('/==/', $awrd_ctgry_nm) || preg_match('/;;/', $awrd_ctgry_nm)) {
        $errors['awrd_ctgry_nm'] = '**Award category cannot include any of the following: [@@], [==], [;;].**';
    } else {
        $awrd_ctgry_url = generateurl($awrd_ctgry_nm);
        $awrd_ctgry_alph = alph($awrd_ctgry_nm);
        $sql = "SELECT awrd_ctgry_id, awrd_ctgry_nm FROM awrd_ctgry WHERE awrd_ctgry_url='{$awrd_ctgry_url}'";
        $result = mysqli_query($link, $sql);
        if (!$result) {
            $error = 'Error checking for existing award category URL: ' . mysqli_error($link);
            include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
            exit;
        }
        $row = mysqli_fetch_array($result);
        if (mysqli_num_rows($result) > 0 && $row['awrd_ctgry_id'] !== $awrd_ctgry_id) {
            $errors['awrd_ctgry_nm'] = '</br>**Duplicate URL exists for: ' . html($row['awrd_ctgry_nm']) . '. You must keep the original name or assign an award category name without an existing URL.**';
        }
    }
    if (count($errors) > 0) {
        include $_SERVER['DOCUMENT_ROOT'] . '/includes/db.inc.php';
        $awrd_ctgry_id = cln($_POST['awrd_ctgry_id']);
Exemplo n.º 9
0
    include 'editform.html.php';
    exit;
}
if (isset($_POST['edit']) and $_POST['edit'] == 'Submit') {
    include $_SERVER['DOCUMENT_ROOT'] . '/includes/db.inc.php';
    $fstvl_id = cln($_POST['fstvl_id']);
    $fstvl_nm = trim(cln($_POST['fstvl_nm']));
    $fstvl_url = generateurl($fstvl_nm);
    $fstvl_nm_session = $_POST['fstvl_nm'];
    $errors = array();
    if (!preg_match('/\\S+/', $fstvl_nm)) {
        $errors['fstvl_nm'] = '**You must enter a festival name.**';
    } elseif (strlen($fstvl_nm) > 255) {
        $errors['fstvl_nm'] = '</br>**Festival name is allowed a maximum of 255 characters.**';
    } else {
        $fstvl_alph = alph($fstvl_nm);
        $sql = "SELECT fstvl_id, fstvl_nm FROM fstvl WHERE fstvl_url='{$fstvl_url}'";
        $result = mysqli_query($link, $sql);
        if (!$result) {
            $error = 'Error checking for existing festival URL: ' . mysqli_error($link);
            include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
            exit;
        }
        $row = mysqli_fetch_array($result);
        if (mysqli_num_rows($result) > 0 && $row['fstvl_id'] !== $fstvl_id) {
            $errors['fstvl_url'] = '</br>**Duplicate URL exists for: ' . html($row['fstvl_nm']) . '. You must keep the original name or assign a festival name without an existing URL.**';
        }
    }
    if (count($errors) > 0) {
        include $_SERVER['DOCUMENT_ROOT'] . '/includes/db.inc.php';
        $fstvl_id = cln($_POST['fstvl_id']);
Exemplo n.º 10
0
     $awrd_comp_nm = trim($awrd_comp_nm);
     $awrd_comp_rl = trim($awrd_comp_rl);
 } else {
     $awrd_comp_rl = '';
 }
 if (preg_match('/^\\S+.*--[1-9][0-9]{0,1}$/', $awrd_comp_nm)) {
     list($awrd_comp_nm, $awrd_comp_sffx_num) = explode('--', $awrd_comp_nm);
     $awrd_comp_nm = trim($awrd_comp_nm);
     $awrd_comp_sffx_num = trim($awrd_comp_sffx_num);
     $awrd_comp_sffx_rmn = ' (' . romannumeral($awrd_comp_sffx_num) . ')';
 } else {
     $awrd_comp_sffx_num = '0';
     $awrd_comp_sffx_rmn = '';
 }
 $awrd_comp_url = generateurl($awrd_comp_nm . $awrd_comp_sffx_rmn);
 $awrd_comp_alph = alph($awrd_comp_nm);
 $sql = "SELECT 1 FROM comp WHERE comp_url='{$awrd_comp_url}'";
 $result = mysqli_query($link, $sql);
 if (!$result) {
     $error = 'Error checking for existence of nominee/winner (company): ' . mysqli_error($link);
     include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
     exit;
 }
 if (mysqli_num_rows($result) == 0) {
     $sql = "INSERT INTO comp(comp_nm, comp_alph, comp_sffx_num, comp_url, comp_bool, comp_dslv, comp_nm_exp)\n                          VALUES('{$awrd_comp_nm}', CASE WHEN '{$awrd_comp_alph}'!='' THEN '{$awrd_comp_alph}' END, '{$awrd_comp_sffx_num}', '{$awrd_comp_url}', 1, 0, 0)";
     if (!mysqli_query($link, $sql)) {
         $error = 'Error adding nominee/winner (company) data: ' . mysqli_error($link);
         include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
         exit;
     }
 }
Exemplo n.º 11
0
 } else {
     $prvsad_thtr_lctn = NULL;
     $prvsad_thtr_lctn_dsply = '';
 }
 if (preg_match('/\\S+.*;;.*\\S+/', $prvsad_thtr_nm)) {
     list($prvsad_thtr_nm, $prvsad_sbthtr_nm) = explode(';;', $prvsad_thtr_nm);
     $prvsad_thtr_nm = trim($prvsad_thtr_nm);
     $prvsad_sbthtr_nm = trim($prvsad_sbthtr_nm);
     $prvsad_sbthtr_nm_dsply = ': ' . $prvsad_sbthtr_nm;
 } else {
     $prvsad_sbthtr_nm = NULL;
     $prvsad_sbthtr_nm_dsply = '';
 }
 $prvsad_thtr_fll_nm = $prvsad_thtr_nm . $prvsad_sbthtr_nm_dsply . $prvsad_thtr_lctn_dsply;
 $prvsad_thtr_url = generateurl($prvsad_thtr_fll_nm . $prvsad_thtr_sffx_rmn);
 $prvsad_thtr_alph = alph($prvsad_thtr_fll_nm);
 $sql = "SELECT 1 FROM thtr WHERE thtr_url='{$prvsad_thtr_url}'";
 $result = mysqli_query($link, $sql);
 if (!$result) {
     $error = 'Error checking for existence of theatre (against previously located theatre): ' . mysqli_error($link);
     include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
     exit;
 }
 if (mysqli_num_rows($result) == 0) {
     $sql = "INSERT INTO thtr(thtr_nm, sbthtr_nm, thtr_lctn, thtr_fll_nm, thtr_alph, thtr_sffx_num, thtr_url, thtr_clsd, thtr_nm_exp, thtr_tr_ov)\n                  VALUES('{$prvsad_thtr_nm}', '{$prvsad_sbthtr_nm}', '{$prvsad_thtr_lctn}', '{$prvsad_thtr_fll_nm}', CASE WHEN '{$prvsad_thtr_alph}'!='' THEN '{$prvsad_thtr_alph}' END, '{$prvsad_thtr_sffx_num}', '{$prvsad_thtr_url}', 0, 0, 0)";
     if (!mysqli_query($link, $sql)) {
         $error = 'Error adding previous address theatre data: ' . mysqli_error($link);
         include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
         exit;
     }
 }
Exemplo n.º 12
0
 list($rvw_pub_crtc_nm, $rvw_dt) = explode('##', $rvw_pub_crtc_nm_dt);
 $rvw_dt = preg_replace('/([0-9]{2})-([0-9]{2})-([0-9]{4})/', "\$3-\$2-\$1", $rvw_dt);
 list($rvw_pub_nm, $rvw_crtc_nm) = explode('||', $rvw_pub_crtc_nm);
 $rvw_pub_nm = trim($rvw_pub_nm);
 $rvw_crtc_nm = trim($rvw_crtc_nm);
 if (preg_match('/^\\S+.*--[1-9][0-9]{0,1}$/', $rvw_pub_nm)) {
     list($rvw_pub_nm, $rvw_pub_sffx_num) = explode('--', $rvw_pub_nm);
     $rvw_pub_nm = trim($rvw_pub_nm);
     $rvw_pub_sffx_num = trim($rvw_pub_sffx_num);
     $rvw_pub_sffx_rmn = ' (' . romannumeral($rvw_pub_sffx_num) . ')';
 } else {
     $rvw_pub_sffx_num = '0';
     $rvw_pub_sffx_rmn = '';
 }
 $rvw_pub_url = generateurl($rvw_pub_nm . $rvw_pub_sffx_rmn);
 $rvw_pub_alph = alph($rvw_pub_nm);
 if (preg_match('/^\\S+.*--[1-9][0-9]{0,1}$/', $rvw_crtc_nm)) {
     list($rvw_crtc_nm, $rvw_crtc_sffx_num) = explode('--', $rvw_crtc_nm);
     $rvw_crtc_nm = trim($rvw_crtc_nm);
     $rvw_crtc_sffx_num = trim($rvw_crtc_sffx_num);
     $rvw_crtc_sffx_rmn = ' (' . romannumeral($rvw_crtc_sffx_num) . ')';
 } else {
     $rvw_crtc_sffx_num = '0';
     $rvw_crtc_sffx_rmn = '';
 }
 list($rvw_crtc_frst_nm, $rvw_crtc_lst_nm) = explode(';;', $rvw_crtc_nm);
 $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 {
Exemplo n.º 13
0
    exit;
}
if (isset($_POST['edit']) and $_POST['edit'] == 'Submit') {
    include $_SERVER['DOCUMENT_ROOT'] . '/includes/db.inc.php';
    $ssn_id = cln($_POST['ssn_id']);
    $ssn_nm = trim(cln($_POST['ssn_nm']));
    $ssn_url = generateurl($ssn_nm);
    $ssn_nm_session = $_POST['ssn_nm'];
    $errors = array();
    if (!preg_match('/\\S+/', $ssn_nm)) {
        $errors['ssn_nm'] = '**You must enter a season name.**';
    }
    if (strlen($ssn_nm) > 255) {
        $errors['ssn_nm'] = '</br>**Season name is allowed a maximum of 255 characters.**';
    } else {
        $ssn_alph = alph($ssn_nm);
        $sql = "SELECT ssn_id, ssn_nm FROM ssn WHERE ssn_url='{$ssn_url}'";
        $result = mysqli_query($link, $sql);
        if (!$result) {
            $error = 'Error checking for existing season URL: ' . mysqli_error($link);
            include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
            exit;
        }
        $row = mysqli_fetch_array($result);
        if (mysqli_num_rows($result) > 0 && $row['ssn_id'] !== $ssn_id) {
            $errors['ssn_url'] = '</br>**Duplicate URL exists for: ' . html($row['ssn_nm']) . '. You must keep the original name or assign a season name without an existing URL.**';
        }
    }
    if (count($errors) > 0) {
        include $_SERVER['DOCUMENT_ROOT'] . '/includes/db.inc.php';
        $ssn_id = cln($_POST['ssn_id']);
Exemplo n.º 14
0
     include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
     exit;
 }
 $sql = "DELETE FROM rel_tm WHERE rel_tm1='{$tm_id}'";
 if (!mysqli_query($link, $sql)) {
     $error = 'Error deleting time-related time associations: ' . mysqli_error($link);
     include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
     exit;
 }
 if (preg_match('/\\S+/', $rel_tm_list)) {
     $rel_tm_nms = explode(',,', $rel_tm_list);
     $n = 0;
     foreach ($rel_tm_nms as $rel_tm_nm) {
         $rel_tm_ordr = ++$n;
         $rel_tm_url = generateurl($rel_tm_nm);
         $rel_tm_alph = alph($rel_tm_nm);
         $sql = "SELECT 1 FROM tm WHERE tm_url='{$rel_tm_url}'";
         $result = mysqli_query($link, $sql);
         if (!$result) {
             $error = 'Error checking for existence of time: ' . mysqli_error($link);
             include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
             exit;
         }
         if (mysqli_num_rows($result) == 0) {
             $sql = "INSERT INTO tm(tm_nm, tm_alph, tm_url, tm_frm_dt_bce, tm_to_dt_bce, tm_rcr)\n                  VALUES('{$rel_tm_nm}', CASE WHEN '{$rel_tm_alph}'!='' THEN '{$rel_tm_alph}' END, '{$rel_tm_url}', 0, 0, 0)";
             if (!mysqli_query($link, $sql)) {
                 $error = 'Error adding time data: ' . mysqli_error($link);
                 include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
                 exit;
             }
         }
Exemplo n.º 15
0
     $lctn_prvs_sg = '1';
     $prvs_lctn_nm = trim($prvs_lctn_nm);
 } else {
     $lctn_prvs_sg = '0';
 }
 if (preg_match('/^\\S+.*--[1-9][0-9]{0,1}$/', $prvs_lctn_nm)) {
     list($prvs_lctn_nm, $prvs_lctn_sffx_num) = explode('--', $prvs_lctn_nm);
     $prvs_lctn_nm = trim($prvs_lctn_nm);
     $prvs_lctn_sffx_num = trim($prvs_lctn_sffx_num);
     $prvs_lctn_sffx_rmn = ' (' . romannumeral($prvs_lctn_sffx_num) . ')';
 } else {
     $prvs_lctn_nm = trim($prvs_lctn_nm);
     $prvs_lctn_sffx_rmn = '';
 }
 $prvs_lctn_url = generateurl($prvs_lctn_nm . $prvs_lctn_sffx_rmn);
 $prvs_lctn_alph = alph($prvs_lctn_nm);
 $sql = "SELECT 1 FROM lctn WHERE lctn_url='{$prvs_lctn_url}'";
 $result = mysqli_query($link, $sql);
 if (!$result) {
     $error = 'Error checking for existence of location: ' . mysqli_error($link);
     include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
     exit;
 }
 if (mysqli_num_rows($result) == 0) {
     $sql = "INSERT INTO lctn(lctn_nm, lctn_alph, lctn_sffx_num, lctn_url, lctn_exp, lctn_fctn)\n                VALUES('{$prvs_lctn_nm}', CASE WHEN '{$prvs_lctn_alph}'!='' THEN '{$prvs_lctn_alph}' END, '{$prvs_lctn_sffx_num}', '{$prvs_lctn_url}', '{$prvs_lctn_exp}', 0)";
     if (!mysqli_query($link, $sql)) {
         $error = 'Error adding location data: ' . mysqli_error($link);
         include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
         exit;
     }
 }
Exemplo n.º 16
0
     list($comp_lctn_nm, $comp_lctn_alt_list) = explode('||', $comp_lctn_nm);
     $comp_lctn_nm = trim($comp_lctn_nm);
     $comp_lctn_alt_list = trim($comp_lctn_alt_list);
 } else {
     $comp_lctn_alt_list = '';
 }
 if (preg_match('/^\\S+.*--[1-9][0-9]{0,1}$/', $comp_lctn_nm)) {
     list($comp_lctn_nm, $comp_lctn_sffx_num) = explode('--', $comp_lctn_nm);
     $comp_lctn_nm = trim($comp_lctn_nm);
     $comp_lctn_sffx_num = trim($comp_lctn_sffx_num);
     $comp_lctn_sffx_rmn = ' (' . romannumeral($comp_lctn_sffx_num) . ')';
 } else {
     $comp_lctn_sffx_num = '0';
     $comp_lctn_sffx_rmn = '';
 }
 $comp_lctn_alph = alph($comp_lctn_nm);
 $comp_lctn_ordr = ++$n;
 $sql = "SELECT 1 FROM lctn WHERE lctn_url='{$comp_lctn_url}'";
 $result = mysqli_query($link, $sql);
 if (!$result) {
     $error = 'Error checking for existence of place of origin: ' . mysqli_error($link);
     include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
     exit;
 }
 if (mysqli_num_rows($result) == 0) {
     $sql = "INSERT INTO lctn(lctn_nm, lctn_alph, lctn_sffx_num, lctn_url, lctn_exp, lctn_fctn)\n                  VALUES('{$comp_lctn_nm}', CASE WHEN '{$comp_lctn_alph}'!='' THEN '{$comp_lctn_alph}' END, '{$comp_lctn_sffx_num}', '{$comp_lctn_url}', 0, 0)";
     if (!mysqli_query($link, $sql)) {
         $error = 'Error adding (company) location data: ' . mysqli_error($link);
         include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
         exit;
     }
Exemplo n.º 17
0
     $org_lctn_nm = trim($org_lctn_nm);
     $org_lctn_alt_list = trim($org_lctn_alt_list);
 } else {
     $org_lctn_alt_list = '';
 }
 if (preg_match('/^\\S+.*--[1-9][0-9]{0,1}$/', $org_lctn_nm)) {
     list($org_lctn_nm, $org_lctn_sffx_num) = explode('--', $org_lctn_nm);
     $org_lctn_nm = trim($org_lctn_nm);
     $org_lctn_sffx_num = trim($org_lctn_sffx_num);
     $org_lctn_sffx_rmn = ' (' . romannumeral($org_lctn_sffx_num) . ')';
 } else {
     $org_lctn_sffx_num = '0';
     $org_lctn_sffx_rmn = '';
 }
 $org_lctn_url = generateurl($org_lctn_nm . $org_lctn_sffx_rmn);
 $org_lctn_alph = alph($org_lctn_nm);
 $org_lctn_ordr = ++$n;
 $sql = "SELECT 1 FROM lctn WHERE lctn_url='{$org_lctn_url}'";
 $result = mysqli_query($link, $sql);
 if (!$result) {
     $error = 'Error checking for existence of place of origin: ' . mysqli_error($link);
     include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
     exit;
 }
 if (mysqli_num_rows($result) == 0) {
     $sql = "INSERT INTO lctn(lctn_nm, lctn_alph, lctn_sffx_num, lctn_url, lctn_exp, lctn_fctn)\n                VALUES('{$org_lctn_nm}', CASE WHEN '{$org_lctn_alph}'!='' THEN '{$org_lctn_alph}' END, '{$org_lctn_sffx_num}', '{$org_lctn_url}', 0, 0)";
     if (!mysqli_query($link, $sql)) {
         $error = 'Error adding place of origin data: ' . mysqli_error($link);
         include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php';
         exit;
     }