Ignore:
Timestamp:
Dec 6, 2014, 8:32:09 AM (10 years ago)
Author:
ddtddt
Message:

[extensions] - manage_properties_photos -beta 4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/manage_properties_photos/include/function.aip.inc.php

    r30631 r30702  
    11<?php
     2/*picture*/
    23function tab_add_info_one_photo($id_img){
    34$query = '
    4     SELECT aip.id_info_pho,aip.designation,aipd.data,aip.orderinfo
    5     FROM ' . ADD_INFO_PHOTO_TABLE . ' AS aip
    6     LEFT JOIN ' . ADD_INFO_PHOTO_DATA_TABLE . ' AS aipd ON aip.id_info_pho=aipd.id_info_pho
     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
    78    WHERE aipd.id_img = \'' . $id_img . '\'
    89    AND aip.active = 0
    9     ORDER BY aip.orderinfo ASC
     10    ORDER BY aip.orderprop ASC
    1011    ;';
    1112
    1213return pwg_query($query);
    1314}
    14 
     15/*
    1516function tab_add_info_one_photo2($id_img){
    1617$query = '
    17     SELECT aip.id_info_pho,aip.designation,aipd.data,aip.orderinfo
    18     FROM ' . ADD_INFO_PHOTO_DATA_TABLE . ' AS aipd
    19     RIGHT JOIN ' . ADD_INFO_PHOTO_TABLE . ' AS aip ON aip.id_info_pho=aipd.id_info_pho
     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
    2021    WHERE aipd.id_img = \'' . $id_img . '\'
    2122    AND aip.active = 0
    22     ORDER BY aip.orderinfo ASC
     23    ORDER BY aip.orderprop ASC
    2324    ;';
    2425
    2526return pwg_query($query);
    2627}
    27 
     28*/
     29/*Admin*/
    2830function tab_add_info_by_photo(){
    2931$query = '
    30     SELECT id_info_pho,designation
    31     FROM ' . ADD_INFO_PHOTO_TABLE . '
     32    SELECT id_prop_pho,wording
     33    FROM ' . ADD_PROP_PHOTO_TABLE . '
    3234    WHERE active = 0
    3335    AND edit = 1
    34     ORDER BY orderinfo ASC
     36    ORDER BY orderprop ASC
    3537    ;';
    3638return pwg_query($query);
    3739}
    3840
     41
     42/*initpicture*/
    3943function tab_add_info_by_photo_show(){
    4044$query = '
    41     SELECT id_info_pho,designation,orderinfo
    42     FROM ' . ADD_INFO_PHOTO_TABLE . '
     45    SELECT id_prop_pho,wording,orderprop
     46    FROM ' . ADD_PROP_PHOTO_TABLE . '
    4347    WHERE active = 0
    44     ORDER BY orderinfo ASC
     48    ORDER BY orderprop ASC
    4549    ;';
    4650return pwg_query($query);
    4751}
    4852
    49 function data_info_photos($id_img=null,$id_info_pho=NULL){
     53/*initpicture et admin*/
     54function data_info_photos($id_img=null,$id_prop_pho=NULL){
    5055$query = '
    5156    SELECT data
    52     FROM ' . ADD_INFO_PHOTO_DATA_TABLE;
     57    FROM ' . ADD_PROP_PHOTO_DATA_TABLE;
    5358    $wa='WHERE';
    5459    if($id_img!=null){
    5560        $query .=' '.$wa.' id_img='.$id_img;$wa='AND';
    5661    }
    57     if($id_info_pho!=null){
    58         $query .=' '.$wa.' id_info_pho='.$id_info_pho;$wa='AND';
     62    if($id_prop_pho!=null){
     63        $query .=' '.$wa.' id_prop_pho='.$id_prop_pho;$wa='AND';
    5964    }
    6065$query .= ';';
     
    6267}
    6368
    64 
    65 function tab_info_photos($id_info_pho=NULL){
     69/*Admin*/
     70function tab_info_photos($id_prop_pho=NULL){
    6671$query = '
    67     SELECT id_info_pho,designation,orderinfo,active,edit
    68     FROM ' . ADD_INFO_PHOTO_TABLE;
    69     if($id_info_pho!=null){
    70         $query .= ' WHERE id_info_pho='.$id_info_pho;
     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;
    7176    }
    7277
    73 $query .= ' ORDER BY orderinfo ASC
     78$query .= ' ORDER BY orderprop ASC
    7479    ;';
    7580return pwg_query($query);
Note: See TracChangeset for help on using the changeset viewer.