示例#1
0
文件: Objects.php 项目: rosko/workapp
 public function findObj($params)
 {
     $tfind = $params["find"];
     $find = new Model_Find();
     $object = new Model_Object();
     $findSess =& $_SESSION["find"];
     if (isset($tfind)) {
         $findSess["string"] = $tfind;
     } else {
         if (!isset($findSess["string"])) {
             $findSess["string"] = "";
         }
     }
     if (isset($findSess["string"])) {
         $text = substr($findSess["string"], 0, 64);
         $text = explode(" ", $text);
         $tfind = $find->findObjects($text);
         if (count($tfind) == 0) {
             echo "<p style='color: #777; margin-left: 20px'>Ничего не найдено</p>";
         }
         foreach ($tfind as $part) {
             echo '<div style="margin-bottom: 20px">';
             $obj = $object->getShortObject($part["id"]);
             foreach ($obj as $val) {
                 echo "<p><b>" . $val["field"] . ":</b> " . $val["val"] . "</p>";
                 $row[$val["field"]] = $val["val"];
             }
             $row["id"] = $val["id"];
             $data = json_encode($row);
             echo "<p><img src='" . $this->registry['uri'] . "img/enter.png' alt='' style='vertical-align: middle; margin-right: 5px'><a style='cursor: pointer' onclick='selObj(" . $data . ")'>выбрать</a></p>";
             echo '</div>';
         }
     }
 }
示例#2
0
文件: Tt.php 项目: rosko/workapp
 public function findObj($params)
 {
     $tfind = $params["find"];
     $find = new Model_Find();
     $object = new Model_Object();
     $findSess =& $_SESSION["find"];
     if (isset($tfind)) {
         $findSess["string"] = $tfind;
     } else {
         if (!isset($findSess["string"])) {
             $findSess["string"] = "";
         }
     }
     if (isset($findSess["string"])) {
         $text = substr($findSess["string"], 0, 64);
         $text = explode(" ", $text);
         $tfind = $find->findObjects($text);
         if (count($tfind) == 0) {
             echo "<p style='color: #777; margin-left: 20px'>Ничего не найдено</p>";
         }
         foreach ($tfind as $part) {
             $obj = $object->getShortObject($part["id"]);
             foreach ($obj as $val) {
                 $row[$val["field"]] = $val["val"];
             }
             $id = $obj[0]["id"];
             echo $this->view->render("tt_setObj", array("data" => $row, "id" => $id));
         }
     }
 }