TUTOS PHP Cross Reference Groupware Applications

Source: /php/location.pinc - 737 lines - 25229 bytes - Summary - Text - Print

Description: Copyright 1999 - 2013 by Gero Kohnert This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.

   1  <?php
   2  /**
   3   *  Copyright 1999 - 2013 by Gero Kohnert
   4   *
   5   *  This program is free software; you can redistribute it and/or modify it
   6   *  under the terms of the GNU General Public License as published by the
   7   *  Free Software Foundation; version 2 of the License.
   8   *
   9   *  SVN Info  $Id: location.pinc 1198 2013-12-11 08:36:37Z gokohnert $
  10   *  $Author: gokohnert $
  11   */
  12  $tutos['files'][__FILE__] = '$Rev: 1198 $';
  13  
  14  require_once  'company.pinc';
  15  require_once  'department.pinc';
  16  
  17  /**
  18   * Read all locations references of an object
  19   * force : true will ignore permissions
  20   *         false need see permission on locations
  21   */
  22  function read_locs (tutos_base $obj,$force = false) {
  23      global $table;
  24  
  25      if (empty($obj->id))  return;
  26      if (! is_object($obj) ) return;
  27      if (-1 == $obj->id)   return;
  28      if ( $obj->rl1 == true ) return;
  29  
  30  
  31      if ( isset($obj->loc) && (count($obj->loc) > 0) ) {
  32          return;
  33      }
  34  
  35      $obj->loc = array();
  36  
  37      if ($obj->dbconn->prep) {
  38          $obj->dbconn->addPStatement('SELECT * from '.$obj->dbconn->prefix .$table['address1'][name].' WHERE adr_id = $1','B_'.$obj->dbconn->prefix .$table['address1'][name]);
  39          $r = $obj->dbconn->execPStatement('B_'.$obj->dbconn->prefix .$table['address1'][name],1,$obj->id);
  40      } else {
  41          $q = 'SELECT * FROM '. $obj->dbconn->prefix .$table['address1'][name].' WHERE adr_id = '. $obj->id;
  42          $r = $obj->dbconn->Exec($q);
  43      }
  44  
  45      $n = $r->numrows();
  46      $a = 0;
  47      while ( $a < $n ) {
  48          $l_id   = $r->get($a, "loc_id");
  49          $obj->loc[$l_id]  = $r->get($a, "name");
  50  
  51          $a++;
  52      }
  53  
  54      $r->free();
  55      $obj->rl1 = true;
  56  
  57      return;
  58  }
  59  
  60  /**
  61   * Read all locations data
  62   * force : true will ignore permissions
  63   *         false need see permission on locations
  64   */
  65  function read_locs_data (tutos_base $obj,$force = false) {
  66      if (empty($obj->id))  return;
  67      if (! is_object($obj) ) return;
  68      if (-1 == $obj->id)   return;
  69  
  70      if ( $obj->rl2 == true ) {
  71          return;
  72      };
  73      if ( $obj->rl1 == false ) {
  74          read_locs($obj,$force);
  75      };
  76  
  77      if ( isset($obj->location) && (count($obj->location) > 0) ) {
  78          return;
  79      }
  80  
  81  
  82      $obj->location = array();
  83      $obj->locall   = array();
  84  
  85      $x = $obj->loc;
  86      if ( isset($x) && (count($x) > 0) ) {
  87          foreach($x as $i => $f) {
  88              $l = new location($obj->dbconn);
  89              $l = $l->read($i,$l);
  90              if (!is_object($l)) continue;
  91              $l->lname = $f;
  92              $l->adr_id = $obj->id;
  93              $l->ref = &$obj;
  94              if ( count($l->acl) < 1 ) {
  95                  $l->acl = $obj->acl;
  96              }
  97              if ( $force || $l->see_ok() ) {
  98                  $obj->location[$i] = &$l;
  99              } else {
 100                  unset($obj->loc[$i]);
 101              }
 102              // we need the hidden locations for watchlist-emails
 103              $obj->locall[$i] = &$l;
 104              unset($l);
 105          }
 106      }
 107      $obj->rl2 = true;
 108      return;
 109  }
 110  
 111  /**
 112   * a location part of an address
 113   *
 114   * @package address
 115   * @module location
 116   */
 117  class Location extends Tutos_base {
 118  
 119      static  $larray = array('desc1','city','zip','state','country','street1','street2','email_1','email_2','phone_1','phone_2','fax_1','acc_info1','acc_info2','acc_nr','customer_id');
 120      /* ---------------------------------------------------------------------------
 121       */
 122      function location(tutos_db $dbconn) {
 123          global $table,$tutos;
 124  
 125          $this->init($dbconn);
 126  
 127          $this->department = new department($dbconn);
 128          $this->company    = new company($dbconn);
 129          $this->desc1   = '';
 130          $this->country = $tutos[defaultcntry];
 131          $this->lname   = '';
 132          $this->acc_info1   = '';
 133          $this->acc_info2   = '';
 134          $this->acc_nr      = '';
 135          $this->customer_id = '';
 136          $this->category = 2;
 137          $this->adr_id = -1;
 138          $this->ref = -1;
 139  
 140          $this->tablename  = $this->dbconn->prefix .$table['location'][name];
 141          $this->tablename2 = $this->dbconn->prefix .$table['address1'][name];
 142          $this->run_postinit_hook();
 143      }
 144  
 145      /**
 146       * read the referenced object
 147       */
 148      function read_ref() {
 149          if ($this->adr_id != -1) {
 150              return;
 151          }
 152          if ($this->ref != -1) {
 153              return;
 154          }
 155  
 156          $q = 'SELECT * from '. $this->tablename2 .' WHERE loc_id = '. $this->id;
 157          $r = $this->dbconn->Exec($q);
 158          if ($r->numrows() == 1) {
 159              $this->adr_id = $r->get(0, "adr_id");
 160              $this->lname  = $r->get(0, "name");
 161              $this->ref = getObject($this->dbconn,$this->adr_id);
 162          }
 163          $r->free();
 164      }
 165  
 166      /**
 167       * Return a link to this address
 168       */
 169      function getLink($text = "") {
 170          global $lang;
 171  
 172          if (empty($this->id)) return;
 173          if ( empty($text) ) {
 174              $text = $this->getFullName();
 175          }
 176  
 177          $this->read_ref();
 178          if ( $this->see_ok() && is_object($this->ref)) {
 179              return makelink($this->ref->getURL() , myentities($text) ,sprintf($lang['location'] ." %s",$this->getFullName()));
 180          } else {
 181              return myentities($text);
 182          }
 183      }
 184      /**
 185       * fill the object data with a given resultset
 186       *
 187       * @param Object $r    a result set object
 188       * @param int    $pos  a index in the resultset
 189       */
 190      function read_result(result $r,$pos) {
 191          global $g_hash;
 192  
 193          foreach(self::$larray as $f) {
 194              $this->$f = $r->get($pos, $f);
 195              if (!isset($this->$f)) {
 196                  $this->$f = '';
 197              }
 198          }
 199          $this->c_id          = $r->get($pos, 'c_id');
 200          $this->d_id          = $r->get($pos, 'd_id');
 201  
 202          if ( !empty($this->d_id) ) {
 203              $this->department = $this->department->read($this->d_id,$this->department);
 204              if (is_object($this->department))
 205                  $this->company = $this->department->company;
 206          }
 207          if ( !empty($this->c_id) && ($this->c_id != -1) ) {
 208              $this->company = $this->company->read($this->c_id,$this->company);
 209          }
 210  
 211          $this->category    = $r->get($pos, 'category');
 212          $this->creator     = $r->getObject($pos, 'creator');
 213  
 214          parent::read_result($r,$pos);
 215      }
 216  
 217      /**
 218       * a headline for CSV Export
 219       * here no linefeed at the end as locations are never (?) used alone
 220       */
 221      static function exportCSV_Header() {
 222          $r = '';
 223          $r .= txt2csv('locid');
 224  
 225          foreach(self::$larray as $f) {
 226              $r .= txt2csv($f);
 227          }
 228  
 229          $r .= txt2csv('department');
 230          $r .= txt2csv('company');
 231  
 232          return $r;
 233      }
 234  
 235      /**
 236       * export as a CSV line
 237       * here no linefeed at the end as locations are never (?) used alone
 238       */
 239      function exportCSV() {
 240          global $lang;
 241  
 242          $r = '';
 243          $r .= txt2csv($this->id);
 244  
 245          foreach(self::$larray as $f) {
 246              $r .= txt2csv($this->$f);
 247          }
 248          // Department
 249          if ( !empty($this->d_id) ) {
 250              if (is_object($this->department))
 251                  $r.= txt2csv($this->department->getFullName());
 252              else
 253                  $r.= txt2csv('');
 254          }
 255          // Company
 256          if ( !empty($this->c_id) && ($this->c_id != -1) ) {
 257              if (is_object($this->company))
 258                  $r.= txt2csv($this->company->getFullName());
 259              else
 260                  $r.= txt2csv('');
 261          }
 262  
 263          return $r;
 264      }
 265  
 266      /**
 267       * set the category
 268       */
 269      function setCategory($value) {
 270          return $this->setStrField("category",$value,"AdrCategory");
 271      }
 272  
 273      /**
 274       * set the lname
 275       */
 276      function setLname($value) {
 277          $this->read_ref();
 278          return $this->setStrField("lname",$value,"AdrDescription");
 279      }
 280  
 281      /**
 282       * set the Company
 283       */
 284      function setCompany($value) {
 285          return $this->setObjectField("company",$value,"Company");
 286      }
 287  
 288      /**
 289       * set the Company
 290       */
 291      function setDepartment($value) {
 292          return $this->setObjectField("department",$value,"Department");
 293      }
 294  
 295      /**
 296       * set a field
 297       */
 298      function setField($field,$value) {
 299          return $this->setStrField($field,$value,$field);
 300      }
 301  
 302      /**
 303       * Return a URL to this location
 304       */
 305      function getURL() {
 306          $this->read_ref();
 307          if ( !(is_numeric($this->ref) && $this->ref == -1) ) {
 308              return $this->ref->getUrl();
 309          }
 310          return 'address_select.php';
 311      }
 312  
 313      /**
 314       * Return the Long Name
 315       */
 316      function getFullname() {
 317          global $lang;
 318  
 319          $this->read_ref();
 320          if (is_object($this->ref) && ($this->ref->id != -1) ) {
 321              return sprintf($this->ref->getFullName()." ".$lang['AdrLocTitle'],$this->lname);
 322          } else {
 323              return sprintf("??? ".$lang['AdrLocTitle'],$this->lname);
 324          }
 325      }
 326  
 327      /**
 328       * save to DB
 329       */
 330      function save () {
 331          global $current_user, $tutos,$table;
 332  
 333          $msg = $this->run_presave_hook();
 334  
 335          $this->read_ref();
 336  
 337          $q1 = new query($this->dbconn);
 338          $q1->setTable($this->tablename);
 339          $q2 = new query($this->dbconn);
 340          $q2->setTable($this->tablename2);
 341  
 342          $i=0;
 343          foreach(self::$larray as $f) {
 344              $q1->addFV($f,$this->$f,'STRING',$table['location'][$f][size]);
 345              $i++;
 346          }
 347          if ( is_object($this->company) && ($this->company->id != -1) ) {
 348              $q1->addFV('c_id',$this->company,'OBJ');
 349          } else {
 350              $q1->addFV('c_id','null','');
 351          }
 352          if ( is_object($this->department) ) {
 353              $q1->addFV('d_id',$this->department,'OBJ');
 354          } else {
 355              $q1->addFV('d_id','null','');
 356          }
 357          $q1->addFV('category',$this->category,'');
 358          $q2->addFV('category',$this->category,'');
 359  
 360          $q2->addFV('name',$this->lname,'STRING',$table['address1']['name'][size]);
 361          $q2->addFV('adr_id',$this->adr_id,'');
 362  
 363          $this->save_custom_fields($q1);
 364  
 365          if ( $this->id < 0 ) {
 366              //
 367              //        INSERT
 368              //
 369              $this->modified = array();
 370              if ( isset($this->newid) ) {
 371                  $this->id = $this->newid;
 372              } else {
 373                  /* Get an new ID */
 374                  $this->id = $q1->addFV('id',-1,'NEXTID');
 375  
 376                  // Defaut Access Control inheritet from parent
 377                  $this->copy_acl($this->ref,true);
 378                  $this->acl_default();
 379                  $this->acl_raise(EVERYBODY, $tutos[useok]);
 380  
 381                  $this->modified[] = array ( 'field' => 'created' ,
 382                                              'old' => $this->getType() ,
 383                                              'new' => $this->id,
 384                                              'obj_id' => $this->id
 385                      );
 386                  $this->modified[] = array ( 'field' => 'AdrLNew' ,
 387                                              'old' => '-1',
 388                                              'new' => $this->id,
 389                                              'obj_id' => $this->adr_id
 390                      );
 391              }
 392              $q2->addFV('loc_id',$this->id,'');
 393              $q1->addFV('creator',$this->creator,'OBJ');
 394              $q1->addFV('creation',$this->creation,'DATETIME');
 395              $query1 = $q1->getInsert();
 396              $query2 = $q2->getInsert();
 397          } else {
 398              //
 399              //        UPDATE
 400              //
 401              $q1->addWC('id',$this->id,'');
 402              $q2->addWC('loc_id',$this->id,'');
 403              $query1 = $q1->getUpdate();
 404              $query2 = $q2->getUpdate();
 405          }
 406          $r = $this->dbconn->Exec($query1);
 407          $r->free();
 408          $r = $this->dbconn->Exec($query2);
 409          $r->free();
 410  
 411          $msg = addLine($msg,parent::save());
 412          return $msg;
 413      }
 414  
 415      /**
 416       * Delete a location from the DB
 417       */
 418      function delete () {
 419          $q = 'DELETE FROM '. $this->tablename2 .' WHERE loc_id = '. $this->id ;
 420          $r = $this->dbconn->Exec($q);
 421          $r->free();
 422  
 423          $this->modified[] = array ( 'field' => 'AdrLDel' ,
 424                                      'old' => $this->lname,
 425                                      'new' => -1,
 426                                      'obj_id' => $this->adr_id
 427              );
 428  
 429          return parent::delete();
 430      }
 431  
 432      /**
 433       * parse XML import
 434       */
 435      function parseXML ($fld,$data,$attrs) {
 436          parent::parseXML($fld,$data,$attrs);
 437  
 438          if ($fld == 'id') {
 439              $this->read_ref();
 440          } else if ($fld == 'lname') {
 441              $this->setLName($data);
 442          } else if ($fld == 'category') {
 443              $this->setCategory($data);
 444          } else if ($fld == 'company_id') {
 445              $this->company = $this->company->read($data,$this->company);
 446          }
 447          foreach(self::$larray as $f) {
 448              if ($fld == $f) {
 449                  $this->setField($f,$data);
 450              }
 451          }
 452          return;
 453      }
 454  
 455      /**
 456       * Data of XML export
 457       */
 458      function exportXML_body ($only_ids = false) {
 459          $r = parent::exportXML_body();
 460          if (!$only_ids) {
 461              $r .=  '<lname>'. htmlspecialchars($this->lname) ."</lname>\n";
 462              $r .=  '<category>'. $this->category ."</category>\n";
 463              if ( is_object($this->company) && ($this->company->id != -1) ) {
 464                  $r .=  '<company_id>'. $this->company->id ."</company_id>\n";
 465                  $r .=  '<company_name>'. htmlspecialchars($this->company->getFullName())."</company_name>\n";
 466              }
 467              $i=0;
 468              foreach(self::$larray as $f) {
 469                  $r .=  '<'.$f.'>'. htmlspecialchars($this->$f) .'</'.$f.">\n";
 470              }
 471          }
 472          return $r;
 473      }
 474  
 475      /**
 476       * get the type of object
 477       */
 478      static function gettype () {
 479          return 'location';
 480      }
 481  
 482      /**
 483       * get the type id of object
 484       */
 485      static function gettypeid () {
 486          return uselocation;
 487      }
 488  
 489      /**
 490       * preset location object (used in *_new scripts)
 491       */
 492      function preset () {
 493          foreach(self::$larray as $f) {
 494              if ( isset($_GET[$f]) ) {
 495                  $this->$f = $_GET[$f];
 496              }
 497          }
 498          if ( isset($_GET['lname']) ) {
 499              $this->lname = $_GET['lname'];
 500          }
 501      }
 502  
 503      /**
 504       * parse the input delivered by a form
 505       */
 506      function parseform() {
 507          global $lang,$gotourl;
 508  
 509          $locid = -1;
 510          $this->used = false;
 511          $msg = '';
 512          if ( !isset($_POST['category']) || empty($_POST['category']) ) {
 513              $msg = addLine($msg,sprintf($lang['Err0009'],$lang['AdrCategory']));
 514              $gotourl = addBadField($gotourl,'category',true);
 515          } else {
 516              $this->setCategory($_POST['category']);
 517              $gotourl= addUrlParameter($gotourl,'category='. $this->category,true);
 518              #      $this->used = true;
 519          }
 520  
 521          if ( !isset($_POST['lname']) ||  empty($_POST['lname']) ) {
 522              $msg = addLine($msg,sprintf($lang['Err0009'],$lang['AdrDescription']));
 523              $gotourl = addBadField($gotourl,'lname',true);
 524          } else {
 525              $this->setLname($_POST['lname']);
 526              $gotourl= addUrlParameter($gotourl,'lname='. UrlEncode($this->lname),true);
 527              if (!empty($this->lname)) {
 528                  $this->used = true;
 529              }
 530          }
 531  
 532          // Check Company
 533          if ( !isset($_POST['c_id']) && isset($_POST['company']) ) {
 534              if ($this->company->getFullName() == $_POST['company']) {
 535                  $gotourl= addUrlParameter($gotourl,'cl[]='. $this->company->id,true);
 536              } else {
 537                  $this->setCompany(check_field($_POST['company'],"company","cl","c"));
 538              }
 539              if (isset($_POST['company']) && !empty($_POST['company'])) {
 540                  $this->used = true;
 541              }
 542          } else if ( isset($_POST['c_id']) && ($_POST['c_id'] != -1) ) {
 543              if ( strstr($_POST['c_id'],'--') ) {
 544                  $c = explode("--",$_POST['c_id']);
 545              } else {
 546                  $c[0] = $_POST['c_id'];
 547                  $c[1] = -1;
 548              }
 549              $this->SetCompany($this->company->read($c[0],$this->company));
 550              $gotourl= addUrlParameter($gotourl,'cl[]='. $this->company->id,true);
 551              $this->used = true;
 552              $locid = $c[1];
 553          }
 554          // Check Department
 555          if ( !isset($_POST['d_id']) && isset($_POST['department']) ) {
 556              $dep_tmp = trim($_POST['department']);
 557              if ( strlen($dep_tmp) && strstr($dep_tmp," / ") == FALSE ) {
 558                  $dep_tmp = ' / ' . $dep_tmp;
 559                  if (isset($_POST['company'])) {
 560                      $dep_tmp = trim($_POST['company']) . $dep_tmp;
 561                  } else if (is_object($this->company)) {
 562                      $dep_tmp = $this->company->getFullName() . $dep_tmp;
 563                  }
 564              }
 565              $this->setDepartment(check_field($dep_tmp,"department","dl","d"));
 566          } else if (isset($_POST['d_id']) &&  ($_POST['d_id'] != -1) ) {
 567              if ( strstr($_POST['d_id'],'--') ) {
 568                  $c = explode("--",$_POST['d_id']);
 569              } else {
 570                  $c[0] = $_POST['d_id'];
 571                  $c[1] = -1;
 572              }
 573              $this->department = new Department($this->dbconn);
 574              $this->SetDepartment($this->department->read($c[0],$this->department));
 575              $gotourl= addUrlParameter($gotourl,"dl[]=". $this->department->id,true);
 576              $locid = $c[1];
 577          }
 578  
 579  
 580          if ( is_object($this->department) ) {
 581              $this->company = &$this->department->company;
 582          }
 583  
 584          foreach(self::$larray as $f) {
 585              if ( isset($_POST[$f]) ) {
 586                  $this->setField($f,$_POST[$f]);
 587                  $gotourl= addUrlParameter($gotourl,$f ."=". UrlEncode($this->$f),true);
 588                  if (!empty($this->$f) && ($f != 'country')) {
 589                      $this->used = true;
 590                  }
 591              }
 592          }
 593  
 594          if ( isset($_POST['cploc']) && ($_POST['cploc'] == 1) ) {
 595              // Copy the location data from the companies location if possible
 596              $gotourl= addUrlParameter($gotourl,'cploc=1',true);
 597              if ( isset ($this->company->id) ) {
 598                  $this->company->read_locs_data();
 599                  if ( count($this->company->location) > 0 ) {
 600                      if ( ($locid != -1) && isset($this->company->location[$locid])) {
 601                          $x = $this->company->location[$locid];
 602                      } else {
 603                          reset ($this->company->location);
 604                          $x = current($this->company->location);
 605                      }
 606                      $this->city = $x->city;
 607                      $this->state = $x->state;
 608                      $this->country = $x->country;
 609                      $this->zip = $x->zip;
 610                      $this->street1 = $x->street1;
 611                      $this->street2 = $x->street2;
 612                  }
 613              }
 614              // if there is a department defined copy department data
 615              if ( isset ($this->department->id) ) {
 616                  $this->department->read_locs_data();
 617                  if ( count($this->department->location) > 0 ) {
 618                      if (($locid != -1) && isset($this->department->location[$locid])) {
 619                          $x = $this->department->location[$locid];
 620                      } else {
 621                          reset ($this->department->location);
 622                          $x = current($this->department->location);
 623                      }
 624                      if (!empty($x->city))
 625                          $this->city = $x->city;
 626                      if (!empty($x->state))
 627                          $this->state = $x->state;
 628                      if (!empty($x->country))
 629                          $this->country = $x->country;
 630                      if (!empty($x->zip))
 631                          $this->zip = $x->zip;
 632                      if (!empty($x->street1))
 633                          $this->street1 = $x->street1;
 634                      if (!empty($x->street2))
 635                          $this->street2 = $x->street2;
 636                  }
 637              }
 638          }
 639  
 640          //  Email Verification was fetched from
 641          //  http://www.phpbuilder.com/snippet/detail.php?type=snippet&id=107
 642          //  (this will produce a warning only , the values are set above)
 643          $regex = '^([._a-z0-9-]+[._a-z0-9-]*)@(([a-z0-9-]+\.)*([a-z0-9-]+)(\.[a-z]{2,5}))$';
 644          if ( isset($_POST['email_1']) ) {
 645              $email_1 = trim($_POST['email_1']);
 646              if ( ($email_1 != "") && !preg_match('#'.$regex.'#i',$email_1)) {
 647                  $msg = addLine($msg,sprintf($lang['Err0043'],myentities($email_1)));
 648              }
 649          }
 650          if ( isset($_POST['email_2']) ) {
 651              $email_2 = trim($_POST['email_2']);
 652              if ( ($email_2 != "") && !preg_match('#'.$regex.'#i',$email_2)) {
 653                  $msg = addLine($msg,sprintf($lang['Err0043'],myentities($email_2)));
 654              }
 655          }
 656          return $msg;
 657      }
 658  
 659      /**
 660       * a input form (used in comapny_new
 661       */
 662      function inputform (&$layout) {
 663          global $lang,$table;
 664  
 665          $r = '';
 666          $r .= "<tr>\n";
 667          $r .= $layout->showfieldc($lang['AdrDescription'],1,'lname');
 668          $r .= ' <td colspan="4"><input size="30" maxlength="'. $table['address1']['name'][size]  .'" id="lname" name="lname" value="'. myentities($this->lname) ."\" /></td>\n";
 669          $r .= "</tr>\n";
 670  
 671          $r .= "<tr>\n";
 672          $r .= $layout->showfieldc($lang['Phone'],0,'phone_1');
 673          $r .= ' <td colspan="4"><input size="30" maxlength="'. $table['location']['phone_1'][size] .'" id="phone_1" name="phone_1" value="'. myentities($this->phone_1) ."\" /></td>\n";
 674          $r .= "</tr>\n";
 675  
 676          $r .= "<tr>\n";
 677          $r .= $layout->showfieldc($lang['AdrFax'],0,'fax_1');
 678          $r .= ' <td colspan="4"><input size="30" maxlength="'. $table['location']['fax_1'][size] .'" id="fax_1" name="fax_1" value="'. myentities($this->fax_1) ."\" /></td>\n";
 679          $r .= "</tr>\n";
 680  
 681          $r .= "<tr>\n";
 682          $r .= $layout->showfieldc($lang['AdrEmail'],0,'email_1');
 683          $r .= ' <td colspan="4"><input size="30" maxlength="'. $table['location']['email_1'][size] .'" id="email_1" name="email_1" value="'. myentities($this->email_1) ."\" /></td>\n";
 684          $r .= "</tr>\n";
 685  
 686          $r .= "<tr>\n";
 687          $r .= $layout->showfieldc($lang['Street'],0,'street1');
 688          $r .= ' <td colspan="4"><input size="30" maxlength="'. $table['location']['street1'][size] .'" id="street1" name="street1" value="'. myentities($this->street1) ."\" /></td>\n";
 689          $r .= "</tr>\n";
 690  
 691          $r .= "<tr>\n";
 692          $r .= $layout->showfieldc($lang['Street'],0,'street2');
 693          $r .= ' <td colspan="4"><input size="30" maxlength="'. $table['location']['street2'][size] .'" id="street2" name="street2" value="'. myentities($this->street2) ."\" /></td>\n";
 694          $r .= "</tr>\n";
 695  
 696          $r .= "<tr>\n";
 697          $r .= $layout->showfieldc($lang['City'],0,'city');
 698          $r .= ' <td><input size="30" maxlength="'. $table['location']['city'][size] .'" id="city" name="city" value="'. myentities($this->city) ."\" /></td>\n";
 699          $r .= $layout->showfieldc($lang['ZIP'],0,'zip');
 700          $r .= ' <td colspan="2"><input size="10" maxlength="'. $table['location']['zip'][size] .'" id="zip" name="zip" value="'. myentities($this->zip) ."\" /></td>\n";
 701          $r .= "</tr>\n";
 702  
 703          $r .= "<tr>\n";
 704          $r .= $layout->showfieldc($lang['State'],0,'state');
 705          $r .= ' <td colspan="4"><input size="30" maxlength="'. $table['location']['state'][size] .'" id="state" name="state" value="'. myentities($this->state) ."\" /></td>\n";
 706          $r .= "</tr>\n";
 707          $r .= "<tr>\n";
 708          $r .= $layout->showfieldc($lang['Country'],0,'country');
 709          $r .= " <td colspan=\"4\">\n";
 710          $r .= SelectCntryCde('country',$this->country);
 711          $r .= " </td>\n";
 712          $r .= "</tr>\n";
 713  
 714          $r .= "<tr>\n";
 715          $r .= $layout->showfieldc($lang['acc_info1'],0,"acc_info1");
 716          $r .= ' <td colspan="4"><input size="50" maxlength="'. $table['location']['acc_info1'][size] .'" id="acc_info1" name="acc_info1" value="'. myentities($this->acc_info1) ."\" /></td>\n";
 717          $r .= "</tr>\n";
 718  
 719          $r .= "<tr>\n";
 720          $r .= $layout->showfieldc($lang['acc_info2'],0,"acc_info2");
 721          $r .= ' <td colspan="4"><input size="50" maxlength="'. $table['location']['acc_info2'][size] .'" id="acc_info2 "name="acc_info2" value="'. myentities($this->acc_info2) ."\" /></td>\n";
 722          $r .= "</tr>\n";
 723  
 724          $r .= "<tr>\n";
 725          $r .= $layout->showfieldc($lang['acc_nr'],0,"acc_nr");
 726          $r .= ' <td colspan="4"><input size="50" maxlength="'. $table['location']['acc_nr'][size] .'" id="acc_nr" name="acc_nr" value="'. myentities($this->acc_nr) ."\" /></td>\n";
 727          $r .= "</tr>\n";
 728  
 729          $r .= "<tr>\n";
 730          $r .= $layout->showfieldc($lang['AdrCustumerID'],0,"customer_id");
 731          $r .= ' <td colspan="4"><input size="50" maxlength="'. $table['location']['customer_id'][size] .'" id="customer_id" name="customer_id" value="'. myentities($this->customer_id) ."\" /></td>\n";
 732          $r .= "</tr>\n";
 733          return $r;
 734      }
 735  
 736  }
 737  ?>

title

Description

title

Description

title

Description

title

title

Body