Changeset 9405 for extensions/AddInfo/admin/admin.php
- Timestamp:
- Feb 28, 2011, 8:14:06 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AddInfo/admin/admin.php
r9260 r9405 15 15 // Gestion des onglets 16 16 if (!isset($_GET['tab'])) 17 $page['tab'] = ' addinfo';17 $page['tab'] = 'explication'; 18 18 else 19 19 $page['tab'] = $_GET['tab']; 20 20 21 21 $tabsheet = new tabsheet(); 22 $tabsheet->add('addinfo',23 l10n('addinfo_ajout'),24 $my_base_url.'&tab=addinfo');25 22 $tabsheet->add('explication', 26 23 l10n('addinfo_explication'), … … 31 28 switch ($page['tab']) 32 29 { 33 // Onglet gestion de onglet addinfo 34 case 'addinfo': 35 36 //charge la liste des images 37 $groups = array(); 38 $query = ' 39 select id,name 40 FROM ' . IMAGES_TABLE . ' 41 ORDER BY id ASC;'; 42 $result = pwg_query($query); 43 44 while ($row = mysql_fetch_array($result)) 45 { 46 $groups[$row['id']] = $row['id'].' : '.$row['name']; 47 } 48 49 $selected = 0; 50 $options[] = l10n('addinfo_selecti3'); 51 $options['a'] = '----------------------'; 52 53 foreach($groups as $listid => $listid2) 54 { 55 $options[$listid] = $listid2; 56 } 57 $template->assign( 58 'addinfoo1', 59 array( 60 'OPTIONS' => $options, 61 'SELECTED' => $selected 62 )); 63 64 //edit des imfos complèmentaire de l'image 65 if (isset($_POST['submitchoiximg'])and is_numeric($_POST['addinfoimg']) and (!$_POST['addinfoimg'])==0 and !is_adviser()) 66 { 67 $lire=$_POST['addinfoimg']; 68 $query = ' 69 select id,name,path 70 FROM ' . IMAGES_TABLE . ' 71 WHERE id = \''.$lire.'\' 72 ;'; 73 $result = pwg_query($query); 74 75 $row = mysql_fetch_array($result); 76 $idimg=$row['id']; 77 $chnameimg=$row['name']; 78 $rootimg=$row['path']; 79 80 $query = ' 81 select id,info1,info2,info3 82 FROM ' . ADDINFO_TABLE . ' 83 WHERE id = \''.$lire.'\' 84 ;'; 85 $result = pwg_query($query); 86 $row = mysql_fetch_array($result); 87 $idaddinfo=$row['id']; 88 $info1=$row['info1']; 89 $info2=$row['info2']; 90 $info3=$row['info3']; 91 92 $selected3 = 0; 93 94 $template->assign( 95 'img_edit', 96 array( 97 'RIMG' => $rootimg, 98 'VALUE' => $idimg, 99 'VALUEN' => $chnameimg, 100 'CONTENT' => htmlspecialchars($info1), 101 'CONTENT2' => htmlspecialchars($info2), 102 'CONTENT3' => htmlspecialchars($info3), 103 'SELECTED' => $selected3 104 )); 105 } 106 107 //insértion les information dans la table addinfo_picture 108 if (isset($_POST['submitinsimgA']) and !is_adviser()) 109 { 110 $query = ' 111 DELETE 112 FROM ' . ADDINFO_TABLE . ' 113 WHERE id = \''.$_POST['invisible'].'\' 114 ;'; 115 $result = pwg_query($query); 116 $q = ' 117 INSERT INTO ' . $prefixeTable . 'AddInfo_images(id,info1,info2,info3)VALUES ('.$_POST['invisible'].',"'.$_POST['inser'].'","'.$_POST['inser2'].'","'.$_POST['inser3'].'");'; 118 pwg_query($q); 119 } 120 121 break; 122 123 // Onglet en attente 30 // tab help 124 31 case 'explication': 125 32 $explication = 'explication';
Note: See TracChangeset
for help on using the changeset viewer.