Esempio n. 1
0
             $item->picture = HOST . "includes/webservices/images/" . $filename . "x" . $random . ".jpg";
             $html .= "<tr>";
             $html .= "  <td>productid " . $item->productid . "</td>";
             $html .= "  <td><img src='" . $item->picture . "' height='40' width='40'/></td>";
             $html .= "  <td><a class='btn btn-primary' href='updateproductpic.php?id=" . $item->id . "'>Update</a></td>";
             $html .= "  <td><button class='btn btn-danger btndelete'>Delete <span hidden>" . $item->id . "</span></button></td>";
             $html .= "</tr>";
         }
         $filename = 0;
         echo $html;
     } else {
         echo "no data";
     }
 } else {
     if ($_GET['itemtype'] == "traffic") {
         $items = Traffic::search($input);
         if (count($items) > 0) {
             foreach ($items as $item) {
                 $filename++;
                 $random = rand(0, 1);
                 file_put_contents("images/" . $filename . "x" . $random . ".jpg", base64_decode($item->picture));
                 $item->picture = HOST . "includes/webservices/images/" . $filename . "x" . $random . ".jpg";
                 $html .= "<tr>";
                 $html .= "  <td><img src='" . $item->picture . "' height='40' width='40'/></td>";
                 $html .= "  <td>userid " . $item->userid . "</td>";
                 $html .= "  <td>storeid " . $item->storeid . "</td>";
                 $html .= "  <td>status " . $item->status . "</td>";
                 $html .= "  <td>" . $item->comment . "</td>";
                 $html .= "  <td><a class='btn btn-primary' href='updatetraffic.php?id=" . $item->id . "'>Update</a></td>";
                 $html .= "  <td><button class='btn btn-danger btndelete'>Delete <span hidden>" . $item->id . "</span></button></td>";
                 $html .= "</tr>";
Esempio n. 2
0
            } else {
                if ($_GET['itemtype'] == "traffic") {
                    $traffics = Traffic::search($input);
                } else {
                    if ($_GET['itemtype'] == "review") {
                        $reviews = Review::search($input);
                    }
                }
            }
        }
    }
} else {
    $users = User::search($input);
    $stores = Store::search($input);
    $products = Product::search($input);
    $traffics = Traffic::search($input);
    $reviews = Review::search($input);
}
$tables = array();
if ($users != null) {
    $table = new Table("users", $users);
    array_push($tables, $table);
}
if ($stores != null) {
    $table = new Table("stores", $stores);
    array_push($tables, $table);
}
if ($products != null) {
    $table = new Table("products", $products);
    array_push($tables, $table);
}