public function procDefRankArray() { //global $database, $multisort; //$array = $database->getRanking(); $holder = array(); $q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, " . TB_PREFIX . "users.dpall, (\n\n\t\t\tSELECT COUNT( " . TB_PREFIX . "vdata.wref )\n\t\t\tFROM " . TB_PREFIX . "vdata\n\t\t\tWHERE " . TB_PREFIX . "vdata.owner = userid AND type != 99\n\t\t\t)totalvillages, (\n\n\t\t\tSELECT SUM( " . TB_PREFIX . "vdata.pop )\n\t\t\tFROM " . TB_PREFIX . "vdata\n\t\t\tWHERE " . TB_PREFIX . "vdata.owner = userid\n\t\t\t)pop\n\t\t\tFROM " . TB_PREFIX . "users\n\t\t\tWHERE " . TB_PREFIX . "users.dpall >=0 AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " AND " . TB_PREFIX . "users.tribe <= 3\n\t\t\tORDER BY " . TB_PREFIX . "users.dpall DESC, pop DESC, userid DESC"; $result = mysql_query($q) or die(mysql_error()); while ($row = mysql_Fetch_assoc($result)) { $datas[] = $row; } foreach ($datas as $key => $row) { $value['userid'] = $row['userid']; $value['username'] = $row['username']; $value['totalvillages'] = $row['totalvillages']; $value['id'] = $row['userid']; $value['totalpop'] = $row['pop']; $value['dpall'] = $row['dpall']; array_push($holder, $value); } //$holder = $multisort->sorte($holder, "'dpall'", false, 2, "'totalvillage'", false, 2, "'dpall'", false, 2); $newholder = array("pad"); foreach ($holder as $key) { array_push($newholder, $key); } $this->rankarray = $newholder; }
$res = mysql_query("SELECT \r\n\t\t\t\tPosTop, PosLeft, Seite\r\n\t\t\tFROM\r\n\t\t\t\tfaq\r\n\t\t\tWHERE\txFaq = " . $_POST['faq'] . ""); $row = mysql_fetch_array($res); mysql_free_result($res); mysql_query("INSERT INTO faq (\r\n\t\t\t\tFrage, Antwort\r\n\t\t\t\t, Zeigen, PosTop, PosLeft, Seite\r\n\t\t\t\t, Sprache\r\n\t\t\t)\r\n\t\t\tVALUES( \r\n\t\t\t\t'" . htmlentities($_POST['question']) . "', '" . htmlentities($_POST['answer']) . "'\r\n\t\t\t\t, 'y', " . $row[0] . ", " . $row[1] . ", '" . $row[2] . "'\r\n\t\t\t\t, '" . $_POST['lang'] . "'\r\n\t\t\t)"); echo mysql_error(); } // foreign languages are: $l = array("fr", "it"); asort($l); $res = mysql_query("select * from faq where Sprache = 'de'"); // compare with german as base ?> <table class='dialog' width="800"> <?php while ($row = mysql_Fetch_assoc($res)) { ?> <tr> <th> </th> <th><?php echo $row['Frage']; ?> </th> <th><?php echo $row['Antwort']; ?> </th> </tr> <?php // get same faq for other lang (we have no faq+lang identifier so compare site and positions) $res2 = mysql_query("select * from faq where Sprache != 'de' and Seite = '" . $row['Seite'] . "'\r\n\t\t\t\tand PosTop = " . $row['PosTop'] . " and PosLeft = " . $row['PosLeft'] . " order by Sprache ASC");
$DB = mysql_connect("localhost", "admin", "sp0fa1"); mysql_select_db("framework", $DB); set_time_limit(0); //////////////////////// function get_url($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461)"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); curl_close($ch); return $result; } // cerca nuove valute $page = get_url('http://it.finance.yahoo.com/m5?a=1&s=EUR&t=EUR&c=0'); while (preg_match('!<option( selected)? value=([A-Z]+)>([^(]+) \\([A-Z]+\\)!', $page, $pp)) { if ($pp[2] != 'EUR') { mysql_query("INSERT INTO INT_valute VALUES (0,'" . mysql_escape_string(trim($pp[3])) . "','" . mysql_escape_string(trim($pp[2])) . "',0,'','')"); } $page = ereg_replace(quotemeta($pp[0]), '', $page); } $q = mysql_query("SELECT * FROM INT_valute ORDER BY va_cod ASC"); while ($l = mysql_Fetch_assoc($q)) { $pg = get_url('http://it.finance.yahoo.com/m5?a=1&s=EUR&t=' . $l['va_cod'] . '&c=0'); preg_match('!<th nowrap>[0-9:]+</th><td>([0-9.]+)!', $pg, $pp); $val = trim($pp[1]); mysql_query("UPDATE INT_valute SET va_val='{$val}' WHERE va_cod='" . $l['va_cod'] . "'"); print "{$l['va_cod']} = {$val}\n"; }
$row = mysql_num_rows($qGetDt); $tab .= "<button class=mybutton onclick=uploadData2('" . $row . "','" . $arr . "') id=btnUpload>" . $_SESSION['lang']['startUpload'] . "</button>"; $tab .= "<table cellpadding=1 cellspacing=1 border=0 class=sortable><thead><tr>"; $tab .= "<td>No.</td>"; $tab .= "<td>No. Kontrak</td>"; $tab .= "<td>No. SIPB</td>"; $tab .= "<td>Tanggal</td>"; $tab .= "<td>Kodebarang</td>"; $tab .= "<td>Kode Transporter</td>"; $tab .= "<td>Nama Transporter</td>"; $tab .= "<td>Keterangan</td>"; $tab .= "</tr></thead><tbody>"; while ($rGetDt = mysql_fetch_assoc($qGetDt)) { $sNm = "select TRPNAME from " . $dbnm . ".msvendortrp where TRPCODE='" . $rGetDt['TRPCODE'] . "'"; $qNm = mysql_query($sNm, $corn) or die(mysql_error($corn)); $rNm = mysql_Fetch_assoc($qNm); $no += 1; $tab .= "<tr class=rowcontent id=row_" . $no . "><td>" . $no . "</td>"; $tab .= "<td id=kontrak_" . $no . ">" . $rGetDt['CTRNO'] . "</td>"; $tab .= "<td id=sipb_" . $no . ">" . $rGetDt['SIPBNO'] . "</td>"; $tab .= "<td id=tgl_sipb_" . $no . ">" . $rGetDt['SIPBDATE'] . "</td>"; $tab .= "<td id=kdbrg_" . $no . ">" . $rGetDt['PRODUCTCODE'] . "</td>"; $tab .= "<td id=trpcod_" . $no . ">" . $rGetDt['TRPCODE'] . "</td>"; $tab .= "<td id=trp_nm_" . $no . ">" . $rNm['TRPNAME'] . "</td>"; $tab .= "<td id=ket_" . $no . ">" . $rGetDt['DESCRIPTION'] . "</td></tr>"; } $tab .= "</tbody></table>"; echo $tab; break; case 'uploadData2': $sCek = "select * from " . $dbname . ".pabrik_mssipb where CTRNO='" . $kntrk . "' and SIPBNO='" . $nosipb . "'";
$ne = mysql_query("select * from ebpls_buss_taxfeeother where\n\t\t\t\t\t\t\t\t\t\t\tnatureid = '{$nid}' and tfo_id='{$tid}' and taxtype=2"); $er = mysql_fetch_assoc($ne); $ntx = $er['taxfeeid']; } $sValues = "'',{$tax_fee_id_ren},'{$ntx}',\n '{$ivar[$loop]}',now()"; $nFormula->InsertNewComplex($sValues); } if ($check_ret == 1) { //get rentire //get renew $rt = mysql_query("select * from ebpls_buss_taxfeeother where\n\t\t\t\t\t\t\t\t\t\t\ttaxfeeid = '{$complex_tfo[$loop]}' and natureid='{$natureid}'"); $cntrs = mysql_num_rows($rt); if ($cntrs == 0) { //tfoid ito $yer = mysql_query("select * from ebpls_buss_tfo where\n\t\t\t\t\t\t\t\t\t\t\t\t\ttfoid = '{$complex_tfo[$loop]}' and tfoindicator=1"); $yr = mysql_Fetch_assoc($yer); $ntx = $yr['tfoid']; } else { $rs = mysql_fetch_assoc($rt); $nid = $rs['natureid']; $tid = $rs['tfo_id']; $ind = $rs['indicator']; $ne = mysql_query("select * from ebpls_buss_taxfeeother where\n\t\t\t\t\t\t\t\t\t\t\tnatureid = '{$nid}' and tfo_id='{$tid}' and taxtype=3"); $er = mysql_fetch_assoc($ne); $ntx = $er['taxfeeid']; } $sValues = "'',{$tax_fee_id_ret},'{$ntx}',\n '{$ivar[$loop]}',now()"; $nFormula->InsertNewComplex($sValues); } } $complex_formula = $orig_complex;