-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprueba2.php
49 lines (38 loc) · 1.15 KB
/
prueba2.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
include 'assets/templates/pwd.php';
include $dir . 'charmadmin/dbc/dbconnect.php';
include $dir . 'charmadmin/dbc/articulosDAO.php';
$dbconnect = new dbconnect('charm_charmlifec536978');
$dbc = $dbconnect->getConnection();
$articulosDAO = new articulosDAO($dbc);
$limit = $_POST['limit'];
$perPage = 10;
$tags = $_POST['tags'];
if(!empty($tags)){
$limit = $limit -1;
$query = $articulosDAO->getMasCharmIntereses($tags, $limit, $perPage);
foreach ($query as $item) {
if (is_dir($dir . 'charmadmin/MasCharm/'.$item->articulo_id . '/')){
$thumb = scandir($dir . 'charmadmin/MasCharm/'.$item->articulo_id . '/');
$item->imagen = $thumb[2];
}
}
echo json_encode($query);
}
//
/*$index = $perPage * $limit;
$articulos = $articulosDAO->getMasCharm($index, $perPage);
foreach ($articulos as $item) {
if (is_dir('../../' . $dir . 'charmadmin/Thumbnails/'.$item->articulo_id . '/')){
$thumb = scandir('../../' . $dir . 'charmadmin/Thumbnails/'.$item->articulo_id . '/');
$item->imagen = $thumb[2];
}
}
if(empty($articulos)){
echo 'NO MORE';
}else{
echo json_encode($articulos);
}*/
?>