/** * Output Event Update Submission Form * @since 2.1.0 * @version 2.2.1 * @return void */ function submit_update() { global $hc_cfg, $hc_captchas, $hc_lang_submit, $hc_lang_config, $hc_lang_core, $hc_time; if (isset($_GET['msg'])) { switch (cIn(strip_tags($_GET['msg']))) { case 1: feedback(1, $hc_lang_submit['Feed02']); echo ' <p>' . $hc_lang_submit['ThankYouUpdated'] . '</p> <p><a href="' . CalRoot . '/index.php?com=acc&sec=list">' . $hc_lang_submit['ClickEvents'] . '</a></p> <p><a href="' . CalRoot . '/index.php?com=submit">' . $hc_lang_submit['ClickSubmitAgain'] . '</a></p>'; return -1; break; } } $eID = $user_id = 0; $uID = isset($_SESSION['UserPkID']) && is_numeric($_SESSION['UserPkID']) ? $_SESSION['UserPkID'] : '0'; $series = $editString = $regProgress = $dateOutput = ''; $events = $dateString = array(); $editSingle = false; $startTimeHour = date($hc_time['format'], strtotime(SYSDATE . ' ' . SYSTIME)); $endTimeHour = date($hc_time['format'], strtotime(SYSDATE . ' ' . SYSTIME . ' +1 hour')); $startTimeMins = $endTimeMins = '00'; $startTimeAMPM = date("A", strtotime(SYSDATE . ' ' . SYSTIME)); $endTimeAMPM = date("A", strtotime(SYSDATE . ' ' . SYSTIME . ' +1 hour')); $user_net = $user_name = $user_email = $user_categories = ''; if (isset($_GET['eID']) && is_numeric($_GET['eID'])) { $editSingle = true; $eID = cIn($_GET['eID']); } else { if (isset($_GET['sID'])) { $series = cIn(strip_tags($_GET['sID'])); $resultS = doQuery("SELECT GROUP_CONCAT(DISTINCT PkID ORDER BY PkID SEPARATOR ',')\r\n\t\t\t\t\t\t\t\tFROM " . HC_TblPrefix . "events WHERE SeriesID = '" . $series . "'"); $events = explode(',', mysql_result($resultS, 0, 0)); $events = array_filter($events, 'is_numeric'); } elseif (isset($_POST['eventID'])) { $events = array_filter($_POST['eventID'], 'is_numeric'); } $eID = count($events) > 0 ? $events[0] : '0'; $editString = count($events) > 0 ? implode(',', $events) : 'NULL'; $resultS = doQuery("SELECT GROUP_CONCAT(StartDate ORDER BY StartDate SEPARATOR ',')\r\n\t\t\t\t\t\t\tFROM " . HC_TblPrefix . "events WHERE PkID IN (" . $editString . ")"); $dateString = hasRows($resultS) ? explode(',', mysql_result($resultS, 0, 0)) : array(); } $result = doQuery("SELECT e.*, l.PkID, l.Name, l.Address, l.Address2, l.City, l.State, l.Zip, l.Country, er.*, u.PkID, u.NetworkType, u.NetworkName, u.Email, u.Categories\r\n\t\t\t\t\t\tFROM " . HC_TblPrefix . "events e\r\n\t\t\t\t\t\t\tLEFT JOIN " . HC_TblPrefix . "locations l ON (e.LocID = l.PkID)\r\n\t\t\t\t\t\t\tLEFT JOIN " . HC_TblPrefix . "eventrsvps er ON (er.EventID = e.PkID)\r\n\t\t\t\t\t\t\tLEFT JOIN " . HC_TblPrefix . "users u ON (e.OwnerID = u.PkID)\r\n\t\t\t\t\t\tWHERE e.PkID = '" . $eID . "' AND e.IsActive = 1 AND e.OwnerID = '" . cIn($uID) . "'"); if (!hasRows($result) || $eID < 1 || mysql_result($result, 0, 0) < 1) { echo ' <p>' . $hc_lang_submit['EditWarning'] . '</p> <p><a href="' . CalRoot . '/index.php?com=acc&sec=list">' . $hc_lang_submit['ClickEvents'] . '</a></p> <p><a href="' . CalRoot . '/index.php?com=submit">' . $hc_lang_submit['ClickSubmitAgain'] . '</a></p>'; } else { $eventTitle = cOut(mysql_result($result, 0, 1)); $eventDesc = cOut(mysql_result($result, 0, 8)); $tbd = cOut(mysql_result($result, 0, 11)); $eventDate = stampToDate(mysql_result($result, 0, 9), $hc_cfg[24]); $contactName = cOut(mysql_result($result, 0, 13)); $contactEmail = cOut(mysql_result($result, 0, 14)); $contactPhone = cOut(mysql_result($result, 0, 15)); $contactURL = mysql_result($result, 0, 24) != '' ? cOut(mysql_result($result, 0, 24)) : ''; $views = cOut(mysql_result($result, 0, 26)); $imageURL = cOut(mysql_result($result, 0, 38)); $featured = cOut(mysql_result($result, 0, 40)); $expire = mysql_result($result, 0, 41) > 0 ? cOut(mysql_result($result, 0, 41)) : $hc_cfg[134]; $locID = cOut(mysql_result($result, 0, 33)); $locName = $locID == 0 ? cOut(mysql_result($result, 0, 2)) : cOut(mysql_result($result, 0, 43)); $locAddress = $locID == 0 ? cOut(mysql_result($result, 0, 3)) : cOut(mysql_result($result, 0, 44)); $locAddress2 = $locID == 0 ? cOut(mysql_result($result, 0, 4)) : cOut(mysql_result($result, 0, 45)); $locCity = $locID == 0 ? cOut(mysql_result($result, 0, 5)) : cOut(mysql_result($result, 0, 46)); $state = $locID == 0 ? cOut(mysql_result($result, 0, 6)) : cOut(mysql_result($result, 0, 47)); $locPostal = $locID == 0 ? cOut(mysql_result($result, 0, 7)) : cOut(mysql_result($result, 0, 48)); $locCountry = $locID == 0 ? cOut(mysql_result($result, 0, 35)) : cOut(mysql_result($result, 0, 49)); $cost = cOut(mysql_result($result, 0, 34)); $rsvp_type = cOut(mysql_result($result, 0, 51)); $rsvp_space = cOut(mysql_result($result, 0, 55)); $rsvp_disp = cOut(mysql_result($result, 0, 56)); $rsvp_notice = cOut(mysql_result($result, 0, 57)); $rsvp_open = stampToDate(mysql_result($result, 0, 53), $hc_cfg[24]); $rsvp_close = stampToDate(mysql_result($result, 0, 54), $hc_cfg[24]); $eventStatus = cOut(mysql_result($result, 0, 17)); $eventBillboard = cOut(mysql_result($result, 0, 18)); $message = cOut(mysql_result($result, 0, 27)); $user_id = cOut(mysql_result($result, 0, 58)); $user_net = cOut(mysql_result($result, 0, 59)); $user_name = cOut(mysql_result($result, 0, 60)); $user_email = cOut(mysql_result($result, 0, 61)); $user_categories = cOut(mysql_result($result, 0, 62)); switch ($user_net) { case 1: $user_net = 'twitter.png'; break; case 2: $user_net = 'facebook.png'; break; case 3: $user_net = 'google.png'; break; } if ($tbd == 0) { $startTimeHour = date($hc_time['format'], strtotime(mysql_result($result, 0, 9) . ' ' . mysql_result($result, 0, 10))); $startTimeMins = date("i", strtotime(mysql_result($result, 0, 9) . ' ' . mysql_result($result, 0, 10))); $startTimeAMPM = date("A", strtotime(mysql_result($result, 0, 9) . ' ' . mysql_result($result, 0, 10))); if (mysql_result($result, 0, 12) != '') { $endTimeHour = date($hc_time['format'], strtotime(mysql_result($result, 0, 9) . ' ' . mysql_result($result, 0, 12))); $endTimeMins = date("i", strtotime(mysql_result($result, 0, 9) . ' ' . mysql_result($result, 0, 12))); $endTimeAMPM = date("A", strtotime(mysql_result($result, 0, 9) . ' ' . mysql_result($result, 0, 12))); } else { $endTimeHour = date($hc_time['format'], strtotime(mysql_result($result, 0, 9) . ' ' . mysql_result($result, 0, 10) . ' +1 hour')); $endTimeAMPM = date("A", strtotime(mysql_result($result, 0, 9) . ' ' . mysql_result($result, 0, 10) . ' +1 hour')); $noEndTime = 1; } } $stime_disabled = $tbd > 0 ? ' disabled="disabled"' : ''; $etime_disabled = isset($noEndTime) || $tbd > 0 ? ' disabled="disabled"' : ''; echo ' <p>' . $hc_lang_submit['UpdateNotice'] . '</p> ' . ($_SESSION['UserLevel'] != 2 ? '<p>' . $hc_lang_submit['NotPublisher'] . '</p>' : '') . ' <p>(<span class="req2">*</span>) = ' . $hc_lang_submit['Required2'] . '<br /> (<span class="req3">*</span>) = ' . $hc_lang_submit['Required3'] . '</p> <form id="frmEventUpdate" name="frmEventUpdate" method="post" action="' . CalRoot . '/event-submit-update.php" onsubmit="return validate();"> <input type="hidden" name="eID" id="eID" value="' . $eID . '" /> <input type="hidden" name="editString" id="editString" value="' . $editString . '" /> <input type="hidden" id="locPreset" name="locPreset" value="' . $locID . '" /> <input type="hidden" id="locPresetName" name="locPresetName" value="' . $locName . '" />'; if ($editSingle == false) { echo ' <input type="hidden" name="grpDate" id="grpDate" value="' . stampToDate(min($dateString), $hc_cfg[24]) . ' - ' . stampToDate(max($dateString), $hc_cfg[24]) . '" />'; $cnt = 1; foreach ($dateString as $val) { $dateOutput .= $cnt % 8 == 0 ? stampToDate($val, $hc_cfg[24]) . '<br />' : stampToDate($val, $hc_cfg[24]) . ', '; ++$cnt; } } if ($hc_cfg[65] > 0 && in_array(1, $hc_captchas)) { echo ' <fieldset> <legend>' . $hc_lang_core['CapLegend'] . '</legend>'; buildCaptcha(); echo ' </fieldset>'; } echo ' <fieldset> <legend>' . $hc_lang_submit['ContactInfo'] . '</legend> <label for="submitName">' . $hc_lang_submit['Name'] . '</label> <span class="output submit_user"> <img src="' . CalRoot . '/img/share/' . $user_net . '" width="16" height="16" alt="" /> ' . $user_name . ' <input name="submitName" id="submitName" type="hidden" value="' . $user_name . '" /> </span> <label for="submitEmail">' . $hc_lang_submit['Email'] . '</label> <span class="output submit_user"> ' . $user_email . ' <input name="submitEmail" id="submitEmail" type="hidden" value="' . $user_email . '" /> </span> <input name="submitID" id="submitID" type="hidden" value="' . $user_id . '" /> </fieldset> <fieldset> <legend>' . $hc_lang_submit['EventDetails'] . '</legend> <label for="eventTitle">' . $hc_lang_submit['Title'] . '</label> <input name="eventTitle" id="eventTitle" type="text" size="65" maxlength="150" required="required" placeholder="' . $hc_lang_submit['PlaceTitle'] . '" value="' . $eventTitle . '" /> <label for="eventDescription">' . $hc_lang_submit['Description'] . '</label> <textarea name="eventDescription" id="eventDescription" rows="20" placeholder="' . $hc_lang_submit['PlaceDesc'] . '" class="mce_edit">' . $eventDesc . '</textarea> <label for="cost">' . $hc_lang_submit['Cost'] . '</label> <input name="cost" id="cost" type="text" size="25" maxlength="50" placeholder="' . $hc_lang_submit['PlaceCost'] . '" value="' . $cost . '" /> </fieldset> <fieldset> <legend>' . $hc_lang_submit['DateTime'] . '</legend> ' . ($editSingle == true ? '<label for="eventDate">' . $hc_lang_submit['EventDate'] . '</label> <input name="eventDate" id="eventDate" type="text" size="12" maxlength="10" required="required" value="' . $eventDate . '" /> <a href="javascript:;" onclick="calx.select(document.getElementById(\'eventDate\'),\'cal1\',\'' . $hc_cfg[51] . '\');return false;" id="cal1" class="ds calendar" tabindex="-1"></a>' : '<label for="eventDate">' . $hc_lang_submit['Dates'] . '</label> <span class="output">' . $dateOutput . '</span>') . ' <label>' . $hc_lang_submit['StartTime'] . '</label> <input name="startTimeHour" id="startTimeHour" type="text" size="2" maxlength="2" required="required" value="' . $startTimeHour . '"' . $stime_disabled . ' /> <span class="frm_ctrls"> <a href="javascript:;" onclick="chngClock(document.getElementById(\'startTimeHour\'),1,' . $hc_time['input'] . ')" class="time tup" tabindex="-1"></a> <a href="javascript:;" onclick="chngClock(document.getElementById(\'startTimeHour\'),-1,' . $hc_time['input'] . ')" class="time tdown" tabindex="-1"></a> </span> <input name="startTimeMins" id="startTimeMins" type="text" size="2" maxlength="2" required="required" value="' . $startTimeMins . '"' . $stime_disabled . ' /> <span class="frm_ctrls"> <a href="javascript:;" onclick="chngClock(document.getElementById(\'startTimeMins\'),5,59)" class="time tup" tabindex="-1"></a> <a href="javascript:;" onclick="chngClock(document.getElementById(\'startTimeMins\'),-5,59)" class="time tdown" tabindex="-1"></a> </span>'; if ($hc_time['input'] == 12) { echo ' <select name="startTimeAMPM" id="startTimeAMPM"> <option ' . ($startTimeAMPM == 'AM' ? 'selected="selected" ' : '') . 'value="AM">' . $hc_lang_submit['AM'] . '</option> <option ' . ($startTimeAMPM == 'PM' ? 'selected="selected" ' : '') . 'value="PM">' . $hc_lang_submit['PM'] . '</option> </select>'; } echo ' <label>' . $hc_lang_submit['EndTime'] . '</label> <input name="endTimeHour" id="endTimeHour" type="text" size="2" maxlength="2" required="required" value="' . $endTimeHour . '"' . $etime_disabled . ' /> <span class="frm_ctrls"> <a href="javascript:;" onclick="chngClock(document.getElementById(\'endTimeHour\'),1,' . $hc_time['input'] . ')" class="time tup" tabindex="-1"></a> <a href="javascript:;" onclick="chngClock(document.getElementById(\'endTimeHour\'),-1,' . $hc_time['input'] . ')" class="time tdown" tabindex="-1"></a> </span> <input name="endTimeMins" id="endTimeMins" type="text" size="2" maxlength="2" required="required" value="' . $endTimeMins . '"' . $etime_disabled . ' /> <span class="frm_ctrls"> <a href="javascript:;" onclick="chngClock(document.getElementById(\'endTimeMins\'),5,59)" class="time tup" tabindex="-1"></a> <a href="javascript:;" onclick="chngClock(document.getElementById(\'endTimeMins\'),-5,59)" class="time tdown" tabindex="-1"></a> </span>'; if ($hc_time['input'] == 12) { echo ' <select name="endTimeAMPM" id="endTimeAMPM"> <option ' . ($endTimeAMPM == 'AM' ? 'selected="selected" ' : '') . 'value="AM">' . $hc_lang_submit['AM'] . '</option> <option ' . ($endTimeAMPM == 'PM' ? 'selected="selected" ' : '') . 'value="PM">' . $hc_lang_submit['PM'] . '</option> </select>'; } echo ' <span class="frm_ctrls"> <label for="ignoreendtime"><input name="ignoreendtime" id="ignoreendtime" type="checkbox"' . (isset($noEndTime) ? ' checked="checked"' : '') . $stime_disabled . ' onclick="togEndTime(this.checked);" />' . $hc_lang_submit['NoEndTime'] . '</label> </span> <label class="blank"> </label> <span class="frm_ctrls"> <label for="overridetime"><input type="checkbox" name="overridetime" id="overridetime"' . ($tbd > 0 ? ' checked="checked"' : '') . ' onclick="togOverride();" />' . $hc_lang_submit['Override'] . '</label> <label for="specialtimeall"><input type="radio" name="specialtime" id="specialtimeall" value="allday"' . ($tbd == 0 ? ' disabled="disabled"' : '') . ($tbd < 2 ? ' checked="checked"' : '') . ' />' . $hc_lang_submit['AllDay'] . '</label> </span> </fieldset> ' . ($hc_cfg['IsRSVP'] == 1 ? ' <fieldset> <legend>' . $hc_lang_submit['RegTitle'] . '</legend> <label for="rsvp_type">' . $hc_lang_submit['Registration'] . '</label> <select name="rsvp_type" id="rsvp_type" onchange="togRegistration();"> <option ' . ($rsvp_type == 0 ? 'selected="selected" ' : '') . 'value="0">' . $hc_lang_submit['Reg0'] . '</option> <option ' . ($rsvp_type == 1 ? 'selected="selected" ' : '') . 'value="1">' . $hc_lang_submit['Reg1'] . '</option> </select> <div id="rsvp"' . ($rsvp_type != 1 ? ' style="display:none;"' : '') . '> <label for="rsvp_space">' . $hc_lang_submit['Limit'] . '</label> <input name="rsvp_space" id="rsvp_space" type="number" min="0" max="9999" size="5" maxlength="4" value="' . $rsvp_space . '"' . ($rsvp_type != 1 ? ' disabled="disabled"' : '') . ' required="required" /> <span class="output">' . $hc_lang_submit['LimitLabel'] . '</span> <label>' . $hc_lang_submit['Allow'] . '</label> <input name="openDate" id="openDate" type="text" size="12" maxlength="10" value="' . $rsvp_open . '"' . ($rsvp_type != 1 ? ' disabled="disabled"' : '') . ' required="required" /> <a href="javascript:;" onclick="calx.select(document.getElementById(\'openDate\'),\'cal3\',\'' . $hc_cfg[51] . '\');return false;" id="cal3" class="ds calendar" tabindex="-1"></a> <span class="output"> ' . $hc_lang_submit['To'] . ' </span> <input name="closeDate" id="closeDate" type="text" size="12" maxlength="10" value="' . $rsvp_close . '"' . ($rsvp_type != 1 ? ' disabled="disabled"' : '') . ' required="required" /> <a href="javascript:;" onclick="calx.select(document.getElementById(\'closeDate\'),\'cal4\',\'' . $hc_cfg[51] . '\');return false;" id="cal4" class="ds calendar" tabindex="-1"></a> ' . (isset($_SESSION['UserLoggedIn']) && $_SESSION['UserLoggedIn'] == 1 ? ' <label for="rsvpEmail">' . $hc_lang_submit['EmailNotice'] . '</label> <select name="rsvpEmail" id="rsvpEmail"> <option value="0">' . $hc_lang_submit['EmailNotice0'] . '</option> <option value="1">' . $hc_lang_submit['EmailNotice1'] . '</option> </select> <label> </label><span class="output onote">' . $hc_lang_submit['RSVPDownload'] . '</span>' : '<input type="hidden" name="rsvpEmail" id="rsvpEmail" value="1" /><label> </label><span class="output onote">' . $hc_lang_submit['RSVPDownloadNo'] . '</span>') . ' </div> </fieldset>' : ' <input type="hidden" name="rsvp_type" id="rsvp_type" value="0" />'); if ($hc_cfg[29] == 1) { $uQuery = $user_categories != '' ? " AND c.PkID IN (" . $user_categories . ")" : ""; echo ' <fieldset> <legend>' . $hc_lang_submit['EventCat'] . '</legend> <label>' . $hc_lang_submit['Categories'] . '</label>'; $query = $eID > 0 ? "SELECT c.PkID, c.CategoryName, c.ParentID, c.CategoryName as Sort, ec.EventID as Selected\r\n\t\t\t\t\tFROM " . HC_TblPrefix . "categories c\r\n\t\t\t\t\t\tLEFT JOIN " . HC_TblPrefix . "eventcategories ec ON (c.PkID = ec.CategoryID AND ec.EventID = " . cIn($eID) . ")\r\n\t\t\t\t\tWHERE c.ParentID = 0 AND c.IsActive = 1" . $uQuery . "\r\n\t\t\t\t\tGROUP BY c.PkID, c.CategoryName, c.ParentID, ec.EventID\r\n\t\t\t\t\tUNION\r\n\t\t\t\t\tSELECT c.PkID, c.CategoryName, c.ParentID, c2.CategoryName as Sort, ec.EventID as Selected\r\n\t\t\t\t\tFROM " . HC_TblPrefix . "categories c\r\n\t\t\t\t\t\tLEFT JOIN " . HC_TblPrefix . "categories c2 ON (c.ParentID = c2.PkID)\r\n\t\t\t\t\t\tLEFT JOIN " . HC_TblPrefix . "eventcategories ec ON (c.PkID = ec.CategoryID AND ec.EventID = " . cIn($eID) . ")\r\n\t\t\t\t\tWHERE c.ParentID > 0 AND c.IsActive = 1" . $uQuery . "\r\n\t\t\t\t\tGROUP BY c.PkID, c.CategoryName, c.ParentID, c2.CategoryName, ec.EventID\r\n\t\t\t\t\tORDER BY Sort, ParentID, CategoryName" : NULL; getCategories('frmEventUpdate', $hc_cfg['CatCols'], $query, $hc_cfg['CatLinks']); echo ' </fieldset>'; } echo ' <fieldset> <legend>' . $hc_lang_submit['LocationLabel'] . '</legend>'; echo $locID > 0 ? ' <div id="locSetting" class="frm_ctrl"> <label>' . $hc_lang_submit['CurLocation'] . '</label> <span class="output"> <b>' . $locName . '</b><br /> ' . buildAddress($locAddress, $locAddress2, $locCity, $state, $locPostal, $locCountry, $hc_lang_config['AddressType']) . ' </span> <label> </label> <span class="output"> <a href="javascript:;" onclick="setLocation(0,\'\',1);" class="locChange">' . $hc_lang_submit['ChngLocation'] . '</a> </span> </div>' : ''; echo ' <div id="locSearch" ' . ($locID > 0 ? ' style="display:none;"' : '') . '>'; location_select(); $inputs = array(1 => array('City', 'locCity', $locCity), 2 => array('Postal', 'locZip', $locPostal)); $first = $hc_lang_config['AddressType'] == 1 ? 1 : 2; $second = $first == 1 ? 2 : 1; echo ' </div> <div id="custom"' . ($locID > 0 ? ' style="display:none;"' : '') . '> <label for="locName">' . $hc_lang_submit['Name'] . '</label> <input name="locName" id="locName" type="text" size="25" maxlength="50" value="' . ($locID < 1 ? $locName : '') . '" /> <label for="locAddress">' . $hc_lang_submit['Address'] . '</label> <input name="locAddress" id="locAddress" type="text" size="30" maxlength="75" value="' . ($locID < 1 ? $locAddress : '') . '" /><span class="output req2">*</span> <label for="locAddress2">' . $hc_lang_submit['Address2'] . '</label> <input name="locAddress2" id="locAddress2" type="text" size="25" maxlength="75" value="' . ($locID < 1 ? $locAddress2 : '') . '" /> <label for="' . $inputs[$first][1] . '">' . $hc_lang_submit[$inputs[$first][0]] . '</label> <input name="' . $inputs[$first][1] . '" id="' . $inputs[$first][1] . '" type="text" size="20" maxlength="50" value="' . ($locID < 1 ? $inputs[$first][2] : '') . '" /><span class="output req2">*</span>'; if ($hc_lang_config['AddressRegion'] != 0) { echo '<label for="locState">' . $hc_lang_config['RegionLabel'] . '</label>'; $regSelect = $state; include HCLANG . '/' . $hc_lang_config['RegionFile']; echo '<span class="output req2">*</span>'; } echo '<label for="' . $inputs[$second][1] . '">' . $hc_lang_submit[$inputs[$second][0]] . '</label> <input name="' . $inputs[$second][1] . '" id="' . $inputs[$second][1] . '" type="text" size="20" maxlength="50" value="' . ($locID < 1 ? $inputs[$second][2] : '') . '" /><span class="output req2">*</span> <label for="locCountry">' . $hc_lang_submit['Country'] . '</label> <input name="locCountry" id="locCountry" type="text" size="10" maxlength="50" value="' . ($locID < 1 ? $locCountry : '') . '" /> </div> <div id="custom_notice" style="display:none;"> <label> </label> <b>' . $hc_lang_core['PresetLoc'] . '</b> </div> </fieldset> <fieldset> <legend>' . $hc_lang_submit['ContactLabel'] . '</legend> <label for="contactName">' . $hc_lang_submit['Name'] . '</label> <input name="contactName" id="contactName" type="text" size="20" maxlength="50" placeholder="' . $hc_lang_submit['PlaceContactName'] . '" value="' . $contactName . '" /><span class="output req3">*</span> <label for="contactEmail">' . $hc_lang_submit['Email'] . '</label> <input name="contactEmail" id="contactEmail" type="text" size="30" maxlength="75" placeholder="' . $hc_lang_submit['PlaceContactEmail'] . '" value="' . $contactEmail . '" /><span class="output req3">*</span> <label for="contactPhone">' . $hc_lang_submit['Phone'] . '</label> <input name="contactPhone" id="contactPhone" type="tel" size="20" maxlength="25" placeholder="' . $hc_lang_submit['PlaceContactPhone'] . '" value="' . $contactPhone . '" /> <label for="contactURL">' . $hc_lang_submit['Website'] . '</label> <input name="contactURL" id="contactURL" type="url" maxlength="100" placeholder="' . $hc_lang_submit['PlaceContactURL'] . '" value="' . $contactURL . '" /> </fieldset> <fieldset> <legend>' . $hc_lang_submit['MessageLabel'] . '</legend> <label for="goadminmessage">' . $hc_lang_submit['Include'] . '</label> <input name="goadminmessage" id="goadminmessage" type="checkbox" value="" onclick="togThis(this,document.getElementById(\'adminmessage\'));"' . ($message != '' ? ' checked="checked"' : '') . ' /> <label for="adminmessage">' . $hc_lang_submit['Message'] . '</label> <textarea name="adminmessage" id="adminmessage" rows="7" required="required" placeholder="' . $hc_lang_submit['PlaceMsgAdmin'] . '"' . ($message == '' ? ' disabled="disabled"' : '') . ' >' . $message . '</textarea> </fieldset> <input name="submit" id="submit" type="submit" value="' . $hc_lang_submit['SubmitEvent'] . '" /> </form> <div id="dsCal"></div>'; makeTinyMCE('', 0, 0, 'eventDescription'); } }
function sr_forms_news_signup() { global $hc_cfg, $hc_lang_config, $hc_lang_news, $hc_captchas, $hc_lang_core; if (isset($_GET['d'])) { $g = cIn(strip_tags($_GET['d'])); $result = doQuery("SELECT PkID FROM " . HC_TblPrefix . "subscribers WHERE GUID = '" . $g . "' AND GUID != '' AND IsConfirm = 1"); if (!hasRows($result)) { return 0; } echo ' <p>' . $hc_lang_news['DeleteNotice'] . '</p> <form name="frmEventNewsletter" id="frmEventNewsletter" method="post" action="' . CalRoot . '/news-edit.php"> <input name="dID" id="dID" type="hidden" value="' . $g . '" /> <div class="newsTools"><input type="submit" name="submit" id="submit" value="' . $hc_lang_news['CancelReg'] . '" /></div> </form>'; return 0; } $t = isset($_GET['t']) && is_numeric($_GET['t']) ? cIn(strip_tags($_GET['t'])) : 0; if (isset($hc_lang_news['ThankYou' . $t])) { echo $hc_lang_news['ThankYou' . $t]; return 0; } $submit = $hc_lang_news['SubmitReg']; $uID = $occupation = 0; $format = 2; $firstname = $lastname = $email = $zipcode = $birthyear = $gender = $refer = $yrOpts = ''; $query = NULL; $g = isset($_GET['u']) && $_GET['u'] != '' ? cIn(strip_tags($_GET['u'])) : ''; $result = doQuery("SELECT * FROM " . HC_TblPrefix . "subscribers WHERE GUID = '" . $g . "' AND GUID != '' AND IsConfirm = 1"); $notice = $hc_lang_news['SubInstruct']; if (hasRows($result)) { $notice = $hc_lang_news['SubInstruct2']; $submit = $hc_lang_news['UpdateReg']; $uID = mysql_result($result, 0, 0); $firstname = mysql_result($result, 0, 1); $lastname = mysql_result($result, 0, 2); $email = mysql_result($result, 0, 3); $occupation = mysql_result($result, 0, 4); $zipcode = mysql_result($result, 0, 5); $addedby = mysql_result($result, 0, 8); $birthyear = mysql_result($result, 0, 11); $gender = mysql_result($result, 0, 12); $refer = mysql_result($result, 0, 13); $format = mysql_result($result, 0, 14); $query = "SELECT c.PkID, c.CategoryName, c.ParentID, c.CategoryName as Sort, uc.UserID as Selected\r\n FROM " . HC_TblPrefix . "categories c\r\n LEFT JOIN " . HC_TblPrefix . "categories c2 ON (c.PkID = c2.PkID)\r\n LEFT JOIN " . HC_TblPrefix . "eventcategories ec ON (c.PkID = ec.CategoryID)\r\n LEFT JOIN " . HC_TblPrefix . "subscriberscategories uc ON (uc.CategoryID = c.PkID AND uc.UserID = '" . $uID . "')\r\n WHERE c.ParentID = 0 AND c.IsActive = 1\r\n GROUP BY c.PkID, c.CategoryName, c.ParentID, uc.UserID\r\n UNION\r\n SELECT c.PkID, c.CategoryName, c.ParentID, c2.CategoryName as Sort, uc.UserID as Selected\r\n FROM " . HC_TblPrefix . "categories c\r\n LEFT JOIN " . HC_TblPrefix . "categories c2 ON (c.ParentID = c2.PkID)\r\n LEFT JOIN " . HC_TblPrefix . "eventcategories ec ON (c.PkID = ec.CategoryID)\r\n LEFT JOIN " . HC_TblPrefix . "subscriberscategories uc ON (uc.CategoryID = c.PkID AND uc.UserID = '" . cIn($uID) . "')\r\n WHERE c.ParentID > 0 AND c.IsActive = 1\r\n GROUP BY c.PkID, c.CategoryName, c.ParentID, c2.CategoryName, uc.UserID\r\n ORDER BY Sort, ParentID, CategoryName"; } if (isset($_GET['msg'])) { switch ($_GET['msg']) { case "1": feedback(2, $hc_lang_news['Feed04']); break; } } $yearSU = date("Y") - 14; for ($x = 0; $x <= 80; $x++) { $yrOpts .= '<option' . ($yearSU == $birthyear ? ' selected="selected"' : '') . ' value="' . $yearSU . '">' . $yearSU . '</option>'; --$yearSU; } echo ' ' . $notice . ' <form name="frmEventNewsletter" id="frmEventNewsletter" method="post" action="' . CalRoot . '/news-signup.php" onsubmit="return validate();"> <input name="uID" id="uID" type="hidden" value="' . $uID . '" /> <input name="gID" id="gID" type="hidden" value="' . $g . '" />'; if ($hc_cfg[65] > 0 && in_array(4, $hc_captchas)) { echo ' <fieldset> <legend>' . $hc_lang_core['CapLegend'] . '</legend>'; buildCaptcha(); echo ' </fieldset>'; } echo ' <fieldset> <legend>' . $hc_lang_news['Subscriber'] . '</legend> <label for="hc_f1">' . $hc_lang_news['FName'] . '</label> <input name="hc_f1" id="hc_f1" type="text" size="20" maxlength="50" placeholder="' . $hc_lang_news['PlaceFName'] . '" value="' . $firstname . '" required="required" /> <label for="hc_f2">' . $hc_lang_news['LName'] . '</label> <input name="hc_f2" id="hc_f2" type="text" size="30" maxlength="50" placeholder="' . $hc_lang_news['PlaceLName'] . '" value="' . $lastname . '" required="required" /> <label for="hc_f3">' . $hc_lang_news['Email'] . '</label>' . ($email == '' ? '<input name="hc_f3" id="hc_f3" type="email" size="45" maxlength="75" placeholder="' . $hc_lang_news['PlaceEmail'] . '" value="' . $email . '" required="required" />' : ' <span class="output">' . $email . '</span> <input type="hidden" name="hc_f3" id="hc_f3" value="' . $email . '" />') . ' <label for="hc_fa">' . $hc_lang_news['Birth'] . '</label> <select name="hc_fa" id="hc_fa"> <option value="0">' . $hc_lang_news['Birth0'] . '</option> ' . $yrOpts . ' </select> <label for="occupation">' . $hc_lang_news['Occupation'] . '</label> '; include HCLANG . '/' . $hc_lang_config['OccupationFile']; echo ' <label for="hc_fb">' . $hc_lang_news['Gender'] . '</label> <select name="hc_fb" id="hc_fb"> <option value="0">' . $hc_lang_news['Gender0'] . '</option> <option' . ($gender == 1 ? ' selected="selected"' : '') . ' value="1">' . $hc_lang_news['GenderF'] . '</option> <option' . ($gender == 2 ? ' selected="selected"' : '') . ' value="2">' . $hc_lang_news['GenderM'] . '</option> </select> <label for="hc_fc">' . $hc_lang_news['Referral'] . '</label> <select name="hc_fc" id="hc_fc"> <option value="0">' . $hc_lang_news['Referral0'] . '</option> <option' . ($refer == 1 ? ' selected="selected"' : '') . ' value="1">' . $hc_lang_news['Referral1'] . '</option> <option' . ($refer == 2 ? ' selected="selected"' : '') . ' value="2">' . $hc_lang_news['Referral2'] . '</option> <option' . ($refer == 3 ? ' selected="selected"' : '') . ' value="3">' . $hc_lang_news['Referral3'] . '</option> <option' . ($refer == 4 ? ' selected="selected"' : '') . ' value="4">' . $hc_lang_news['Referral4'] . '</option> <option' . ($refer == 5 ? ' selected="selected"' : '') . ' value="5">' . $hc_lang_news['Referral5'] . '</option> <option' . ($refer == 6 ? ' selected="selected"' : '') . ' value="6">' . $hc_lang_news['Referral6'] . '</option> <option' . ($refer == 7 ? ' selected="selected"' : '') . ' value="7">' . $hc_lang_news['Referral7'] . '</option> </select> <label for="hc_f4">' . $hc_lang_news['Postal'] . '</label> <input name="hc_f4" id="hc_f4" type="text" size="12" maxlength="10" placeholder="' . $hc_lang_news['PlacePostal'] . '" value="' . $zipcode . '" /> </fieldset> <fieldset> <legend>' . $hc_lang_news['Subscription'] . '</legend> <label class="blank"> </label> <span class="output">' . $hc_lang_news['CategoriesLabel'] . '</span> <label>' . $hc_lang_news['Categories'] . '</label>'; sr_shared_getCategories('frmEventNewsletter', $hc_cfg['CatCols'], $query); echo ' <label for="format">' . $hc_lang_news['LinkFormat'] . '</label> <select name="format" id="format"> <option' . ($format == 0 ? ' selected="selected"' : '') . ' value="0">' . $hc_lang_news['LinkFormat0'] . '</option> <option' . ($format == 1 ? ' selected="selected"' : '') . ' value="1">' . $hc_lang_news['LinkFormat1'] . '</option> <option' . ($format == 2 ? ' selected="selected"' : '') . ' value="2">' . $hc_lang_news['LinkFormat2'] . '</option> </select> </fieldset>'; $result = doQuery("SELECT mg.PkID, mg.Name, mg.Description, sg.UserID\r\n FROM " . HC_TblPrefix . "mailgroups mg\r\n LEFT JOIN " . HC_TblPrefix . "subscribersgroups sg ON (mg.PkID = sg.GroupID AND sg.UserID = '" . $uID . "')\r\n WHERE mg.IsActive = 1 AND mg.PkID > 1 AND mg.IsPublic = 1\r\n ORDER BY Name"); if (hasRows($result)) { echo ' <fieldset class="frm_grp"> <legend>' . $hc_lang_news['GroupLabel'] . '</legend> <label for="grpID_1"><input disabled="disabled" checked="checked" name="grpID[]" id="grpID_1" type="checkbox" value="1" /><b>' . $hc_lang_news['GenericNews'] . '</b><p>' . $hc_lang_news['GenericNewsDesc'] . '</p></label>'; $cnt = 0; while ($row = mysql_fetch_row($result)) { $hl = $cnt % 2 == 0 ? ' class="hl"' : ''; echo ' <label for="grpID_' . $row[0] . '"' . $hl . '><input name="grpID[]" id="grpID_' . $row[0] . '" type="checkbox" value="' . $row[0] . '"' . ($row[3] == $uID && $uID > 0 ? ' checked="checked"' : '') . '/>' . cOut('<b>' . $row[1] . '</b><p>' . $row[2]) . '</p></label>'; ++$cnt; } echo ' </fieldset>'; } echo ' <div class="newsTools"><input type="submit" class="btn btn-primary" name="submit" id="submit" value="' . $submit . '" /></div> </form>'; }
feedback(1, $hc_lang_login['Feed04']); break; case "5": feedback(2, $hc_lang_login['Feed05']); break; case "6": feedback(2, $hc_lang_login['Feed06']); break; } } if ($lp == 1) { echo ' <form name="frm" id="frm" method="post" action="' . AdminRoot . '/components/LostPasswordAction.php" onsubmit="return valid_request();">'; set_form_token(); if ($hc_cfg[65] > 0) { buildCaptcha(1); } echo ' <label for="email">' . $hc_lang_login['Username'] . '</label> <input name="email" id="email" type="email" maxlength="100" value="" required="required" autofocus="autofocus" /> <label> </label><input name="submit" id="submit" type="submit" value="' . $hc_lang_login['Button2'] . '" /> </form>'; } elseif ($lp == 2 && $k != '' && hasRows($result)) { if (isset($_GET['msg']) && $_GET['msg'] == '1') { feedback(2, $hc_lang_login['Feed06']); } echo ' <form name="frm" id="frm" method="post" action="' . AdminRoot . '/components/ResetPassword.php" onsubmit="return valid_reset();"> ' . ($hc_cfg[91] == 1 ? '<label> </label><span>' . $hc_lang_login['PasswordReq'] . '</span>' : ''); set_form_token(); echo '