当前位置: 首页>>代码示例>>PHP>>正文


PHP printTable函数代码示例

本文整理汇总了PHP中printTable函数的典型用法代码示例。如果您正苦于以下问题:PHP printTable函数的具体用法?PHP printTable怎么用?PHP printTable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了printTable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: printModelInfo

function printModelInfo($table, $source, $relationships, $columns)
{
    echo '<h2>Model Info</h2>';
    printTable($table);
    printSource($source);
    printRelationships($relationships);
    printColumns($columns);
}
开发者ID:nanotech,项目名称:recess,代码行数:8,代码来源:classInfo.html.php

示例2: printBallPopularity

function printBallPopularity($orderBy, $showTop)
{
    $conn = connectToDatabase();
    $query = "SELECT roll.Ball_ID, Count(roll.Ball_ID) as numOfRolls, ball.Color, ball.Weight, ball.Size\n                FROM roll, ball\n                WHERE roll.Ball_ID = ball.Ball_ID\n                GROUP by Ball_ID\n                ORDER BY COUNT(Ball_ID) {$orderBy} LIMIT {$showTop}";
    $result = $conn->query($query);
    printTable($result);
    $conn->close();
}
开发者ID:robert-vo,项目名称:Bowling-Score-Tracking-System,代码行数:8,代码来源:ballReport.php

示例3: showSchedule

function showSchedule($array, $month, $teamName)
{
    /*$exists = FALSE;
    		foreach($array as $value)
    		{	
    			if($month!= 'NULL')
    				if($teamName !== 'NULL')
    					if($value['Visitor'] == $teamName || $value['Home'] == $teamName)
    						$exists = TRUE;
    					else
    					{
    					 
    					}
    				else
    					$exists = TRUE;
    		}
    		if($exists == TRUE)
    		{*/
    echo '<table class = "table" style = "text-align:center; margin: 0 auto;" border="1">';
    echo '<tr>';
    echo "<td>Date</td>";
    echo "<td>Logo</td>";
    echo "<td>Visitor</td>";
    echo "<td>PTS Away</td>";
    echo "<td>Logo</td>";
    echo "<td>Home</td>";
    echo "<td>PTS Home</td>";
    foreach ($array as $value) {
        if ($month != 'NULL') {
            if (strpos($value['Date'], $month) !== False) {
                if ($teamName !== 'NULL') {
                    if ($value['Visitor'] == $teamName) {
                        printTable($value);
                    } else {
                        if ($value['Home'] == $teamName) {
                            printTable($value);
                        }
                    }
                } else {
                    if (strpos($value['Visitor'], $month) !== False) {
                    } else {
                        printTable($value);
                    }
                }
            }
        } else {
            if ($value['Visitor'] == $teamName) {
                printTable($value);
            } else {
                if ($value['Home'] == $teamName) {
                    printTable($value);
                }
            }
        }
    }
    echo '</table>';
    //}
}
开发者ID:TeamBall,项目名称:CapstoneProject,代码行数:58,代码来源:schedule.php

示例4: printTable

                printTable($query, $prevparam, $nextparam, $search);
            } else {
                if ($request == "BAND") {
                    $id = $_GET['i'];
                    $prev = $start - $sizelimit;
                    if ($prev < 0) {
                        $prev = 0;
                    }
                    $prevparam = "r={$request}&i={$id}&s={$prev}";
                    $next = $start + $sizelimit;
                    $nextparam = "r={$request}&i={$id}&s={$next}";
                    $query = $basequery . "WHERE v.BandID = {$id} AND v.Approved = 1 ORDER BY BandYear DESC";
                    $result = mysql_query($query);
                    $row = mysql_fetch_array($result);
                    $search = $row['School'];
                    printTable($query, $prevparam, $nextparam, $search);
                }
            }
        }
    }
}
// Prints the actual interface for the user.
// @Input $query - The SQL query to get the list of Videos to display. Must return
// BandID, School, VideoURL,  Title, Name, BandYear, and FestivalID
// @Input $prevparam - The GET parameter for the 'Previous Page' link. Specific to the query type
// @Input $nextparam - The GET parameter for the 'Next Page' link. Specific to the query type
// @Input $search - What terms were searched for. Specific to the query type.
function printTable($query, $prevparam, $nextparam, $search)
{
    global $start, $sizelimit;
    require "../connection.inc.php";
开发者ID:mover5,项目名称:imobackup,代码行数:31,代码来源:videopage.php

示例5: explode

    $boardCells = explode('-', $boardRow);
    if (count($boardCells) != 8) {
        invalidBoard();
    }
    foreach ($boardCells as $piece) {
        if (strpos("RHBKQP ", $piece) === false) {
            invalidBoard();
        }
        if (empty($piecesCount[$piece])) {
            $piecesCount[$piece] = 0;
        }
        $piecesCount[$piece]++;
    }
    $board[] = $boardCells;
}
printTable($board);
$pieceMapping = ['B' => "Bishop", 'H' => "Horseman", 'K' => "King", 'P' => "Pawn", 'Q' => "Queen", 'R' => "Rook"];
$piecesForPrint = [];
foreach ($pieceMapping as $pieceLetter => $pieceName) {
    if (isset($piecesCount[$pieceLetter])) {
        $piecesForPrint[$pieceName] = $piecesCount[$pieceLetter];
    }
}
echo json_encode($piecesForPrint);
function printTable($matrix)
{
    echo '<table>';
    for ($row = 0; $row < count($matrix); $row++) {
        echo '<tr>';
        for ($col = 0; $col < count($matrix[$row]); $col++) {
            echo '<td>' . htmlspecialchars($matrix[$row][$col]) . '</td>';
开发者ID:KonstantinKirchev,项目名称:PHP,代码行数:31,代码来源:PHPChess.php

示例6: getFiles

        <?

        $filesArray = getFiles();
	   // SORT according to links...
	   if ($_GET['sort'] == 'size'){
	     echo "sort by size";
	/*     usort($filesArray, function($a,$b){

	     if($a["size"] == $b["size"]) {
               return 0;
             } 
               return ($a["size"] < $b["size"]) ? -1 : 1;
	     }*/
	   }

	   printTable($filesArray);

        function getFiles(){
         $dirname = 'uploads/';
         $dir = 'uploads/*';
         $files = array();
         $finfo = finfo_open(FILEINFO_MIME_TYPE);
         foreach (glob($dir) as $file){
           $t = date("M j, Y g:i a", filemtime($file));
           $m = finfo_file($finfo, $file);
           $m = getMime($m);
           $s = filesize($file);
           $n = basename($file);
           $href = "$dirname$n";
				    echo $s;
           $files[] = array("href"=>$href,"name"=>$n, "size"=>$s, "mime"=>$m, "time"=>$t);
开发者ID:rbirky1,项目名称:cmsc433-php-fileManager,代码行数:31,代码来源:index_2.php

示例7: json_decode

<?php

$input = json_decode($_GET['jsonTable']);
//$input = [["god","save","the","queen"],[7,2]];
$maxCols = 0;
//var_dump($input); //Uncomment this to see the input
foreach ($input[0] as $key => $line) {
    $input[0][$key] = AffineEncrypt($line, $input[1][0], $input[1][1]);
    $maxCols = max(strlen($line), $maxCols);
}
printTable($input, $maxCols);
function AffineEncrypt($plainText, $k, $s)
{
    $cipherText = "";
    // Put Plain Text (all capitals) into Character Array
    $chars = str_split(strtoupper($plainText));
    // Compute e(x) = (kx + s)(mod m) for every character in the Plain Text
    foreach ($chars as $c) {
        $x = ord($c) - 65;
        if ($x < 0) {
            $cipherText .= $c;
        } else {
            $cipherText .= chr(($k * $x + $s) % 26 + 65);
        }
    }
    return $cipherText;
}
function printTable($input, $maxCol)
{
    echo "<table border='1' cellpadding='5'>";
    foreach ($input[0] as $key => $value) {
开发者ID:KonstantinKirchev,项目名称:PHP,代码行数:31,代码来源:affine-encoder.php

示例8: pg_connect

}
?>

<body>

<?php 
require "../connectionStrings.php";
// create connection
$connection = pg_connect($pgConnectStr1);
if (!$connection) {
    echo "Couldn't make a connection!";
    exit;
}
// test connection
if (!$connection) {
    echo "Couldn't make a connection!";
    exit;
}
// create SQL statement
$sql = "select * from xmipp_users order by my_date";
// execute SQL query and get result
//$sql_result = pg_exec($connection,$sql);
if (!($result = pg_query($sql))) {
    print "Query could not be executed.\n";
}
$r = printTable($result);
pg_close($connection);
?>
 
</body>
开发者ID:josegutab,项目名称:scipion,代码行数:30,代码来源:ver.php

示例9: printTable

function printTable($data, $fields, $row_classes, $cat, $child = 0)
{
    foreach ($data as $count => $row) {
        ?>
		<tr
			class="
  			ds-list-item-new level-<?php 
        print $child;
        ?>
 
  			<?php 
        /* print ($child == 0?'ds-list-item-new':''); */
        ?>
 ">
			<?php 
        printRow($row, $fields, $cat, $child + 1);
        if (!empty($row['child'])) {
            ?>
		</tr>
		<?php 
            printTable($row['child'], $fields, $row_classes, $cat, $child + 1);
        } else {
            ?>
		</tr>
		<?php 
        }
    }
}
开发者ID:maduhu,项目名称:opengovplatform-beta,代码行数:28,代码来源:views-view-table--agency-wise-report--page-3.tpl.php

示例10: while

        print "</mrow>\n\n";
    } while ($row = pg_fetch_assoc($result));
    print "</wholething>";
    return true;
    //close out the table:
}
// create connection
require "../connectionStrings.php";
$connection = pg_connect($pgConnectStr1);
if (!$connection) {
    echo "Couldn't make a connection!";
    exit;
}
// test connection
if (!$connection) {
    echo "Couldn't make a connection!";
    exit;
}
// create SQL statement
$sql = "select * from xmipp_users order by my_date limit 3";
// execute SQL query and get result
//$sql_result = pg_exec($connection,$sql);
if (!($result = pg_query($sql))) {
    print "Query could not be executed.\n";
}
$Nrows = pg_num_rows($result);
$r = printTable($result, $Nrows);
pg_close($connection);
?>
 
开发者ID:josegutab,项目名称:scipion,代码行数:29,代码来源:xml.php

示例11: printTable

function printTable($data, $fields, $row_classes, $cat, $child = 0)
{
    foreach ($data as $count => $row) {
        ?>
  		  <tr class="<?php 
        print implode(' ', $row_classes[$count]);
        ?>
 
    			ds-list-item-new level-<?php 
        print $child;
        ?>
 " >
  			<?php 
        printRow($row, $fields, $cat, $child + 1);
        ?>
          </tr>
        <?php 
        if (!empty($row['child'])) {
            printTable($row['child'], $fields, $row_classes, $cat, $child + 1);
        }
    }
}
开发者ID:maduhu,项目名称:opengovplatform-beta,代码行数:22,代码来源:views-view-table--agency-wise-report--page-2.tpl.php

示例12: generateXML

function generateXML()
{
    global $keywords, $from, $to, $condition, $seller, $buyingFormats, $handlingTime, $sortBy, $resultsPerPage, $url, $xml;
    $length = 0;
    $i = 0;
    $keyword = "";
    if (isset($_GET["search"])) {
        $keywords = $_GET["keywords"];
        $keyword = urlencode($keywords);
        $string = "&keywords=" . $keyword;
        if (isset($_GET["from"]) && $_GET["from"] != "") {
            $from = $_GET["from"];
            append($string, $i, "MinPrice", $from, 0);
        }
        if (isset($_GET["to"]) && $_GET["to"] != "") {
            $to = $_GET["to"];
            append($string, $i, "MaxPrice", $to, 0);
        }
        if (isset($_GET["condition"])) {
            $condition = $_GET["condition"];
            $length = count($condition);
            append($string, $i, "Condition", $condition, $length);
        }
        if (isset($_GET["buyingFormats"])) {
            $buyingFormats = $_GET["buyingFormats"];
            $length = count($buyingFormats);
            append($string, $i, "ListingType", $buyingFormats, $length);
        }
        if (isset($_GET["returnAccepted"])) {
            append($string, $i, "ReturnsAcceptedOnly", "true", 0);
        }
        if (isset($_GET["freeShipping"])) {
            append($string, $i, "FreeShippingOnly", "true", 0);
        }
        if (isset($_GET["expeditedShipping"])) {
            append($string, $i, "ExpeditedShippingType", "Expedited", 0);
        }
        if (isset($_GET["handlingTime"]) && $_GET["handlingTime"] != "") {
            $handlingTime = $_GET["handlingTime"];
            append($string, $i, "MaxHandlingTime", $handlingTime, 0);
        }
        $sortBy = $_GET["sortBy"];
        $string .= "&sortOrder=" . $sortBy;
        $resultsPerPage = $_GET["resultsPerPage"];
        $string .= "&paginationInput.entriesPerPage=" . $resultsPerPage;
        $url .= $string;
        $xml = simplexml_load_file($url);
        //print_r($xml);
        printTable();
    }
}
开发者ID:saileshsidhwani,项目名称:WebTechnologies,代码行数:51,代码来源:hw6php.php

示例13: printTable

    </div>

    <div class="content">
        <h1>Ingredients</h1>
        <form action="addIngredient.php">
            <button type="submit">Add Ingredient</button>
        </form>

        <br>
        <form action="ingredients.php" method="post">
            <input type="text" name="searchInput">
            <button type="submit">SEARCH INGREDIENTS</button>
        </form>
        <br>
        <?php 
require_once 'functions.php';
$db = (require "../php/loadDB.php");
$notSearched = true;
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $searchValue = $_POST["searchInput"];
    $query = "SELECT * FROM ingredients WHERE name = \"{$searchValue}\"";
    $notSearched = false;
} else {
    $query = "SELECT * FROM ingredients";
}
printTable($db->query($query), "name", "unit_measure", $notSearched);
?>
    </div>
</body>
</html>
开发者ID:madmandrew,项目名称:madmandrew.github.io,代码行数:30,代码来源:ingredients.php

示例14: elseif

     // Get the table header
     if (get_class($data) == "TE") {
         $thead = $tableTE;
     } elseif (get_class($data) == "PP") {
         $thead = $tablePP;
     }
     $user = new User($review->user);
     // Get the table data
     if (get_class($data) == "TE") {
         $tdata[] = array(1 => $user->real_name, 2 => $data->s1, 3 => $data->s2, 4 => $data->s3, 5 => $data->s4, 6 => $data->s6);
     } elseif (get_class($data) == "PP") {
         $tdata[] = array(1 => $user->real_name, 2 => $data->s1, 3 => $data->s2, 4 => $data->s3, 5 => $data->s4);
     }
 }
 // Print table
 printTable($thead, $tdata);
 // Print comments
 $comments = $submission->getComments();
 echo "<br><br>";
 echo "Student comment: ";
 if (isset($comments[0])) {
     echo $comments[0]->data;
 }
 echo "<br>Uploaded files: ";
 echo "<br><br>";
 //TODO Name of uploaded files regarding this submission
 foreach ($submission->getReview() as $key => $value) {
     // Get the review
     $id = $submission->getLatestReview($key);
     $review = $submission->getReview($id);
     echo "<br>Overall comments and feedback: " . $review->data->feedback;
开发者ID:RosanderOliver,项目名称:DV1512_Projekt_HT2015,代码行数:31,代码来源:examinatorgrading.php

示例15: printTable

 public function printTable($ladderkey)
 {
     printTable($this->connector->getStats($ladderkey));
     return 1;
 }
开发者ID:arihosu,项目名称:osu-ladders,代码行数:5,代码来源:Core.php


注:本文中的printTable函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。