Beispiel #1
0
<?php

require_once '../base.php';
require_once './models/user.php';
require_once './models/photo.php';
ActivePhp\Base::establish_connection(array('host' => 'localhost', 'database' => 'test_php', 'username' => 'root', 'password' => ''));
$rc = new Activephp\ResultCollection(Photo::find_all());
echo "<br />";
echo $rc->to_xml();
$users = User::find_all();
$user = $users[0];
echo '<pre>';
print_r($users);
var_dump($user);
echo 'photos<br/>';
foreach ($user->photos() as $photo) {
    print_r($photo);
    echo "id<p>";
    echo $photo->id();
    echo "<p> " . $photo->file() . " </p>";
}
echo 'end photos<br/>';
$photos2 = Photo::find(array(1, 2));
var_dump($photos2);
echo "USer start<br/>";
var_dump($photos2[0]->user());
echo "user end<br/>";
$user2 = User::find($user->id());
var_dump($user2);
var_dump($user2->photos());
try {
Beispiel #2
0
        <div class="col-md-12">
        <table class="table table-hover">
            <thead>
            <tr>
                <th>Photo</th>
                <th>ID</th>
                <th>Filename</th>
                <th>Title</th>
                <th>Size</th>
                <th>Comments</th>
            </tr>
            </thead>
            <tbody>
       <?php 
$photos = Photo::find_all();
$output = "";
$blank = "&nbsp;&nbsp;&nbsp;";
foreach ($photos as $photo) {
    $output .= "<tr>";
    $output .= "<td style='text-center'><img  class='admin-photo-thumbnail' src=\"{$photo->picture_path()}\" alt=''>";
    $output .= "<div class='picture_link'>";
    $output .= "<a href='delete_photo.php?id=" . urlencode($photo->id) . "'>Delete</a>{$blank}";
    $output .= "<a href='edit_photo.php?id=" . urlencode($photo->id) . "'>Edit</a>{$blank}";
    $output .= "<a href='../photo.php?id=" . urlencode($photo->id) . "'>View</a>{$blank}";
    $output .= "</div>";
    $output .= "</td>";
    //        $output.="<td><img src=\"{$photo->picture_path()}\" width='80' height='60' alt=''></td>" ;
    $output .= "<td>{$photo->id}</td>";
    $output .= "<td>{$photo->filename}</td>";
    $output .= "<td>{$photo->title}</td>";
Beispiel #3
0
                <div class="col-xs-12">
                    <table class="table table-striped table-hover">
                        <thead>
                            <tr>
                                <th>Photo</th>
                                <th>Id</th>
                                <th>Filename</th>
                                <th>Title</th>
                                <th>Size</th>
                                <th>Comments</th>
                            </tr>
                        </thead>

                        <tbody>
                            <?php 
$photo_found = Photo::find_all();
?>
                            
                            <?php 
foreach ($photo_found as $photo) {
    ?>
                               <tr>
                                    <td>
                                        <img class="img-thumbnail img-responsive thumb-table" src ="<?php 
    echo $photo->picture_path();
    ?>
"/>
                                        <div class="action_links">
                                            <a class="delete_link" href="delete_photo.php?id=<?php 
    echo $photo->id;
    ?>