function Object_data_list() { $page = CurrentPageName(); $tpl = new templates(); $sock = new sockets(); $q = new mysql(); $search = "*" . $_GET["search"] . "*"; $search = str_replace("**", "*", $search); $search = str_replace("**", "*", $search); $search = str_replace("*", "%", $search); $action_delete_rule = $tpl->javascript_parse_text("{action_delete_rule}"); $add = imgtootltip("plus-24.png", "{add}", "PostfwdItemObject(0)"); $sql = "SELECT * FROM postfwd2_items WHERE item_data LIKE '{$search}' AND objectID='{$_GET["ID"]}' ORDER BY ID DESC LIMIT 0,50"; $html = "<center>\n<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>\n<thead class='thead'>\n\t<tr>\n\t\t<th width=1%>{$add}</th>\n\t\t<th nowrap>{rule}</th>\n\t\t<th> </th>\n\t</tr>\n</thead>\n<tbody class='tbody'>"; $postfwd2 = new postfwd2(); $q = new mysql(); writelogs("{$sql}", __FUNCTION__, __FILE__, __LINE__); $results = $q->QUERY_SQL($sql, "artica_backup"); if (!$q->ok) { if (strpos($q->mysql_error, "doesn't exist") > 0) { $q->check_postfwd2_table(); if (!$q->ok) { echo "<H2>{$q->mysql_error}</H2>"; } $q = new mysql(); $results = $q->QUERY_SQL($sql, "artica_backup"); } } if (!$q->ok) { echo "<H2>{$q->mysql_error}</H2>"; } while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) { if ($classtr == "oddRow") { $classtr = null; } else { $classtr = "oddRow"; } //$selectUri="<a href=\"javascript:blur();\" OnClick=\"javascript:PostfwdItemObject('{$ligne["ID"]}');\" style='font-size:14px;text-decoration:underline'>"; $delete = imgtootltip("delete-32.png", "{delete}", "DeleteObjectItem('{$ligne["ID"]}')"); $html = $html . "\n\t\t<tr class={$classtr}>\n\t\t\t<td width=1% {$style} nowrap colspan=2 style='font-size:16px'>{$selectUri}{$postfwd2->item_to_text($ligne, true)}</a></td>\t\n\t\t\t<td width=1% {$delete}</td>\n\t\t</tr>\n\t\t"; } $html = $html . "</tbody>\n\t</table>\n\t<script>\n\t\n\tfunction PostfwdItemObject(itemid){\n\t\tYahooWin3('550','postfwd2.php?postfwd2-item=yes&itemid='+itemid+'&ID={$_GET["ID"]}&instance={$_GET["instance"]}&ByObject=yes','::'+itemid);\n\t}\t\n\t\t\n\tfunction postfwd2ReloadItemsList(){\n\t\tSearchobjectsRuleList();\n\t}\n\t\n\tvar x_DeleteObjectItem= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>2){alert(results);}\n\t\t\tif(document.getElementById('object-datas-list')){SearchobjectsRuleList();}\n\t}\t\t\n\t\n\tfunction DeleteObjectItem(ID){\t\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('DeleteObjectItem',ID);\n\t\tif(document.getElementById('object-datas-list')){AnimateDiv('object-datas-list');}\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_DeleteObjectItem);\n\t}\n</script>\n"; echo $tpl->_ENGINE_parse_body($html); }
function item_to_text($array) { include_once dirname(__FILE__) . "/ressources/class.postfwd2.inc"; $ptfw = new postfwd2(); return $ptfw->item_to_text($array); }