Advertisement
GWibisono

kode isenk blog bal-bal an

Jun 13th, 2012
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.72 KB | None | 0 0
  1. <?php
  2. $aIcon=array("pilih", "Kartu Kuning","Kartu Merah",
  3. 10=>"Goal", 11=>"Pinalti");
  4.  
  5. if(!$_POST)
  6. {
  7. ?>
  8.     <form enctype='multipart/form-data' method='post'>
  9.     <div style='width:500px'>
  10.     <fieldset>Tanggal :<input type=text name='tgl' />
  11.     </fieldset>
  12.     <fieldset>Stadion :<input type=text name='stadion' />
  13.     </fieldset>
  14.     <fieldset>Grup :<br>A<input type=text name='grupA' /> vs
  15.      <input type=text name='grupB' />B *
  16.     </fieldset>
  17.      
  18.     </div>
  19.     <input type=submit> <input type=hidden name=stat value=1 />
  20.     </form>
  21. <?php
  22. }
  23.  
  24. if($_POST['stat']=='1')
  25. {
  26. ?><div style='width:500px'>
  27.     <form enctype='multipart/form-data' method='post'>
  28. <?php
  29. foreach($_POST as $nm=>$val) {
  30. $s.="<input type='hidden'
  31. name='$nm' value='$val' />";
  32. }
  33. echo $s;$s='Antara<center>'.$_POST[grupA].'<br>VS<br>'.$_POST[grupB].
  34. '</center><table >';
  35. $time="";
  36.  
  37.  
  38.     $time.="<option>waktu";
  39.     for($i=0;$i<90;$i++)
  40.         $time.="\n<option>$i";
  41.     foreach($aIcon as $id=>$val)
  42.     {
  43.         $icon.="\n<option value=$id>$val";
  44.     }  
  45.        
  46.     $s.="<tr><th>&nbsp;</th><th>Menit</th>
  47.     <th>Pemain</th><th>team</th><th>Icon</th><th>Ket</th></tr>";   
  48.     for($i=0;$i<20;$i++)
  49.     {
  50.         $s.="\n<tr><td>".++$j."</td>";
  51.         //MENIT
  52.         $s.="<td><select name=rep[$i][0]>$time";   
  53.         $s.="</select></td>";
  54.         //Pemain
  55.         $s.="<td><input type=text name=rep[$i][1] /></td>";
  56.         //yang main
  57.         $s.="<td><select name=rep[$i][2]><option>A<option>B</select></td>";
  58.         //icon
  59.         $s.="<td><select name=rep[$i][3]>$icon</select></td>";
  60.         //keterangan
  61.         $s.="<td><input type=text name=rep[$i][4] /></td>";
  62.         $s.="</tr>";
  63.     }
  64.     $s.="</table>";
  65.     echo $s;$s='';
  66. ?>
  67.     <input type=submit value='buat blog'> <input type=hidden name=stat value=2 />
  68.     </form></div>
  69. <?php
  70. }
  71.  
  72. if($_POST['stat']=='2')
  73. {
  74.     $aBg=array( 'lightblue','lightgreen' );
  75.      
  76.  
  77.     foreach($_POST as $nm=>$val) {
  78.         if($nm!='rep'){
  79.             $s.="\n<input type='hidden' name='$nm' value='".trim($val)."' />";
  80.         }
  81.         $$nm=$val;
  82.     }
  83.      
  84.     foreach($_POST[rep] as $id=>$ar)
  85.     {
  86.         foreach($ar as $id2=>$val) {         
  87.             $s.="\n<input type='hidden'  name='$nm [$id] [$id2] ' value='$val' />";
  88.             $val2=$ar[2];
  89.             if($id2==3 && ($val==10||$val==11))
  90.                 $aGoal[$val2]++;
  91.         }
  92.         if($ar[0]!='waktu'){
  93.            
  94.             $id3=$id+($ar[0]*100);
  95.             $ar[]=$id3;
  96.  
  97.             $ar2=array(
  98.             $ar[0]."'",
  99.            
  100.             );
  101.            
  102.             $aRep[$id3]=$ar;
  103.            
  104.         }
  105.        
  106.        
  107.     }
  108.    
  109.     $s='<table cellpadding=4 cellspacing=0 width=99% border=1>';
  110.    
  111.     $a=array();
  112.     $a[]="FULLTIME";   
  113.     $a[]=$_POST[tgl];
  114.     $a[]="<div style=text-align:right>$stadion</div>";
  115.  
  116.     $a[]="<div style=text-align:center>$grupA $aGoal[A] - $aGoal[B] $grupB</div>";
  117.    
  118.     $i=0;
  119.     foreach($a as $v)
  120.     {
  121.         $bg=$aBg[$i%count($aBg)];
  122.         $s.="\n<tr bgcolor='$bg'><td>$v</td></tr>";
  123.         $i++;
  124.     }
  125.    
  126.     $s.="</table><table cellpadding=4 cellspacing=0 width=99% border=1>";
  127.    
  128.  
  129.          
  130.         //====HALF TIME====
  131.        
  132.  
  133.  
  134.                 ksort($aRep ); $aGoalNow=array(A=>0,B=>0);
  135.                 foreach($aRep as $ar)
  136.                 {
  137.                     $a=array();
  138.                     if($ar[3]==10||$ar[3]==11 )
  139.                     {
  140.                         $aGoalNow[$ar[2]]++;
  141.                     }
  142.                
  143.                     $a=array($ar[0]."'");
  144.                     if($ar[2]=='A'){
  145.                         $a[]=$ar[1]." (".$aIcon[$ar[3]].")";
  146.                     }else{
  147.                         $a[]='';
  148.                     }
  149.                      
  150.                     $a[]="( ".$aGoalNow['A']." - ".$aGoalNow['B']." )";
  151.                     if($ar[2]=='B'){
  152.                         $a[]=$ar[1]." (".$aIcon[$ar[3]].")";
  153.                     }else{
  154.                         $a[]='';
  155.                     }
  156.                    
  157.                     $aRep2[]=$a;
  158.                 }
  159.                
  160.                 $s.="<p>  <table cellpadding=4 cellspacing=0 width=99% border=1>";
  161.                 foreach($aRep2  as $ar)
  162.                 {
  163.                     $bg=$aBg[$i%count($aBg)];$i++;
  164.                     $s.="\n<tr bgcolor='$bg'> ";
  165.                     for($i2=0 ;$i2<4;$i2++)
  166.                     {
  167.                         $s.="<td>".$ar[$i2]."</td>";
  168.                     }
  169.                    
  170.                     $s.="</tr>";
  171.                 }
  172.                
  173.                 $s.="</table>";
  174.  
  175.  
  176.  
  177.    
  178.     ?><textarea rows="10" cols="80" name=lineUpB><?=$s;?></textarea>
  179.     <?php
  180.     echo $s;
  181.  
  182. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement