Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- DIBUTUHKAN PANDUAN dan juga css yg rapi
- */
- $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>
- <fieldset>Pelatih :<br>A<input type=text name='coachA' />
- <input type=text name='coachB' />B
- </fieldset>
- <fieldset>Lineup :<p align=center>A vs B<br>
- <textarea rows="6" cols="20" name=lineUpA></textarea>
- <textarea rows="6" cols="20" name=lineUpB></textarea></p>
- </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('silver','lightblue','BlanchedAlmond','Cornsilk');
- 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;
- /*
- if($ar[0]<=45){
- $id4=0;
- }elseif($ar[0]>45&&$ar[0]<=90){
- $id4=1;
- }elseif($ar[0]>90&&$ar[0]<=105 ){
- $id4=2;
- }elseif($ar[0]>105&&$ar[0]<=120){
- $id4=3;
- }
- [$id4]
- */
- $ar2=array(
- $ar[0]."'",
- );
- $aRep[$id3]=$ar;
- }
- }
- $s='<table cellpadding=4 cellspacing=0 width=500>';
- $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=500>";
- if($lineUpA && $lineUpB)
- {
- $a=array();
- $a[]=array(1,"Lineup");
- $a[]=array(2,"$lineUpA [br/]$lineUpB");
- $a[]=array(2,"$coachA [br/]$coachB");
- $i=0;
- foreach($a as $a2){
- $bg=$aBg[$i%count($aBg)];
- if($a2[0]==1)
- {
- $td="<td colspan=3>$a2[1] </td>";
- }
- if($a2[0]==2)
- {
- $a3=explode("[br/]",$a2[1]);
- $td="<td>".nl2br(trim($a3[0])).
- " </td><td> </td><td>".
- nl2br(trim($a3[1]))."</td>";
- }
- $s.="\n<tr bgcolor='$bg'> $td</tr>";
- $i++;
- }
- //====HALF TIME====
- $s.="</table>";
- /*
- for($i=0;$i<4;$i++)
- {
- $aRep1=$aRep[$i];
- if(count($aRep1)>=1)
- {
- */
- 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=500>";
- 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