//// $srcFile = 'resources/Rotating_earth_(large).gif';
$srcFile = 'resources/SmallFullColourGIF.gif';
// $srcFile = 'resources/frame_diff_ir2t.gif';
$dstFile1 = 'resources/test1.gif';
$dstFile2 = 'resources/test2.gif';
$dstFile3 = 'resources/test3.gif';
echo "<!doctype html><html><head><title>ResizeGif.Test1</title></head><body>\n<p>Files are used for in and output, as you really don't want to\ndynamically resize animated gifs every time they are used.</p><pre>\n";
showStats($srcFile);
echo "Resizing to half size\n";
ResizeGif::ResizeByRatio($srcFile, $dstFile1, 0.5);
showStats($dstFile1);
echo "Resizing to 2x\n";
ResizeGif::ResizeByRatio($srcFile, $dstFile2, 2);
showStats($dstFile2);
echo "Resizing to 200px wide\n";
ResizeGif::ResizeToWidth($srcFile, $dstFile3, 200);
showStats($dstFile3);
echo "</pre></body></html>\n";
/**
 * @param string $file
 * @throws Exception
 */
function showStats($file)
{
    $size = ResizeGif::getSize($file);
    echo "File: {$file}:\n";
    echo " - width.: " . $size['width'] . "\n";
    echo " - height: " . $size['height'] . "\n";
    echo "<img src='{$file}' />\n";
    echo "\n";
}
Exemple #2
0
     /*case "previewTemplate" :
     		previewTemplate();
     
     		break;*/
 /*case "previewTemplate" :
 		previewTemplate();
 
 		break;*/
 case "addKTemplate":
     addKTemplate();
     break;
 case "installTemplate":
     extractKTemplate();
     break;
 case "showstats":
     showStats();
     break;
 case "uninstallKTemplate":
     uninstallKTemplate();
     break;
     //###########################################
     //			END TEMPLATE MANAGER
     //###########################################
 //###########################################
 //			END TEMPLATE MANAGER
 //###########################################
 case "createmenu":
     $lang = JFactory::getLanguage();
     // Start by loading English strings and override them by current locale
     $lang->load('com_kunena.install', JPATH_ADMINISTRATOR, 'en-GB');
     $lang->load('com_kunena.install', JPATH_ADMINISTRATOR);
Exemple #3
0
		</script></td></tr>

		<tr>
			<td></td>
			<td>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
			&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<INPUT
				type="submit" name="button" value="Update" /></td>
		</tr>

	</tr>
	</table>
</form>
<legend></legend></fieldset>
<?php 
$today = date('Y-m-d');
showStats('pawning');
$dataSubmitted = $_GET['submitted'];
if ($dataSubmitted == "yes") {
    //include_once('localDB.php');
    $genericInsert = "INSERT INTO pawning(ref_no,amount,date,type,weight,branch,entryDate) " . "VALUES('{$_POST['ref_no']}','{$_POST['amount']}','{$_POST['date']}','{$_POST['type']}','{$_POST['weight']}','{$_SESSION['branch']}','" . $today . "');";
    $pawningResult = mysql_query($genericInsert);
    if ($customerCheck['name'] == "") {
        $cus_detailInsert = "INSERT INTO customer_details(cus_id,name,address,branch) " . "VALUES('{$_POST['id']}','{$_POST['name']}','{$_POST['address']}','{$_SESSION['branch']}');";
        $cusResult = mysql_query($cus_detailInsert);
    }
    $cus_refInsert = "INSERT INTO customer_ref(cus_id,ref_no) " . "VALUES('{$_POST['id']}','{$_POST['ref_no']}');";
    $referenceResult = mysql_query($cus_refInsert);
    $goldInsert = "INSERT INTO gold(ref_no,type,weight,status) " . "VALUES('{$_POST['ref_no']}','{$_POST['type']}','{$_POST['weight']}','pawned');";
    $goldResult = mysql_query($goldInsert);
    $cashResult = mysql_query("SELECT cash FROM hand_cash WHERE branch='{$_SESSION['branch']}'");
    $cash = mysql_fetch_array($cashResult);
<?php

include "stats.php";
$column = $_POST["column"];
$tableName = $_POST["table"];
//createStats($tableName, $localDB);
showStats($tableName, $column, TRUE);
showStats($tableName, $column, FALSE);
showTRStats($tableName, $column, TRUE);
showTRStats($tableName, $column, FALSE);
<?php

//session_start();
include_once 'localDB.php';
include_once 'loginchecker.php';
include_once 'functions.php';
$date = date('Y-m-d');
$data = showStats('view');
?>
<script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
<link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
<h3>Transaction details for today</h3>

<table border="0" width="80%">
	<thead>
		<tr>
			<th>Branch</th>
			<th>Tot.Transactions</th>
			<th>Tot.Pawns</th>
			<th>Tot.Gold</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td>All</td>
			<td style="text-align:center"><?php 
echo $data['total']['trans'];
?>
</td>
			<td style="text-align:center"><?php 
echo $data['total']['pawning'];
			max( MAX_ALT - TAKEOFF_ALT ) AS maxAltGain,
			
		   ' . ' count( * ) AS totalFlights, 
			sum( LINEAR_DISTANCE ) AS totalDistance, 
			sum( DURATION ) AS totalDuration, ' . ' sum( LINEAR_DISTANCE )/count( * ) as mean_distance, ' . ' sum( DURATION )/count( * ) as mean_duration, ' . ' sum( FLIGHT_KM ) as totalOlcKm, ' . ' sum( FLIGHT_POINTS ) as totalOlcScore, ' . ' max( FLIGHT_POINTS ) as bestOlcScore ' . ' FROM ' . $flightsTable . $extra_table_str . ' WHERE ' . $flightsTable . '.userID = ' . $pilotIDview . ' AND ' . $flightsTable . '.userServerID = ' . $serverIDview . $where_clause . ' GROUP BY gliderBrandID,glider' . ' ';
//echo "<hr>stats query: $query<hr>";
$res = $db->sql_query($query);
if ($res <= 0) {
    echo "<H3> Error in pilot stats query </H3>\n";
    return;
}
$groupBy = 'gliderBrandID,glider';
while ($row = mysql_fetch_assoc($res)) {
    $brandName = $CONF['brands']['list'][$row['gliderBrandID']];
    echo "<h2>{$brandName} " . $row['glider'] . "</h2>";
    showStats($row, ' gliderBrandID,glider', $where_clause, " AND gliderBrandID=" . $row['gliderBrandID'] . " AND glider='" . $row['glider'] . "' ", $row['gliderBrandID'] . '_' . $row['glider']);
    //echo "<hr>";
    //print_r($row);
}
?>

	</div>

<?php 
function showStats($row, $groupBy, $where_clause, $where_clause2, $suffix = '')
{
    global $CONF, $db, $flightsTable, $pilotIDview, $serverIDview, $extra_table_str;
    $suffixHash = md5($groupBy . $where_clause . $where_clause2 . $suffix);
    $query = 'SELECT DISTINCT ' . $groupBy . ', max( FLIGHT_KM ) AS BestFreeTriangle ' . ' FROM ' . $flightsTable . $extra_table_str . ' WHERE ' . $flightsTable . '.userID = ' . $pilotIDview . ' AND ' . $flightsTable . '.userServerID = ' . $serverIDview . $where_clause . $where_clause2 . ' AND  BEST_FLIGHT_TYPE = "FREE_TRIANGLE" ' . ' GROUP BY ' . $groupBy . ' ' . ' ';
    //     echo "<hr>stats query: $query<hr>";
    $res = $db->sql_query($query);