[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/admin/ -> barcode.php (source)

   1  <?php
   2  /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   * Copyright (C) 2004-2005 Laurent Destailleur  <eldy@users.sourceforge.net>
   4   * Copyright (C) 2005      Regis Houssin        <regis.houssin@cap-networks.com>
   5   *
   6   * This program is free software; you can redistribute it and/or modify
   7   * it under the terms of the GNU General Public License as published by
   8   * the Free Software Foundation; either version 2 of the License, or
   9   * (at your option) any later version.
  10   *
  11   * This program is distributed in the hope that it will be useful,
  12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14   * GNU General Public License for more details.
  15   *
  16   * You should have received a copy of the GNU General Public License
  17   * along with this program; if not, write to the Free Software
  18   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19   *
  20   * $Id: barcode.php,v 1.3 2005/07/16 01:23:10 eldy Exp $
  21   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/admin/barcode.php,v $
  22   */
  23  
  24  /**    
  25          \file       htdocs/admin/barcode.php
  26          \ingroup    barcode
  27          \brief      Page d'administration/configuration du module Code barre
  28          \version    $Revision: 1.3 $
  29  */
  30  
  31  require ("./pre.inc.php");
  32  
  33  $langs->load("admin");
  34  $langs->load("bills");
  35  
  36  if (!$user->admin)
  37    accessforbidden();
  38  
  39  $barcode_encode_type_set = BARCODE_ENCODE_TYPE;
  40  
  41  $typeconst=array('yesno','texte','chaine');
  42  
  43  if ($_GET["action"] == 'settype' && $user->admin)
  44  {
  45      if (dolibarr_set_const($db, "BARCODE_ENCODE_TYPE",$_GET["value"]))
  46      $barcode_encode_type_set = $_GET["value"];
  47  }
  48  
  49  /*
  50    $sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = 'BARCODE_ENCODE_TYPE';";
  51    $db->query($sql);
  52  
  53    $sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,value,visible) VALUES
  54      ('BARCODE_ENCODE_TYPE','".$_POST["host"]."',0);";
  55      $db->query($sql);
  56  }
  57  */
  58  
  59  llxHeader('',$langs->trans("BarcodeSetup"),'BarcodeConfiguration');
  60  
  61  print_titre($langs->trans("BarcodeSetup"));
  62  
  63  /*
  64   *  CHOIX ENCODAGE
  65   */
  66   
  67  print '<br>';
  68  print_titre($langs->trans("BarcodeEncodeModule"));
  69  
  70  print '<table class="noborder" width="100%">';
  71  
  72  //print '<form action="barcode.php" method="post">';
  73  //print '<input type="hidden" name="action" value="settype">';
  74  
  75  print '<tr class="liste_titre">';
  76  
  77  print '<td>'.$langs->trans("Name").'</td>';
  78  print '<td>'.$langs->trans("Description").'</td>';
  79  print '<td>'.$langs->trans("Example").'</td>';
  80  print '<td align="center" width="60">'.$langs->trans("Default").'</td>';
  81  print "</tr>\n";
  82  
  83  clearstatcache();
  84  $var=true;
  85  
  86  //EAN13
  87        $var=!$var;
  88        print '<tr '.$bc[$var].'><td width="100">';
  89        print "EAN13";
  90        print "</td><td>\n";
  91        
  92        print "information";
  93        print '</td>';
  94  
  95        // Affiche example
  96        print '<td><img src="http://ns32126.ovh.net/barcode/barcode.php?code=123456789012&encoding=EAN&scale=1"></td>';
  97        
  98        print '<td align="center">';
  99        if ($barcode_encode_type_set == "EAN13")
 100          {
 101              print img_tick();
 102          }
 103        else
 104          {
 105            print '<a href="barcode.php?action=settype&amp;value=EAN13">'.$langs->trans("Default").'</a>';
 106          }
 107          print "</td></tr>\n";
 108  
 109  //UPC
 110        $var=!$var;
 111        print '<tr '.$bc[$var].'><td width="100">';
 112        print "UPC";
 113        print "</td><td>\n";
 114        print "information";
 115        print '</td>';
 116  
 117        // Affiche example
 118        print '<td><img src="http://ns32126.ovh.net/barcode/barcode.php?code=123456789012&encoding=UPC&scale=1"></td>';
 119        
 120        print '<td align="center">';
 121        if ($barcode_encode_type_set == "UPC")
 122          {
 123              print img_tick();
 124          }
 125        else
 126          {
 127            print '<a href="barcode.php?action=settype&amp;value=UPC">'.$langs->trans("Default").'</a>';
 128          }
 129          print "</td></tr>\n";
 130          
 131  //ISBN
 132        $var=!$var;
 133        print '<tr '.$bc[$var].'><td width="100">';
 134        print "ISBN";
 135        print "</td><td>\n";
 136        print "information";
 137        print '</td>';
 138  
 139        // Affiche example
 140        print '<td><img src="http://ns32126.ovh.net/barcode/barcode.php?code=123456789&encoding=ISBN&scale=1"></td>';
 141        
 142        print '<td align="center">';
 143        if ($barcode_encode_type_set == "ISBN")
 144          {
 145              print img_tick();
 146          }
 147        else
 148          {
 149            print '<a href="barcode.php?action=settype&amp;value=ISBN">'.$langs->trans("Default").'</a>';
 150          }
 151          print "</td></tr>\n";
 152          
 153  //code 39
 154        $var=!$var;
 155        print '<tr '.$bc[$var].'><td width="100">';
 156        print "Code 39";
 157        print "</td><td>\n";
 158        print "information";
 159        print '</td>';
 160  
 161        // Affiche example
 162        print '<td><img src="http://ns32126.ovh.net/barcode/barcode.php?code=1234567890&encoding=39&scale=1"></td>';
 163        
 164        print '<td align="center">';
 165        if ($barcode_encode_type_set == "code39")
 166          {
 167              print img_tick();
 168          }
 169        else
 170          {
 171            print '<a href="barcode.php?action=settype&amp;value=code39">'.$langs->trans("Default").'</a>';
 172          }
 173          print "</td></tr>\n";
 174          
 175          
 176  //code 128
 177        $var=!$var;
 178        print '<tr '.$bc[$var].'><td width="100">';
 179        print "Code 128";
 180        print "</td><td>\n";
 181        print "information";
 182        print '</td>';
 183  
 184        // Affiche example
 185        print '<td><img src="http://ns32126.ovh.net/barcode/barcode.php?code=ABCD1234567890&encoding=128&scale=1"></td>';
 186        
 187        print '<td align="center">';
 188        if ($barcode_encode_type_set == "code128")
 189          {
 190              print img_tick();
 191          }
 192        else
 193          {
 194            print '<a href="barcode.php?action=settype&amp;value=code128">'.$langs->trans("Default").'</a>';
 195          }
 196          print "</td></tr>\n";
 197          
 198  //I25
 199        $var=!$var;
 200        print '<tr '.$bc[$var].'><td width="100">';
 201        print "I25";
 202        print "</td><td>\n";
 203        print "information";
 204        print '</td>';
 205  
 206        // Affiche example
 207        print '<td><img src="http://ns32126.ovh.net/barcode/barcode.php?code=1234567890&encoding=I25&scale=1"></td>';
 208        
 209        print '<td align="center">';
 210        if ($barcode_encode_type_set == "I25")
 211          {
 212              print img_tick();
 213          }
 214        else
 215          {
 216            print '<a href="barcode.php?action=settype&amp;value=I25">'.$langs->trans("Default").'</a>';
 217          }
 218          print "</td></tr>\n";
 219  
 220  
 221  
 222  
 223  /*
 224  print '<td>'.$langs->trans('Name').'</td><td>'.$langs->trans('Description').'</td>';
 225  print '<td><input type="submit" value="'.$langs->trans('Modify').'"></td>';
 226  print "</tr>\n";
 227  print '<tr '.$bc[false].'><td width="200"><input type="radio" name="compta_mode" value="RECETTES-DEPENSES"'.($compta_mode != 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeTrue').'</td>';
 228  print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc'))."</td></tr>\n";
 229  print '<tr '.$bc[true].'><td width="200"><input type="radio" name="compta_mode" value="CREANCES-DETTES"'.($compta_mode == 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeVirtual').'</td>';
 230  print '<td colspan="2">'.$langs->trans('OptionModeVirtualDesc')."</td></tr>\n";
 231  print '</form>';
 232  */
 233  
 234  print "</table>\n";
 235  
 236  
 237  
 238  /*
 239   * FORMAT PAPIER
 240   */
 241  /*
 242  print_titre($langs->trans("PaperFormatModule"));
 243  
 244  $def = array();
 245  
 246  $sql = "SELECT nom FROM ".MAIN_DB_PREFIX."barcode_format_paper_model_pdf";
 247  $resql=$db->query($sql);
 248  if ($resql)
 249  {
 250    $i = 0;
 251    $num_rows=$db->num_rows($resql);
 252    while ($i < $num_rows)
 253      {
 254        $array = $db->fetch_array($resql);
 255        array_push($def, $array[0]);
 256        $i++;
 257      }
 258  }
 259  else
 260  {
 261    dolibarr_print_error($db);
 262  }
 263  
 264  $dir = "../includes/modules/formatpaper/";
 265  
 266  print "<table class=\"noborder\" width=\"100%\">\n";
 267  print "<tr class=\"liste_titre\">\n";
 268  print "  <td width=\"140\">".$langs->trans("Name")."</td>\n";
 269  print "  <td>".$langs->trans("Description")."</td>\n";
 270  print '  <td align="center" width="60">'.$langs->trans("Activated")."</td>\n";
 271  print '  <td align="center" width="60">'.$langs->trans("Default")."</td>\n";
 272  print "</tr>\n";
 273  
 274  clearstatcache();
 275  
 276  $handle=opendir($dir);
 277  
 278  $var=true;
 279  while (($file = readdir($handle))!==false)
 280  {
 281    if (substr($file, strlen($file) -12) == '.modules.php' && substr($file,0,12) == 'pdf_paper_')
 282      {
 283        $name = substr($file, 12, strlen($file) - 24);
 284        $classname = substr($file, 0, strlen($file) -12);
 285  
 286        $var=!$var;
 287        print "<tr ".$bc[$var].">\n  <td>";
 288        print "$name";
 289        print "</td>\n  <td>\n";
 290        require_once($dir.$file);
 291        $obj = new $classname($db);
 292        
 293        print $obj->description;
 294  
 295        print "</td>\n  <td align=\"center\">\n";
 296  
 297        if (in_array($name, $def))
 298      {
 299        print img_tick();
 300        print "</td>\n  <td>";
 301        print '<a href="barcode.php?action=del&amp;value='.$name.'">'.$langs->trans("Disable").'</a>';
 302      }
 303        else
 304      {
 305        print "&nbsp;";
 306        print "</td>\n  <td>";
 307        print '<a href="barcode.php?action=set&amp;value='.$name.'">'.$langs->trans("Activate").'</a>';
 308      }
 309  
 310        print "</td>\n  <td align=\"center\">";
 311  
 312        if ($barcode_addon_var_pdf == "$name")
 313      {
 314        print img_tick();
 315      }
 316        else
 317      {
 318        print '<a href="barcode.php?action=setpdf&amp;value='.$name.'">'.$langs->trans("Activate").'</a>';
 319      }
 320        print '</td></tr>';
 321      }
 322  }
 323  closedir($handle);
 324  
 325  print '</table>';
 326  
 327  */
 328  
 329  print "<br>";
 330  
 331  $db->close();
 332  
 333  llxFooter('$Date: 2005/07/16 01:23:10 $ - $Revision: 1.3 $');
 334  ?>


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics