INSERT INTO `Class` (`Class_ID`, `Class_Name`, `Class_Group`, `DaysToHold`, `AllowTags`, `FormPrefix`, `FormSuffix`, `RecordTemplate`, `RecordsPerPage`, `SortBy`, `RecordTemplateFull`, `TitleTemplate`, `AddTemplate`, `EditTemplate`, `AddActionTemplate`, `EditActionTemplate`, `SearchTemplate`, `FullSearchTemplate`, `SubscribeTemplate`, `System_Table_ID`, `Settings`, `AddCond`, `EditCond`, `SubscribeCond`, `NL2BR`, `UseCaptcha`, `CheckActionTemplate`, `DeleteActionTemplate`, `CustomSettingsTemplate`, `ClassDescription`) VALUES (51, 'Магазин: Заказ', 'Магазин', 0, 0, '$f_AdminCommon\r\n\r\n<br>\r\n<form method=get>\r\n".opt($inside_admin, "<input type=hidden name=inside_admin value=1>")."\r\n<input type=hidden name=catalogue value=$catalogue>\r\n<input type=hidden name=sub value=$sub>\r\n<input type=hidden name=cc value=$cc>\r\n\r\n".NETCAT_MODULE_NETSHOP_ORDER_STATUS." \r\n<select name=order_status onchange=''this.form.submit();''>\r\n<option value=0>".NETCAT_MODULE_NETSHOP_ORDER_NEW.\r\n\r\n listQuery("SELECT ShopOrderStatus_ID, ShopOrderStatus_Name FROM Classificator_ShopOrderStatus",\r\n "<option value=\\$data[ShopOrderStatus_ID]\\".\r\n (\\$data[''ShopOrderStatus_ID'']==\\$_GET[''order_status''] ?\r\n '' selected'':'''').\\">\\$data[ShopOrderStatus_Name]")."\r\n</select>\r\n<input type=submit value='' OK ''>\r\n<hr size=1 noshade>', '', '";\r\n\r\n$shop->LoadOrder($f_RowID);\r\n\r\n$result .= "<br><table border=0 width=100% cellspacing=0 cellpadding=0><tr valign=top><td>\r\n <b>$f_ContactName</b><br>$f_Phone".\r\n ($f_Phone && $f_Email ? ", " : "").\r\n ($f_Email ? "<a href=''mailto:$f_Email''>$f_Email</a>":"" );\r\n\r\nif ($f_Address) { $result .= "<br>$f_Address"; }\r\n\r\n$result .= "<br><a href=''".$SUB_FOLDER.$HTTP_ROOT_PATH."modules/netshop/export/commerceml.php?order_id=$f_RowID''>Экспорт в CommerceML</a></td>\r\n <td width=350>$f_AdminButtons</td></tr></table>\r\n <table border=1 width=100%>";\r\n\r\nforeach ($shop->CartContents as $row_order)\r\n{\r\n $item_id = ($row_order["ItemID"] ? "[$row_order[ItemID]]" : "[$row_order[Message_ID]]");\r\n\r\n $result .= "\r\n<tr>\r\n <td width=60%>$item_id $row_order[Name]</td>\r\n <td>$row_order[ItemPriceF] * $row_order[Qty] $row_order[Units] = $row_order[TotalPriceF]</td>\r\n</tr>";\r\n}\r\n\r\n$result .= "</table>\r\n<br>\r\n\r\n', 20, '', '', '', '".eval("if (!\\$shop) \\$shop=new Netshop(); return \\$shop->PrintOrderForm();")."', '". \r\n\r\n/* WEIRD HACK. (Corrupts script flow, yet works) */\r\n\r\neval("include(''{$MODULE_FOLDER}netshop/interface/order_edit.php'');")\r\n\r\n." \r\n', '";\r\n$shop->SaveOrder($msgID);\r\nprint "Заказ оформлен (#$msgID).";\r\n$result .= "\r\n', '". NETCAT_MODERATION_MSG_OBJCHANGED."\r\n<br><br>\r\n<a href=$goBackLink>".NETCAT_MODERATION_BACKTOSECTION."</a>";\r\n\r\ninclude("{$MODULE_FOLDER}netshop/interface/order_save.php");\r\n\r\n"', '', '', '', 0, 'if ($order_status)\r\n{\r\n $order_status = (int)$order_status;\r\n $query_where = "a.Status = ''$order_status''";\r\n}\r\nelse\r\n{\r\n $query_where = "a.Status IS NULL"; // new orders\r\n}', 'if (!$shop->CartCount())\r\n{\r\n $posting=0;\r\n}\r\n', '', '', 0, 0, '', '".NETCAT_MODERATION_MSG_OBJSDELETED. "<br><br>\r\n<a href=$goBackLink>".NETCAT_MODERATION_BACKTOSECTION."</a>";\r\n\r\nif (is_numeric($message)) { $ids = $message; }\r\nelse\r\n{\r\n $ids = array();\r\n foreach ((array)$q as $row) { $ids[] = $row[0]; }\r\n $ids = join(", ", $ids);\r\n}\r\n\r\nif (strlen($ids))\r\n{\r\n q("DELETE FROM Netshop_OrderGoods WHERE Order_ID IN ($ids)");\r\n q("DELETE FROM Netshop_OrderDiscounts WHERE Order_ID IN ($ids)");\r\n}\r\n\r\necho "', '', '');