Exemplo n.º 1
0
 public function cudTeam($team, $action)
 {
     if (isset($team)) {
         $query = "";
         if (strcasecmp($action, CREATE) == 0) {
             //add team record
             $query = " dbo.SP_CREATE_TEAM '" . $team->get_teamName() . "','" . $team->get_coachEmailAddress() . "'";
         } else {
             if (strcasecmp($action, UPDATE) == 0) {
                 //update team record
                 $query = " dbo.SP_UPDATE_TEAM '" . $team->get_oldTeamName() . "','" . $team->get_teamName() . "','" . $team->get_coachEmailAddress() . "'";
             } else {
                 if (strcasecmp($action, DELETE) == 0) {
                     //delete team record
                     $query = " dbo.SP_DELETE_TEAM '" . $team->get_teamName() . "'";
                 }
             }
         }
         $result = parent::processCUD($query, $action);
         //or use $this->
         //  echo 'Result in TeamDAO='.$result;
         return $result;
     } else {
         return ERROR;
     }
 }
Exemplo n.º 2
0
 public function cudPlayer($player, $action)
 {
     if (isset($player)) {
         $query = "";
         if (strcasecmp($action, CREATE) == 0) {
             //add team record
             $query = " dbo.SP_CREATE_PLAYER '" . $player->get_fname() . "','" . $player->get_lname() . "','" . $player->get_height() . "','" . $player->get_weight() . "','" . $player->get_gender() . "','" . $player->get_dob() . "','" . $player->get_email() . "','" . $player->get_teamId() . "'";
         } else {
             if (strcasecmp($action, UPDATE) == 0) {
                 //update team record
                 $query = " dbo.SP_UPDATE_PLAYER '" . $player->get_fname() . "','" . $player->get_lname() . "','" . $player->get_height() . "','" . $player->get_weight() . "','" . $player->get_gender() . "','" . $player->get_dob() . "','" . $player->get_teamId() . "','" . $player->get_email() . "','" . $player->get_playerId() . "'";
             } else {
                 if (strcasecmp($action, DELETE) == 0) {
                     //delete team record
                     //$query = " dbo.SP_DELETE_PLAYER '".$player->get_email()."','".$player->get_teamName()."'";
                     $query = " dbo.SP_DELETE_PLAYER '" . $player->get_playerId() . "'";
                 }
             }
         }
         $result = parent::processCUD($query, $action);
         //or use $this->
         return $result;
     } else {
         return ERROR;
     }
 }
Exemplo n.º 3
0
 public function cudCoach($coach, $action)
 {
     if (isset($coach)) {
         $query = "";
         if (strcasecmp($action, CREATE) == 0) {
             //add coach record
             $query = " dbo.SP_CREATE_COACH '" . $coach->get_fname() . "','" . $coach->get_lname() . "','" . $coach->get_emailAddress() . "','" . $coach->get_password() . "'";
         } else {
             if (strcasecmp($action, UPDATE) == 0) {
                 //update coach record
                 $query = " dbo.SP_UPDATE_COACH '" . $coach->get_fname() . "','" . $coach->get_lname() . "','" . $coach->get_oldEmailAddress() . "','" . $coach->get_emailAddress() . "','" . $coach->get_password() . "'";
             } else {
                 if (strcasecmp($action, DELETE) == 0) {
                     //delete coach record
                     $query = " dbo.SP_DELETE_COACH '" . $coach->get_emailAddress() . "'";
                 }
             }
         }
         $result = parent::processCUD($query, $action);
         //or use $this->
         //   echo 'Result in CoachDAO='.$result;
         return $result;
     } else {
         return ERROR;
     }
 }
Exemplo n.º 4
0
 public function cudRegistration($registration, $action)
 {
     if (isset($registration)) {
         //  print_r($registration);
         $query = "";
         if (strcasecmp($action, CREATE) == 0) {
             //add registration record
             $query = " dbo.SP_CREATE_REGISTRATION '" . $registration->get_teamId() . "','" . $registration->get_tournamentId() . "'";
         } else {
             if (strcasecmp($action, UPDATE) == 0) {
                 //update registration record
                 $query = " dbo.SP_UPDATE_REGISTRATION '" . $registration->get_teamName() . "','" . $registration->get_tournamentName() . "','" . $registration->get_newTournamentName() . "'";
             } else {
                 if (strcasecmp($action, DELETE) == 0) {
                     //delete registration record
                     $query = " dbo.SP_DELETE_REGISTRATION '" . $registration->get_teamName() . "','" . $registration->get_tournamentName() . "";
                 }
             }
         }
         $result = parent::processCUD($query, $action);
         return $result;
     } else {
         return ERROR;
     }
 }