Ejemplo n.º 1
0
 public function index()
 {
     if ($this->registry["ui"]["admin"]) {
         $this->view->setTitle("Просмотр удалённых объектов");
         $this->view->setLeftContent($this->view->render("left_objects", array()));
         if (isset($this->args[1])) {
             if (isset($_GET["page"])) {
                 if (is_numeric($_GET["page"])) {
                     if (!$this->object->setPage($_GET["page"])) {
                         $this->__call("objects", "list");
                     }
                 }
             }
             $ai = new Model_Ai();
             $forms = $ai->getForms();
             $this->object->links = "objects/" . $this->args[0] . "/" . $this->args[1] . "/";
             $data = $this->object->getTrashObjects($this->args[1]);
             $template = new Model_Template();
             $arr_objs = array();
             $i = 0;
             foreach ($data as $part) {
                 $arr_objs[$i] = $this->object->getShortObject($part["id"]);
                 $arr_objs[$i]["ai"] = $ai->getAdvancedInfo($part["id"]);
                 $i++;
             }
             $fields = $template->getTypeTemplate($this->args[1]);
             $this->view->objects_subgroupstrash(array("objs" => $arr_objs, "forms" => $forms, "gid" => $this->args[1], "fields" => $fields));
             //Отобразим пейджер
             if (count($this->object->pager) != 0) {
                 $this->view->pager(array("pages" => $this->object->pager));
             }
         }
     }
     $this->view->showPage();
 }
Ejemplo n.º 2
0
 public function index()
 {
     if ($this->registry["ui"]["admin"]) {
         $this->view->setTitle("Шаблоны");
         $template = new Model_Template();
         $list = $template->getTemplates();
         if (isset($this->args[1])) {
             if ($this->args[1] == "add") {
                 if (isset($_POST["submit"])) {
                     $template->addTemplate($_POST);
                     $this->view->refresh(array("timer" => "1", "url" => "objects/"));
                 } else {
                     $this->view->objects_templateadd();
                 }
             } elseif ($this->args[1] == "edit") {
                 if (isset($this->args[2])) {
                     if (isset($_POST["submit"])) {
                         $template->editTemplate($this->args[2], $_POST);
                         $this->view->refresh(array("timer" => "1", "url" => "objects/"));
                     } else {
                         $param = $template->getTemplate($this->args[2]);
                         $this->view->objects_templateedit(array("post" => $param));
                     }
                 }
             } elseif ($this->args[1] == "list") {
                 $this->view->objects_templatelist(array("id" => $this->args[2]));
             }
         } else {
             $this->view->objects_templates(array("list" => $list));
         }
     }
     $this->view->showPage();
 }
Ejemplo n.º 3
0
 public function index()
 {
     $this->view->setTitle("Просмотр объектов");
     if (isset($this->args[1])) {
         if (isset($_GET["page"])) {
             if (is_numeric($_GET["page"])) {
                 if (!$this->object->setPage($_GET["page"])) {
                     $this->__call("objects", "list");
                 }
             }
         }
         $ai = $this->registry["module_kb"];
         $forms = $ai->getForms();
         $this->object->links = "objects/" . $this->args[0] . "/" . $this->args[1] . "/";
         $data = $this->object->getObjects($this->args[1]);
         $template = new Model_Template();
         $tid = $template->getTidFromTtid($this->args[1]);
         $tt = $template->getTree($tid[0]["tid"]);
         foreach ($data as $part) {
             $arr_objs[] = $this->object->getShortObject($part["id"]);
         }
         if (isset($this->registry["module_mail"])) {
             $mail = true;
         } else {
             $mail = false;
         }
         $this->view->objects_subgroups(array("objs" => $arr_objs, "mail" => $mail, "forms" => $forms, "gid" => $this->args[1], "tt" => $tt));
         //Отобразим пейджер
         if (count($this->object->pager) != 0) {
             $this->view->pager(array("pages" => $this->object->pager));
         }
     }
     $this->view->showPage();
 }
Ejemplo n.º 4
0
Archivo: Kb.php Proyecto: rosko/workapp
 public function index()
 {
     $this->view->setLeftContent($this->view->render("left_kb", array()));
     $advinfo = new Model_Ai();
     $tpl = new Model_Template();
     if (isset($this->get["history"])) {
         $this->view->setTitle("История");
         $tasks = $this->registry["logs"]->getHistory("info", $this->get["history"]);
         foreach ($tasks as $task) {
             if ($task["param"][0]["key"]) {
                 $this->view->history(array("obj" => $task));
             }
         }
     } elseif (isset($_GET["tag"])) {
         $this->view->setTitle("Тег: " . htmlspecialchars($_GET["tag"]));
         $ai = $advinfo->getAIFromTag($_GET["tag"]);
         $this->view->setMainContent("<b>Тег:</b> " . htmlspecialchars($_GET["tag"]));
         foreach ($ai as $part) {
             $aiinfo = $advinfo->getaiinfo();
             /*
             if ($ainfo = json_decode($part["val"], true)) {
             	$part["val"] = null;
             	foreach($ainfo as $key=>$val) {
             		$part["val"] .= "<b>" . $key . "</b>: " . $val . "<br />";
             	}
             }
             */
             $this->view->ai(array("ai" => $part, "info" => $aiinfo));
         }
     } elseif (isset($this->args[1]) and $this->args[1] == "add") {
         $this->view->setTitle("Добавить информацию");
         $this->view->kb_add();
     } else {
         $this->view->setTitle("Теги");
         $templates = $tpl->getTemplates();
         $id = count($templates);
         $templates[$id]["id"] = 0;
         $templates[$id]["name"] = "Заметки";
         $list = $advinfo->getAi();
         for ($i = 0; $i < count($list); $i++) {
             if ($list[$i]["oid"] == "0") {
                 $list[$i]["name"] = "Заметки";
             }
         }
         $sortlist = array();
         foreach ($templates as $template) {
             foreach ($list as $kb) {
                 if ($kb["name"] == $template["name"]) {
                     $sortlist[$template["name"]][] = $kb["tag"];
                 }
             }
         }
         $this->print_array($sortlist);
         $this->view->kb_tree(array("list" => $this->tree));
     }
     $this->view->showPage();
 }
Ejemplo n.º 5
0
 public function index()
 {
     if ($this->registry["ui"]["admin"]) {
         $this->view->setTitle("Управление объектами");
         $template = new Model_Template();
         $list = $template->getTemplates();
         $this->view->objects_admin(array("list" => $list));
         $this->view->showPage();
     }
 }
Ejemplo n.º 6
0
 public function index()
 {
     $this->view->setTitle("Просмотр");
     $this->view->setLeftContent($this->view->render("left_objects", array()));
     $template = new Model_Template();
     $list = $template->getTemplates();
     $this->object->links = "/list";
     $this->view->objects_find(array("list" => $this->templates, "templates" => $this->templates));
     $this->view->showPage();
 }
Ejemplo n.º 7
0
 public function index()
 {
     $this->view->setTitle("Просмотр объектов");
     $this->view->setLeftContent($this->view->render("left_objects", array()));
     if (isset($this->args[1])) {
         if (isset($_GET["page"])) {
             if (is_numeric($_GET["page"])) {
                 if (!$this->object->setPage($_GET["page"])) {
                     $this->__call("objects", "list");
                 }
             }
         }
         $ai = new Model_Ai();
         $forms = $ai->getForms();
         $this->object->links = "objects/" . $this->args[0] . "/" . $this->args[1] . "/";
         $sort =& $_SESSION["sort"];
         if (isset($_GET["clear"])) {
             unset($sort["sort"]);
         }
         if (isset($_POST) and count($_POST) > 0) {
             $sort_flag = true;
             $sort = $_POST;
             $data = $this->object->getObjectsSearch($this->args[1], $_POST);
         } else {
             if ($sort["sort"] != "") {
                 $sort_flag = true;
                 $data = $this->object->getObjectsSearch($this->args[1], $sort);
             } else {
                 $sort_flag = false;
                 $data = $this->object->getObjects($this->args[1]);
             }
         }
         $template = new Model_Template();
         $arr_objs = array();
         $i = 0;
         foreach ($data as $part) {
             $arr_objs[$i] = $this->object->getShortObject($part["id"]);
             $arr_objs[$i]["ai"] = $ai->getAdvancedInfo($part["id"]);
             $i++;
         }
         if (isset($this->registry["module_mail"])) {
             $mail = true;
         } else {
             $mail = false;
         }
         $fields = $template->getTypeTemplate($this->args[1]);
         $this->view->objects_subgroups(array("objs" => $arr_objs, "mail" => $mail, "forms" => $forms, "gid" => $this->args[1], "fields" => $fields, "sort_flag" => $sort_flag));
         //Отобразим пейджер
         if (count($this->object->pager) != 0) {
             $this->view->pager(array("pages" => $this->object->pager));
         }
     }
     $this->view->showPage();
 }
Ejemplo n.º 8
0
 public function index()
 {
     if ($this->registry["ui"]["admin"]) {
         $this->view->setTitle("Типы данных");
         $this->view->setLeftContent($this->view->render("left_settings", array()));
         if (isset($this->get["id"])) {
             $this->view->settings_objects_datafield(array("id" => $this->get["id"]));
         } else {
             $templates = new Model_Template();
             $datatypes = $templates->getDataTypes();
             $this->view->settings_objects_datatype(array("datatypes" => $datatypes));
         }
     }
 }
Ejemplo n.º 9
0
 function index()
 {
     if ($this->registry["ui"]["admin"]) {
         if (isset($this->get["id"])) {
             $this->view->setTitle("Правка задачи");
             $routes = new Model_Route();
             $data = $routes->getTaskData($this->get["id"]);
             $this->view->setLeftContent($this->view->render("left_route", array()));
             $this->view->setLeftContent($this->view->render("left_data", array("data" => $data)));
             $task = $routes->getDraftRouteTask($this->get["id"]);
             $data[0] = $task["task"];
             $formtask = $this->registry["module_tt"]->formfulltask($data);
             $template = new Model_Template();
             $datatypes = $template->getDataTypes();
             $result = $routes->getResult($this->get["id"]);
             $this->view->taskedit(array("formtask" => $formtask, "task" => $task, "datatypes" => $datatypes, "result" => $result));
             $this->view->showPage();
         }
     }
 }
Ejemplo n.º 10
0
 public function index()
 {
     $this->view->setTitle("Просмотр");
     $template = new Model_Template();
     $list = $template->getTemplates();
     $this->object->links = "/list";
     $data = $this->object->getObjsTree();
     $res_tree = null;
     foreach ($data as $part) {
         if (!isset($part["id"])) {
             if (isset($part["tname"])) {
                 $template = "[" . $part["tname"] . "]";
                 $sub = $part["type_id"];
                 if (!isset($res_tree[$template][$sub][0])) {
                     $res_tree[$template][$sub][0] = null;
                 }
             }
         }
     }
     $this->print_array($res_tree);
     $this->view->objects_find(array("list" => $this->find, "tree" => $this->tree, "templates" => $this->templates));
     $this->view->showPage();
 }
Ejemplo n.º 11
0
 public function index()
 {
     $this->view->setTitle("Формы");
     $this->view->setLeftContent($this->view->render("left_objects", array()));
     $ai = new Model_Ai();
     $template = new Model_Template();
     $datatypes = $template->getDataTypes();
     if (isset($this->args[1])) {
         if ($this->args[1] == "add") {
             if (isset($_POST["submit"])) {
                 $ai->addForm($_POST);
                 $this->view->refresh(array("timer" => "1", "url" => "objects/forms/"));
             } else {
                 $this->view->objects_formadd(array("datatypes" => $datatypes));
             }
         } else {
             if ($this->args[1] == "edit") {
                 if (isset($_POST["submit"])) {
                     $ai->editForm($_GET["id"], $_POST);
                     $this->view->refresh(array("timer" => "1", "url" => "objects/forms/"));
                 } else {
                     if (isset($_GET["id"])) {
                         $post = $ai->getForm($_GET["id"]);
                         $this->view->objects_formedit(array("post" => $post, "datatypes" => $datatypes));
                     }
                 }
             } elseif ($this->args[1] == "editview") {
                 $param = $ai->getTemplateView($_GET["id"]);
                 $this->view->objects_formeditview(array("tid" => $_GET["id"], "post" => $param, "datatypes" => $datatypes));
             }
         }
     } else {
         $forms = $ai->getForms();
         $this->view->objects_formslist(array("forms" => $forms));
     }
     $this->view->showPage();
 }
Ejemplo n.º 12
0
 public static function merge_db_configs_template($configs)
 {
     if ($db_configs = Model_Template::query()->get()) {
         foreach ($db_configs as $db_config) {
             $key = str_replace('_', '.', $db_config->name);
             $values = Arr::get($configs, $key);
             if ($db_config->format) {
                 $values['format'] = $db_config->format;
             }
             if ($db_config->title) {
                 $values['title'] = $db_config->title;
             }
             if ($db_config->body) {
                 $values['body'] = $db_config->body;
             }
             if (!$values) {
                 continue;
             }
             Arr::set($configs, $key, $values);
         }
     }
     return $configs;
 }
Ejemplo n.º 13
0
 public function index()
 {
     if ($this->registry["ui"]["admin"]) {
         $this->view->setTitle("Шаблоны");
         $this->view->setLeftContent($this->view->render("left_objects", array()));
         $template = new Model_Template();
         $list = $template->getTemplates();
         $datatypes = $template->getDataTypes();
         if (isset($this->args[1])) {
             if ($this->args[1] == "add") {
                 if (isset($_POST["submit"])) {
                     $template->addTemplate($_POST);
                     $this->view->refresh(array("timer" => "1", "url" => "objects/admin/"));
                 } else {
                     $this->view->objects_templateadd(array("datatypes" => $datatypes));
                 }
             } elseif ($this->args[1] == "edit") {
                 if (isset($this->args[2])) {
                     if (isset($_POST["submit"])) {
                         $template->editTemplate($this->args[2], $_POST);
                         $this->view->refresh(array("timer" => "1", "url" => "objects/admin/"));
                     } else {
                         $param = $template->getTemplate($this->args[2]);
                         $this->view->objects_templateedit(array("post" => $param, "datatypes" => $datatypes));
                     }
                 }
             } elseif ($this->args[1] == "editview") {
                 $param = $template->getTemplateView($this->args[2]);
                 $this->view->objects_templateeditview(array("tid" => $this->args[2], "post" => $param, "datatypes" => $datatypes));
             } elseif ($this->args[1] == "list") {
                 $this->view->objects_templatelist(array("id" => $this->args[2]));
             }
         } else {
             $this->view->objects_templates(array("list" => $list));
         }
     }
     $this->view->showPage();
 }
Ejemplo n.º 14
0
 private static function get_validation(array $configs)
 {
     $val = \Validation::forge();
     $val->add_model(\Model_Template::forge());
     $val->field('name')->delete_rule('required');
     $val->field('format')->delete_rule('required');
     $val->field('body')->add_rule('required');
     if (empty($configs['title'])) {
         $val->fieldset()->delete('title');
     } else {
         $val->field('title')->add_rule('required');
     }
     return $val;
 }
Ejemplo n.º 15
0
 function getFidFromFname($param)
 {
     $template = new Model_Template();
     return $template->getFidFromFname($param[0], $param[1]);
 }
Ejemplo n.º 16
0
 public function setTemplateViewSize($params)
 {
     $tpl = new Model_Template();
     $tpl->setTemplateViewSize($params["tid"], $params["fid"], $params["w"], $params["h"]);
 }
Ejemplo n.º 17
0
 public function getObject($id)
 {
     $rows = FALSE;
     $sql = "SELECT o.id AS id, o.timestamp AS `timestamp`, o.template AS tid, o.fid AS fdirid, t.id AS tid, t.name AS tname, ov.fid AS fid, tf.field AS `field`, tf.main AS `main`, tf.type AS `type`, tf.datatype AS datatype, ov.val AS val, o.uid AS auid, author.name AS aname, author.soname AS asoname, o.timestamp AS adate, ov.uid AS euid, editor.name AS ename, editor.soname AS esoname, ov.timestamp AS edate\r\n\t\t\t\tFROM objects AS o\r\n                LEFT JOIN objects_vals AS ov ON (ov.oid = o.id)\r\n                LEFT JOIN templates_fields AS tf ON (tf.id = ov.fid)\r\n                LEFT JOIN templates AS t ON (t.id = tf.tid)\r\n                LEFT JOIN users AS author ON (author.id = o.uid)\r\n                LEFT JOIN users AS editor ON (editor.id = ov.uid)\r\n                WHERE o.id = :id\r\n                ORDER BY fid";
     $res = $this->registry['db']->prepare($sql);
     $param = array(":id" => $id);
     $res->execute($param);
     $rows = $res->fetchAll(PDO::FETCH_ASSOC);
     $template = new Model_Template();
     $fields = $template->getTypeTemplate($rows[0]["tid"]);
     for ($i = 0; $i < count($fields); $i++) {
         $flag = false;
         for ($j = 0; $j < count($rows); $j++) {
             if (isset($rows[$j]["val"])) {
                 $rows[$j]["formatval"] = nl2br($rows[$j]["val"]);
                 $search = array("\n", "\r");
                 $rows[$j]["formatval"] = str_replace($search, "", $rows[$j]["formatval"]);
             }
             if (isset($rows[$j]["field"])) {
                 if ($fields[$i]["field"] == $rows[$j]["field"]) {
                     $flag = true;
                     $rows[$i]["sel"] = $template->getDataVals($rows[$i]["datatype"]);
                 }
             }
         }
         if (!$flag) {
             $rows[] = $fields[$i];
         }
     }
     $sql = "SELECT `email`\r\n\t\tFROM mail_contacts\r\n\t\tWHERE oid = :id";
     $res = $this->registry['db']->prepare($sql);
     $param = array(":id" => $id);
     $res->execute($param);
     $email = $res->fetchAll(PDO::FETCH_ASSOC);
     if (count($email) and $email[0]["email"] != "") {
         $rows[0]["email"] = $email[0]["email"];
     }
     if ($rows) {
         $fields = $template->getTemplate($rows[0]["tid"]);
     } else {
         return FALSE;
     }
     foreach ($fields as $part) {
         $flag = FALSE;
         foreach ($rows as $row) {
             if ($part["fid"] == $row["fid"]) {
                 $flag = TRUE;
             }
         }
         if (!$flag) {
             $rows[] = $part;
         }
     }
     for ($i = 0; $i < count($rows); $i++) {
         $sql = "SELECT fid, x, y, w, h\r\n        \t\tFROM templates_view\r\n        \t\tWHERE tid = :tid";
         $res = $this->registry['db']->prepare($sql);
         $param = array(":tid" => $rows[0]["tid"]);
         $res->execute($param);
         $data = $res->fetchAll(PDO::FETCH_ASSOC);
     }
     // если поле есть в таблице  templates_view, присвоим массиву $fields значения
     for ($i = 0; $i < count($rows); $i++) {
         for ($j = 0; $j < count($data); $j++) {
             if ($rows[$i]["fid"] == $data[$j]["fid"]) {
                 $rows[$i]["view"] = $data[$j];
             }
         }
     }
     // sort array
     for ($i = 0; $i < count($rows); $i++) {
         for ($j = 0; $j < count($rows); $j++) {
             if (isset($rows[$i]["view"]["y"]) and isset($rows[$j]["view"]["y"])) {
                 if ($rows[$i]["view"]["y"] < $rows[$j]["view"]["y"]) {
                     $min = $rows[$i];
                     $rows[$i] = $rows[$j];
                     $rows[$j] = $min;
                 }
             }
         }
     }
     return $rows;
 }
Ejemplo n.º 18
0
Archivo: Ai.php Proyecto: rosko/workapp
 public function getForm($id)
 {
     $data = array();
     $sql = "SELECT f.id AS id, f.name AS `name`, ff.id AS fid, ff.field AS `field`, ff.type AS `type`, ff.datatype\r\n        FROM objects_forms AS f\r\n        LEFT JOIN objects_forms_fields AS ff ON (f.id = ff.tid)\r\n        WHERE f.id = :id\r\n        ORDER BY ff.id";
     $res = $this->registry['db']->prepare($sql);
     $param = array(":id" => $id);
     $res->execute($param);
     $fields = $res->fetchAll(PDO::FETCH_ASSOC);
     $templates = new Model_Template();
     for ($i = 0; $i < count($fields); $i++) {
         $fields[$i]["sel"] = $templates->getDataVals($fields[$i]["datatype"]);
     }
     $sql = "SELECT fid, x, y, w, h\r\n\t\t\t\t\tFROM objects_forms_view\r\n\t\t\t\t\tWHERE tid = :tid";
     $res = $this->registry['db']->prepare($sql);
     $param = array(":tid" => $id);
     $res->execute($param);
     $data = $res->fetchAll(PDO::FETCH_ASSOC);
     // если поле есть в таблице  templates_view, присвоим массиву $fields значения
     for ($i = 0; $i < count($fields); $i++) {
         for ($j = 0; $j < count($data); $j++) {
             if ($fields[$i]["fid"] == $data[$j]["fid"]) {
                 $fields[$i]["view"] = $data[$j];
             }
         }
     }
     // sort array
     for ($i = 0; $i < count($fields); $i++) {
         for ($j = 0; $j < count($fields); $j++) {
             if (isset($fields[$i]["view"]["y"]) and isset($fields[$j]["view"]["y"])) {
                 if ($fields[$i]["view"]["y"] < $fields[$j]["view"]["y"]) {
                     $min = $fields[$i];
                     $fields[$i] = $fields[$j];
                     $fields[$j] = $min;
                 }
             }
         }
     }
     return $fields;
 }
Ejemplo n.º 19
0
 public function getCatName($params)
 {
     $id = $params["id"];
     $template = new Model_Template();
     $cat = $template->getCatName($id);
     echo $cat["name"];
 }
Ejemplo n.º 20
0
 public function runAction($rid, $step_id, $results)
 {
     $goto = null;
     $routes = new Model_RealRoute();
     $action = $routes->getRouteAction($step_id);
     if (count($action) == 0) {
         $goto = $this->countStep($rid, $step_id);
     } else {
         foreach ($action as $part) {
             $templates = new Model_Template();
             $sql = "SELECT datatype FROM route_tasks_results WHERE id = :ifdata LIMIT 1";
             $res = $this->registry['db']->prepare($sql);
             $param = array(":ifdata" => $part["ifdata"]);
             $res->execute($param);
             $row = $res->fetchAll(PDO::FETCH_ASSOC);
             $vals = $templates->getDataVals($row[0]["datatype"]);
             foreach ($results as $key => $val) {
                 foreach ($vals as $temps) {
                     if ($temps["id"] == $val) {
                         $id = $temps["val"];
                     }
                 }
                 if ($key == $part["ifdata"]) {
                     if ($part["ifcon"] == "=") {
                         if ($id == $part["ifval"]) {
                             $goto = $part["goto"];
                         }
                     } else {
                         if ($part["ifcon"] == "<") {
                             if ($id < $part["ifval"]) {
                                 $goto = $part["goto"];
                             }
                         } else {
                             if ($part["ifcon"] == ">") {
                                 if ($id > $part["ifval"]) {
                                     $goto = $part["goto"];
                                 }
                             } else {
                                 if ($part["ifcon"] == "!=") {
                                     if ($id != $part["ifval"]) {
                                         $goto = $part["goto"];
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         if ($goto == null) {
             $goto = $this->countStep($rid, $step_id);
         }
     }
     return $goto;
 }
Ejemplo n.º 21
0
 function setResult($params)
 {
     $tid = $params["tid"];
     $process = new Model_Process();
     $form = $process->getTaskResultsForms($tid);
     if (count($form) > 0) {
         $template = new Model_Template();
         $datatypes = $template->getDataTypes();
         for ($i = 0; $i < count($form); $i++) {
             for ($k = 0; $k < count($datatypes); $k++) {
                 if ($form[$i]["datatype"] == $datatypes[$k]["id"]) {
                     $form[$i]["select"] = $datatypes[$k]["vals"];
                 }
             }
         }
         echo $this->view->render("formresults", array("form" => $form));
     } else {
         //$params["results"] = array();
         //$this->closeTask($params);
         echo "null";
     }
 }
Ejemplo n.º 22
0
" alt="<?php 
    echo $appConfig->appAuthor;
    ?>
" />
							<?php 
} else {
    ?>
							<h4><?php 
    echo $this->translate('site.template.footer', 'ABOUT US');
    ?>
</h4>
							<?php 
}
?>
							<?php 
echo Model_Template::getTemplateContent('FOOTER_ABOUT_US');
?>
						</p>
					</div>
					<br clear="both" />
				</div>
				
				<div class="col-md-5 col-md-offset-1 col-xs-12">
					<div style="margin-left: 25px; margin-right: 25px;">
						<h4><?php 
echo $this->translate('site.template.footer', 'CONTACT US');
?>
</h4>
						<p style="line-height: 24px; text-transform: uppercase;">
							<?php 
if (!empty($configDetail->address)) {
Ejemplo n.º 23
0
 public function getObject($id)
 {
     $template = new Model_Template();
     $rows = FALSE;
     $sql = "SELECT o.id AS id, o.timestamp AS `timestamp`, o.template AS tid, t.name AS tname, ov.fid AS fid, tf.field AS `field`, tf.main AS `main`, tf.expand AS `expand`, ov.val AS val, o.uid AS auid, author.name AS aname, author.soname AS asoname, o.timestamp AS adate, ov.uid AS euid, editor.name AS ename, editor.soname AS esoname, ov.timestamp AS edate\r\n\t\t\t\t\tFROM objects AS o\r\n\t                LEFT JOIN objects_vals AS ov ON (ov.oid = o.id)\r\n\t                LEFT JOIN templates_fields AS tf ON (tf.id = ov.fid)\r\n\t                LEFT JOIN templates AS t ON (t.id = tf.tid)\r\n\t                LEFT JOIN users AS author ON (author.id = o.uid)\r\n\t                LEFT JOIN users AS editor ON (editor.id = ov.uid)\r\n\t                WHERE o.id = :id\r\n\t                ORDER BY fid";
     $res = $this->registry['db']->prepare($sql);
     $param = array(":id" => $id);
     $res->execute($param);
     $rows = $res->fetchAll(PDO::FETCH_ASSOC);
     $sql = "SELECT `email`\r\n\t\t\tFROM mail_contacts\r\n\t\t\tWHERE oid = :id";
     $res = $this->registry['db']->prepare($sql);
     $param = array(":id" => $id);
     $res->execute($param);
     $email = $res->fetchAll(PDO::FETCH_ASSOC);
     if (count($email) and $email[0]["email"] != "") {
         $rows[0]["email"] = $email[0]["email"];
     }
     if ($rows) {
         $fields = $template->getTemplate($rows[0]["tid"]);
     } else {
         return FALSE;
     }
     foreach ($fields as $part) {
         $flag = FALSE;
         foreach ($rows as $row) {
             if ($part["fid"] == $row["fid"]) {
                 $flag = TRUE;
             }
         }
         if (!$flag) {
             $rows[] = $part;
         }
     }
     return $rows;
 }
Ejemplo n.º 24
0
Archivo: Tt.php Proyecto: rosko/workapp
 public function delTemplate($params)
 {
     $id = $params["id"];
     $tpl = new Model_Template();
     $tpl->delTemplate($id);
 }