Pages

Monday, November 1, 2010

Zend framework Views

//views sample program

---------------------------------------------

<?php

    $this->js()->enableJQuery();

    $this->js()->appendLibrary('TEST');

    $this->js()->addJQueryPlugin("tipsy",true);

    $this->js()->addJQueryPlugin("validate",true);

    $this->js()->addJQueryPlugin("autocomplete",true);

    $this->js()->append($this->urls()->js()."NewPopup.js");

    $this->js()->append($this->urls()->js()."library/jquery/jquery-ui-custom.min.js");

    $this->js()->append($this->urls()->js()."statistics/statistics.js");

    $this->css()->append($this->urls()->css()."/jquery-ui-1.7.2.custom.css");   

   

    $testTeamFieldDet=$this->vtestTeamFieldDet;

      $PyrLstGameDet = $this->vPyrLstGameDet;

      $PyrGameDet = $this->vPyrGameDet;

    ?>



<?php echo $this->testTeamsidebar();  ?> 

<?php $summaryAct = $this->url(array('page'=>$this->testTeamURL,'action'=>'summary'),'global_routing');?>     

<div class="cal_mid_mid_acc">

        <div class="go_mid_mid_acc">

            <div class="testTeam_mid_mid">

                <p><a href="<?=$summaryAct ?>"><< <?php echo $this->translate("Go to testTeam Summary") ?></a></p>

                <span class="vh"><?php echo $this->translate("Last Modified: Friday, April 13, 2010") ?></span>

            </div>

            <div class="testTeam_bulid_mid">

                <div class="testTeam_bulid_invite_left">

                    <h2><a class="page_title" href="<?php echo $this->url(array('page'=>$this->testTeamURL,'action'=>'roaster'))?>"><?php echo $this->translate("Roster") ?></a> &gt;&gt;</h2>

                    <p>[<?php echo $this->playerName;?>]&nbsp; Statistics</p>

                    <p><a href="#" onclick="loadStatistics(<?=$this->testTeamID ?>,'<?=$this->testTeamName ?>',<?=$this->vPlayerid ?>)"><?php echo $this->translate("Add Statistics") ?></a></p>                  

                </div>     

            </div>

        </div>

      <div>

    </div>

        <form name="frmRoaster" method="post" action="#">

<input type="hidden" name="hidplayerID" id="hidplayerID"  value="<?=$this->vPlayerid ?>"/>

<input type="hidden" name="hidSorting" id="hidSorting" />

        <div class="testTeam_player_pitcher">

          <div class="testTeam_player_bio padding_top_15" >

       

            <div class="testTeam_player_last_game">

                <span><a href="#">testTeam Total</a></span>

                <div class="periodbox">

                <div class="periodtxt">Period</div>

                <div class="formbox">

                  <select name="select">

                  <option style="width: 35px;">All</option>

                  </select>

                </div>

                </div>

            </div>

         

            <div class="testTeam_player_game_date"> 

                <b>G</b>

                <b>AB</b>

                <b>R</b>

                <b>H</b>

                <b>2B</b>

                <b>3B</b>     

                <b>HR</b>     

                <b>RBI</b>

                <b>BB</b>

                <b>SO</b>

                <b>SB</b>

                <b>CS</b>

                <b>K</b>     

                <b>OBP</b> 

                <b>SLG</b>     

                <b>OPS</b>

                <b>AVG</b>     

            </div>

         

            <div class="testTeam_player_game_long">         

                <b>0</b>

                <b>0</b>

                <b>0</b>

                <b>0</b>

                <b>0</b>

                <b>0</b>     

                <b>0</b>     

                <b>0</b>

                <b>0</b>

                <b>0</b>

                <b>0</b>

                <b>0</b>

                <b>0</b>     

                <b>0.000</b>     

                <b>0.000</b>     

                <b>0.000</b>

                <b class="border_right">0.000</b>

            </div>

        </div>

     

        <div class="testTeam_player_bio">

     

         

<!--Latest statistics start-->

    <div class="testTeam_player_last_game" style="margin-top:15px">

        <span><a href="#"><?php echo $this->translate("Last Game") ?></a></span>     

    </div>

         

    <div class="testTeam_player_game_date">

        <p><?php echo $this->translate("Date") ?></p>

        <i><?php echo $this->translate("Opponent") ?></i>

        <em>

        <?php for($i=0;$i<count($testTeamFieldDet);$i++){ ?>

        <span><?=$testTeamFieldDet[$i]['stsm_name'] ?></span>

        <?php } ?>             

        <span>&nbsp;</span></em> 

    </div>

             

    <div class="testTeam_player_game_long">

 

        <?php if(count($PyrLstGameDet)>=1){ ?>

        <p><?=$PyrLstGameDet[0]['stst_game_date'] ?></p>

        <i><?=$PyrLstGameDet[0]['stst_played_testTeam_name'] ?></i>

        <em>

        <?php

        //field ids

            $field_id=$PyrLstGameDet[$k]['sts_id'];

            $fids=explode(',',$field_id);

             

        //field values/score

            $field_val=$PyrLstGameDet[$k]['stsd_value'];

            $fval=explode(',',$field_val);

             

        //print alll fields and check with db selected vals

            for($m=0;$m<count($testTeamFieldDet);$m++){

            $score=0;

                for($n=0;$n<count($fids);$n++){          

                    if($fids[$n]==$testTeamFieldDet[$m]['stsm_id']){

                    $score=$fval[$n];break;

                    }             

                }

                ?>

        <span><?=$score ?></span>     

        <?php }  ?>             

        <span><a href="#" onclick="loadStatisticseditform(<?=$PyrLstGameDet[0]['stst_id'] ?>)">Edit</a></span>     

        </em>

        <?php } else{ echo "<p> &nbsp;</p><p> &nbsp;</p><p>No data Found</p>"; }?>

    </div>         

            <!--Latest statistics end-->

         

   

            <!--Player''s statistics summary start-->

            <div class="testTeam_player_bio" style="margin-top:15px">

         

                <div class="testTeam_player_last_game">

                    <div class="periodbox">

                        <div class="periodtxt"><?php echo $this->translate("Period") ?></div>

                            <div class="formbox">

                              <select name="selSort" id="selSort" onchange="sortStatisticsSummary(<?=$this->vPlayerid ?>,'<?php echo $this->url(array('page'=>$this->testTeamURL,'action'=>'statistics')) ?>')">

                              <?php

                              //for searching

                              $yr=date('Y');

                              $count=$yr-10;

                              for($yr=2010;$yr>$count;$yr--){?>                           

                                <option <?php if($_POST['hidSorting']==$yr){ ?> selected="selected"<?php }?> value="<?=$yr?>"><?=$yr?></option>

                                <?php } ?>

                              </select>

                            </div>

                    </div>

                    <span><a href="#"><?php echo $this->translate("Previous Games") ?> </a></span>

                </div>

             

            <div class="testTeam_player_game_date"> 

                <p><?php echo $this->translate("Date") ?></p>

                <i><?php echo $this->translate("Opponent") ?></i>

                <em style="float:none">

                <span></span>

                <?php for($i=0;$i<count($testTeamFieldDet);$i++){ ?>

                <span><?=$testTeamFieldDet[$i]['stsm_name'] ?></span>

                <?php } ?>

                <span></span></em> 

            </div>

         

            <?php if(count($PyrGameDet)>=1){

              for($k=0;$k<count($PyrGameDet);$k++){ ?>

            <div class="testTeam_player_game_long">

                <p><?=$PyrGameDet[$k]['stst_game_date'] ?></p>

                <i><?=$PyrGameDet[$k]['stst_played_testTeam_name'] ?></i>

                <em>

                <?php

                //field ids

                $field_id=$PyrGameDet[$k]['sts_id'];

                $fids=explode(',',$field_id);

             

                //field values/score

                $field_val=$PyrGameDet[$k]['stsd_value'];

                $fval=explode(',',$field_val);

             

                //print alll fields and check with db selected vals

                for($m=0;$m<count($testTeamFieldDet);$m++){

                $score=0;

                    for($n=0;$n<count($fids);$n++){          

                        if($fids[$n]==$testTeamFieldDet[$m]['stsm_id']){

                        $score=$fval[$n];break;

                        }             

                    }

                ?>

                <span><?=$score ?></span>     

                <?php }  ?>

                <span><a href="#" onclick="loadStatisticseditform(<?=$PyrGameDet[$k]['stst_id'] ?>)">Edit</a></span>

                </em>     

            </div>

         <?php  } } else{ echo "<div class=testTeam_player_game_long><p> &nbsp;</p><p> &nbsp;</p><p>No data Found</p></div>"; }?>

     

        </div>

        <!--Player''s statistics summary end-->         

       </div>

    </div>

    </form>

</div>

<div class="cal_mid_right_ig">

    <span><a href="#"><img src="<? echo $this->urls()->images(); ?>will_grace_ig.gif"  alt="" border="0"/></a></span>

</div>

           

            

No comments:

Post a Comment