Esempio n. 1
0
 }
 if ($row[0] > 0) {
     $blnCategoryFlg = true;
 }
 $strField = "comboWorkType";
 $strWhere = "{$strWhereBF} and field_name='{$strField}' ";
 $row = selectSQL($con, $db, $strClm, $strTable, $strWhere);
 if ($row == false) {
     goto NsSome_ERROR;
 }
 if ($row[0] > 0) {
     $blnWorkTypeflg = true;
 }
 $strField = "strPaperStatus";
 $strWhere = "{$strWhereBF} and field_name='{$strField}' ";
 $row = selectSQL($con, $db, $strClm, $strTable, $strWhere);
 if ($row == false) {
     goto NsSome_ERROR;
 }
 if ($row[0] > 0) {
     $blnPaperStatusflg = true;
 }
 //*******値の変更********
 if ($blnCategoryFlg) {
     $strValue = $obj["comboWorkCategory" . $i];
     $strField = "comboWorkCategory";
     $strWhere = $strWhereBF . "and field_name='" . $strField . "' ";
     $result = updateSQL($con, $db, $strClm, $strValue, $strTable, $strWhere);
     if ($result == false) {
         goto NsSome_ERROR;
     }
Esempio n. 2
0
function pdo_get_assoc_from_id($table, $id)
{
    $SQL = "SELECT \n              DISTINCT * \n            FROM `{$table}` \n            WHERE `id`='{$id}' \n            LIMIT 0,1;";
    $ra = selectSQL($SQL);
    if (count($ra) != 0) {
        return $ra[0];
    } else {
        return "";
    }
}
Esempio n. 3
0
     exit;
     break;
 case 'for_elly_upload':
     $POSTS_STRING = "ppt_id,page,b64_contents";
     $POSTS = getGET_POST($POSTS_STRING, 'POST');
     $kind = pdo_get_field_from_id('ppt', ${$POSTS}['ppt_id'], 'kind');
     $fn = sprintf("{$POSTS['ppt_id']}-{$POSTS['page']}.{$kind}");
     file_put_contents("{$base_dir}/OUTPUT/png/{$POSTS['ppt_id']}/{$fn}", base64_decode($POSTS['b64_contents']));
     $m = array();
     $m['has_single_page'] = "1";
     updateSQL('ppt', $m, "`ppt_id`='{$POSTS['ppt_id']}'");
     exit;
     break;
 case 'for_elly_webservice':
     $SQL = "select * from `ppt` where `has_single_page`='0'";
     $ra = selectSQL($SQL);
     for ($i = 0, $max_i = count($ra); $i < $max_i; $i++) {
         $ra[$i]['ppt_download'] = "{$base_url}/upload/{$ra[$i]['filename']}";
     }
     echo json_format(json_encode($ra));
     exit;
     break;
 case 'del_ppt':
     //刪除簡報
     $POSTS_STRING = "id";
     $POSTS = getGET_POST($POSTS_STRING, 'POST');
     $SQL = "SELECT * FROM `ppt` WHERE `id`=? LIMIT 1";
     $ra = selectSQL_SAFE($SQL, array($POSTS['id']));
     if (count($ra) != 0) {
         @unlink("{$base_dir}/upload/{$ra[0]['filename']}");
         @unlink("{$base_dir}/OUTPUT/pdf/{$POSTS['id']}");
Esempio n. 4
0
			<div class="slider">
				<ul class="slides">
<?php 
// connection à la base de donnée
if (connection($dbb)) {
    $parametres = array("ID", "titre", "contenu", "auteur", "date", "nomcouverture", "BORNEinf" => "0", "BORNEmax" => "9");
    //recupération des 10 derniers messages
    $reponse = selectSQL($dbb, 'articles', $parametres);
    //affichage de chaque message
    while ($donnees = $reponse->fetch()) {
        ?>
						
							<li class="slide">
								<img src="<?php 
        echo $chemin . 'images/articles/couverture/' . $donnees['nomcouverture'];
        ?>
" alt="<?php 
        echo nl2br(stripslashes($donnees['titre']));
        ?>
">
								<div class="section">
									<h2><a href="<?php 
        if (isset($idpage) and $idpage == 'admin') {
            echo $cheminADM . 'articles/articles.php?IDartcl=' . $donnees['ID'];
        } else {
            echo $chemin . 'articles/articles.php?IDartcl=' . $donnees['ID'];
        }
        ?>
"><?php 
        echo nl2br(stripslashes($donnees['titre']));
        ?>
static $DB = "db";
static $MISCELLANEOUS = "miscellaneous";
static $AUTHENTIFICATION = "auth";
static $MAIL = "mail";
$db = array("maxlength");
$miscellaneous = array("is_private_field");
$authentification = array("admin", "db_ext", "imap_php", "params", "session_cookie", "session_php", "smtp", "user");
//Penser à ajouter "_setitings"
$mail = array("mail", "sendmail", "smtp");
/* Récupération des contenus */
$conn = connectToDatabase($NAME_DB);
$name = $_GET['name'];
if ($name == $MAIL) {
    $res = NULL;
} else {
    $res = selectSQL($name, $conn);
}
/* Génération du contenu principal */
if ($res != null) {
    generateContent($res);
}
/*Si le contenu cotient des sous-catégories, on les traite */
if ($name == $DB) {
    generateSubAccordion($name, $db, $conn);
} else {
    if ($name == $MISCELLANEOUS) {
        generateSubAccordion($name, $miscellaneous, $conn);
    } else {
        if ($name == $AUTHENTIFICATION) {
            generateSubAccordion($name, $authentification, $conn);
        } else {
    die('接続失敗です。' . mysql_error());
}
$db_selected = mysql_select_db('sample', $link);
if (!$db_selected) {
    die('データベース選択失敗です。' . mysql_error());
}
$result = mysql_query('SELECT * FROM boards');
if (!$result) {
    die('クエリーが失敗しました。' . mysql_error());
}
$row = mysql_fetch_row($result);
//while ($row = mysql_fetch_assoc($result)) {
//    print($row['id']);
//    print($row['name']);
//}
$aaa = selectSQL($link, $db_selected, "count(*)", "boards", "id = 1");
$bbb = updateSQL($link, $db_selected, "name", "aiueo", "boards", "id = 1");
$ccc = insertSQL($link, $db_selected, "id", 10, "boards");
function selectSQL($objCon, $selectDB, $strClm, $strTable, $strWhere)
{
    $strSql = "select " . $strClm;
    $strSql .= " from " . $strTable;
    $strSql .= " where " . $strWhere;
    //$result = mysql_query('SELECT * FROM boards');
    //    $result = mysql_query($strSql,$objCon);
    $result = mysql_query($strSql);
    $row = mysql_fetch_row($result);
    return $row;
}
function updateSQL($objCon, $selectDB, $strClm, $strValue, $strTable, $strWhere)
{