• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getDataFromSQL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getDataFromSQL函数的典型用法代码示例。如果您正苦于以下问题:PHP getDataFromSQL函数的具体用法?PHP getDataFromSQL怎么用?PHP getDataFromSQL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getDataFromSQL函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getCrsDefsAsArray

function getCrsDefsAsArray($s)
{
    $sql = "SELECT * FROM `" . $_SESSION['Application_host'] . "`.`T_crs` WHERE Code = " . returnDefault($s, 'text');
    $data = getDataFromSQL($sql, __FILE__, "details", __FUNCTION__);
    if ($data['Count'] != 1) {
        exit;
    } else {
        return $data;
    }
}
开发者ID:GrottoCenter,项目名称:GrottoCenter,代码行数:10,代码来源:crs_info.php


示例2: addphpBBuser

function addphpBBuser($login, $pwd, $mail, $lang)
{
    $cryptpass = phpbb_hash($pwd);
    $sql = "SELECT * FROM `" . $_SESSION['Application_host'] . "`.`forum_users` WHERE `username` = '" . $login . "'";
    $dataset_exists = getDataFromSQL($sql, __FILE__, "function", __FUNCTION__);
    if ($dataset_exists['Count'] == 0) {
        $new_user_array = array('username' => stripslashes($login), 'user_password' => $cryptpass, 'user_email' => $mail, 'group_id' => 7, 'user_type' => 0, 'user_lang' => strtolower($lang));
        $phpBBid = user_add($new_user_array);
    }
}
开发者ID:GrottoCenter,项目名称:GrottoCenter,代码行数:10,代码来源:phpBBinterface.php


示例3: getAvgApproach

function getAvgApproach($id_entry)
{
    if ($id_entry != "") {
        $sql = "SELECT AVG(Approach) AS Avg FROM `" . $_SESSION['Application_host'] . "`.`T_comment` ";
        $sql .= "WHERE Id_entry=" . $id_entry . " AND Approach IS NOT NULL ";
        $array = getDataFromSQL($sql, __FILE__, "function", __FUNCTION__);
        return $array[0]["Avg"];
    } else {
        return false;
    }
}
开发者ID:GrottoCenter,项目名称:GrottoCenter,代码行数:11,代码来源:loader_func.php


示例4: getNews

/**
 * This file is part of GrottoCenter.
 *
 * GrottoCenter is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * GrottoCenter is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with GrottoCenter.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @copyright Copyright (c) 2009-2012 Clément Ronzon
 * @license http://www.gnu.org/licenses/agpl.txt
 */
function getNews($is_admin)
{
    $sql = "SELECT n.*, ";
    $sql .= "CONCAT(if(caa.Surname is null,'',CONCAT(caa.Surname, ' ')), if(caa.Name is null,'',CONCAT(caa.Name , ' alias ')), caa.Nickname) AS Author, ";
    $sql .= "CONCAT(if(cab.Surname is null,'',CONCAT(cab.Surname, ' ')), if(cab.Name is null,'',CONCAT(cab.Name , ' alias ')), cab.Nickname) AS Reviewer ";
    $sql .= "FROM `" . $_SESSION['Application_host'] . "`.`T_news` n ";
    $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_caver` caa ON n.Id_author = caa.Id ";
    $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_caver` cab ON n.Id_reviewer = cab.Id ";
    if (!$is_admin) {
        $sql .= "WHERE n.Is_public = 'YES' ";
    }
    $sql .= "ORDER BY n.Id_answered, n.Date_inscription ";
    $data = getDataFromSQL($sql, __FILE__, "function", __FUNCTION__);
    return sortByThread($data);
}
开发者ID:GrottoCenter,项目名称:GrottoCenter,代码行数:34,代码来源:info_func.php


示例5: getOverviewLayers

function getOverviewLayers($enabled)
{
    $sql = "SELECT ";
    $sql .= "g.Code AS Group_code,g.Name AS Group_name,lbl." . $_SESSION['language'] . " AS Label,l.Code AS Layer_code,l.Url,l.Name AS Layer_name,l.Short_name,l.Layer,l.Style,l.Format,l.Version,l.Background_color ";
    $sql .= "FROM `" . $_SESSION['Application_host'] . "`.`T_layer` l ";
    $sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`J_group_layer` gl ON gl.Id_layer = l.Id ";
    $sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`T_group_layer` g ON g.Id = gl.Id_group ";
    $sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`T_label` lbl ON lbl.Id = g.Id_label ";
    if ($enabled) {
        $sql .= "WHERE l.Enabled = 'YES' ";
    }
    $sql .= "ORDER BY 1,2,3,4,5,6,7,8,9,10,11,12 ";
    $data = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__);
    $group_code = "";
    $return = "";
    for ($i = 0; $i < $data['Count']; $i++) {
        if ($group_code != $data[$i]['Group_code']) {
            $group_code = $data[$i]['Group_code'];
            if ($return != "") {
                $return = substr($return, 0, strlen($return) - 1);
                $return .= '}},' . "\n";
            }
            $return .= '"' . $group_code . '":{"NAME":"' . $data[$i]['Group_name'] . '",
                                          "SHORTNAME":"' . $data[$i]['Label'] . '",
                                          "OPACITY":opacity,
                                          "SPECS":{';
        }
        $return .= '"' . $data[$i]['Layer_code'] . '":{"URL":"' . $data[$i]['Url'] . '",
                                "NAME":"' . $data[$i]['Layer_name'] . '",
                                "SHORTNAME":"' . $data[$i]['Short_name'] . '",
                                "LAYER":"' . $data[$i]['Layer'] . '",
                                "STYLE":"' . $data[$i]['Style'] . '",
                                "FORMAT":"' . $data[$i]['Format'] . '",
                                "VERSION":"' . $data[$i]['Version'] . '",
                                "BGCOLOR":"' . $data[$i]['Background_color'] . '"}';
        if ($group_code == $data[$i + 1]['Group_code']) {
            $return .= ',';
        }
        $return .= "\n";
    }
    return $return . "}}";
}
开发者ID:GrottoCenter,项目名称:GrottoCenter,代码行数:42,代码来源:overview.php


示例6: getDataFromSQL

/html/legal_and_privacy_De.php?lang=De</loc>
    <changefreq>monthly</changefreq>
    <priority>0.1</priority>
  </url>
  <url>
    <loc><?php 
echo $root;
?>
/phpBB3/</loc>
    <changefreq>monthly</changefreq>
    <priority>0.1</priority>
  </url>
<?php 
if ($doListFiles) {
    $sql = "SELECT Id, Name FROM `" . $app_prop['Host'] . "`.`T_entry` WHERE Is_public = 'YES' ORDER BY Name ";
    $data = getDataFromSQL($sql, __FILE__, "function", __FUNCTION__);
    $languagesArray = getAvailableLanguages();
    for ($i = 0; $i < $data['Count']; $i++) {
        $changefreq = "monthly";
        $priority = 0.5;
        foreach ($languagesArray as $shortLang => $largeLang) {
            $entry = $data[$i]['Name'];
            $entry = preg_replace('/([^\\(\\)]*)(\\(.*\\))/', '$2 $1', $entry);
            $entry = cleanString($entry);
            $loc = $root . "/?lang=" . $shortLang . "&amp;entryId=" . $data[$i]['Id'] . "&amp;entry=" . urlencode($entry);
            ?>
  <url>
    <loc><?php 
            echo $loc;
            ?>
</loc>
开发者ID:GrottoCenter,项目名称:GrottoCenter,代码行数:31,代码来源:sitemap.php


示例7: getProperties

/**
 * This file is part of GrottoCenter.
 *
 * GrottoCenter is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * GrottoCenter is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with GrottoCenter.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @copyright Copyright (c) 2009-2012 Cl�ment Ronzon
 * @license http://www.gnu.org/licenses/agpl.txt
 */
function getProperties($category, $id, $isConnected, $labelsBlank, $labelsSinceDate, $addTitle, $systemArray = array(), $for_printer = false, $opener)
{
    switch ($category) {
        case "entry":
            $AvgAe = getAvgAestheticism($id);
            $sqlAe = "SELECT round(Aestheticism) AS Aestheticism FROM `" . $_SESSION['Application_host'] . "`.`T_comment` WHERE Id_entry=" . $id;
            $AvgCa = getAvgCaving($id);
            $sqlCa = "SELECT round(Caving) AS Caving FROM `" . $_SESSION['Application_host'] . "`.`T_comment` WHERE Id_entry=" . $id;
            $AvgAp = getAvgApproach($id);
            $sqlAp = "SELECT round(Approach) AS Approach FROM `" . $_SESSION['Application_host'] . "`.`T_comment` WHERE Id_entry=" . $id;
            if (!$addTitle) {
                $histoAe = "<div onclick=\"JavaScript:infoHistoAe();\" class=\"histo\"><img src=\"" . getHistoSrc($sqlAe, 'Aestheticism') . "\" alt=\"image\" /></div>\n";
                $histoCa = "<div onclick=\"JavaScript:infoHistoCa();\" class=\"histo\"><img src=\"" . getHistoSrc($sqlCa, 'Caving') . "\" alt=\"image\" /></div>\n";
                $histoAp = "<div onclick=\"JavaScript:infoHistoAp();\" class=\"histo\"><img src=\"" . getHistoSrc($sqlAp, 'Approach') . "\" alt=\"image\" /></div>\n";
            } else {
                $histoAe = "";
                $histoCa = "";
                $histoAp = "";
            }
            $sql = "SELECT cat.*, ty." . $_SESSION['language'] . "_type AS typeName, ca.Name as NetwName, ca.Id as NetwId, ma.Name AS MasName, ma.Id AS MasId, ";
            //$sql .= "IF(ISNULL(ca.Id)=1,eybis.Min_depth,ca.Min_depth) AS Min_depth, ";
            //$sql .= "IF(ISNULL(ca.Id)=1,eybis.Max_depth,ca.Max_depth) AS Max_depth, ";
            $sql .= "IF(ISNULL(ca.Id)=1,eybis.Depth,ca.Depth) AS Depth, ";
            $sql .= "IF(ISNULL(ca.Id)=1,eybis.Is_diving,ca.Is_diving) AS Is_diving, ";
            $sql .= "IF(ISNULL(ca.Id)=1,eybis.Length,ca.Length) AS Length, ";
            $sql .= "IF(ISNULL(ca.Id)=1,eybis.Temperature,ca.Temperature) AS Temperature, ";
            $sql .= "IF(ISNULL(ca.Id)=1,NULL,(SELECT COUNT(*) FROM `" . $_SESSION['Application_host'] . "`.`J_cave_entry` WHERE ca.Id = Id_cave)) AS NumberOfEntries, ";
            $sql .= "GROUP_CONCAT(DISTINCT u.Url ORDER BY u.Url SEPARATOR '<br />\n') AS Partners ";
            $sql .= "FROM `" . $_SESSION['Application_host'] . "`.`T_entry` cat ";
            $sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`T_single_entry` eybis ON cat.Id = eybis.Id ";
            $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_type` ty ON cat.Id_type = ty.Id ";
            $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`J_cave_entry` ce ON cat.Id = ce.Id_entry ";
            $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_cave` ca ON ce.Id_cave = ca.Id ";
            $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`J_massif_cave` mc ON (mc.Id_cave = ca.Id OR mc.Id_entry = cat.Id) ";
            $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_massif` ma ON ma.Id = mc.Id_massif ";
            $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`J_entry_url` eu ON eu.Id_entry = cat.Id ";
            $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_url` u ON u.Id = eu.Id_url ";
            break;
        case "cave":
            $listSQL = "SELECT DISTINCT e.Id, e.Name ";
            $listSQL .= "FROM `" . $_SESSION['Application_host'] . "`.`T_entry` e ";
            $listSQL .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`J_cave_entry` ce ON ce.Id_entry = e.Id ";
            $listSQL .= "WHERE ce.Id_cave = " . $id . " AND e.Is_public = 'YES' ";
            if (!$isConnected) {
                $listSQL .= "AND e.Is_public = 'YES' ";
            }
            $listSQL .= "ORDER BY e.Name ";
            $entryList = getDataFromSQL($listSQL, __FILE__, "function", __FUNCTION__);
            $entriesList = "";
            for ($index = 0; $index < $entryList["Count"]; $index++) {
                $entriesList .= "<a href=\"JavaScript:openMe(" . $entryList[$index]['Id'] . ", 'entry', false);\">" . $entryList[$index]['Name'] . "</a>, ";
            }
            $entriesList = substr($entriesList, 0, strlen($entriesList) - 2);
            $sql = "SELECT cat.*, ma.Name AS MasName, ma.Id AS MasId ";
            $sql .= "FROM `" . $_SESSION['Application_host'] . "`.`T_cave` cat ";
            $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`J_massif_cave` mc ON mc.Id_cave = cat.Id ";
            $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_massif` ma ON ma.Id = mc.Id_massif ";
            break;
        case "massif":
            $listSQL = "SELECT COUNT(*) AS Nb, ";
            $listSQL .= "-MAX(ABS(IF(ISNULL(ca.Id)=1,eybis.Depth,ca.Depth))) AS Max_Depth, ";
            $listSQL .= "MAX(ABS(IF(ISNULL(ca.Id)=1,eybis.Length,ca.Length))) AS Max_Length, ";
            $listSQL .= "SUM(ABS(IF(ISNULL(ca.Id)=1,eybis.Length,ca.Length))) AS Sum_Length, ";
            $listSQL .= "-AVG(ABS(IF(ISNULL(ca.Id)=1,eybis.Depth,ca.Depth))) AS Avg_Depth, ";
            $listSQL .= "STD(ABS(IF(ISNULL(ca.Id)=1,eybis.Depth,ca.Depth))) AS Std_Depth, ";
            $listSQL .= "AVG(ABS(IF(ISNULL(ca.Id)=1,eybis.Length,ca.Length))) AS Avg_Length, ";
            $listSQL .= "STD(ABS(IF(ISNULL(ca.Id)=1,eybis.Length,ca.Length))) AS Std_Length ";
            $listSQL .= "FROM `" . $_SESSION['Application_host'] . "`.`T_entry` e ";
            $listSQL .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`T_single_entry` eybis ON e.Id = eybis.Id ";
            $listSQL .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`J_cave_entry` ce ON e.Id = ce.Id_entry ";
            $listSQL .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_cave` ca ON ca.Id = ce.Id_cave ";
            $listSQL .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`J_massif_cave` mc ON (mc.Id_cave = ce.Id_cave OR mc.Id_entry = e.Id) ";
            $listSQL .= "WHERE mc.Id_massif = " . $id . " ";
            $entriesStats = getDataFromSQL($listSQL, __FILE__, "function", __FUNCTION__);
        default:
            $sql = "SELECT cat.* ";
            $sql .= "FROM `" . $_SESSION['Application_host'] . "`.`T_" . $category . "` cat ";
            break;
    }
    $sql .= "WHERE cat.Id = " . $id . " ";
    if (!$isConnected && $category == "entry") {
//.........这里部分代码省略.........
开发者ID:GrottoCenter,项目名称:GrottoCenter,代码行数:101,代码来源:properties.php


示例8: execSQL

         $sql .= $_SESSION['user_id'] . ", ";
         $sql .= "Now() ";
         $sql .= ") ";
         $req = execSQL($sql, $frame, __FILE__, __FUNCTION__);
         $nid = $req['mysql_insert_id'];
         //Tracker
         trackAction("insert_" . $ncat, $nid, "T_" . $ncat);
         //Update the entry contribution flag
         $sql = "UPDATE `" . $_SESSION['Application_host'] . "`.`T_entry` ";
         $sql .= "SET Has_contributions = 'YES' ";
         $sql .= "WHERE Id = " . $id;
         $req = execSQL($sql, $frame, __FILE__, __FUNCTION__);
         //Send an e-mail to the answered person
         if ($id_answered != "" && $ncat == "comment") {
             $get_answered_sql = "SELECT * FROM `" . $_SESSION['Application_host'] . "`.`T_comment` WHERE Id = " . $id_answered;
             $answered_array = getDataFromSQL($get_answered_sql, __FILE__, $frame, __FUNCTION__);
             if ($answered_array[0]["Alert"] == "YES") {
                 alertForCommentReply($id_answered, $nid, $category, $id);
             }
         }
         if ($ncat == "rigging" || $ncat == "description") {
             $sql = "INSERT INTO `" . $_SESSION['Application_host'] . "`.`J_entry_" . $ncat . "` (Id_entry, Id_" . $ncat . ") VALUES ( ";
             $sql .= returnDefault($id, 'id') . ", ";
             $sql .= $nid . " ";
             $sql .= ") ";
             $req = execSQL($sql, $frame, __FILE__, __FUNCTION__);
         }
         $save_failed = false;
     }
 }
 $contributionSaved = !$save_failed && (isset($_POST['save']) || isset($_POST['new']));
开发者ID:GrottoCenter,项目名称:GrottoCenter,代码行数:31,代码来源:file.php


示例9: isset

include "../conf/config.php";
include "../func/function.php";
include "declaration.php";
$lang = isset($_GET['lang']) ? strtolower($_GET['lang']) : 'en';
$zoom = isset($_GET['z']) ? $_GET['z'] : 4;
$id = isset($_GET['id']) ? $_GET['id'] : 0;
$langArray = array('fr', 'en', 'es', 'de', 'it');
$lang = in_array($lang, $langArray) ? $lang : 'en';
if ($id == "") {
    exit;
}
$sql = "SELECT AVG(Latitude) AS Latitude, AVG(Longitude) AS Longitude FROM T_entry WHERE Id IN (" . $id . ") ";
if (!USER_IS_CONNECTED) {
    $sql .= "AND Is_public = 'YES' ";
}
$data = getDataFromSQL($sql, __FILE__, "Geoportail", __FUNCTION__);
$selection = array('fr' => "", 'en' => "", 'es' => "", 'de' => "", 'it' => "");
$selection[$lang] = ' selected="selected"';
echo getDoctype(false) . "\n";
?>
<html <?php 
echo getHTMLTagContent();
?>
>
  <head>
<?php 
include "application_" . $_SESSION['language'] . ".php";
include "mailfunctions_" . $_SESSION['language'] . ".php";
?>
    <?php 
echo getMetaTags();
开发者ID:GrottoCenter,项目名称:GrottoCenter,代码行数:31,代码来源:geoportail.php


示例10: WHERE

LEFT OUTER JOIN T_entry ON V_contributions.Id_entry = T_entry.Id
WHERE (V_contributions.Id IS NULL AND T_entry.Has_contributions = 'YES') OR (V_contributions.Id IS NOT NULL AND T_entry.Has_contributions = 'NO')
*/
include "application_" . $_SESSION['language'] . ".php";
include "mailfunctions_" . $_SESSION['language'] . ".php";
//CRO 2011-10-12
if (false) {
    $sql = "SELECT Nickname FROM `" . $_SESSION['Application_host'] . "`.`T_caver` WHERE Date_inscription >= STR_TO_DATE(CONCAT_WS('/', YEAR(NOW()), MONTH(NOW())-1, '01'), '%Y/%m/%d') ORDER BY Date_inscription DESC";
    $newCaversArray = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__);
    $new_cavers = array();
    for ($i = 0; $i < $newCaversArray['Count']; $i++) {
        $new_cavers[] .= $newCaversArray[$i]['Nickname'];
    }
    $newCaversStr = implode(", ", array_unique($new_cavers));
    $sql = "SELECT CONCAT(Nickname,' (',Relevance,' pts)') AS Result FROM `" . $_SESSION['Application_host'] . "`.`T_caver` ORDER BY Relevance DESC, Nickname ASC LIMIT 0,10";
    $bestCaversArray = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__);
    $best_cavers = array();
    for ($i = 0; $i < $bestCaversArray['Count']; $i++) {
        $best_cavers[] .= $bestCaversArray[$i]['Result'];
    }
    $bestCaversStr = implode(", ", array_unique($best_cavers));
}
$records_by_page = 20;
$max_length = 40;
$sql = "SELECT ";
$sql .= "IFNULL(contrib.Id_entry,contrib.Id) AS `0`, ";
$sql .= "CASE contrib.Category ";
$sql .= "WHEN _latin1'T_description' THEN '<convert>#label=497<convert>' ";
//Description
$sql .= "WHEN _latin1'J_entry_description' THEN '<convert>#label=497<convert>' ";
//Description
开发者ID:GrottoCenter,项目名称:GrottoCenter,代码行数:31,代码来源:home.php


示例11: sendRequestMail

function sendRequestMail($request_id)
{
    if ($request_id != "") {
        $request_sql = "SELECT T_label." . $_SESSION['language'] . " AS Status, T_status.Name AS Status_name, T_request.Name, ";
        $request_sql .= "T_caver_a.Contact AS Aut_contact, T_caver_a.Nickname AS Aut_nick,  ";
        $request_sql .= "T_caver_b.Contact AS Rec_contact, T_caver_b.Nickname AS Rec_nick  ";
        $request_sql .= "FROM `" . $_SESSION['Application_host'] . "`.`T_topography` ";
        $request_sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`T_request` ON T_request.Id = T_topography.Id_request ";
        $request_sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`T_status` ON T_status.Id = T_request.Id_status ";
        $request_sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`T_label` ON T_label.Id = T_status.Id_label ";
        $request_sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`T_caver` T_caver_a ON T_caver_a.Id = T_request.Id_author ";
        $request_sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`T_caver` T_caver_b ON T_caver_b.Id = T_request.Id_recipient ";
        $request_sql .= "WHERE T_request.Id = '" . $request_id . "' ";
        $request_data = getDataFromSQL($request_sql, __FILE__, "function", __FUNCTION__);
        $status_lbl = $request_data[0]['Status'];
        $request_name = $request_data[0]['Name'];
        $status_name = $request_data[0]['Status_name'];
        $rec_contact = $request_data[0]['Rec_contact'];
        $rec_name = $request_data[0]['Rec_nick'];
        $aut_contact = $request_data[0]['Aut_contact'];
        $aut_name = $request_data[0]['Aut_nick'];
        $copy = false;
        switch ($status_name) {
            case "submitted":
                $mail_dest = $rec_contact;
                $name_dest = $rec_name;
                $mail_from = $aut_contact;
                $name_from = $aut_name;
                $subject = "<convert>#label=847<convert> '" . $request_name . "' <convert>#label=849<convert>.";
                //La demande : //vous a été envoyée
                $temp_body = "<convert>#label=851<convert>";
                //Veuillez vérifier les droits d'auteurs et appliquer les modifications nécessaires à la topographie. Ensuite vous pourez choisir de valider ou refuser la demande.
                break;
            case "rejected":
                $mail_dest = $aut_contact;
                $name_dest = $aut_name;
                $mail_from = $rec_contact;
                $name_from = $rec_name;
                $subject = "<convert>#label=846<convert> '" . $request_name . "' <convert>#label=848<convert> '" . $status_lbl . "'.";
                //Votre demande : //est passée à l'état :
                $temp_body = "<convert>#label=852<convert>";
                //Votre demande a été rejetée, la cause du rejet peut être indiquée dans le champ commentaire de la demande. Veuillez modifier votre demande avant de la soumettre à nouveau.
                break;
            case "approved":
                trackAction("approve_request", $request_id, "T_request");
                $mail_dest = $aut_contact;
                $name_dest = $aut_name;
                $mail_from = $rec_contact;
                $name_from = $rec_name;
                $subject = "<convert>#label=846<convert> '" . $request_name . "' <convert>#label=848<convert> '" . $status_lbl . "'.";
                //Votre demande : //est passée à l'état :
                $temp_body = "<convert>#label=853<convert>";
                //Votre demande a été accepté et est dès à présent en ligne, vous pouvez consulter les topographies sur GrottoCenter.org.
                break;
            case "canceled":
                trackAction("cancel_request", $request_id, "T_request");
                $mail_dest = $rec_contact;
                $name_dest = $rec_name;
                $mail_from = $aut_contact;
                $name_from = $aut_name;
                $subject = "<convert>#label=847<convert> '" . $request_name . "' <convert>#label=850<convert>.";
                //La demande : //a été signalée comme illicite
                $temp_body = "<convert>#label=851<convert>";
                //Veuillez vérifier les droits d'auteurs et appliquer les modifications nécessaires à la topographie. Ensuite vous pourez choisir de valider ou refuser la demande.
                break;
        }
        $mail_body = "<p><convert>#label=470<convert> " . $name_dest . ",<br />";
        //Bonjour
        $mail_body .= $subject . "<br/>";
        $mail_body .= $temp_body . "</p>";
        $mail_body .= "<ul><li><convert>#label=854<convert> " . $name_dest . " " . $mail_dest . "</li>";
        //Vous :
        $mail_body .= "<li><convert>#label=855<convert> " . $name_from . " " . $mail_from . "</li>";
        //Votre contact (Leader) :
        $mail_body .= "<li><convert>#label=861<convert>: " . $request_id . "</li></ul>";
        //Numéro de la demande :
        $mail_body .= getSignature();
        return sendMail($mail_dest, $subject, $mail_body, "", "", $copy);
    } else {
        return false;
    }
}
开发者ID:GrottoCenter,项目名称:GrottoCenter,代码行数:82,代码来源:mailfunctions.php


示例12: getHelpTopic

function getHelpTopic($helpId, $helpTitle)
{
    $help = "";
    if ($helpId != '') {
        $sql = "SELECT Id_forum, Id_topic FROM J_help_topic WHERE Id_help = " . $helpId . " AND Language = '" . $_SESSION['language'] . "'";
        $data = getDataFromSQL($sql, __FILE__, "function", __FUNCTION__);
        if ($data['Count'] != 0) {
            $url = "help_" . $_SESSION['language'] . ".php?f=" . $data[0]['Id_forum'] . "&amp;t=" . $data[0]['Id_topic'];
            $windowName = "";
            $widht = 500;
            $height = 400;
            $help = '<span class="help"><a class="nothing" href="JavaScript:openWindow(\'' . $url . '\', \'' . $windowName . '\', ' . $widht . ', ' . $height . ');"><img src="../images/icons/help.png" alt="' . $helpTitle . '" style="border:0px none;" title="' . $helpTitle . '" /></a></span>';
        }
    }
    return $help;
}
开发者ID:GrottoCenter,项目名称:GrottoCenter,代码行数:16,代码来源:function.php


示例13: ON

     $sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`T_caver` usr ON (usr.Id = cat.Id_author OR usr.Id = cat.Id_reviewer) ";
     $sql .= "WHERE usr.Id = " . $id . " AND NOT cat.Id_entry = 0 AND cat.Id_entry IS NOT NULL ";
     if (USER_IS_CONNECTED) {
     } else {
         $sql .= "AND cat.Is_public = 'YES' ";
     }
     $sql .= "ORDER BY NName ";
     $comparedCol = "value";
     $idCol = "objectId";
     $categoryCol = "category";
     $textCol = "NName";
     $selected = "";
     $Obj_name_sql = "SELECT * ";
     $Obj_name_sql .= "FROM `" . $_SESSION['Application_host'] . "`.`T_" . $category . "` ";
     $Obj_name_sql .= "WHERE Id = " . $id;
     $object_source_name = getDataFromSQL($Obj_name_sql, __FILE__, $frame, __FUNCTION__);
     if ($category == "caver") {
         $object_source_name = $object_source_name[0]['Nickname'];
     } else {
         $object_source_name = $object_source_name[0]['Name'];
     }
     $rnd_div_id = "list_contribution_div_" . rand();
     $innerHTML = "<div id=\"" . $rnd_div_id . "\" class=\"menu\">";
     $innerHTML .= getTopMenu(getCloseBtn("JavaScript:resetListDiv('" . $rnd_div_id . "');", "<convert>#label=371<convert>") . "<div class=\"frame_title\">" . setTitle("JavaScript:openMe(" . $id . ", '" . $category . "', false);", "list", "<convert>#label=887<convert> <convert>#label=540<convert> " . $object_source_name, 1) . "</div>");
     //Contributions en lien avec//Fermer
     $innerHTML .= "<select onclick=\"JavaScript:selectOnClick(this);\" size=\"5\" class=\"entry\">\n";
     $innerHTML .= getOptions($sql, "", $selected, $comparedCol, $countryCol, $idCol, $categoryCol, $textCol) . "\n";
     $innerHTML .= "</select>" . getBotMenu() . "</div>\n";
     break;
 default:
     break;
开发者ID:GrottoCenter,项目名称:GrottoCenter,代码行数:31,代码来源:getPropertiesPlain.php


示例14: getComment

function getComment($category, $id)
{
    if ($id != "" && $category != "") {
        $sql = "SELECT c.*, e.Name as Exit_name, ";
        //    $sql .= "CONCAT(if(caa.Surname is null,'',CONCAT(caa.Surname, ' ')), if(caa.Name is null,'',CONCAT(caa.Name , ' alias ')), caa.Nickname) AS Author, ";
        //    $sql .= "CONCAT(if(cab.Surname is null,'',CONCAT(cab.Surname, ' ')), if(cab.Name is null,'',CONCAT(cab.Name , ' alias ')), cab.Nickname) AS Reviewer ";
        $sql .= "caa.Nickname AS Author, ";
        $sql .= "cab.Nickname AS Reviewer ";
        $sql .= "FROM `" . $_SESSION['Application_host'] . "`.`T_comment` c ";
        $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_caver` caa ON c.Id_author = caa.Id ";
        $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_caver` cab ON c.Id_reviewer = cab.Id ";
        $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_entry` e ON c.Id_exit = e.Id ";
        $sql .= "WHERE c.Id_entry=" . $id . " OR c.Id_exit=" . $id . " ";
        $sql .= "ORDER BY c.Id_answered, c.Date_inscription ";
        $data = getDataFromSQL($sql, __FILE__, "function", __FUNCTION__);
        return sortByThread($data);
    } else {
        return "";
    }
}
开发者ID:GrottoCenter,项目名称:GrottoCenter,代码行数:20,代码来源:file_func.php


示例15: getDataFromSQL

        $sql = "SELECT `" . $_SESSION['language'] . "_admin_id` AS Admin_id FROM `" . $_SESSION['Application_host'] . "`.`T_message_subject` WHERE `Subject` = '" . $subject . "'";
        $data = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__);
        $admin_id = "";
        if ($data['Count'] > 0) {
            $admin_id = $data[0]['Admin_id'];
        }
        if ($subject == "bad_content" || $subject == "restore_element") {
            $subject .= "; Category: " . $category;
        }
        if ($bad_name != "") {
            $subject .= "; Id: " . $bad_name;
        }
        sendMessageToWM($admin_id, $contact, $real_mail, $name, $subject, nl2br($body));
        if ($category == 'topography' && $bad_name != '') {
            $sql = "SELECT Id FROM T_status WHERE Name = 'canceled'";
            $status_id = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__);
            $sql = "UPDATE `" . $_SESSION['Application_host'] . "`.`T_topography` SET Enabled = 'NO' WHERE Id_request = " . $bad_name;
            $req = execSQL($sql, $frame, __FILE__, __FUNCTION__);
            $user_login = $_SESSION['user_login'] == '' ? "guest" : $_SESSION['user_login'];
            $date_stamp = '---- <convert>#label=230<convert>: ' . $user_login . ' ' . date("Y-m-d H:i:s") . ' ----';
            $sql = "UPDATE `" . $_SESSION['Application_host'] . "`.`T_request` SET Id_status = " . returnDefault($status_id[0]['Id'], 'id') . ", Comments = " . returnDefault($date_stamp . "\n" . $body, 'text') . " WHERE Id = " . $bad_name;
            $req = execSQL($sql, $frame, __FILE__, __FUNCTION__);
            trackAction("edit_request", $bad_name, "T_request");
            sendRequestMail($bad_name);
        }
        $send_failed = false;
    }
}
function formIsValid()
{
    $string = isset($_POST['m_check']) ? $_POST['m_check'] : '';
开发者ID:GrottoCenter,项目名称:GrottoCenter,代码行数:31,代码来源:contact.php


示例16: COUNT

        if (USER_IS_CONNECTED) {
            //Is it in my list ?
            $sql = "SELECT COUNT(*) Count FROM `" . $_SESSION['Application_host'] . "`.`J_grotto_caver` ";
            $sql .= "WHERE Id_grotto = " . $id . " AND Id_caver = " . $_SESSION['user_id'];
            $inMyList = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__);
        }
        if ($grotto[0]['Picture_file_name'] == "") {
            $logo_filename = "default_logo.png";
        } else {
            $logo_filename = $grotto[0]['Picture_file_name'];
        }
    }
} else {
    $sql = "SELECT * FROM `" . $_SESSION['Application_host'] . "`.`T_grotto` ";
    $sql .= "WHERE Id IN (" . $id . ") ";
    $grottoes = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__);
}
if (!$clustered) {
    ?>
  	<div class="header grotto">
  		<convert>#label=186<convert><!--Club-->
<?php 
    if (USER_IS_CONNECTED) {
        ?>
      <form id="GC_IW_manage_my_list" name="manage_my_list" method="post" action="#" style="display:inline;">
<?php 
        if ($inMyList[0]['Count'] > 0) {
            ?>
        <input class="button_remove" type="button" id="GC_IW_remove" name="remove" onclick="JavaScript:infowindowReload(this)" value="" title="<convert>#label=596<convert>" /><!--Retirer de ma liste-->
<?php 
        } else {
开发者ID:GrottoCenter,项目名称:GrottoCenter,代码行数:31,代码来源:grottoInfowindow.php


示例17: isset

        }
    }
} else {
    $_SESSION['login_retry'] = 1;
}
//Send a new password to the user :
if (isset($_POST['send_pwd'])) {
    $login = isset($_POST['f_caver_login']) ? $_POST['f_caver_login'] : '';
    $contact = isset($_POST['f_caver_contact']) ? $_POST['f_caver_contact'] : '';
    $password = generatePassword(10, 8);
    $string = isset($_POST['f_caver_check']) ? $_POST['f_caver_check'] : '';
    $user_check = isset($_SESSION['userCheck']) ? $_SESSION['userCheck'] : '';
    if (!$_SESSION['do_check'] || md5(getIp() . strtolower($string)) == $user_check) {
        $sql = "SELECT * FROM `" . $_SESSION['Application_host'] . "`.`T_caver`";
        $sql .= " WHERE Login = '" . $login . "' AND Contact ='" . $contact . "'";
        $data = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__);
        if ($data['Count'] > 0) {
            if ($data[0]['Activated'] == 'YES') {
                $sql = "UPDATE `" . $_SESSION['Application_host'] . "`.`T_caver`";
                $sql .= " SET Password ='" . getCryptedPwd($login, $password) . "'";
                $sql .= " WHERE Id = " . $data[0]['Id'];
                $req = execSQL($sql, $frame, __FILE__, __FUNCTION__);
                if (!defined('NO_PHPBB_INSTALLED')) {
                    chgPwdphpBBuser($login, $password);
                }
                sendNewPwdMail($data[0], $password);
                //echo $password;
                trackAction("pwd_user", $data[0]['Id'], "T_caver");
                $_SESSION['user_pwd_sent'] = true;
            } else {
                $activated = false;
开发者ID:GrottoCenter,项目名称:GrottoCenter,代码行数:31,代码来源:connection.php


示例18: getDataFromSQL

        $sql = "SELECT u.* FROM `" . $_SESSION['Application_host'] . "`.`T_url` u ";
        $sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`J_entry_url` eu ON u.Id = eu.Id_url ";
        $sql .= "WHERE eu.Id_entry = " . $id;
        $url = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__);
        //Check for my list of entries
        if (USER_IS_CONNECTED) {
            //Is it in my list ?
            $sql = "SELECT COUNT(*) Count FROM `" . $_SESSION['Application_host'] . "`.`J_entry_caver` ";
            $sql .= "WHERE Id_entry = " . $id . " AND Id_caver = " . $_SESSION['user_id'];
            $inMyList = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__);
        }
    }
} else {
    $sql = "SELECT Name, Id FROM `" . $_SESSION['Application_host'] . "`.`T_entry` ";
    $sql .= "WHERE Id IN (" . $id . ") ";
    $entries = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__);
}
if (!$clustered) {
    ?>
  	<div class="header entry">
  		<convert>#label=182<convert><!--Cavité-->
<?php 
    if (USER_IS_CONNECTED) {
        ?>
      <form id="GC_IW_manage_my_list" name="manage_my_list" method="post" action="#" style="display:inline;">
<?php 
        if ($inMyList[0]['Count'] > 0) {
            ?>
        <input class="button_remove" type="button" id="GC_IW_remove" name="remove" onclick="JavaScript:infowindowReload(this)" value="" title="<convert>#label=596<convert>" /><!--Retirer de ma liste-->
<?php 
        } else {
开发者ID:GrottoCenter,项目名称:GrottoCenter,代码行数:31,代码来源:entryInfowindow.php



注:本文中的getDataFromSQL函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getDataPrefix函数代码示例发布时间:2022-05-15
下一篇:
PHP getData函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap