From: x2000habouzit Date: Tue, 27 Jan 2004 21:17:42 +0000 (+0000) Subject: stats par promo, et qqs php qui ont pas besoin de templates ... X-Git-Tag: xorg/old~1927 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=56e0d47413ac0eb925f898e224969c1aa17c04ff;p=platal.git stats par promo, et qqs php qui ont pas besoin de templates ... --- diff --git a/htdocs/cacert.php b/htdocs/cacert.php new file mode 100644 index 0000000..98404c4 --- /dev/null +++ b/htdocs/cacert.php @@ -0,0 +1,8 @@ + diff --git a/htdocs/getphoto.php b/htdocs/getphoto.php new file mode 100644 index 0000000..9ac453d --- /dev/null +++ b/htdocs/getphoto.php @@ -0,0 +1,31 @@ + +// Example php script to demonstrate the direct passing of binary data +// to the user. More infos at http://www.phpbuilder.com +// Syntax: getdata.php3?id= + +if(isset($_REQUEST['x'])) { + if(isset($_REQUEST['req']) && $_REQUEST['req']="true") { + $myphoto = PhotoReq::get_unique_request($_REQUEST['x']); + Header("Content-type: image/".$myphoto->mimetype); + echo $myphoto->data; + } else { + $result = mysql_query("SELECT attachmime, attach FROM photo WHERE uid = '{$_REQUEST['x']}'"); + + if( list($type,$data) = @mysql_fetch_row($result) ) { + Header( "Content-type: image/$type"); + echo $data; + } else { + Header( "Content-type: image/png"); + $f=fopen(url("none.png"),"r"); + echo fread($f,30000); + fclose($f); + } + } +} +?> diff --git a/htdocs/stats/nb_by_promo.php b/htdocs/stats/nb_by_promo.php new file mode 100644 index 0000000..2e2eaf8 --- /dev/null +++ b/htdocs/stats/nb_by_promo.php @@ -0,0 +1,19 @@ + 1900 GROUP BY promo ORDER BY promo"); +$max=0; $min=3000; +while(list($promo,$nb)=mysql_fetch_row($result)) { + $promo=intval($promo); + if(!isset($nbpromo[$promo/10])) + $nbpromo[$promo/10] = Array('','', '','', '','', '','', '',''); + $nbpromo[$promo/10][$promo%10]=$nb; +} + +$page->assign_by_ref('nbs', $nbpromo); +$page->assign('min', $min-$min % 10); +$page->assign('max', $max+10-$max%10); + +$page->display(); +?> diff --git a/templates/stats/nb_by_promo.tpl b/templates/stats/nb_by_promo.tpl new file mode 100644 index 0000000..9406d24 --- /dev/null +++ b/templates/stats/nb_by_promo.tpl @@ -0,0 +1,35 @@ +{* $Id: nb_by_promo.tpl,v 1.1 2004-01-27 21:17:43 x2000habouzit Exp $ *} + +
+ Inscrits par promo +
+ +

+Voici le nombre d'inscrits par promo : +

+ +{dynamic} + + + + + + + {foreach item=nb10 key=lustre from=$nbs} + + + {foreach item=nb from=$nb10} + + {/foreach} + + {/foreach} +
0123456789
{$lustre}-{$nb|default:"-"}
+{/dynamic} + +
+ Inscrits par promo en (%) +
+ + + +{* vim:set et sw=2 sts=2 sws=2: *}