示例#1
0
 function readAll(&$conn)
 {
     $sql = "SELECT\n              id,\n              speednr,\n              name,\n              telnr,\n              permission\n                FROM speednr ORDER BY speednr";
     $result = $conn->makequery($sql);
     $arr_obj = array();
     while ($result and $row = $conn->nextRow($result)) {
         $one_entry = new SpeedEntry();
         $one_entry->setID($row[0]);
         $one_entry->setNumber($row[1]);
         $one_entry->setDescription($row[2]);
         $one_entry->setTelnr($row[3]);
         $one_entry->setPermission($row[4]);
         $arr_obj[] = $one_entry;
         //      $two_entry = new PhoneEntry();
         //      $two_entry = $one_entry->cloneEntry();
         //      $arr_obj[] = $two_entry;
     }
     return $arr_obj;
 }
示例#2
0
             $permission = "";
         }
         if (trim(strtolower($permission)) == 'yes') {
             $permission = "CHECKED";
         }
         //insert only lines with both fields
         if ($number != "" and $description != "" and $telnr != "") {
             $speeddialEntry->setNumber($number);
             //search only by number
             //search if number exist, if exist overwrite description only
             //          $speedEntrySearchedArr = $daospeed->search($dsspeed,$speeddialEntry);
             //          if (count($speedEntrySearchedArr)>0) {
             //            $speeddialEntry->setID($speedEntrySearchedArr[0]->getID());//overwrite description
             //          }
             $speeddialEntry->setDescription($description);
             $speeddialEntry->setTelnr($telnr);
             $speeddialEntry->setPermission($permission);
             $daospeed->save($dsspeed, $speeddialEntry);
             //          unset($speedEntrySearchedArr);
         }
         //if not empty
         unset($speeddialEntry);
     }
     //while
     $filename = $_FILES["file"]["name"][0];
     echo "The file <b>{$filename}</b> is successfully sent.<br>";
     // esegue script per il parsing mysql -> conf solo se la procedura di upload e' andata a buon fine.
     exec($wScript);
     // richiama funzione per il reload.
     needreload();
 } else {