Changeset 764 for trunk/phpbms/modules/bms/include/products.php
- Timestamp:
- 01/15/10 15:01:40 (2 years ago)
- Files:
-
- 1 modified
-
trunk/phpbms/modules/bms/include/products.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpbms/modules/bms/include/products.php
r703 r764 534 534 /* 535 535 * function api_searchByPartNumber 536 * 536 537 * @param array $requestData Array containing the "partnumber" key. 537 538 * @param bool $returnUuid If true, returns result's uuid , if 538 539 * false, the id. 540 * 539 541 * @return array An array containing response information 540 * @returnf string 'type'The type of response (e.g. 'error' or 'result')541 * @returnf string 'message'Message explaining the type / result542 * @returnf array details Either the array of uuid / ids if no errors542 * @returnf string type The type of response (e.g. 'error' or 'result') 543 * @returnf string message Message explaining the type / result 544 * @returnf array extras Either the array of uuid / ids if no errors 543 545 * were encountered, or the original $requestData if there was an error 544 546 */ … … 547 549 548 550 /** 549 * do error search551 * verify data integrity. 550 552 */ 553 554 $response["type"] = ""; 555 $response["message"] = ""; 551 556 if(!isset($requestData["partnumber"])){ 552 557 $response["type"] = "error"; 553 $response["message"] = "Data does not contain a key of 'partnumber'."; 554 $response["details"] = $requestData; 558 $response["message"] = "Data does not contain a key of 'partnumber'"; 559 }//end if 560 561 if(!isset($requestData["webenabled"])){ 562 $response["type"] = "error"; 563 if($response["message"]) 564 $response["message"] .= " or 'webenabled'."; 565 else 566 $response["message"] = "Data does not contain a key of 'webenabled'."; 567 568 }//end if 569 570 if(!isset($requestData["inactive"])){ 571 $response["type"] = "error"; 572 if($response["message"]) 573 $response["message"] .= " or 'inactive'."; 574 else 575 $response["message"] = "Data does not contain a key of 'inactive'."; 576 577 }//end if 578 579 if($response["type"] == "error") 555 580 return $response; 556 }//end if581 557 582 558 583 /** … … 567 592 WHERE 568 593 `partnumber` = '".mysql_real_escape_string($requestData["partnumber"])."' 594 AND 595 `webenabled` = '".(int)$response["webenabled"]."' 596 AND 597 `inactive` = '".(int)$response["inactive"]."' 569 598 "; 570 599 … … 576 605 $thereturn["message"] = "The function api_searchByPartNumber has been run successfully."; 577 606 $thereturn["type"] = ""; 578 $thereturn[" details"] = array();607 $thereturn["extras"] = array(); 579 608 while($therecord = $this->db->fetchArray($queryresult)){ 580 609 581 610 if($returnUuid) 582 $thereturn[" details"][] = $therecord["uuid"];611 $thereturn["extras"][] = $therecord["uuid"]; 583 612 else 584 $thereturn[" details"][] = $therecord["id"];613 $thereturn["extras"][] = $therecord["id"]; 585 614 586 615 }//end while