{
    public $firstName;
    public $lastName;
    public function __construct($firstName, $lastName)
    {
        $this->firstName = $firstName;
        $this->lastName = $lastName;
    }
    public function fullName()
    {
        return $this->firstName . ' ' . $this->lastName;
    }
}
class Superhero extends Person
{
    public $pseudonym;
    public $capeColor;
    public function alterEgo()
    {
        return 'Top Secret Alternate Ego: ' . $this->fullName();
    }
    public function hasCape()
    {
        return !empty($this->capeColor);
    }
}
$superman = new Superhero('Clark', 'Kent');
$superman->pseudonym = 'Superman';
$superman->capeColor = 'Red';
echo $superman->fullName();
echo $superman->alterEgo();
Example #2
0
    <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap-theme.min.css">

    <!-- Latest compiled and minified JavaScript -->
    <script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="css.css">
    <link rel="stylesheet" href="rotate.css">

</head>

<body class="bg2">
    <?php 
require "server/DatabasePDO.php";
require "server/Superhero.php";
require "server/Power.php";
$current = Superhero::findById($_POST["current"]);
$opponent = Superhero::findById($_POST["opponent"]);
$cpower = Power::findById($current->getPowerId());
$opower = Power::findById($opponent->getPowerId());
$avgcpower = Power::findAvg($current->getPowerId());
$avgopower = Power::findAvg($opponent->getPowerId());
$avgcpower = doubleval($avgcpower[0]);
$avgopower = doubleval($avgopower[0]);
?>
    <img id="upper_left" class="back_pic" src="images/batman.png" width="490px">

    <div class="container result">
        <div class="row text-center header">
            <div id="logo"></div>
        </div>

        <!--Character Start-->
Example #3
0
 public function index()
 {
     $var = \Superhero::with('wonders')->get();
     var_dump($var->toArray());
     die;
 }
Example #4
0
            <div class="panel-body">
                <div class="col-xs-offset-1 col-xs-10">
                    <table class="table">
                        <thead>
                            <tr>
                                <th>Rank</th>

                                <th colspan="2">Superhero</th>
                                <th>Total Score</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php 
$count = 1;
foreach ($powers as $power) {
    $superhero = Superhero::findByPowerId($power[1]);
    if ($count == 1) {
        echo "<tr class='danger rank1'>";
    } else {
        echo "<tr>";
    }
    echo "<td class='col-xs-2'>#" . $count . "</td>";
    echo "<td class='col-xs-2'>";
    echo "<a href='#' id='" . $superhero->getId() . "' onclick='sendSuperheroID(this.id)'>";
    echo "<img src='" . $superhero->getImageUrl() . "'>";
    echo "</a>";
    echo "</td>";
    echo "<td><a href='#' id='" . $superhero->getId() . "' onclick='sendSuperheroID(this.id)'>Superman</a></td>";
    echo "<td class='col-xs-2'>" . substr($power[0], 0, 3) . "</td>";
    echo "</tr>";
}
Example #5
0
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h3 class="panel-title">Team Members</h3>
                            </div>
                            <div class="panel-body">
                                <?php 
foreach ($memberof as $member) {
    echo "<div class='col-xs-2'>";
    echo "<div class='thumbnail'>";
    echo "<a href='#' id='" . Superhero::findById($member->getSuperheroId())->getId() . "' onclick='sendSuperheroID(this.id)'>";
    echo "<img src='" . Superhero::findById($member->getSuperheroId())->getImageUrl() . "' class='img-rounded member-pic' width='100px' height='80px'>";
    echo "</a>";
    echo "<div class='caption text-center'>";
    echo "<a href='#' id='" . Superhero::findById($member->getSuperheroId())->getId() . "' onclick='sendSuperheroID(this.id)'>";
    echo "<p>" . Superhero::findById($member->getSuperheroId())->getName() . "</p>";
    echo "</a>";
    echo "</div>";
    echo "</div>";
    echo "</div>";
}
?>
                                <form id="superhero-form" action="superhero.php" method="post">
                                    <input id="superheroID" type="hidden" name="superheroID">
                                </form>
                            </div>
                        </div>
                        <br>
                        <br>
                    </div>
                </div>
Example #6
0
    protected $lastName;
    public function __construct($firstName, $lastName)
    {
        $this->firstName = $firstName;
        $this->lastName = $lastName;
    }
    public function fullName()
    {
        return $this->firstName . ' ' . $this->lastName;
    }
}
class Superhero extends Person
{
    public $pseudonym;
    public $capeColor;
    public function __construct($firstName, $lastName, $pseudonym)
    {
        parent::__construct($firstName, $lastName);
        $this->pseudonym = $pseudonym;
    }
    public function alterEgo()
    {
        return 'Top Secret Alternate Ego: ' . $this->fullName();
    }
    public function hasCape()
    {
        return !empty($this->capeColor);
    }
}
$superman = new Superhero('Clark', 'Kent', 'Superman');
echo $superman->alterEgo();
Example #7
0
}
?>
                                        <h4 class="text-primary">Plot</h4>
                                        <p><?php 
echo $story->getPlot();
?>
</p>
                                    </div>
                                </div>


                                <h4 class="text-primary">Character</h4>
                                <div class="row">
                                    <?php 
foreach ($superheroof as $superheroID) {
    $superhero = Superhero::findById($superheroID->getSuperheroId());
    echo "<div class='col-xs-2'>";
    echo "<a href='#' id='" . $superhero->getId() . "' onclick='sendSuperheroID(this.id)'>";
    echo "<div class='thumbnail'>";
    echo "<img src='" . $superhero->getImageUrl() . "'>";
    echo "<div class='caption text-center'>";
    echo "<p>" . $superhero->getName() . "</p>";
    echo "</div>";
    echo "</div>";
    echo "</a>";
    echo "</div>";
}
?>
                                    <form id="superhero-form" action="superhero.php" method="post">
                                        <input id="superheroID" type="hidden" name="superheroID">
                                    </form>
Example #8
0
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!--    Power End -->
                <div class="row">

                    <div class="col-xs-4 text-center">
                        <h3 class="text-danger">VERSUS</h3>
                        <form class="form-inline" role="form" action="versus.php" method="post">
                            <div class="row">
                                <div class="col-xs-offset-1 col-xs-10">
                                    <select name="opponent" class="form-control input-lg">
                                        <?php 
$superheroAll = Superhero::findAll();
foreach ($superheroAll as $superhero) {
    echo "<option value='" . $superhero->getId() . "'>";
    echo $superhero->getName();
    echo "</option>";
}
?>
                                    </select>
                                </div>
                            </div>

                            <div class="row">
                                <?php 
echo "<input type='hidden' name='current' value='" . $_POST["superheroID"] . "'>";
?>
                                <button type="submit" class="btn btn-primary btn-lg button-versus">Versus</button>
Example #9
0
    <!-- Latest compiled and minified JavaScript -->
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="css.css">
    <script src="server.js" type="text/javascript"></script>
</head>

<body class="bg2">
    <?php 
require "server/DatabasePDO.php";
require "server/Superhero.php";
require "server/Team.php";
require "server/Movie.php";
require "server/Story.php";
$superheros = Superhero::findByName($_POST["keyword"]);
$teams = Team::findByName($_POST["keyword"]);
$movies = Movie::findByName($_POST["keyword"]);
$stories = Story::findByName($_POST["keyword"]);
?>
    <img id="upper_right" class="reflect back-panel" src="images/ironman.png" width="500px">

    <div class="container result">
        <div class="row text-center header">
            <div class="row">
                <div id="logo"></div>
            </div>
            <br>
            <br>
            <div class="alert alert2 alert-success col-xs-offset-4 col-xs-4">
                <h3>
Example #10
0
 private static function initializeConnection()
 {
     if (is_null(self::$dbConn)) {
         self::$dbConn = DatabasePDO::getInstance();
     }
 }