You are here

function patron_update in Library 6

Same name and namespace in other branches
  1. 5.2 patron/patron.module \patron_update()

Implemenation of hook_update().

File

patron/patron.module, line 133

Code

function patron_update($node) {
  if (empty($node->patron_uid)) {
    db_query("UPDATE {library_patrons} SET name_last = '%s', name_first = '%s', email = '%s', patron_uid = NULL, barcode = '%s', disabled = %d WHERE nid = %d", $node->name_last, $node->name_first, $node->email, $node->barcode, $node->disabled, $node->nid);
  }
  else {
    db_query("UPDATE {library_patrons} SET name_last = '%s', name_first = '%s', email = '%s', patron_uid = %d, barcode = '%s', disabled = %d WHERE nid = %d", $node->name_last, $node->name_first, $node->email, $node->patron_uid, $node->barcode, $node->disabled, $node->nid);
  }
}