Exemple #1
0
 /**
  *
  * @param int $ID
  * @return array 
  */
 protected function getNewGuestContact($ID)
 {
     try {
         $pdo = new DbConnector();
         $newGuestContact = $pdo->prepare("SELECT * FROM `orders` where orders_id = ?");
         $newGuestContact->execute(array($cID));
         $tmp = $newGuestContact->fetchAll();
         foreach ($tmp as $row) {
             if ($row['customers_gender'] == 'm') {
                 $gender = true;
             } else {
                 $gender = false;
             }
             if ($row['customers_vat_id_status'] != null && $row['customers_vat_id_status'] == 1) {
                 $iscompany = true;
                 $vatid = $row['customers_vat_id'];
                 $company = $row['customers_company'];
             } else {
                 $iscompany = false;
                 $vatid = '';
                 $company = '';
             }
             $gesamteContacts[] = new xmlrpcval(array('id' => new xmlrpcval($i, 'int'), 'key' => new xmlrpcval('ids', 'string'), 'value' => new xmlrpcval($row['customers_id'], 'int')), 'struct');
             $gesamteContacts[] = new xmlrpcval(array('id' => new xmlrpcval($i, 'int'), 'key' => new xmlrpcval('cname', 'string'), 'value' => new xmlrpcval($row['customers_name'], 'string')), 'struct');
             $gesamteContacts[] = new xmlrpcval(array('id' => new xmlrpcval($i, 'int'), 'key' => new xmlrpcval('taxnumber', 'string'), 'value' => new xmlrpcval($vatid, 'int')), 'struct');
             $gesamteContacts[] = new xmlrpcval(array('id' => new xmlrpcval($i, 'int'), 'key' => new xmlrpcval('street', 'string'), 'value' => new xmlrpcval($row['customers_street_address'], 'string')), 'struct');
             $gesamteContacts[] = new xmlrpcval(array('id' => new xmlrpcval($i, 'int'), 'key' => new xmlrpcval('zip', 'string'), 'value' => new xmlrpcval($row['customers_postcode'], 'int')), 'struct');
             $gesamteContacts[] = new xmlrpcval(array('id' => new xmlrpcval($i, 'int'), 'key' => new xmlrpcval('city', 'string'), 'value' => new xmlrpcval($row['customers_city'], 'string')), 'struct');
             $gesamteContacts[] = new xmlrpcval(array('id' => new xmlrpcval($i, 'int'), 'key' => new xmlrpcval('mainphone', 'string'), 'value' => new xmlrpcval($row['customers_telephone'], 'int')), 'struct');
             $gesamteContacts[] = new xmlrpcval(array('id' => new xmlrpcval($i, 'int'), 'key' => new xmlrpcval('mailaddress', 'string'), 'value' => new xmlrpcval($row['customers_email_address'], 'string')), 'struct');
             $gesamteContacts[] = new xmlrpcval(array('id' => new xmlrpcval($i, 'int'), 'key' => new xmlrpcval('company', 'string'), 'value' => new xmlrpcval($company, 'string')), 'struct');
             $gesamteContacts[] = new xmlrpcval(array('id' => new xmlrpcval($i, 'int'), 'key' => new xmlrpcval('country', 'string'), 'value' => new xmlrpcval($row['customers_country'], 'string')), 'struct');
             $gesamteContacts[] = new xmlrpcval(array('id' => new xmlrpcval($i, 'int'), 'key' => new xmlrpcval('ismale', 'string'), 'value' => new xmlrpcval($gender, 'boolean')), 'struct');
             $gesamteContacts[] = new xmlrpcval(array('id' => new xmlrpcval($i, 'int'), 'key' => new xmlrpcval('iscompany', 'string'), 'value' => new xmlrpcval($iscompany, 'boolean')), 'struct');
             $i++;
         }
         return $gesamteContacts;
     } catch (PDOException $e) {
         throw new exception($e->getMessage());
     }
 }