本文整理汇总了PHP中mysql函数的典型用法代码示例。如果您正苦于以下问题:PHP mysql函数的具体用法?PHP mysql怎么用?PHP mysql使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mysql函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MoveUnrewardedToBalance
function MoveUnrewardedToBalance()
{
$blocksQ = mysql_query("SELECT blockNumber FROM winning_shares WHERE rewarded = 'N' AND confirms > 119 ORDER BY id ASC") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($blocksQ) > 0) {
while ($blocksR = mysql_fetch_object($blocksQ)) {
$overallreward = 0;
$blockNumber = $blocksR->blockNumber;
echo "Block: {$blockNumber}\n";
$unrewarededQ = mysql_query("SELECT userId, amount FROM unconfirmed_rewards WHERE blockNumber = {$blockNumber} AND rewarded = 'N'") or sqlerr(__FILE__, __LINE__);
mysql("BEGIN");
try {
while ($unrewardedR = mysql_fetch_object($unrewarededQ)) {
$amount = $unrewardedR->amount;
$userid = $unrewardedR->userId;
$overallreward += $amount;
echo "UPDATE accountBalance SET balance = balance + {$amount} WHERE userId = {$userid}\n";
mysql_query("UPDATE accountBalance SET balance = balance + {$amount} WHERE userId = {$userid}") or sqlerr(__FILE__, __LINE__);
}
mysql_query("DELETE FROM unconfirmed_rewards WHERE blockNumber = {$blockNumber}") or sqlerr(__FILE__, __LINE__);
mysql_query("UPDATE winning_shares SET rewarded = 'Y' WHERE blockNumber = {$blockNumber}") or sqlerr(__FILE__, __LINE__);
mysql_query("UPDATE rounddetails SET rewarded = 'Y' WHERE blockNumber = {$blockNumber}") or sqlerr(__FILE__, __LINE__);
mysql_query("COMMIT");
echo "Total Reward: {$overallreward}\n";
} catch (Exception $e) {
echo "Exception: " . $e->getMessage() . "\n";
mysql_query("ROLLBACK");
}
}
}
}
示例2: grade
function grade($mark)
{
$query = "SELECT * FROM grades WHERE min_mark<='{$mark}' AND max_mark>='{$mark}' ";
$result = mysql_query($query) or die(mysql());
$row = mysql_fetch_array($result);
$grade = $row['grade'];
return $grade;
}
示例3: query
function query($query)
{
global $handle, $database;
$res = mysql($database, $query, $handle);
if (mysql_errno() > 0) {
echo mysql_errno() . ": " . mysql_error() . " ({$query})<br>";
}
return $res;
}
示例4: excluir
/**
* Metodo para excluír novo modulo
* @param int $co_pai
* @param string $no_modulo
* @param int $fl_ativo
* @since 12/11/2012
*/
public function excluir($co_modulo)
{
$filho = $this->getFilho($co_modulo);
while ($dados = mysql_fetch_array($filho)) {
$query = "DELETE FROM tb_modulos WHERE co_pai = " . $dados['CO_MODULO'];
mysql($query, $this->conexaoERP);
$this->excluir($dados['CO_MODULO']);
}
$sqlFilho = "DELETE FROM tb_modulos WHERE co_pai = " . $co_modulo;
$sqlPai = "DELETE FROM tb_modulos WHERE co_modulo = " . $co_modulo;
mysql_query($sqlFilho, $this->conexaoERP);
mysql_query($sqlPai, $this->conexaoERP);
}
示例5: main
/**
* Main function, launching the dump functionality.
*
* @return string HTML content for the module.
*/
function main()
{
// Set GPvar:
$this->table = t3lib_div::_GP('table');
$this->uid = t3lib_div::_GP('uid');
$this->hide = t3lib_div::_GP('hide');
// Select / format content to display:
if ($this->table == 'sys_template' || $this->table == 'static_template') {
$where = $this->table == 'sys_template' ? 'NOT deleted' : '1=1';
if (intval($this->uid)) {
$where .= ' AND uid=' . intval($this->uid);
}
$query = 'SELECT uid,pid,constants,config,title FROM ' . addslashes($this->table) . ' WHERE ' . $where . ' ORDER BY title';
$res = mysql(TYPO3_db, $query);
$out = '';
while ($row = mysql_fetch_assoc($res)) {
$out .= $this->getTemplateOutput($row);
}
// Output and exit, if set:
if ($this->hide) {
echo '<pre>' . htmlspecialchars($out) . '</pre>';
exit;
}
}
// Create output:
$content .= '
<select name="table">
<option value="static_template"' . ($this->table == 'static_template' ? 'selected="selected"' : '') . '>static_template</option>
<option value="sys_template"' . ($this->table == 'sys_template' ? 'selected="selected"' : '') . '>sys_template</option>
</select><br />
<p>Specific Uid: </p>
<input type="text" name="uid" size="5" /><br />
<p>Hide this control:</p>
<input type="checkbox" name="hide" value="1" /><br />
<input type="submit" />
<hr />';
if ($out) {
$content .= '
<p>MD5: ' . md5($out) . '</p>
<hr />
<pre>' . htmlspecialchars($out) . '</pre>
';
}
// Return content:
return $content;
}
示例6: storeForumNames
function storeForumNames($db, $username, $password, $email, $sig, $occ, $from, $website, $icq, $aim, $yim, $msnm, $interests, $viewemail, $gametype)
{
$username = strip_tags($username);
$username = trim($username);
$username = normalize_whitespace($username);
$username = mysql_escape_string($username);
$sig = chop($sig);
// Strip all trailing whitespace.
$sig = str_replace("\n", "<BR>", $sig);
$sig = mysql_escape_string($sig);
$occ = mysql_escape_string($occ);
$intrest = mysql_escape_string($intrest);
$from = mysql_escape_string($from);
$password = str_replace("\\", "", $password);
$passwd = md5($password);
$email = mysql_escape_string($email);
$regdate = time();
// Ensure the website URL starts with "http://".
$website = trim($website);
if (substr(strtolower($website), 0, 7) != "http://") {
$website = "http://" . $website;
}
if ($website == "http://") {
$website = "";
}
$website = mysql_escape_string($website);
// Check if the ICQ number only contains digits
$icq = ereg("^[0-9]+\$", $icq) ? $icq : '';
$aim = mysql_escape_string($aim);
$yim = mysql_escape_string($yim);
$msnm = mysql_escape_string($msnm);
if ($viewemail == "1") {
$sqlviewemail = "1";
} else {
$sqlviewemail = "0";
}
$sql = "SELECT max(user_id) AS total FROM users";
if (!($r = mysql($db, $sql))) {
return -1;
}
list($total) = mysql_fetch_array($r);
$total += 1;
$userDateFormat = $board_config['default_dateformat'];
$userTimeZone = $board_config['board_timezone'];
$sql = "INSERT INTO users (user_id, username, user_dateformat, user_timezone, user_regdate, user_email, user_icq, user_password, user_occ, user_interests, user_from, user_website, user_sig, user_aim, user_viewemail, user_yim, user_msnm, user_game_type) VALUES ('{$total}', '{$username}', '{$userDateFormat}', '{$userTimeZone}', '{$regdate}', '{$email}', '{$icq}', '{$passwd}', '{$occ}', '{$intrest}', '{$from}', '{$website}', '{$sig}', '{$aim}', '{$sqlviewemail}', '{$yim}', '{$msnm}', '{$gametype}')";
if (!($result = mysql($db, $sql))) {
return -1;
}
return $total;
}
示例7: display
function display($content, $conf)
{
$this->pi_loadLL();
$this->conf = $conf;
$this->pi_setPiVarDefaults();
//$urlactus=($conf['pid_actus_pa']>0 ? "?id=".$conf['pid_actus_pa'] : "#") ;
$urlactus = $conf['pid_actus_pa'] > 0 ? t3lib_div::getIndpEnv('TYPO3_SITE_URL') . $this->pi_getPageLink($conf['pid_actus_pa']) : "#";
$content .= '
<a href="' . $urlactus . '" class="boutonActus"></a><ul>';
$limit = $conf['nb_accros_aff'] > 0 ? $conf['nb_accros_aff'] : 5;
$query = "SELECT * from tx_vm19news_news where paccdisp=1 AND deleted!=1 AND hidden!=1 AND (endtime=0 OR endtime > " . time() . ") AND (starttime=0 OR starttime < " . time() . ") order by tstamp DESC,sorting LIMIT {$limit}";
$res = mysql(TYPO3_db, $query) or die("req invalide : {$query}");
/* $content.="linkVars:".$GLOBALS["TSFE"]->linkVars;
$GLOBALS["TSFE"]->linkVars='vm19news_dirlink_uid';*/
if (mysql_num_rows($res) > 0) {
while ($row = mysql_fetch_array($res)) {
//$tbparams=Array('vm19news_dirlink_uid'=>trim($row['uid']),'cHash'=>md5($row['uid'])); // parametres supplémentaires à passer à l'url
// le cHash est faux, donc ce ne sera pas mis en cache ni indexé mais on s'en tamponne
// titre a enlacer par le lien
$thetitle = '<b>' . $row['title'] . '</b><br/>' . t3tronqstrww($row['abstract'], $conf['nb_words']);
// on rajoute l'ancre...
$content .= '<li>' . str_replace('"><b>', '?vm19news_dirlink_uid=' . trim($row['uid']) . '&cHash=' . md5($row['uid']) . '#Anc' . $row['uid'] . '"><b>', $this->pi_linkToPage($thetitle, $row['pid'], '', $tbparams)) . '</li>';
//$content.=t3lib_div::getIndpEnv('TYPO3_SITE_URL') . $this->pi_getPageLink($GLOBALS['TSFE']->id,$params);
// ancienne méthode sans utiliser le pi_geypagelink
//$content.='<li><a href="?id='.$row['pid'].'&vm19news_dirlink_uid='.trim($row['uid']).'#Anc'.$row['uid'].'"><b>'.$row['title'].'</b><br/>'.t3tronqstrww($row['abstract'],$conf['nb_words']).'</a>'.'</li>';
}
}
/*
$content .= '
<li>la premi�e accroche <a href="#">Ut vin,
oemata reddit, scire velim, chartis pretium quotus...</a> </li>
<li>Hos ediscit et hos arto stipata theatro spectat <a href="#">Ut vin,
poemata reddit, scire velim, chartis pretium quotus...</a> </li>
*/
//ancienne méthode
$content .= '<br/><li><a href="' . $this->pi_getPageLink($conf['pid_archives_actus']) . '#debform"><b>' . $this->pi_getLL("reach_archives", "consult archives") . '</b></a></li>';
//$content.='<br/><li><a href="index.php?id='.$conf['pid_archives_actus'].'#debform"></a></li>';
$content .= '</ul>
';
return $content;
}
示例8: txRecupLib
function txRecupLib($LtableN, $LfieldK, $LfieldN, $key, $wheresup = "")
{
$valret = false;
$tkey = explode(",", $key);
foreach ($tkey as $key) {
$query = "SELECT {$LfieldN} from {$LtableN} WHERE {$LfieldK}='{$key}' {$wheresup}";
$res = mysql(TYPO3_db, $query);
if (mysql_error()) {
debug(array(mysql_error(), $query));
}
if (mysql_num_rows($res) > 0) {
$tbvr = mysql_fetch_row($res);
$valret = $tbvr[0] . ',';
}
}
// vire la derniere virgule �la fin
if ($valret != false) {
$valret = substr($valret, 0, strlen($valret) - 1);
}
return $valret;
}
示例9: DispFav
function DispFav($whtbl)
{
// argument=
$query = "SELECT * from tt_links where {$whtbl} AND deleted!=1 AND hidden!=1 order by category";
$res = mysql(TYPO3_db, $query) or die("req invalide : {$query}");
if (mysql_num_rows($res) > 0) {
while ($row = mysql_fetch_array($res)) {
if ($catc && $catc != $row['category']) {
$ret .= '<tr height="10">
<td align="center" valign="middle" height="10"><img src="./fileadmin/templates/IMAGES/filet_appli.gif" alt="" height="2" width="176" border="0"></td>
</tr><tr><td>';
}
$catc = $row['category'];
$ret .= '<a href="' . $row['url'] . '" title="' . $row['title'] . " " . $row['note'] . '">';
$ret .= $this->srcimg($row['image'], $row['uid'], $row['title']) . '</a>';
// pour avoir des retours �la ligne auto
//if ($nb%3==0) $ret.="<br/>";
//$ret.=($row['image'] ? '<img border="0" src="'.$this->pics_path.$row['image'].'">' : "->CLICK<-")."</a> ";
}
}
return $ret;
}
示例10: listView
/**
* [Put your description here]
*/
function listView($content, $conf)
{
$this->uid = substr(strstr($GLOBALS[GLOBALS][TSFE]->currentRecord, ":"), 1);
//debug($this->uid);
// $this->uid correspond à l'uid du tt_content contenant le plugin
$this->conf = $conf;
// Setting the TypoScript passed to this function in $this->conf
$this->pi_setPiVarDefaults();
$this->pi_loadLL();
// Loading the LOCAL_LANG values
$lConf = $this->conf["listView."];
// Local settings for the listView function
/* !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-
modif: on ne se met et en mode singleView que si showUid!=" ET SURTOUT que si l'uid tt_content passé correspond
// au courant
// voir aussi utilisation du dernier argument optionel de la la fonction
pi_list_linkSingle qui permet de passer un tableau de hachage contenant autant d'arguments supplémentaires que l'on veut
!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-
*/
if ($this->piVars["showUid"] && $this->piVars["ttc_uid"] == $this->uid) {
// If a single element should be displayed:
$this->internal["currentTable"] = "tx_vm19docsbase_docs";
$this->internal["currentRow"] = $this->pi_getRecord("tx_vm19docsbase_docs", $this->piVars["showUid"]);
$content = $this->singleView($content, $conf);
return $content;
} else {
/* Sert pour le sélecteur de mode, on s'en tappe
$items=array(
"1"=> $this->pi_getLL("list_mode_1","Mode 1"),
"2"=> $this->pi_getLL("list_mode_2","Mode 2"),
"3"=> $this->pi_getLL("list_mode_3","Mode 3"),
); */
if (!isset($this->piVars["pointer"])) {
$this->piVars["pointer"] = 0;
}
if (!isset($this->piVars["mode"])) {
$this->piVars["mode"] = 1;
}
// Initializing the query parameters:
list($this->internal["orderBy"], $this->internal["descFlag"]) = explode(":", $this->piVars["sort"]);
// si aucun classement specifie, par défaut on classe par date décroissante
if ($this->internal["orderBy"] == "") {
$this->internal["orderBy"] = "tstamp";
$this->internal["descFlag"] = 1;
}
//debug ($this->piVars["sort"]);
$this->internal["results_at_a_time"] = t3lib_div::intInRange($lConf["results_at_a_time"], 0, 1000, 3);
// Number of results to show in a listing.
$this->internal["maxPages"] = t3lib_div::intInRange($lConf["maxPages"], 0, 1000, 2);
// The maximum number of "pages" in the browse-box: "Page 1", "Page 2", etc.
$this->internal["searchFieldList"] = "internal_code,title,ext_author,isbn,keywords,abstract,workflow_state,document";
$this->internal["orderByList"] = "title,tstamp";
$query = $this->pi_list_query("tx_vm19docsbase_docs", 1);
$res = mysql(TYPO3_db, $query);
if (mysql_error()) {
debug(array(mysql_error(), $query));
}
$fullTable = $this->RetEntete();
list($this->internal["res_count"]) = mysql_fetch_row($res);
if ($this->internal["res_count"] > 0) {
// Make listing query, pass query to MySQL:
//$query = $this->pi_list_query("tx_vm19docsbase_docs",0,"","","","ORDER BY tstamp DESC, title ASC");
$query = $this->pi_list_query("tx_vm19docsbase_docs");
$res = mysql(TYPO3_db, $query);
if (mysql_error()) {
debug(array(mysql_error(), $query));
}
$this->internal["currentTable"] = "tx_vm19docsbase_docs";
# $fullTable.=t3lib_div::view_array($this->piVars); // DEBUG: Output the content of $this->piVars for debug purposes. REMEMBER to comment out the IP-lock in the debug() function in t3lib/config_default.php if nothing happens when you un-comment this line!
// Adds the mode selector: on le vire
//$fullTable.=$this->pi_list_modeSelector($items);
// Adds the whole list table
$fullTable .= $this->pi_list_makelist($res);
// Adds the search box:
// Elle est Moche alors on la vire
//$fullTable.=$this->pi_list_searchBox();
// Adds the result browser, seulement s'il y a assez de résultats
if ($this->internal["res_count"] > $this->internal["results_at_a_time"]) {
$fullTable .= $this->pi_list_browseresults();
}
} else {
$fullTable .= $this->pi_getLL("no_docs", "[no_docs]");
}
// Returns the content from the plugin.
return $fullTable;
}
}
示例11: main
function main($content, $conf)
{
$this->conf = $conf;
//debug ($conf);
$this->pi_loadLL();
//debug($this->piVars);
$WhereSTH = " WHERE (starttime=0 OR starttime <" . time() . ") AND (endtime=0 OR endtime>" . time() . ") AND deleted=0 AND hidden=0";
$req = "SELECT * from tx_vm19watsniou" . $WhereSTH . " order by tstamp DESC LIMIT " . $this->conf['NiousNumber'];
$rep = mysql(TYPO3_db, $req);
//$content='<H2>'.$this->pi_getLL("WhatsNew").'</H2>'; // le titre est affich�au niveau du plugin
$content .= '<table border="0">';
while ($rw = mysql_fetch_array($rep)) {
if ($this->pi_getPageLink($rw[pid] || $rw[typcontent] == "vm19_hnlinks")) {
// gestion des droits ... simple non ?
// les images sont nomm�s comme les types de contenus
$content .= '<tr><td><img src="' . $this->imgPath . $rw[typcontent] . '.gif"></td><td>';
// debug $content.= "| getPageLink". $this->pi_getPageLink($rw[pid])."|";
if ($rw[typcontent] == "vm19_hnlinks") {
$tabisa = explode("|", $rw[title]);
$href = strstr($tabisa[1], "http://") ? $tabisa[1] : "http://" . $tabisa[1];
$title = $tabisa[0];
$content .= '<H3><a href="' . $href . '" target="_blank">' . $title . '</a></H3>';
} else {
$content .= '<H3>' . $this->pi_linkToPage($rw[title], $rw[pid]) . '</H3>';
}
// ne fonctionne pas quand l'id ne correspond pas au titre
// $content.='<H2>'.VmlinkToPage($rw[title],$rw[pid]).'</H2>';
$content .= '<DIV style="margin:2px">';
$content .= "<b>" . $this->pi_getLL("tc_" . $rw[typcontent]) . "</b>";
if ($rw[tstamp] <= $rw[crdate]) {
$content .= $this->pi_getLL("crdate");
} else {
$content .= $this->pi_getLL("modifdate");
}
$femtctrad = $this->pi_getLL("tcf_" . $rw[typcontent]);
// pour g�er le f�inin de cr�(e) ou modifi�e)
$content .= $femtctrad . $this->pi_getLL("on");
$content .= getDateF($rw[tstamp]);
// $tabidarbo=unserialize($rw[tabidarbo]);
$content .= "<br/>" . $this->pi_getLL("path");
$tabstrarbo = unserialize(stripslashes($rw[tabstrarbo]));
foreach ($tabstrarbo as $key => $value) {
$content .= $this->pi_linkToPage($value, substr($key, 2)) . " > ";
}
$content = vdc($content, 3);
// enl�e le dernier " > "
$content .= '</DIV></td></tr>';
}
// fin si droit OK
}
// fin boucle sur nouveaut�
$content .= "</table>";
/*$content='
<strong>This is a few paragraphs:</strong><BR>
<P>This is line 1</P>
<P>This is line 2</P>
<h3>This is a form:</h3>
<form action="'.$this->pi_getPageLink($GLOBALS["TSFE"]->id).'" method="POST">
<input type="hidden" name="no_cache" value="1">
<input type="text" name="'.$this->prefixId.'[input_field]" value="'.htmlspecialchars($this->piVars["input_field"]).'">
<input type="submit" name="'.$this->prefixId.'[submit_button]" value="'.htmlspecialchars($this->pi_getLL("submit_button_label")).'">
</form>
<BR>
<P>You can click here to '.$this->pi_linkToPage("get to this page again",$GLOBALS["TSFE"]->id).'</P>
';
*/
return $this->pi_wrapInBaseClass($content);
}
示例12: db_query
function db_query($qstring, $print = 0)
{
global $wmr_dbname;
return @mysql($wmr_dbname, $qstring);
}
示例13: main
/**
/**
* le plugin a ��modifi�de fa�n �permettre d'�re ins��plusieurs fois dans une m�e page et que le passage en singleview de l'un n'influence pas les autres
*/
function main($content, $conf)
{
$this->uid = substr(strstr($GLOBALS[GLOBALS][TSFE]->currentRecord, ":"), 1);
if (strstr($this->cObj->currentRecord, "tt_content")) {
$conf["pidList"] = $this->cObj->data["pages"];
$conf["recursive"] = $this->cObj->data["recursive"];
}
$this->conf = $conf;
// Setting the TypoScript passed to this function in $this->conf
$this->pi_setPiVarDefaults();
$this->pi_loadLL();
// Loading the LOCAL_LANG values
//$this->pi_moreParams="&pointeruid[".$this->uid."]=".$this->uid;
/* !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-
modif: on ne se met et en mode singleView que si showUid!=" ET SURTOUT que si l'uid tt_content pass�correspond
// au courant
// voir aussi utilisation du dernier argument optionel de la la fonction
pi_list_linkSingle qui permet de passer un tableau de hachage contenant autant d'arguments suppl�entaires que l'on veut
!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-
*/
/* if ($this->piVars["showUid"] && $this->piVars["ttc_uid"]==$this->uid) { // If a single element should be displayed:
Maintenant la loupe se fait directement dans la liste */
// Affichage Titre verrue Elodie : si nom du dossier syst�e contenant les actus contient "_noinfo", pas de Logo actu ni titre, ni auteur en mode normal
if (!strstr(txRecupLib("pages", "uid", "title", $this->conf['pidList']), "_noinfo")) {
$content .= '<H2>' . $this->pi_getLL("titre_fe", "[titre_fe]") . '</H2>';
// <img src="'.$this->conf["extCurDir"].'picto_actu.gif" class="picto"> cette bourrique de Diane veut plus du picto
}
// si changement de page, on efface le contexte
if ($_SESSION['datafvmnews']['pidcour'] != $this->cObj->data['pid']) {
unset($_SESSION['datafvmnews']);
}
// gestion mode archive
if (isset($this->piVars['arch_mode'])) {
$_SESSION['vmnews_arch_mode'] = $this->piVars['arch_mode'];
}
$this->arch_mode = $this->cObj->data['layout'] >= 1 || $_SESSION['vmnews_arch_mode'] == 1;
/* debug($this->cObj->data['layout'],"this->cObj->data['layout']");
debug($this->piVars,"this->piVars:");*/
//debug ($_SESSION,"sessione");
if ($this->arch_mode) {
// mode archive
//$GLOBALS["TSFE"]->set_no_cache(); // desactive la cache en mode archive sinon formulairee merde...
$content .= '<a name="debform"></a>';
$content .= "<H3>" . $this->pi_getLL("rech_arch", "Rech arhives") . "</H3>";
$content .= $this->buttdisphiddarch();
$content .= "<H4>" . $this->pi_getLL("crit_arch", "Crit arhives") . "</H4>";
//debug($this->conf);
//debug($_SESSION['datafvmnews'],"_SESSION['datafvmnews']");
// si formulaire envoyé, on met en session sa valeur; sinon quand on suit un lien vers le détail d'une actu, comme il n'y a pas de submit, on perd les critères courant
if (isset($this->piVars['DATA']['test_f_sent'])) {
if ($this->piVars['DATA']['datedebp'] != "") {
$this->piVars['DATA']['datedebp'] = rmfDateF($this->piVars['DATA']['datedebp']);
}
if ($this->piVars['DATA']['datefinp'] != "") {
$this->piVars['DATA']['datefinp'] = rmfDateF($this->piVars['DATA']['datefinp']);
}
$tsdtdebp = DateF2tstamp($this->piVars['DATA']['datedebp']);
$tsdtfinp = DateF2tstamp($this->piVars['DATA']['datefinp']);
if ($tsdtdebp > 0 && $tsdtfinp > 0 && $tsdtdebp > $tsdtfinp) {
$errorcd = $this->pi_getLL("err_coher_dates", "erreur de cohérences sur les dates");
$this->piVars['DATA']['datefinp'] = "";
unset($_SESSION['datafvmnews']['datefinp']);
}
$_SESSION['datafvmnews'] = $this->piVars['DATA'];
}
if (!isset($_SESSION['datafvmnews']['emplact'])) {
$this->piVars['DATA']['emplact'][0] = "'" . $this->cObj->data['pid'] . "'";
// si pas de sélection precedente, prend l'uid de la page courante
$_SESSION['datafvmnews']['emplact'][0] = "'" . $this->cObj->data['pid'] . "'";
}
$_SESSION['datafvmnews']['pidcour'] = $this->cObj->data['pid'];
//debug(in_array($this->cObj->data['pid'],$_SESSION['datafvmnews']['emplact']));
//debug($this->piVars['DATA'],"this->piVars['DATA']:");
//debug($_SESSION['datafvmnews'],"_SESSION['datafvmnews']");
$reqroot = "SELECT pid FROM sys_template WHERE hidden = 0 AND root = 1 AND deleted = 0";
$resroot = mysql(TYPO3_db, $reqroot);
if (mysql_num_rows($resroot) == 0) {
die("This site seems to contain no root page");
}
while ($rep = mysql_fetch_row($resroot)) {
$tbpidroot[] = $rep[0];
}
// debug root pid tables
foreach ($tbpidroot as $pidroot) {
$this->retTLDarbo($pidroot);
}
$this->tbemplact = array("%" => $this->pi_getLL("Indifferent", "Indifferent")) + $this->tbemplact;
$LDEmplact = DispLD($this->tbemplact, $this->prefixId . '[DATA][emplact]', "yes", "", false);
// liste d�oulante multi
// avant DispLD n'etait pas compatible XHTML
//$LDEmplact=str_replace("SELECTED",' selected="selected" ',$LDEmplact);
$comment_fdate = " <small> ex. : 15/10/2005 </small>";
$cHash = md5(serialize($this->piVars['DATA']));
$content .= '<FORM action="' . $this->pi_getPageLink($GLOBALS["TSFE"]->id) . '?cHash=' . $cHash . '#debform" name="' . $this->prefixId . 'fname" method="POST">';
$content .= '
<INPUT TYPE="hidden" value="coucou" name="' . $this->prefixId . '[DATA][test_f_sent]" />
//.........这里部分代码省略.........
示例14: reqInfos
/**
* selection des infos sur la table
**/
function reqInfos($uid)
{
$query = 'SELECT typefrequence, typeetat, typeextension, uidpages, hidden,newsletter FROM tx_fabformmail_abonne
WHERE uid = ' . $uid;
$res = mysql(TYPO3_db, $query);
if (mysql_num_rows($res)) {
return mysql_fetch_row($res);
} else {
return false;
}
}
示例15: date
$date_jour = date("Ymd");
$jour = substr($date_jour, 6, 2);
$mois = substr($date_jour, 4, 2);
$annee = substr($date_jour, 0, 4);
$date_file = date("YmdHis");
$date_envoi = date("d/m/Y à H:i:s");
$date_event = date("d/m/Y", mktime(0, 0, 0, $mois, $jour, $annee));
$balise_element = "\n<entete>";
$balise_element .= "\n<idActeur>{$idActeur}</idActeur>";
$balise_element .= "\n<cleActeur>{$cleDepot}</cleActeur>";
$balise_element .= "\n<arRequis>{$arRequis}</arRequis>";
$balise_element .= "\n<mail>{$mail}</mail>";
$balise_element .= "\n</entete>";
//###################Recherche des lits disponibles par uf #########
$requete = "SELECT uf.code, count(*) nb\n\tFROM tagref , uf, lit \n\tWHERE tagref.iduf = uf.iduf and lit.idlit=tagref.idlit \n\t\tand lit.officiel='O' and tagref.idpass='' \n\t\tand uf.code<>'2702'\tand uf.code<='3221'\n\tGROUP BY uf.code";
$result = mysql($baseBD, $requete);
$Nb3021 = $Nb3031 = $Nb3043 = $Nb3080 = $Nb3101 = $Nb3221 = $Nb2702 = $Nb3701 = 0;
while ($record = mysql_fetch_array($result)) {
$UF = $record[code];
$NB = $record[nb];
if ($UF == 3021) {
$Nb3021 = $Nb3021 + $NB;
} elseif ($UF == 3031) {
$Nb3031 = $Nb3031 + $NB;
} elseif ($UF == 3043) {
$Nb3043 = $Nb3043 + $NB;
} elseif ($UF == 3080 or $UF == 3090 or $UF == 3041 or $UF == 3061) {
$Nb3080 = $Nb3080 + $NB;
} elseif ($UF == 3101 or $UF == 3111) {
$Nb3101 = $Nb3101 + $NB;
} elseif ($UF == 3201 or $UF == 3221) {