Exemplo n.º 1
0
		<label for="eventHide">' . $hc_lang_event['Expire'] . '</label>
		<input name="eventHide" id="eventHide" type="number" min="1" max="999" size="4" maxlength="3" value="' . $expire . '" required="required" />
		<span class="output">' . $hc_lang_event['Days'] . '</span>
		<label>' . $hc_lang_event['Categories'] . '</label>';
$query = $eID > 0 ? "SELECT c.PkID, c.CategoryName, c.ParentID, c.CategoryName as Sort, ec.EventID as Selected\r\n\t\t\tFROM " . HC_TblPrefix . "categories c\r\n\t\t\t\tLEFT JOIN " . HC_TblPrefix . "eventcategories ec ON (c.PkID = ec.CategoryID AND ec.EventID = " . cIn($eID) . ")\r\n\t\t\tWHERE c.ParentID = 0 AND c.IsActive = 1\r\n\t\t\tGROUP BY c.PkID, c.CategoryName, c.ParentID, ec.EventID\r\n\t\t\tUNION\r\n\t\t\tSELECT c.PkID, c.CategoryName, c.ParentID, c2.CategoryName as Sort, ec.EventID as Selected\r\n\t\t\tFROM " . HC_TblPrefix . "categories c\r\n\t\t\t\tLEFT JOIN " . HC_TblPrefix . "categories c2 ON (c.ParentID = c2.PkID)\r\n\t\t\t\tLEFT JOIN " . HC_TblPrefix . "eventcategories ec ON (c.PkID = ec.CategoryID AND ec.EventID = " . cIn($eID) . ")\r\n\t\t\tWHERE c.ParentID > 0 AND c.IsActive = 1\r\n\t\t\tGROUP BY c.PkID, c.CategoryName, c.ParentID, c2.CategoryName, ec.EventID\r\n\t\t\tORDER BY Sort, ParentID, CategoryName" : NULL;
getCategories('frmEventAdd', 3, $query, 1);
echo '
	</fieldset>
	<fieldset>
		<legend>' . $hc_lang_event['Location'] . '</legend>';
echo $locID > 0 ? '
		<div id="locSetting" class="frm_ctrl">
			<label>' . $hc_lang_event['CurLocation'] . '</label>
			<span class="output">
				<b>' . $locName . '</b><br />
				' . buildAddress($locAddress, $locAddress2, $locCity, $state, $locPostal, $locCountry, $hc_lang_config['AddressType']) . '
			</span>
			<label>&nbsp;</label>
			<span class="output">
				<a href="javascript:;" onclick="setLocation(0,\'\',1);" class="locChange">' . $hc_lang_event['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;"' : '') . '>
Exemplo n.º 2
0
$po = isset($_GET['po']) && is_numeric($_GET['po']) ? cIn(strip_tags($_GET['po'])) : 1;
$eo = isset($_GET['eo']) && is_numeric($_GET['eo']) ? cIn(strip_tags($_GET['eo'])) : 0;
if ($locName != '') {
    if ($eo == 0) {
        $pQuery = $po == 0 ? '' : ' AND IsPublic = 1';
        $result = doQuery("SELECT PkID, Name, Address, Address2, City, State, Zip, Country, Lat, Lon\r\n\t\t\t\t\t\t\tFROM " . HC_TblPrefix . "locations\r\n\t\t\t\t\t\t\tWHERE NAME LIKE('%" . $locName . "%')" . $pQuery . " AND IsActive = 1\r\n\t\t\t\t\t\t\tORDER BY Name LIMIT " . $resLimit . " OFFSET " . $resOffset * $resLimit);
        $resultP = doQuery("SELECT COUNT(PkID) FROM " . HC_TblPrefix . "locations WHERE NAME LIKE('%" . cIn($locName) . "%')" . $pQuery . " AND IsActive = 1");
    } else {
        $result = doQuery("SELECT DISTINCT(l.PkID), l.Name, l.Address, l.Address2, l.City, l.State, l.Zip, l.Country, l.Lat, l.Lon\r\n\t\t\t\t\t\t\tFROM " . HC_TblPrefix . "locations l\r\n\t\t\t\t\t\t\t\tLEFT JOIN " . HC_TblPrefix . "events e ON (e.LocID = l.PkID)\r\n\t\t\t\t\t\t\tWHERE l.NAME LIKE('%" . $locName . "%') AND l.IsActive = 1\r\n\t\t\t\t\t\t\t\tAND e.IsActive = 1 AND e.IsApproved = 1 AND e.StartDate >= '" . date("Y-m-d") . "'\r\n\t\t\t\t\t\t\tORDER BY Name LIMIT " . $resLimit . " OFFSET " . $resOffset * $resLimit);
        $resultP = doQuery("SELECT COUNT(DISTINCT(l.PkID)) FROM " . HC_TblPrefix . "locations l LEFT JOIN " . HC_TblPrefix . "events e ON (e.LocID = l.PkID) WHERE NAME LIKE('%" . $locName . "%') AND l.IsPublic = 1 AND l.IsActive = 1 AND e.IsActive = 1 AND e.IsApproved = 1 AND e.StartDate >= '" . date("Y-m-d") . "'");
    }
}
if (isset($result) && hasRows($result)) {
    $x = 0;
    while ($row = mysql_fetch_row($result)) {
        $locAddress = buildAddress(htmlentities($row[3], ENT_QUOTES), htmlentities($row[2], ENT_QUOTES), htmlentities($row[4], ENT_QUOTES), htmlentities($row[5], ENT_QUOTES), htmlentities($row[6], ENT_QUOTES), htmlentities($row[7], ENT_QUOTES), $hc_lang_config['AddressType']);
        $locAddress = str_replace('<br />', ',&nbsp;', $locAddress);
        $hl = $x % 2 == 0 ? ' class="hl_frm"' : '';
        echo '
				<label' . $hl . ' for="locValue_' . $row[0] . '"><input name="locValue" id="locValue_' . $row[0] . '" type="radio" onclick="setLocation(' . $row[0] . ',\'' . htmlentities(str_replace('\'', '\\\'', $row[1]), ENT_QUOTES) . '\', 1);" />';
        echo $hc_cfg[52] != '' && ($row[8] != '' && $row[9] != '') ? '<a href="' . $hc_cfg[52] . 'maps?q=' . $row[8] . ',' . $row[9] . '" target="_blank"><img src="' . CalRoot . '/img/icons/map.png" width="16" height="16" class="pull-left" alt="' . $hc_lang_search['Map'] . '" /></a>' : '';
        echo $po == 0 && isset($_SESSION['AdminLoggedIn']) ? '<a href="' . AdminRoot . '/index.php?com=addlocation&amp;lID=' . $row[0] . '" target="_blank"><img src="' . AdminRoot . '/img/icons/edit.png" width="16" height="16" alt=""  /></a>' : '';
        echo '
				<span class="loc_name">' . htmlentities($row[1], ENT_QUOTES) . '</span>
				<span class="loc_add">' . $locAddress . '</span></label>';
        ++$x;
    }
    $pages = ceil(mysql_result($resultP, 0, 0) / $resLimit);
    if ($pages > 1) {
        echo '<div id="pages">';
        for ($x = 0; $x < $pages; ++$x) {
Exemplo n.º 3
0
 $eMsg .= '<br /><a href="' . CalRoot . '/index.php?eID=' . $eID . '">' . CalRoot . '/index.php?eID=' . $eID . '</a></p>';
 for ($x = 1; $x <= $partySize; $x++) {
     $addName = $partySize > 1 ? $regName . " - " . $x . "/" . $partySize : $regName;
     doQuery("INSERT into " . HC_TblPrefix . "registrants(Name, Email, Phone, Address, Address2, City, State, Zip, EventID, IsActive, RegisteredAt, GroupID)\r\n\t\t\t\t\tValues(\t'" . cIn($addName) . "',\r\n\t\t\t\t\t\t\t'" . $regEmail . "',\r\n\t\t\t\t\t\t\t'" . $phone . "',\r\n\t\t\t\t\t\t\t'" . $address . "','" . $address2 . "','" . $city . "','" . $state . "','" . $zip . "',\r\n\t\t\t\t\t\t\t'" . $eID . "',\r\n\t\t\t\t\t\t\t1, NOW(),\r\n\t\t\t\t\t\t\t'" . cIn($groupID) . "');");
 }
 $result = doQuery("SELECT COUNT(r.EventID), er.Space\r\n\t\t\t\t\t\t\tFROM " . HC_TblPrefix . "registrants r\r\n\t\t\t\t\t\t\t\tLEFT JOIN " . HC_TblPrefix . "eventrsvps er ON (r.EventID = er.EventID)\r\n\t\t\t\t\t\t\tWHERE r.EventID = '" . $eID . "' and r.IsActive = 1\r\n\t\t\t\t\t\t\tGROUP BY r.EventID, er.Space");
 $eOver = $eLimit = 0;
 if (mysql_result($result, 0, 0) > mysql_result($result, 0, 1) && mysql_result($result, 0, 1) != 0) {
     $eOver = 1;
 } elseif (mysql_result($result, 0, 0) == mysql_result($result, 0, 1) && mysql_result($result, 0, 1) != 0) {
     $eLimit = 1;
 }
 $rMsg = '<p><b>' . cOut($hc_lang_rsvp['PartySize']) . " " . cOut($partySize) . '</b>';
 $rMsg .= '<br />' . cOut($regName) . '<br />' . cOut($regEmail);
 $rMsg .= $phone != '' ? '<br />' . $phone : '';
 $rMsg .= $address != '' ? '<br />' . strip_tags(buildAddress($address, $address2, $city, $state, $zip, $country, $hc_lang_config['AddressType']), '<br>') : '';
 $rMsg .= '</p>';
 //	RSVP User Email
 $regSubj = cOut($hc_lang_rsvp['regSubject']) . $eventTitle;
 $regMsg = '<p>' . cOut($hc_lang_rsvp['regMsg']) . '</p>';
 $regMsg .= $eMsg . $rMsg;
 $regMsg .= $eOver == 1 ? " " . cOut($hc_lang_rsvp['regOverflow']) : '';
 $regMsg .= '<p>' . cOut($hc_lang_rsvp['ThankYou']) . '<br />' . $hc_cfg[79] . '</p>';
 $regMsg .= '<p>' . cOut($hc_lang_rsvp['regDisclaimer']) . '</p>';
 //	Event Contact Email
 $conSubj = cOut($hc_lang_rsvp['conSubject']) . $eventTitle;
 $conMsg = '<p>' . cOut($hc_lang_rsvp['conMsg']) . '</p>';
 $conMsg .= $eMsg;
 $conMsg .= $eOver == 1 ? '<p>' . cOut($hc_lang_rsvp['conOverflow']) . '</p>' : '';
 $conMsg .= $eLimit == 1 ? '<p>' . cOut($hc_lang_rsvp['conLimit']) . '</p>' : '';
 $conMsg .= $rMsg;
Exemplo n.º 4
0
         if ($row[4] > $row[5]) {
             $endDate = date("Ymd\\THis", mktime($endtimepart[0], $endtimepart[1], $endtimepart[2], $startdatepart[1], $startdatepart[2] + 1, $startdatepart[0]));
         } else {
             $endDate = date("Ymd\\THis", mktime($endtimepart[0], $endtimepart[1], $endtimepart[2], $startdatepart[1], $startdatepart[2], $startdatepart[0]));
         }
     } else {
         $endDate = date("Ymd\\THis", mktime($starttimepart[0], $starttimepart[1], $starttimepart[2], $startdatepart[1], $startdatepart[2], $startdatepart[0]));
     }
 } else {
     $allDay = true;
     $startDate = date("Ymd", mktime(0, 0, 0, $startdatepart[1], $startdatepart[2], $startdatepart[0]));
     $endDate = date("Ymd", mktime(0, 0, 0, $startdatepart[1], $startdatepart[2] + 1, $startdatepart[0]));
 }
 $summary = $row[1];
 $description = $hc_cfg[109] > 0 ? clean_truncate(strip_tags($row[2]), $hc_cfg[109]) . ' ' . $hc_lang_event['ReadMore'] . ' ' . CalRoot . '/?eID=' . $row[0] : $row[2];
 $location = $row[13] > 0 ? $row[24] . ' - ' . str_replace('<br />', ' ', buildAddress($row[25], $row[26], $row[27], $row[28], $row[29], $row[30])) : $row[16] . ' - ' . str_replace('<br />', ' ', buildAddress($row[17], $row[18], $row[19], $row[20], $row[21], $row[22]));
 $descFooter = "\\n______________________________\\niCalendar Feed powered by OU Calendar";
 echo "BEGIN:VEVENT\r\n";
 echo "URL;VALUE=URI:" . CalRoot . "/index.php?eID=" . $row[0] . "\r\n";
 if ($allDay == false) {
     echo "DTSTART:" . $startDate . "\r\n";
     echo "DTEND:" . $endDate . "\r\n";
 } else {
     echo "DTSTART;VALUE=DATE:" . $startDate . "\r\n";
     echo "DTEND;VALUE=DATE:" . $endDate . "\r\n";
 }
 echo "SUMMARY:" . str_replace(";", "\\;", str_replace(",", "\\,", html_entity_decode(cOut(cleanSpecialChars(strip_tags($summary)))))) . "\r\n";
 echo "DESCRIPTION:" . str_replace(";", "\\;", str_replace(",", "\\,", html_entity_decode(cOut(cleanSpecialChars(strip_tags(cleanBreaks($description))))) . $descFooter)) . "\r\n";
 echo "LOCATION:" . str_replace(";", "\\;", str_replace(",", "\\,", html_entity_decode(cOut($location)))) . "\r\n";
 echo "CATEGORIES:" . CalName . " Events\r\n";
 echo "PRIORITY:0\r\n";
Exemplo n.º 5
0
$rsvp_close = isset($_POST['closeDate']) ? dateToMySQL(cIn($_POST['closeDate']), $hc_cfg[24]) : '';
$rsvp_notice = isset($_POST['rsvpEmail']) && is_numeric($_POST['rsvpEmail']) ? cIn($_POST['rsvpEmail']) : 0;
$subname = isset($_POST['subname']) ? cIn($_POST['subname']) : '';
$subemail = isset($_POST['subemail']) ? cIn($_POST['subemail']) : '';
$sendmsg = isset($_POST['sendmsg']) && $_POST['sendmsg'] != "no" ? 1 : 0;
$message = isset($_POST['message']) ? $_POST['message'] : '';
if ($locID == 0) {
    $locName = cIn(cleanQuotes($_POST['locName']));
    $locAddress = cIn($_POST['locAddress']);
    $locAddress2 = cIn($_POST['locAddress2']);
    $locCity = cIn($_POST['locCity']);
    $locState = cIn($_POST['locState']);
    $locZip = cIn($_POST['locZip']);
    $locCountry = cIn($_POST['locCountry']);
    if (isset($_POST['newLoc'])) {
        $locString = str_replace("<br />", ", ", buildAddress($locAddress, $locAddress2, $locCity, $locState, $locZip, $locCountry, $hc_lang_config['AddressType']));
        require_once HCPATH . HCINC . '/api/google/GetGeocode.php';
        if ($lat == 0 || $lon == 0) {
            $lat = $lon = '';
        }
        doQuery("INSERT INTO " . HC_TblPrefix . "locations(Name, Address, Address2, City, State, Country, Zip, Lat, Lon, IsPublic, IsActive, Phone)\r\n\t\t\t\tVALUES( '" . $locName . "','" . $locAddress . "','" . $locAddress2 . "','" . $locCity . "','" . $locState . "','" . $locCountry . "','" . $locZip . "','" . $lat . "','" . $lon . "',1,1,NULL)");
        $result = doQuery("SELECT LAST_INSERT_ID() FROM " . HC_TblPrefix . "locations");
        $locID = mysql_result($result, 0, 0);
    }
}
if (!isset($_POST['overridetime'])) {
    if ($hc_cfg[31] == 12) {
        $startTimeHour = $startTimeAMPM == 'PM' ? $startTimeHour < 12 ? $startTimeHour + 12 : $startTimeHour : ($startTimeHour == 12 ? 0 : $startTimeHour);
        if (!isset($_POST['ignoreendtime'])) {
            $endTimeHour = $endTimeAMPM == 'PM' ? $endTimeHour < 12 ? $endTimeHour + 12 : $endTimeHour : ($endTimeHour == 12 ? 0 : $endTimeHour);
        }
Exemplo n.º 6
0
}
if (hasRows($result) && $myName != '' && $myEmail != '' && $friendName != '' && $friendEmail != '') {
    $message = '<p>' . cOut($sendMsg) . '</p>';
    $message .= '<p><b>' . mysql_result($result, 0, 0) . '</b><br />';
    if ($tID == 0) {
        $where = '/index.php?com=send&eID=';
        $subject = CalName . " " . $hc_lang_sendtofriend['SubjectE'] . " " . $myName;
        $message .= stampToDate(mysql_result($result, 0, 1), $hc_cfg[14]) . ' - ';
        if (mysql_result($result, 0, 3) == 0) {
            $message .= stampToDate("1980-01-01 " . mysql_result($result, 0, 2), $hc_cfg[23]);
        } elseif (mysql_result($result, 0, 3) == 1) {
            $message .= $hc_lang_sendtofriend['AllDay'];
        } elseif (mysql_result($result, 0, 3) == 2) {
            $message .= $hc_lang_sendtofriend['TBA'];
        }
        $message .= '<br /><a href="' . CalRoot . '/index.php?eID=' . $eID . '">' . CalRoot . '/index.php?eID=' . $eID . '</a></p>';
    } else {
        $where = '/index.php?com=send&lID=';
        $subject = CalName . " " . $hc_lang_sendtofriend['SubjectL'] . " " . $myName;
        $message .= buildAddress(mysql_result($result, 0, 1), mysql_result($result, 0, 2), mysql_result($result, 0, 3), mysql_result($result, 0, 4), mysql_result($result, 0, 5), mysql_result($result, 0, 6), $hc_lang_config['AddressType']);
        $message .= '<br /><a href="' . CalRoot . '/index.php?com=location&lID=' . $eID . '">' . CalRoot . '/index.php?com=location&lID=' . $eID . '</a></p>';
    }
    $message .= '<p>' . $hc_lang_sendtofriend['From'] . '<br />' . $myName . ' (' . $myEmail . ')</p>';
    $message .= '<p>' . $hc_lang_sendtofriend['AutoNotice'] . ' ' . $hc_cfg[78];
    reMail($friendName, $friendEmail, $subject, $message, $myName, $myEmail);
    doQuery("INSERT INTO " . HC_TblPrefix . "sendtofriend(MyName, MyEmail, RecipientName, RecipientEmail, Message, EntityID, IPAddress, SendDate, TypeID)\r\n\t\t\t\tValues('" . $myName . "', '" . $myEmail . "', '" . $friendName . "', '" . $friendEmail . "', '" . cleanSpecialChars(str_replace('<br>', '\\n', $message)) . "', '" . $eID . "',\r\n\t\t\t\t'" . cIn(strip_tags($_SERVER["REMOTE_ADDR"])) . "', '" . date("Y-m-d") . "', '" . $tID . "')");
    doQuery("UPDATE " . HC_TblPrefix . "events SET EmailToFriend = EmailToFriend + 1 WHERE PkID = '" . $eID . "'");
    header("Location: " . CalRoot . $where . $eID . "&msg=1");
} else {
    header("Location: " . CalRoot . "/");
}
Exemplo n.º 7
0
/**
 * Generate and send new/updated public event submission notice email to subscribed admin users.
 * @since 2.2.0
 * @version 2.2.0
 * @param string $subName Name of event submitter
 * @param string $subEmail Email address of event submitter
 * @param string $adminMessage Message to admin user from event submitter
 * @param integer $locID Location ID
 * @param string $locName Location Name
 * @param string $locAddress Location Address
 * @param string $locAddress2 Location Address Extra Line
 * @param string $locCity Location City
 * @param string $locState Location State
 * @param string $locCountry Location Country
 * @param string $locZip Location Zip
 * @param string $eventTitle Submitted Event Title
 * @param string $eventDesc Submitted Event Description
 * @param string $eventDates String describing date range
 * @param integer $occurs Number of event occurrences
 * @return void
 */
function notice_public_event($subName, $subEmail, $adminMessage, $locID, $locName, $locAddress, $locAddress2, $locCity, $locState, $locCountry, $locZip, $eventTitle, $eventDesc, $eventDates, $occurs)
{
    global $hc_cfg, $hc_lang_config, $hc_lang_submit;
    $resultE = doQuery("SELECT a.FirstName, a.LastName, a.Email\r\n\t\t\t\t\t\tFROM " . HC_TblPrefix . "adminnotices n\r\n\t\t\t\t\t\t\tLEFT JOIN " . HC_TblPrefix . "admin a ON (n.AdminID = a.PkID)\r\n\t\t\t\t\t\tWHERE a.IsActive = 1 AND n.IsActive = 1 AND n.TypeID = 0");
    if (hasRows($resultE)) {
        $toNotice = array();
        while ($row = mysql_fetch_row($resultE)) {
            $toNotice[trim($row[0] . ' ' . $row[1])] = $row[2];
        }
        $user_level = isset($_SESSION['UserLevel']) ? cIn($_SESSION['UserLevel']) : 0;
        $subject = $hc_lang_submit['NoticeSubject'] . ' - ' . CalName;
        $message = '<p>' . $hc_lang_submit['NoticeEmail1'] . '</p>
<p>
	<b>' . $hc_lang_submit['NoticeEmail2'] . '</b> ' . $subName . ' - ' . $subEmail . '<br />
	<b>' . $hc_lang_submit['NoticeEmail5'] . '</b> ' . $hc_lang_submit['NoticeEmail5' . $user_level] . '<br />
	<b>' . $hc_lang_submit['NoticeEmail3'] . '</b> ' . strip_tags($_SERVER['REMOTE_ADDR']) . '
</p>
';
        $message .= $adminMessage != '' ? '<p><b>' . $hc_lang_submit['NoticeEmail4'] . '</b> ' . cOut(str_replace('<br />', ' ', strip_tags(cleanBreaks($adminMessage), '<br>'))) . '</p>' : '';
        $message .= '
<p>
';
        if ($locID == 0) {
            $message .= $locName . ', ';
            $message .= str_replace('<br />', ' ', strip_tags(buildAddress($locAddress, $locAddress2, $locCity, $locState, $locZip, $locCountry, $hc_lang_config['AddressType']), '<br>'));
        } else {
            $result = doQuery("SELECT Name, Address, Address2, City, State, Country, Zip FROM " . HC_TblPrefix . "locations WHERE PkID = '" . cIn($locID) . "'");
            $message .= mysql_result($result, 0, 0) . ', ';
            $message .= str_replace('<br />', ' ', strip_tags(buildAddress(mysql_result($result, 0, 1), mysql_result($result, 0, 2), mysql_result($result, 0, 3), mysql_result($result, 0, 4), mysql_result($result, 0, 5), mysql_result($result, 0, 6), $hc_lang_config['AddressType']), '<br>'));
        }
        $message .= '
</p>
<p>
	<b>' . $hc_lang_submit['EventTitle'] . '</b> ' . cOut($eventTitle) . '<br />
	' . ($occurs > 0 ? '<b>' . $hc_lang_submit['Occurs'] . '</b> ' . cOut($eventDates) . ' (x' . $occurs . ')<br />' : '') . '
</p>
<p>' . cOut(strip_tags($eventDesc)) . '</p>
<p><a href="' . AdminRoot . '">' . AdminRoot . '</a></p>';
        reMail('', $toNotice, $subject, $message);
    }
}
Exemplo n.º 8
0
 $zip = isset($_POST['zip']) ? cIn(strip_tags($_POST['zip'])) : '';
 $website = isset($_POST['website']) ? cIn(strip_tags($_POST['website'])) : '';
 $website = preg_match('/^https?:\\/\\//', $website) || $website == '' ? $website : 'http://' . $website;
 $email = isset($_POST['email']) ? cIn(strip_tags($_POST['email'])) : '';
 $phone = isset($_POST['phone']) ? cIn(strip_tags($_POST['phone'])) : '';
 $status = isset($_POST['status']) ? cIn(strip_tags($_POST['status'])) : '';
 $descript = isset($_POST['descript']) ? cIn(cleanQuotes($_POST['descript'], 0)) : '';
 $lat = isset($_POST['lat']) ? cIn(strip_tags($_POST['lat'])) : '';
 $lon = isset($_POST['lat']) ? cIn(strip_tags($_POST['lon'])) : '';
 $gQuality = '0';
 $imageURL = isset($_POST['imageURL']) ? cIn($_POST['imageURL']) : '';
 $imageURL = preg_match('/^https?:\\/\\//', $imageURL) || $imageURL == '' ? $imageURL : 'http://' . $imageURL;
 $follow_up = isset($_POST['follow_up']) ? cIn($_POST['follow_up']) : 0;
 $fnote = isset($_POST['follow_note']) ? cIn(cleanQuotes($_POST['follow_note'])) : '';
 if (isset($_POST['updateMap'])) {
     $locString = str_replace("<br />", ", ", buildAddress($address, $address2, $city, $state, $zip, $country, $hc_lang_config['AddressType']));
     require_once HCPATH . HCINC . '/api/google/GetGeocode.php';
 }
 $result = doQuery("SELECT PkID FROM " . HC_TblPrefix . "locations WHERE PkID = '" . $lID . "' AND IsActive = 1");
 if (hasRows($result)) {
     doQuery("UPDATE " . HC_TblPrefix . "locations\r\n\t\t\t\t\tSET Name = '" . $name . "',\r\n\t\t\t\t\t\tAddress = '" . $address . "',Address2 = '" . $address2 . "',City = '" . $city . "',State = '" . $state . "',Country = '" . $country . "',Zip = '" . $zip . "',\r\n\t\t\t\t\t\tURL = '" . $website . "',Phone = '" . $phone . "',Email = '" . $email . "',Descript = '" . $descript . "',\r\n\t\t\t\t\t\tIsPublic = '" . $status . "',Lat = '" . $lat . "',Lon = '" . $lon . "',GoogleAcc = '" . $gQuality . "', LastMod = '" . SYSDATE . ' ' . SYSTIME . "',\r\n\t\t\t\t\t\tImage = '" . $imageURL . "'\r\n\t\t\t\t\tWHERE PkID = '" . $lID . "'");
     $msgID = 2;
 } else {
     doQuery("INSERT INTO " . HC_TblPrefix . "locations(Name, Address, Address2, City, State, Country, Zip, URL, Phone, Email, Descript, IsPublic, IsActive, Lat, Lon, GoogleAcc, LastMod, Image)\r\n\t\t\t\t\tVALUES(\t'" . $name . "','" . $address . "','" . $address2 . "','" . $city . "','" . $state . "','" . $country . "','" . $zip . "',\r\n\t\t\t\t\t\t\t'" . $website . "','" . $phone . "','" . $email . "','" . $descript . "'," . $status . ",1,'" . $lat . "','" . $lon . "','" . $gQuality . "','" . SYSDATE . ' ' . SYSTIME . "',\r\n\t\t\t\t\t\t\t'" . $imageURL . "')");
     $result = doQuery("SELECT LAST_INSERT_ID() FROM " . HC_TblPrefix . "locations");
     $lID = mysql_result($result, 0, 0);
     $msgID = 1;
 }
 $efID = $ebID = $efFetched = '';
 $efNew = $ebNew = true;
 $resultD = doQuery("SELECT * FROM " . HC_TblPrefix . "locationnetwork WHERE LocationID = '" . $lID . "'");
Exemplo n.º 9
0
        $errorMsg = 'Facebook API Settings Missing.';
    } else {
        $action = $fbID == '' ? '/' . $fb_id . '/events' : '/' . $fbID;
        $fbStart = $startTimeHour != '' ? $eventDate . ' ' . $startTimeHour . ":" . $startTimeMins . ":00" : $eventDate;
        $fbEnd = $eventDate;
        if ($tbd == 0 && !isset($_POST['ignoreendtime']) && $startTime > $endTime) {
            $dateParts = explode("-", $eventDate);
            $fbEnd = date("Y-m-d", mktime(0, 0, 0, $dateParts[1], $dateParts[2] + 1, $dateParts[0]));
        }
        $eventD = utf8_encode(htmlentities(strip_tags($eventDesc)));
        if (strlen($eventD) > 400) {
            $eventD = clean_truncate($eventDesc, 400) . '<br /><br /><a href="' . CalRoot . '/index.php?eID=' . $eID . '">' . utf8_encode(htmlentities($hc_lang_event['FacebookFull'])) . '</a>';
        }
        require_once HCPATH . HCINC . '/api/facebook/sdk/facebook.php';
        $facebook = new Facebook(array('appId' => $app_id, 'secret' => $app_secret, 'cookie' => true));
        $params = array('access_token' => $fb_token, 'name' => utf8_encode($eventTitle), 'start_time' => date("c", strtotime($fbStart)), 'description' => $eventD, 'location' => $name . ' ' . str_replace('<br />', ' ', utf8_encode(buildAddress($add, $add2, $city, $region, $postal, $country, $hc_lang_config['AddressType']))), 'privacy_type' => 'OPEN');
        if ($endTimeHour != '') {
            $params['end_time'] = date("c", strtotime($fbEnd . ' ' . $endTimeHour . ":" . $endTimeMins . ":00"));
        } else {
            $params['end_time'] = date("c", strtotime($eventDate));
        }
        $status = $facebook->api($action, 'post', $params);
        if (isset($status['id']) || $status === true) {
            $fbID = $status['id'];
        } else {
            $apiFail = true;
            $errorMsg = 'Facebook Event Submission Failed';
        }
    }
}
echo $errorMsg != '' ? $errorMsg : '';
Exemplo n.º 10
0
/**
 * 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&amp;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&amp;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">&nbsp;</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">&nbsp;&nbsp;' . $hc_lang_submit['To'] . '&nbsp;&nbsp;</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>&nbsp;</label><span class="output onote">' . $hc_lang_submit['RSVPDownload'] . '</span>' : '<input type="hidden" name="rsvpEmail" id="rsvpEmail" value="1" /><label>&nbsp;</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>&nbsp;</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>&nbsp;</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');
    }
}
Exemplo n.º 11
0
$token = set_form_token(1);
$result = doQuery("SELECT l1.PkID as `First`, l1.Name, l1.Address, l1.Address2, l1.City, l1.State, l1.Zip, l1.Country,\r\n\t\t\t\t\t\t\t(SELECT COUNT(*) FROM " . HC_TblPrefix . "events e WHERE e.IsActive = 1 AND e.LocID = l1.PkID) as Events,\r\n\t\t\t\t\t\tl2.PkID as `Duplicate`, l2.Name, l2.Address, l2.Address2, l2.City, l2.State, l2.Zip, l2.Country,\r\n\t\t\t\t\t\t\t(SELECT COUNT(*) FROM " . HC_TblPrefix . "events e WHERE e.IsActive = 1 AND e.LocID = l2.PkID) as DupEvents\r\n\t\t\t\t\tFROM " . HC_TblPrefix . "locations l1\r\n\t\t\t\t\tLEFT JOIN " . HC_TblPrefix . "locations l2 ON (" . $compName . " l1.Address = l2.Address AND l1.City = l2.City AND l1.State = l2.State AND l1.Zip = l2.Zip AND l1.Country = l2.Country)\r\n\t\t\t\t\tWHERE l1.PkID != l2.PkID AND l1.IsActive = 1 AND l2.IsActive = 1\r\n\t\t\t\t\tORDER BY l1.PkID");
echo '
		<fieldset style="border:0;">
		<span class="frm_ctrls">
			<label><input type="checkbox" onclick="window.location.href=\'' . AdminRoot . '/index.php?com=reportdupl' . (!isset($_GET['n']) ? '&n=1\'" checked="checked" /> ' : '\'" /> ') . $hc_lang_reports['IncludeName'] . '</label>
		</span>
		</fieldset>';
if (hasRows($result)) {
    echo '
		<ul class="data">
		<div class="drpt">';
    $cnt = $curID = 0;
    $foundDup = array();
    while ($row = mysql_fetch_row($result)) {
        $address = str_replace('<br />', ' ', buildAddress($row[2], $row[3], $row[4], $row[5], $row[6], $row[7]));
        if ($curID != $row[0] && !in_array($row[0], $foundDup)) {
            $cnt = 0;
            $curID = $row[0];
            echo '
			<li class="row uline header">
				<div class="txt" title="' . cOut($row[1]) . '" style="width:29%;">
					' . cOut('(' . $row[0] . ') ' . $row[1]) . '
				</div>
				<div class="txt" title="' . $address . '" style="width:45%;">' . $address . '</div>
				<div class="txt" style="width:11%;">' . $row[8] . ' ' . $hc_lang_reports['Events'] . '</div>
				<div class="tools" style="width:15%;">
					<a href="' . AdminRoot . '/index.php?com=addlocation&amp;lID=' . $row[0] . '"><img src="' . AdminRoot . '/img/icons/edit.png" width="16" height="16" alt="" /></a>
					<a href="javascript:;" onclick="doDelete(' . $row[0] . ')"><img src="' . AdminRoot . '/img/icons/delete.png" width="16" height="16" alt="" border="0" /></a>
					<a href="' . AdminRoot . '/index.php?com=locsearch&tkn=' . $token . '&l=' . (!isset($_GET['n']) ? cOut($row[1]) : '\'' . cOut($row[2]) . '\'') . '"><img src="' . AdminRoot . '/img/icons/merge.png" width="16" height="16" alt="" /></a>
				</div>