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"); } } } }
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; }
function query($query) { global $handle, $database; $res = mysql($database, $query, $handle); if (mysql_errno() > 0) { echo mysql_errno() . ": " . mysql_error() . " ({$query})<br>"; } return $res; }
/** * 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); }
/** * 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; }
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; }
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; }
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; }
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; }
/** * [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; } }
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); }
function db_query($qstring, $print = 0) { global $wmr_dbname; return @mysql($wmr_dbname, $qstring); }
/** /** * 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]" /> <TABLE><TR><TD width="120><label for="keywords">' . $this->pi_getLL("keywords", "Mots clés") . '</label></TD><TD><INPUT id="keywords" type="text" size="60" value="' . $_SESSION['datafvmnews']['keywords'] . '" name="' . $this->prefixId . '[DATA][keywords]" /> </TD></TR><TR><TD> <label for="and_or">' . $this->pi_getLL("and_or", "Et/ou") . '</label></TD><TD><INPUT type="radio" id="and_or" ' . ($_SESSION['datafvmnews']["and_or"] != "OR" ? ' checked="checked" ' : '') . ' name="' . $this->prefixId . '[DATA][and_or]" value="AND">' . $this->pi_getLL("AND", "ET") . ' <INPUT type="radio" name="' . $this->prefixId . '[DATA][and_or]" value="OR" ' . ($_SESSION['datafvmnews']["and_or"] == "OR" ? ' checked="checked" ' : '') . '>' . $this->pi_getLL("OR", "OU") . '</TD></TR><TR> <TD> <label for="datedebp">' . $this->pi_getLL("datedebp", "Datedebp") . '</label></TD><TD><INPUT id="datedebp" type="text" size="12" value="' . $_SESSION['datafvmnews']['datedebp'] . '" name="' . $this->prefixId . '[DATA][datedebp]" />' . $comment_fdate . ' </TD</TR><TR><TD> <label for="datefinp">' . $this->pi_getLL("datefinp", "Datefinp") . '</label></TD><TD><INPUT id="datefinp" type="text" size="12" value="' . $_SESSION['datafvmnews']['datefinp'] . '" name="' . $this->prefixId . '[DATA][datefinp]" /> ' . $comment_fdate . ($errorcd ? '<BR><span style="color:red">' . $errorcd . '<span>' : "") . '</TD></TR><TR><TD> <label for="emplact">' . $this->pi_getLL("Emplact", "emplact") . '</label></TD><TD>' . $LDEmplact . ' </TD></TR><TR><TD> <INPUT ' . $this->pi_classParam("submit-button") . ' type="button" name="' . $this->prefixId . '[reset_button]" value="' . $this->pi_getLL("Reset", "Annuler") . '" onclick="getElementById(\'keywords\').value=\'\'; getElementById(\'datedebp\').value=\'\'; getElementById(\'datefinp\').value=\'\';"> </TD><TD> <INPUT ' . $this->pi_classParam("submit-button") . ' type="submit" name="' . $this->prefixId . '[submit_button]" value="' . $this->pi_getLL("rechercher", "Rechercher") . '"> </TD></TR></TABLE> <HR/>'; $content .= '</FORM>'; } //debug($this->cObj->data['pid']); uidd e la page courante //debug($this->uid); //debug($this->piVars); 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"]); //debug($this->piVars); $this->internal["results_at_a_time"] = t3lib_div::intInRange($conf["results_at_a_time"], 0, 1000, 3); // Number of results to show in a listing. $this->internal["maxPages"] = t3lib_div::intInRange($conf["maxPages"], 0, 1000, 2); // The maximum number of "pages" in the browse-box: "Page 1", "Page 2", etc. $this->internal["searchFieldList"] = "title,abstract,bodytext"; $this->internal["orderByList"] = "tstamp,uid,title"; if ($this->arch_mode) { // envoie la requete spéciale if (isset($_SESSION['datafvmnews']['keywords'])) { $_SESSION['datafvmnews']['keywords'] = addslashes($_SESSION['datafvmnews']['keywords']); $tbkeyw = explode(" ", $_SESSION['datafvmnews']['keywords']); foreach ($tbkeyw as $keyw) { $whk .= " __nom_chp__ LIKE '%{$keyw}%' __op__ "; } $whk = vdc($whk, 7); $whk = "(" . str_replace("__op__", $_SESSION['datafvmnews']["and_or"], $whk) . ")"; $whk = "(" . str_replace("__nom_chp__", "title", $whk) . " OR " . str_replace("__nom_chp__", "abstract", $whk) . " OR " . str_replace("__nom_chp__", "bodytext", $whk) . ")"; } if ($_SESSION['datafvmnews']['datedebp'] != "") { $whdp = "( (starttime> " . DateF2tstamp($_SESSION['datafvmnews']['datedebp']) . ") OR ( starttime=0 AND tstamp > " . DateF2tstamp($_SESSION['datafvmnews']['datedebp']) . ") )"; } if ($_SESSION['datafvmnews']['datefinp'] != "") { $whfp = "( (endtime>0 AND endtime < " . DateF2tstamp($_SESSION['datafvmnews']['datefinp']) . ") OR ( endtime=0 AND tstamp < " . DateF2tstamp($_SESSION['datafvmnews']['datefinp']) . ") )"; } $whg = "from tx_vm19news_news WHERE deleted=0 AND hidden=0 "; $whg .= ($whk ? " AND " : "") . $whk; $whg .= ($whdp ? " AND " : "") . $whdp; $whg .= ($whfp ? " AND " : "") . $whfp; if ($_SESSION['datafvmnews']['emplact'][0] != "%") { $whg .= " AND pid IN (" . implode(",", $_SESSION['datafvmnews']['emplact']) . ")"; } //debug ($whg,"where avant :"); $query = $this->pi_list_query("tx_vm19news_news", 1, '', '', '', '', $whg); // le 1 sert a compter seulement //debug ($query,"query apres :"); //pi_list_query($table,$count=0,$addWhere='',$mm_cat='',$groupBy='',$orderBy='',$query='',$returnQueryArray=FALSE) } else { // anciennee methode "normale", ... mais on a rajouté l'affichage sur d'autres pages pr 1 meme actu... //$query = $this->pi_list_query("tx_vm19news_news",1); $whg = "from tx_vm19news_news WHERE deleted=0 AND hidden=0 "; $whg .= "AND ( starttime< " . time() . ' OR starttime=0 )'; $whg .= " AND ( endtime> " . time() . ' OR endtime=0 )'; $pidc = $this->cObj->data['pid']; $whg .= " AND (pid={$pidc} OR otherpages LIKE '{$pidc},%' OR otherpages LIKE '%,{$pidc},%' OR otherpages LIKE '%,{$pidc}')"; $query = $this->pi_list_query("tx_vm19news_news", 1, '', '', '', '', $whg); // le 1 sert a compter seulement //debug($query); } $res = mysql(TYPO3_db, $query); //debug($query); if (mysql_error()) { debug(array(mysql_error(), $query)); } list($this->internal["res_count"]) = mysql_fetch_row($res); # $content.=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! if ($this->internal["res_count"] > 0) { // Make listing query, pass query to MySQL: //pi_list_query($table, $count=0, $addWhere="", $mm_cat="", $groupBy="", $orderBy="", $query="") if ($this->arch_mode) { $content .= '<div class="nbrep_r">' . $this->pi_getLL("nb_news_r", "[nb_news]") . " : <b>" . $this->internal["res_count"] . "</b></div>"; //$query="SELECT * ".$whg." ORDER BY sorting,tstamp DESC"; // le fait de passer par pi_list_query permet d'utiliser la pagination native $query = $this->pi_list_query("tx_vm19news_news", 0, '', '', '', "ORDER BY sorting,tstamp DESC", $whg); } else { // anciennee methode "normale", ... mais on a rajouté l'affichage sur d'autres pages pr 1 meme actu... //$query = $this->pi_list_query("tx_vm19news_news",0,"","","","ORDER BY sorting,tstamp DESC"); $query = $this->pi_list_query("tx_vm19news_news", 0, '', '', '', "ORDER BY sorting,tstamp DESC", $whg); } $res = mysql(TYPO3_db, $query); if (mysql_error()) { debug(array(mysql_error(), $query)); } $this->internal["currentTable"] = "tx_vm19news_news"; // Adds the mode selector. //$content.=$this->pi_list_modeSelector($items); // Adds the whole list table $content .= $this->makelist($res); // Adds the search box: //$content.=$this->pi_list_searchBox(); // Adds the result browser: // Adds the result browser, seulement s'il y a assez de r�ultats if ($this->internal["res_count"] > $this->internal["results_at_a_time"]) { $content .= $this->pi_list_browseresults(); } } else { $content .= $this->pi_getLL("no_news" . ($this->arch_mode ? "1" : ""), "[no_news]"); } $content .= "<BR/>" . $this->buttdisphiddarch(); //$content.=$this->pi_list_browseresults(); // Returns the content from the plugin. return $this->pi_wrapInBaseClass($content); }
/** * 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; } }
$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) {
/** * Main function, returning the HTML content of the module * * @return string HTML */ function main() { $content = ''; $update040a = false; $update040b = false; $update040c = false; $tableNames = $GLOBALS['TYPO3_DB']->admin_get_tables(); if (!isset($tableNames['tx_myquizpoll_relation_user_id_mm'])) { $update040a = true; $update040b = true; $update040c = true; } if (t3lib_div::_GP('update040a')) { $content .= "<br />Executing: Update relations-table for advanced statistics\n"; $mmArray = array(); $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid_local, uid_foreign', 'tx_myquizpoll_relation_user_id_mm', '', '', '', ''); $rows = $GLOBALS['TYPO3_DB']->sql_num_rows($res); if ($rows > 0) { // DB entries found? while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $local = $row['uid_local']; $mmArray[$local] = array(); $mmArray[$local]['user'] = $row['uid_foreign']; } } $res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid_local, uid_foreign', 'tx_myquizpoll_relation_question_id_mm', '', '', '', ''); $rows = $GLOBALS['TYPO3_DB']->sql_num_rows($res2); if ($rows > 0) { // DB entries found? while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2)) { $local = $row['uid_local']; $mmArray[$local]['quest'] = $row['uid_foreign']; } } $updateArray = array(); foreach ($mmArray as $key => $value) { //$content .= "- $key: ".$value['user'].'/'.$value['quest']."<br />\n"; $updateArray = array('user_id' => $value['user'], 'question_id' => $value['quest']); $success = $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_myquizpoll_relation', 'uid=' . $key, $updateArray); if (!$success) { $content .= "<p>MySQL Update-Error :-(</p>"; } } $update040a = true; } if (t3lib_div::_GP('update040b')) { $content .= "<br />Executing: - Delete no longer needed relation-data\n"; $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_myquizpoll_relation_user_id_mm', ''); $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_myquizpoll_relation_question_id_mm', ''); $update040b = true; } if (t3lib_div::_GP('update040c')) { $content .= "<br />Executing: - Delete no longer needed relation-tables\n"; mysql(TYPO3_db, 'DROP TABLE tx_myquizpoll_relation_user_id_mm'); mysql(TYPO3_db, 'DROP TABLE tx_myquizpoll_relation_question_id_mm'); $update040c = true; } if (t3lib_div::_GP('updatepoll') && t3lib_div::_GP('pollpid')) { $thePID = intval(t3lib_div::_GP('pollpid')); $timestamp = time(); $content .= "<br />Executing: - Converting basic poll data to advanced poll data (folder {$thePID})\n"; $res5 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid, cruser_id,sys_language_uid,hidden, p_or_a, qids', 'tx_myquizpoll_result', 'pid=' . $thePID, '', '', ''); $rows = $GLOBALS['TYPO3_DB']->sql_num_rows($res5); if ($rows > 0) { $statisticsArray = array(); while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res5)) { $theUID = $row['uid']; if (intval($row['p_or_a']) > 0 && intval($row['p_or_a']) < 13) { $statisticsArray[$theUID] = array('pid' => $thePID, 'tstamp' => $timestamp, 'crdate' => $timestamp, 'cruser_id' => $row['cruser_id'], 'hidden' => $row['hidden'], 'user_id' => $theUID, 'question_id' => $row['qids'], 'checked' . $row['p_or_a'] => 1, 'sys_language_uid' => $row['sys_language_uid']); } } } if (is_array($statisticsArray)) { foreach ($statisticsArray as $type => $element) { $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_myquizpoll_relation', $element); } $content .= "<br />" . count($statisticsArray) . " elements inserted. done.<br />\n"; } } if (t3lib_div::_GP('updatepoll2a') && t3lib_div::_GP('pollpid2a')) { $thePID = intval(t3lib_div::_GP('pollpid2a')); $timestamp = time(); $content .= "<br />Executing: - Copy basic poll data to tx_myquizpoll_voting (folder {$thePID})\n"; $res5 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid, crdate,cruser_id,sys_language_uid,hidden, p_or_a, qids, ip', 'tx_myquizpoll_result', 'pid=' . $thePID, '', '', ''); $rows = $GLOBALS['TYPO3_DB']->sql_num_rows($res5); if ($rows > 0) { $votingArray = array(); while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res5)) { $theUID = $row['uid']; if (intval($row['p_or_a']) > 0 && intval($row['p_or_a']) < 13) { $votingArray[$theUID] = array('pid' => $thePID, 'tstamp' => $timestamp, 'crdate' => $row['crdate'], 'cruser_id' => $row['cruser_id'], 'hidden' => $row['hidden'], 'question_id' => intval($row['qids']), 'answer_no' => $row['p_or_a'], 'ip' => $row['ip'], 'sys_language_uid' => $row['sys_language_uid']); } } } if (is_array($votingArray)) { foreach ($votingArray as $type => $element) { $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_myquizpoll_voting', $element); } $content .= "<br />" . count($votingArray) . " elements inserted into tx_myquizpoll_voting. done.<br />\n"; } } if (t3lib_div::_GP('updatepoll2b') && t3lib_div::_GP('pollpid2a')) { $thePID = intval(t3lib_div::_GP('pollpid2a')); $content .= "<br />Executing: - Deleting old basic poll data (folder {$thePID})\n"; $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_myquizpoll_result', 'pid=' . $thePID); } // formular if ($content) { $content .= "<br /><br />\n"; } $linkScript = t3lib_div::linkThisScript(); // htmlspecialchars() //$content.=$linkScript; $content .= '<form name="myquiz" action="' . $linkScript . '" method="post">'; if (!($update040a && $update040b && $update040c)) { $content .= '<br /><p>Updates from Version 0.3.0-0.4.2 to 1.0.0:<br />'; if (!$update040a) { $content .= '<input type="checkbox" name="update040a" value="1" checked="checked" /> Update relation-table for advanced statistics<br />'; } if (!$update040b) { $content .= '<input type="checkbox" name="update040b" value="1" checked="checked" /> - Delete no longer needed relation-data<br />'; } if (!$update040c) { $content .= '<input type="checkbox" name="update040c" value="1" checked="checked" /> - Delete no longer needed relation-tables<br />'; } $content .= '</p><br />'; } $content .= '<p><input type="checkbox" name="updatepoll" value="1" /> Optional: convert basic poll data to advanced poll data. ID of the folder: '; $content .= '<input type="text" name="pollpid" value="" /> (be carefully, there is no check if there are really basic poll data). Execute it only once!</p><br />'; $content .= '<p><input type="checkbox" name="updatepoll2a" value="1" /> Optional: copy basic poll data to the table tx_myquizpoll_voting. ID of the folder: '; $content .= '<input type="text" name="pollpid2a" value="" /> (be carefully, there is no check if there are really basic poll data). Execute it only once!'; $content .= '<br /> - <input type="checkbox" name="updatepoll2b" value="1" /> Delete old entries in the table tx_myquizpoll_result with the above ID.</p><br />'; //$linkScript = t3lib_div::slashJS(t3lib_div::linkThisScript()); //$content.=$linkScript; // this.form.action=\''.$linkScript.'\'; $content .= '<input type="button" onclick="this.form.submit();" name="send" value="Start" />'; $content .= '</form>'; return $content; }
<?php header("Content-type:text/xml"); mysql_connect("localhost", "root", ""); $result = mysql("hr", "SELECT LastName,FirstName from Employees ORDER BY LastName, FirstName"); $i = 0; echo "<data_mahasiswa>"; while ($i < mysql_num_rows($result)) { $fields = mysql_fetch_row($result); echo "<nama>{$fields['1']} {$fields['0']} </nama>\r\n"; $i++; } echo "</data_mahasiswa>"; mysql_close();
/** * Plug-in pour creation de comptes CAS */ function main($content, $conf) { $this->conf = $conf; $this->pi_setPiVarDefaults(); $this->pi_USER_INT_obj = 1; // Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object! $this->pi_loadLL(); session_start(); if (!isset($_SESSION["portalId"]) || $_SESSION["portalId"] == "") { header("Location: index.php?id=2822"); } $type = "dev_ext"; $url = null; if ($type == "prod") { $url = "www4.haras-nationaux.fr:8080"; } else { if ($type == "dev") { $url = "xinf-devlinux:8080"; } else { if ($type == "dev_ext") { $url = "80.124.158.237:8080"; } } } /** * declaration des urls de redirection iframe */ $this->urlPassageIdentFort = $this->pi_getPageLink("3684"); $this->urlAchatPoint = $this->pi_getPageLink("3675"); $this->urlGererConsulterCheval = $this->pi_getPageLink("3674"); $this->urlDeclarerCheval = $this->pi_getPageLink("3673"); $this->urlModifSosPoulain = $this->pi_getPageLink("3672"); $this->urlAjoutSosPoulain = $this->pi_getPageLink("3671"); $this->urlModifCompte = $this->pi_getPageLink("3670"); /** * Declaration des URL pour accéder aux services externes */ $this->urlDeclaNovelleNaissance = "http://" . $url . "/cid-internet-web/declaration-naissance/ReferenceDeSaillieAction.do?dispatch=initDataBeforeLoad&typeDeclaration=POS"; $this->urlDeclaResultNeg = "http://" . $url . "/cid-internet-web/declaration-naissance/ReferenceDeSaillieAction.do?dispatch=initDataBeforeLoad&typeDeclaration=NEG"; $userId = $_SESSION["portalId"]; $userId = "faible"; $param[] = array("login" => $userId, "ctx" => null); $ws = new WebservicesCompte("dev_ext"); if (!$ws->connectIdent()) { $content = "ERROR:" . $ws->getErrorMessage(); $content = "L'espace privé est momentanément indisponible, veuillez nous excuser de ce désagrément."; return $content; } $this->personne = $ws->getPersonneByLogin($param); print_r($this->personne); /** * recuperation du nombre de naissance, de lieux de detention */ $paramCid[] = array("login" => $_SESSION["portalId"], "ctx" => null); $wsCid = new WebservicesCompte("dev_ext"); if (!$wsCid->connectCid()) { //$content="ERROR:".$wsCid->getErrorMessage(); $content = "L'espace privé est momentanément indisponible, veuillez nous excuser de ce désagrément."; return $content; } $this->nbreNaissance = $wsCid->getNbrNaissanceAnneeEnCours4User($paramCid); $this->nbreLieudetention = $wsCid->getNbrLieuDetention4User($paramCid); $this->nbreChevaux = $wsCid->getNbrChevaux4User($paramCid); /** * recuperation du nombre de factures et le montant total */ if ($this->personne["findPersonneByLoginReturn"]["key"]["numeroPersonne"] != "") { $paramPsi[] = $this->personne["findPersonneByLoginReturn"]["key"]["numeroPersonne"]; $paramPsi[] = $this->personne["findPersonneByLoginReturn"]["key"]["numeroOrdreAdresse"]; $wsPsi = new WebservicesCompte(); if (!$wsPsi->connectPsi()) { //$content="ERROR:".$wsPsi->getErrorMessage(); $content = "L'espace privé est momentanément indisponible, veuillez nous excuser de ce désagrément."; return $content; } else { //Nombre de factures $this->nbreFactures = $wsPsi->getNbrFactureARegler4User($paramPsi); $this->montantFactures = $wsPsi->getMontantFactureARegler4User($paramPsi); } } /** * Recup des centres tech du departement */ if ($this->personne["findPersonneByLoginReturn"]["adresse"]["commune"]["codePostal"] != "" && $this->personne["findPersonneByLoginReturn"]["adresse"]["commune"]["codePostal"] > 0) { $ws = new WebservicesAccess(); if ($ws->connect()) { $objTransfert = new ObjectTransfertWS(); $objTransfert->setKey("codeDepartement"); $objTransfert->setValue(substr($this->personne["findPersonneByLoginReturn"]["adresse"]["commune"]["codePostal"], 0, 2)); $paramCT[] = $objTransfert; $result = $ws->getCentresTEchniques($paramCT); //if(!$result && $ws->getErrorMessage()!="") echo "[error resultat:]".$ws->getErrorMessage(); /** * Calcul du centre le plus proche */ $precTot = 10000000000; foreach ($result as $centre) { if ($centre["codePostal"] > $this->personne["findPersonneByLoginReturn"]["adresse"]["commune"]["codePostal"]) { $result = $centre["codePostal"] - $this->personne["findPersonneByLoginReturn"]["adresse"]["commune"]["codePostal"]; } else { $result = $this->personne["findPersonneByLoginReturn"]["adresse"]["commune"]["codePostal"] - $centre["codePostal"]; } if ($result < $precTot) { $precTot = $result; $this->ct = $centre; } } } } /** * On regarde si l'utilisateur est abonn� aux news et alertes */ if ($this->personne["findPersonneByLoginReturn"]["coordonnees"]["email"] != "") { $query = "SELECT * FROM tx_fabformmail_abonne where email='" . $this->personne["findPersonneByLoginReturn"]["coordonnees"]["email"] . "'"; $res = mysql(TYPO3_db, $query) or die("req invalide : {$query}"); if (mysql_num_rows($res) > 0) { $row = mysql_fetch_array($res); if ($row['newsletter'] == "1") { $this->isAbonNews = true; } if ($row['hidden'] == "0") { $this->isAbonAlert = true; } } } $content = $this->getEspacePerso(); if ($_GET["debug"]) { $this->getDebug(); } return $this->pi_wrapInBaseClass($content); }
mysql_query("UPDATE explore SET mthrs= \"0\""); echo "<center>All accounts have been reset.<br>\r\n\t\t\t\t<a href=http://www.medievalbattles.com/gameconfig.php>Return</a></center>"; } ?> <br> <br> <br> <?php include "include/connect.php"; $tablename = "user"; echo "\r\n\t<table border=1 align=center width=\"100%\">\r\n\t <tr>\r\n\t <td>Empire Name</td>\r\n\t <td>Password</td>\r\n\t <td>Email</td>\r\n\t <td>AIM</td>\r\n\t <td>MSN</td>\r\n\t <td>Host Name</td>\r\n"; $query_string = "SELECT ename, pw, email, aim, msn, ip FROM user ORDER BY ip"; $result_id = mysql_query($query_string, $var); while ($row = mysql_fetch_row($result_id)) { $ONLINE_NO = mysql($dbnam, "SELECT online FROM user WHERE ename='{$row['0']}'"); $OLINE = mysql_result($ONLINE_NO, "OLINE"); if ($OLINE == 1) { $O_line = "<font color=red>*</font>"; } else { $O_line = ""; } print "<TR ALIGN=center VALIGN=TOP colspan=7>\r\n\t\t\t\t<td>{$row['0']} {$O_line}</td>\r\n\t\t\t\t<td>{$row['1']}</td>\r\n\t\t\t\t<td>{$row['2']}</td>\r\n\t\t\t\t<td>{$row['3']}</td>\r\n\t\t\t\t<td>{$row['4']}</td>\r\n\t\t\t\t<td>{$row['5']}</td>\n"; } echo "</table>"; ?> <?php ob_end_flush(); ?>
<?php include_once "config.inc.php"; $ip = getenv("REMOTE_ADDR"); $id = $_REQUEST['id']; // Seleciona a enquete da vez, só pra pegar o ID $sql = "select * from tab01_enquetes where tab01_id = '{$id}' limit 1"; $data_enquete = query($sql, 1); // Controla votação por IP $sql = "select * from tab02_voto where tab01_id = '{$id}' and tab02_ip = '{$ip}' "; $data = mysql($sql, 1); ?> <table id="tb_enquete" style="display: " width="100%" border="0" align="center"> <tr> <td> Enquete Nr.: <?php echo $data_enquete['tab01_id']; ?> <input name="tab01_id" type="hidden" id="tab01_id" value="<?php echo $data_enquete['tab01_id']; ?> " /></td> </tr> <tr> <td align="left"><hr align="left" width=75% size="0"/></td> </tr> <tr> <td><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="9"> </td> <td><?php
<?php $dbhost = "localhost"; $dbuser = "******"; $dbpass = ""; $conn = mysql_connect($dbhost, $dbuser, $dbpass); if (!$conn) { die('Could not connect: ' . mysql()); } $sql = 'SELECT emp_id, emp_name, emp_address, emp_salary FROM employee'; mysql_SELECT_db('test_db'); $retval = mysql_query($sql, $conn); if (!$retval) { die('Could not get data:' . mysql_error()); } while ($row = mysql_fetch_array($retval, MYSQL_ASSOC)) { echo "EMP ID :{$row['emp_id']} <br> " . "EMP NAME : {$row['emp_name']} <br> " . "EMP SALARY : {$row['emp_salary']} <br> " . "--------------------------------<br>"; } echo "Fetched data successfully\n"; mysql_close($conn);
echo mysql_error(); $num1 = mysql_num_rows($result1); //$anz = mysql_result($result1, $i1, 'count'); //echo $anz."<BR>"; $MIN_DTO = mysql_result($result2, $i2, 'MIN_DTO'); $MAX_DTO = mysql_result($result2, $i2, 'MAX_DTO'); echo "Frühestes Jahr: ".$MIN_DTO.", spätestes Jahr: ".$MAX_DTO."<BR>"; FOR($i1='0'; $i1<$num1; $i1++) { $DTO = mysql_result($result1, $i1, 'DTO'); echo $i1." - ".$DTO."<BR>"; } */ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ###################################################################################################################### // Routine zur �bertragung der vorhandenen kat_id's von der kategorie-Tabelle zur kat_lex-Tabelle: $result1 = mysql($db, "SELECT kat_id FROM {$table4} ORDER BY 'kat_id'"); $num1 = mysql_num_rows($result1); for ($i1 = '0'; $i1 < $num1; $i1++) { $kat_id = mysql_result($result1, $i1, 'kat_id'); $res2 = mysql($db, "INSERT INTO {$table11} (kat_id, info) VALUES ('{$kat_id}', '')"); echo "Kategorie " . $kat_id . " wurde übertragen<BR>"; } // ####################################################################################################################### // ###################################################################################################################### // ##### Routine zur L�schung der pb_column_info-Tabelle: ############################################################ $result1 = mysql($db, "DROP TABLE pb_column_info"); if (mysql_error == "") { echo "Tabelle pb_column_info wurde gelöscht<BR>"; } // #######################################################################################################################
* * This file is licensed under the terms of the Open Software License * http://www.opensource.org/licenses/osl-2.1.php * * @copyright 2003-2005 Klaus Henneberg * @author Klaus Henneberg * @package pic2base * @license http://www.opensource.org/licenses/osl-2.1.php Open Software License */ unset($username); if ($_COOKIE['login']) { list($c_username) = preg_split('#,#', $_COOKIE['login']); //echo $c_username; } include '../share/db_connect1.php'; $result1 = mysql($db, "SELECT * FROM {$table1} WHERE username = '******' AND aktiv = '1'"); $berechtigung = mysql_result($result1, $i1, 'berechtigung'); switch ($berechtigung) { //Admin case $berechtigung == '1': $navigation = "<a class='navi' href='adminframe.php'>Administration</a>\n\t\t\t<a class='navi' href='erfassung0.php'>Erfassung</a>\n\t\t\t<a class='navi' href='auswahl0.php?mod=rech'>Recherche</a>\n\t\t\t<a class='navi' href='start.php'>Zur�ck</a>\n\t\t\t<a class='navi' href='hilfe1.php'>Hilfe</a>\n\t\t\t<a class='navi' href='../../index.php'>Logout</a>"; break; //Owner //Owner case $berechtigung == '5': $navigation = "<a class='navi' href='erfassung0.php'>Erfassung</a>\n\t\t\t<a class='navi' href='recherche1.php'>Recherche</a>\n\t\t\t<a class='navi' href='vorschau.php'>Bearbeitung</a>\n\t\t\t<a class='navi' href='hilfe1.php'>Hilfe</a>\n\t\t\t<a class='navi' href='../../index.php'>Logout</a>"; break; //Web-User //Web-User case $berechtigung == '9': $navigation = "<a class='navi' href='recherche1.php'>Recherche</a>\n\t\t\t<a class='navi' href='hilfe1.php'>Hilfe</a>\n\t\t\t<a class='navi' href='../../index.php'>Logout</a>";
<?php header("Content-type:text/xml"); mysql_connect("127.0.0.1", "root", ""); $result = mysql("hr2", "SELECT LastName,FirstName FROM Employees ORDER BY LastName,FirstName"); $i = 0; echo '<data_mahasiswa>'; while ($i < mysql_numrows($result)) { $fields = mysql_fetch_row($result); echo "<nama>{$fields['1']} {$fields['0']} </nama>"; $i++; } echo '</data_mahasiswa>'; mysql_close();
<? ob_start(); $title = "СМЯНА НА ПАРОЛА"; include 'config.php'; include 'head.php'; //get the code that is being checked and protect it before assigning it to a variable $code = $_GET['code']; $user = $_GET['user']; $codeemail=$_GET['codeemail']; $query = "SELECT * FROM `users` WHERE `user_name`= '" . $user . "' "; $result = mysql_query($query) or die(mysql(mysql_error())); while ($row = mysql_fetch_array($result)) { $_SESSION['user_info'] = $row; } //check if there was no code found if (!$code || !$user || !$codeemail) { //if not display error message $error_act = '<div class="error" >За съжаление възникна грешка грешка!</div>'; } else { if (md5($_SESSION['user_info']['email']==$codeemail)){ $error_act =' <form method="post" action="change_pass2.php?user='******'&code='.$code.'"> <table border="0" align="center" width="100%"> <tr > <td colspan="2"><div style="width: auto;"><?php echo $error; ?> </div></td>
* Copyright (c) 2006 - 2007 Klaus Henneberg * * Project owner: * Dipl.-Ing. Klaus Henneberg * 38889 Blankenburg, BRD * * This file is licensed under the terms of the Open Software License * http://www.opensource.org/licenses/osl-2.1.php * */ if ($_COOKIE['uid']) { $uid = $_COOKIE['uid']; } include '../share/global_config.php'; include $sr . '/bin/share/db_connect1.php'; $result1 = mysql($db, "SELECT * FROM {$table1} WHERE id = '{$uid}' AND aktiv = '1'"); $username = mysql_result($result1, isset($i1), 'username'); echo "\n<div class='page'>\n\t<FORM name='', method='post' action=''>\n\t<p id='kopf'>pic2base :: </p>\n\t\n\t<div class='navi' style='clear:right;'>\n\t\t<div class='menucontainer'>\n\t\t\t" . $navigation . "\n\t\t</div>\n\t</div>\n\t\n\t<div id='spalte1F'>\n\t\t\n\t</div>\n\t\n\t<div id='spalte2F'>\n\t\t\n\t</div>\n\t\n\t<div id='filmstreifen'>"; include '../share/get_preview.php'; echo "\n\t</div>"; if ($button_view !== '0') { echo "<p align='right' style='margin-right:20px;'><INPUT type='submit'>   <INPUT type='button' value='Abbrechen' OnClick='location.href=\"edit_start.php\"'></p>"; } else { echo "<p align='right' style='margin-right:20px;'><INPUT type='submit' disabled>   <INPUT type='button' value='Abbrechen' OnClick='location.href=\"edit_start.php\"'></p>"; } echo "\n</FORM>\n\t<p id='fuss'><A style='margin-right:745px;' HREF='http://www.pic2base.de' target='blank'>www.pic2base.de</A>" . $cr . "</p>\n\t\n</div>"; mysql_close($conn); ?> </DIV> </CENTER> </BODY>
function getCount($pid) { $query = "SELECT count(*) FROM pages WHERE pid = '{$pid}'" . $this->clause; $res = mysql(TYPO3_db, $query); $row = mysql_fetch_row($res); return $row[0]; }
<?php require_once 'login.php'; $db_server = mysql_connect($db_hostname, $db_username, $db_password); if (!$db_server) { die("Невозможно подключиться к MYSQL:" . mysql()); } mysql_select_db($db_database) or die("НЕВОЗМОЖНО выбрать базу данных" . mysql_error()); $query = "CREATE TABLE otzyv (\nid SMALLINT NOT NULL AUTO_INCREMENT,\norder VARCHAR(32) NOT NULL,\nball VARCHAR(32) NOT NULL,\nbrigada VARCHAR(32) NOT NULL,\ncomment VARCHAR (32) NOT NULL\n)"; $result = mysql_query($query); if (!$result) { die("Сбой при доступе к базе данных:" . mysql_error()); }
function DispCP($tb_links) { $sqlIN = $this->conf['fixedLinksCats'] ? "category NOT IN (" . $this->conf['fixedLinksCats'] . ")" : "1"; $query = "SELECT * from tt_links where {$sqlIN} AND deleted!=1 AND hidden!=1 AND pid=" . $this->pidulinks . " order by category"; $res = mysql(TYPO3_db, $query); if (mysql_num_rows($res) > 0) { $ret .= '<FORM action="' . $this->pi_getPageLink($GLOBALS["TSFE"]->id) . '" name="' . $this->prefixId . 'fname" method="POST"> <INPUT type="hidden" name="' . $this->prefixId . '[ValidCP]" value="OK">'; $ret .= '<table border="0">'; $vtb_links = array(); if ($tb_links) { $vtb_links = explode(",", $tb_links); } while ($row = mysql_fetch_array($res)) { $ncat = RecupLib("tt_links_cat", "uid", "title", $row['category']); if ($catc != $ncat) { $catc = $ncat; $ret .= '<tr><td colspan="2"><b>' . $catc . '</b></td></tr>'; } $ret .= '<tr><td>'; $ret .= '<input type="checkbox" name="' . $this->prefixId . '[u_links][]" value="' . $row[uid] . '" ' . (in_array($row[uid], $vtb_links) ? "checked" : "") . '>'; $ret .= '</td><td align="center">'; $ret .= '<a href="' . $row['url'] . '" target="_blank" title="' . $row['title'] . " " . $row['note'] . '">'; $ret .= $this->srcimg($row['image'], $row['uid'], $row['title']) . "</a></td>"; $ret .= '<td><a href="' . $row['url'] . '" target="' . (strstr($row['url'], "http://") ? "_blank" : "_self") . '" title="' . $row['note'] . '">' . $row['title'] . '</a></td>'; $ret .= '</tr>'; } $ret .= '</table>'; $ret .= '<INPUT ' . $this->pi_classParam("submit-button") . ' type="submit" name="' . $this->prefixId . '[submit_button]" value="' . $this->pi_getLL("validprefs", "Valid preferences") . '"></form>'; } else { //pas de liens actifs $ret .= "<br/>" . $this->pi_getLL("no_act_links", "Aucun lien spécifique disponible") . "<br/>"; } return $ret; }
function saveCondition($sID, $whereClause) { if (!isset($sID) || $sID == '') { header('Content-Type: text/xml'); print "<request>-1</request>"; return -1; } global $DBHost, $DBUser, $DBPass, $DBName; mysql_connect("{$DBHost}", "{$DBUser}", "{$DBPass}"); $result = mysql("{$DBName}", "SELECT 1 FROM setups WHERE sID = '{$sID}'") or die(mysql_error()); $found_sID = mysql_num_rows($result); if ($found_sID != '' && $found_sID <= 0) { header('Content-Type: text/xml'); print "<request>Parent folder does not exist ({$sID}). Please try again later.</request>"; return -1; } $squery = "UPDATE setups SET sValue = '{$whereClause}' WHERE sID = {$sID}"; logger("{$squery}"); $result = mysql_query($squery) or die("Invalid Query: " . mysql_error()); header('Content-Type: text/xml'); print "<request>{$sID}</request>"; return 0; }