function cloneEntry() { $cloned = new PhoneEntry(); $cloned->setID($this->phonebook_id); $cloned->setNumber($this->number); $cloned->setDescription($this->description); return $cloned; }
function searchpager(&$conn, $page) { $sql = $this->pager_sql; $offset = ($page - 1) * $this->pager_items; $limit = $this->pager_items; $sql .= " LIMIT {$offset},{$limit}"; //print_r($sql); $result = $conn->makequery($sql); $arr_obj = array(); while ($result and $row = $conn->nextRow($result)) { $one_entry = new PhoneEntry(); $one_entry->setID($row[0]); $one_entry->setNumber($row[1]); $one_entry->setDescription($row[2]); $arr_obj[] = $one_entry; } return $arr_obj; }
$phonebookEntrySearched = $dao->search($ds, $phonebookEntry); if (count($phonebookEntrySearched) > 0) { $phoneduplicate = "This number is already in use!"; } else { $phonebookEntry->setDescription($_REQUEST['description']); $dao->save($ds, $phonebookEntry); } break; case "delete": $phonebookEntry = new PhoneEntry(); $phonebookEntry->setID($phdisplay); $dao->delete($ds, $phonebookEntry); break; case "edit": $phonebookEntry = new PhoneEntry(); $phonebookEntry->setID($phdisplay); //how search if number exist? $phonebookEntry->setNumber($_REQUEST['number']); $phonebookEntry->setDescription($_REQUEST['description']); $dao->save($ds, $phonebookEntry); break; } ?> </div> <div class="rnav" style="width:225px;"> <li><a id="<?php echo $phdisplay == '' ? 'current' : ''; ?> " href="config.php?mode=tools&display=<?php