Changeset 30638


Ignore:
Timestamp:
Dec 1, 2014, 10:50:24 PM (10 years ago)
Author:
ddtddt
Message:

[extensions] - Add info - add export to manage_info_photos

Location:
extensions/AddInfo/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/AddInfo/admin/admin.php

    r21631 r30638  
    3939          'meta'=>l10n('meta_name'),
    4040          ));
     41         
     42        $exp = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'manage_info_photos';"));
     43        if($exp['state']=='active'){
     44                $template->assign(
     45                        'gestionC',
     46                                array(
     47                                 'meta'=>l10n('meta_name'),
     48                ));
     49        }       
     50        if (isset($_POST['submitexpot'])){
     51
     52        $idinfo=pwg_db_fetch_assoc(pwg_query('SELECT id_info_pho FROM ' . ADD_INFO_PHOTO_TABLE . ' ORDER BY id_info_pho DESC LIMIT 1;'));       
     53        $idinfo=$idinfo['id_info_pho'];
     54        $idinfo1=$idinfo+1;$idinfo2=$idinfo+2;$idinfo3=$idinfo+3;
     55        $q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES ('.$idinfo1.',"infos1",'.$idinfo1.',0,1);';
     56    pwg_query($q);
     57        $q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES ('.$idinfo2.',"infos2",'.$idinfo2.',0,1);';
     58    pwg_query($q);
     59        $q = 'INSERT INTO ' . $prefixeTable . 'Add_Info_photos(id_info_pho,designation,orderinfo,active,edit)VALUES ('.$idinfo3.',"infos3",'.$idinfo3.',0,1);';
     60    pwg_query($q);
     61        $query = 'SELECT * FROM ' . ADDINFO_TABLE . ';';
     62        $result = pwg_query($query);
     63        if (pwg_db_num_rows($result)) {
     64                while ($info = pwg_db_fetch_assoc($result)){
     65                        $q = 'INSERT INTO ' . $prefixeTable . 'add_Info_photos_data(id_img,id_info_pho,data)VALUES ('.$info['id'].','.$idinfo1.',"'.$info['info1'].'");';
     66                        pwg_query($q);
     67                        $q = 'INSERT INTO ' . $prefixeTable . 'add_Info_photos_data(id_img,id_info_pho,data)VALUES ('.$info['id'].','.$idinfo2.',"'.$info['info2'].'");';
     68                        pwg_query($q);
     69                        $q = 'INSERT INTO ' . $prefixeTable . 'add_Info_photos_data(id_img,id_info_pho,data)VALUES ('.$info['id'].','.$idinfo3.',"'.$info['info3'].'");';
     70                        pwg_query($q);
     71
     72                }
     73        }
     74        array_push($page['infos'], l10n('export is ok'));
     75
     76 
     77
     78       
     79        } 
     80         
    4181 
    4282        break;
  • extensions/AddInfo/admin/admin.tpl

    r21631 r30638  
    1212                        {'addinfo_explication_update non_help'|@translate}
    1313        </div>
     14{/if}
     15{if isset ($gestionC)}
     16        <form method="post" >
     17                <fieldset>
     18                        <legend>{'Export infos to manage info photo'|@translate}</legend>
     19                        <input class="submit" name="submitexpot" type="submit" value="{'Export'|@translate}">
     20                </fieldset>
     21        </form>
    1422{/if}
    1523{if isset ($gestionA)}
Note: See TracChangeset for help on using the changeset viewer.