Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $aIcon=array("pilih", "Kartu Kuning","Kartu Merah",
- 10=>"Goal", 11=>"Pinalti");
- if(!$_POST)
- {
- ?>
- <form enctype='multipart/form-data' method='post'>
- <div style='width:500px'>
- <fieldset>Tanggal :<input type=text name='tgl' />
- </fieldset>
- <fieldset>Stadion :<input type=text name='stadion' />
- </fieldset>
- <fieldset>Grup :<br>A<input type=text name='grupA' /> vs
- <input type=text name='grupB' />B *
- </fieldset>
- </div>
- <input type=submit> <input type=hidden name=stat value=1 />
- </form>
- <?php
- }
- if($_POST['stat']=='1')
- {
- ?><div style='width:500px'>
- <form enctype='multipart/form-data' method='post'>
- <?php
- foreach($_POST as $nm=>$val) {
- $s.="<input type='hidden'
- name='$nm' value='$val' />";
- }
- echo $s;$s='Antara<center>'.$_POST[grupA].'<br>VS<br>'.$_POST[grupB].
- '</center><table >';
- $time="";
- $time.="<option>waktu";
- for($i=0;$i<90;$i++)
- $time.="\n<option>$i";
- foreach($aIcon as $id=>$val)
- {
- $icon.="\n<option value=$id>$val";
- }
- $s.="<tr><th> </th><th>Menit</th>
- <th>Pemain</th><th>team</th><th>Icon</th><th>Ket</th></tr>";
- for($i=0;$i<20;$i++)
- {
- $s.="\n<tr><td>".++$j."</td>";
- //MENIT
- $s.="<td><select name=rep[$i][0]>$time";
- $s.="</select></td>";
- //Pemain
- $s.="<td><input type=text name=rep[$i][1] /></td>";
- //yang main
- $s.="<td><select name=rep[$i][2]><option>A<option>B</select></td>";
- //icon
- $s.="<td><select name=rep[$i][3]>$icon</select></td>";
- //keterangan
- $s.="<td><input type=text name=rep[$i][4] /></td>";
- $s.="</tr>";
- }
- $s.="</table>";
- echo $s;$s='';
- ?>
- <input type=submit value='buat blog'> <input type=hidden name=stat value=2 />
- </form></div>
- <?php
- }
- if($_POST['stat']=='2')
- {
- $aBg=array( 'lightblue','lightgreen' );
- foreach($_POST as $nm=>$val) {
- if($nm!='rep'){
- $s.="\n<input type='hidden' name='$nm' value='".trim($val)."' />";
- }
- $$nm=$val;
- }
- foreach($_POST[rep] as $id=>$ar)
- {
- foreach($ar as $id2=>$val) {
- $s.="\n<input type='hidden' name='$nm [$id] [$id2] ' value='$val' />";
- $val2=$ar[2];
- if($id2==3 && ($val==10||$val==11))
- $aGoal[$val2]++;
- }
- if($ar[0]!='waktu'){
- $id3=$id+($ar[0]*100);
- $ar[]=$id3;
- $ar2=array(
- $ar[0]."'",
- );
- $aRep[$id3]=$ar;
- }
- }
- $s='<table cellpadding=4 cellspacing=0 width=99% border=1>';
- $a=array();
- $a[]="FULLTIME";
- $a[]=$_POST[tgl];
- $a[]="<div style=text-align:right>$stadion</div>";
- $a[]="<div style=text-align:center>$grupA $aGoal[A] - $aGoal[B] $grupB</div>";
- $i=0;
- foreach($a as $v)
- {
- $bg=$aBg[$i%count($aBg)];
- $s.="\n<tr bgcolor='$bg'><td>$v</td></tr>";
- $i++;
- }
- $s.="</table><table cellpadding=4 cellspacing=0 width=99% border=1>";
- //====HALF TIME====
- ksort($aRep ); $aGoalNow=array(A=>0,B=>0);
- foreach($aRep as $ar)
- {
- $a=array();
- if($ar[3]==10||$ar[3]==11 )
- {
- $aGoalNow[$ar[2]]++;
- }
- $a=array($ar[0]."'");
- if($ar[2]=='A'){
- $a[]=$ar[1]." (".$aIcon[$ar[3]].")";
- }else{
- $a[]='';
- }
- $a[]="( ".$aGoalNow['A']." - ".$aGoalNow['B']." )";
- if($ar[2]=='B'){
- $a[]=$ar[1]." (".$aIcon[$ar[3]].")";
- }else{
- $a[]='';
- }
- $aRep2[]=$a;
- }
- $s.="<p> <table cellpadding=4 cellspacing=0 width=99% border=1>";
- foreach($aRep2 as $ar)
- {
- $bg=$aBg[$i%count($aBg)];$i++;
- $s.="\n<tr bgcolor='$bg'> ";
- for($i2=0 ;$i2<4;$i2++)
- {
- $s.="<td>".$ar[$i2]."</td>";
- }
- $s.="</tr>";
- }
- $s.="</table>";
- ?><textarea rows="10" cols="80" name=lineUpB><?=$s;?></textarea>
- <?php
- echo $s;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement