source: extensions/manage_properties_photos/include/function.aip.inc.php @ 30703

Last change on this file since 30703 was 30702, checked in by ddtddt, 10 years ago

[extensions] - manage_properties_photos -beta 4

File size: 2.0 KB
Line 
1<?php 
2/*picture*/
3function tab_add_info_one_photo($id_img){
4$query = '
5    SELECT aip.id_prop_pho,aip.wording,aipd.data,aip.orderprop
6    FROM ' . ADD_PROP_PHOTO_TABLE . ' AS aip
7    LEFT JOIN ' . ADD_PROP_PHOTO_DATA_TABLE . ' AS aipd ON aip.id_prop_pho=aipd.id_prop_pho
8    WHERE aipd.id_img = \'' . $id_img . '\'
9    AND aip.active = 0
10    ORDER BY aip.orderprop ASC
11    ;';
12
13return pwg_query($query);
14}
15/*
16function tab_add_info_one_photo2($id_img){
17$query = '
18    SELECT aip.id_prop_pho,aip.wording,aipd.data,aip.orderprop
19    FROM ' . ADD_PROP_PHOTO_DATA_TABLE . ' AS aipd
20    RIGHT JOIN ' . ADD_PROP_PHOTO_TABLE . ' AS aip ON aip.id_prop_pho=aipd.id_prop_pho
21    WHERE aipd.id_img = \'' . $id_img . '\'
22    AND aip.active = 0
23    ORDER BY aip.orderprop ASC
24    ;';
25
26return pwg_query($query);
27}
28*/
29/*Admin*/
30function tab_add_info_by_photo(){
31$query = '
32    SELECT id_prop_pho,wording
33    FROM ' . ADD_PROP_PHOTO_TABLE . '
34    WHERE active = 0
35    AND edit = 1
36    ORDER BY orderprop ASC
37    ;';
38return pwg_query($query);
39}
40
41
42/*initpicture*/
43function tab_add_info_by_photo_show(){
44$query = '
45    SELECT id_prop_pho,wording,orderprop
46    FROM ' . ADD_PROP_PHOTO_TABLE . '
47    WHERE active = 0
48    ORDER BY orderprop ASC
49    ;';
50return pwg_query($query);
51}
52
53/*initpicture et admin*/
54function data_info_photos($id_img=null,$id_prop_pho=NULL){
55$query = '
56    SELECT data
57    FROM ' . ADD_PROP_PHOTO_DATA_TABLE;
58    $wa='WHERE';
59    if($id_img!=null){
60        $query .=' '.$wa.' id_img='.$id_img;$wa='AND';
61    }
62    if($id_prop_pho!=null){
63        $query .=' '.$wa.' id_prop_pho='.$id_prop_pho;$wa='AND';
64    }
65$query .= ';';
66return pwg_query($query);
67}
68
69/*Admin*/
70function tab_info_photos($id_prop_pho=NULL){
71$query = '
72    SELECT id_prop_pho,wording,orderprop,active,edit
73    FROM ' . ADD_PROP_PHOTO_TABLE;
74    if($id_prop_pho!=null){
75        $query .= ' WHERE id_prop_pho='.$id_prop_pho;
76    }
77
78$query .= ' ORDER BY orderprop ASC
79    ;';
80return pwg_query($query);
81}
82
83?>
Note: See TracBrowser for help on using the repository browser.