Advertisement
Advertisement
| 05.08.2008 at 01:15AM PDT, ID: 23385358 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: |
<?php
require_once("./classes/xml.class.php");
$xgen = new xmlgenerator();
$xgen->path = "inc/data.xml";
$xgen->imgPath = "/backoffice/app/webroot/img/images/";
$xgen->thumbPath = "/backoffice/app/webroot/img/images/thumbs/";
$xgen->topmenu = array("welkom","nieuwsbrief","vacatures","contact");
$xgen->menu = array("wie","missie","duurzaam-bouwen","wedstrijden","referenties","publicaties","vorming");
// create doctype
$dom = new DOMDocument();
//$dom = domxml_new_doc("1.0");
$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;
// create root element
$root = $dom->createElement("xml");
$dom->appendChild($root);
//TOPMENU
$top = $dom->createElement("topmenu");
$root->appendChild($top);
//TOPMENU ITEMS
for($i=0;$i<count($xgen->topmenu);$i++){
$menuitem = $dom->createElement("node");
$top->appendChild($menuitem);
$nme = $dom->createAttribute("nme");
$menuitem->appendChild($nme);
$nmeValue = $dom->createTextNode($xgen->topmenu[$i]);
$nme->appendChild($nmeValue);
switch($xgen->topmenu[$i]){
case "welkom":
$images = $dom->createElement("images");
$menuitem->appendChild($images);
//ADD PAGE FOR IMAGES
$sql = "SELECT (SELECT content FROM i18n I WHERE I.locale='nl' AND I.model='PagesItem' AND field='content' ".
"AND I.foreign_key=P.id) as content ".
" FROM pages_items AS P WHERE P.url LIKE '%welkom'";
$data = $xgen->db->get_array($sql);
$nmeValue = $dom->createTextNode($data[0]['content']);
$images->appendChild($nmeValue);
$news = $dom->createElement("news");
$menuitem->appendChild($news);
//ADD NEWSITEMS
$sql = "SELECT DATE_FORMAT(N.date,'%e %b %y') as mydate,N.id as newsId,".
"(SELECT file FROM images WHERE id=N.image_id) as image,".
"(SELECT content FROM i18n I WHERE I.locale='nl' AND I.model='NewsItem' AND field='title' ".
"AND I.foreign_key=N.id) as title,(SELECT content FROM i18n I WHERE I.locale='nl' AND ".
"I.model='NewsItem' AND field='description' AND I.foreign_key=N.id) as description,".
"(SELECT content FROM i18n I WHERE I.locale='nl' AND I.model='NewsItem' AND field='teaser' ".
"AND I.foreign_key=N.id) as teaser".
" FROM news_items AS N WHERE arch=0 ORDER BY N.date DESC LIMIT 0,4";
$data = $xgen->db->get_array($sql);
for($j=0;$j<count($data);$j++){
$newsitem = $dom->createElement("newsitem");
$news->appendChild($newsitem);
$nme = $dom->createAttribute("link");
$newsitem->appendChild($nme);
$nmeValue = $dom->createTextNode("dbfield");
$nme->appendChild($nmeValue);
$nme = $dom->createAttribute("catnode");
$newsitem->appendChild($nme);
$nmeValue = $dom->createTextNode("dbfield");
$nme->appendChild($nmeValue);
$nme = $dom->createAttribute("refnode");
$newsitem->appendChild($nme);
$nmeValue = $dom->createTextNode("dbfield");
$nme->appendChild($nmeValue);
$nme = $dom->createAttribute("dte");
$newsitem->appendChild($nme);
$nmeValue = $dom->createTextNode($data[$j]['mydate']);
$nme->appendChild($nmeValue);
$nme = $dom->createAttribute("ttl");
$newsitem->appendChild($nme);
$nmeValue = $dom->createTextNode($data[$j]['title']);
$nme->appendChild($nmeValue);
$nmeValue = $dom->createTextNode($data[$j]['description']);
$newsitem->appendChild($nmeValue);
}
break;
case "vacatures":
//ADD PAGE FOR VACATURE
$sql = "SELECT (SELECT content FROM i18n I WHERE I.locale='nl' AND I.model='PagesItem' AND field='content' ".
"AND I.foreign_key=P.id) as content ".
" FROM pages_items AS P WHERE P.url LIKE '%vacatures'";
$data = $xgen->db->get_array($sql);
$val = $dom->createTextNode($data[0]['content']);
$nme->appendChild($val);
break;
}
}
//MAINMENU
$menu = $dom->createElement("menu");
$root->appendChild($menu);
//MAINMENU ITEMS
for($i=0;$i<count($xgen->menu);$i++){
$menuitem = $dom->createElement("node");
$menu->appendChild($menuitem);
$nme = $dom->createAttribute("nme");
$menuitem->appendChild($nme);
$nmeValue = $dom->createTextNode($xgen->menu[$i]);
$nme->appendChild($nmeValue);
//ADD PAGES
if($xgen->menu[$i]!="referenties"){
$sql = "SELECT (SELECT content FROM i18n I WHERE I.locale='nl' AND I.model='PagesItem' AND field='content' ".
"AND I.foreign_key=P.id) as content ".
" FROM pages_items AS P WHERE P.url LIKE '%".$xgen->menu[$i]."'";
//echo "$sql<br /><br />";
$data = $xgen->db->get_array($sql);
$val = $dom->createTextNode($data[0]['content']);
$menuitem->appendChild($val);
}else{
//GET PROJECTGROUPS
$sql = "SELECT (SELECT content FROM i18n I WHERE I.locale='nl' AND I.model='ProductsGroup' AND field='name' ".
"AND I.foreign_key=P.id) as name,P.id ".
" FROM products_groups AS P WHERE P.parent_id=0 ORDER BY weight ASC";
//echo "$sql<br /><br />";
$data2 = $xgen->db->get_array($sql);
for($x=0;$x<count($data2);$x++){
$ref = $dom->createElement("node");
$menuitem->appendChild($ref);
$refatt = $dom->createAttribute("nme");
$ref->appendChild($refatt);
$nmeValue = $dom->createTextNode($data2[$x]['name']);
$refatt->appendChild($nmeValue);
//GET PROJECTS
$sql = "SELECT P.id,(SELECT content FROM i18n I WHERE I.locale='nl' AND I.model='ProductsItem' AND field='name' ".
"AND I.foreign_key=P.id) as name,(SELECT content FROM i18n I WHERE I.locale='nl' AND ".
"I.model='ProductsItem' AND field='description' AND I.foreign_key=P.id) as description,refnumber ".
" FROM products_items AS P INNER JOIN products_groups_items G ON P.id=G.products_item_id ".
" WHERE G.products_group_id=".$data2[$x]['id']." ORDER BY weight ASC";
$data3 = $xgen->db->get_array($sql);
for($y=0;$y<count($data3);$y++){
//ADD REF
$refnode = $dom->createElement("node");
$ref->appendChild($refnode);
$refnr = $dom->createAttribute("refnr");
$refnode->appendChild($refnr);
$refnrVal = $dom->createTextNode($data3[$y]['refnumber']);
$refnr->appendChild($refnrVal);
$ttl = $dom->createAttribute("ttl");
$refnode->appendChild($ttl);
$ttlVal = $dom->createTextNode($data3[$y]['name']);
$ttl->appendChild($ttlVal);
//ADD IMAGES
$images = $dom->createElement("images");
$refnode->appendChild($images);
$sql = "SELECT file,thumb FROM images I INNER JOIN products_items_images P ON I.id=P.image_id WHERE ".
"P.products_item_id=".$data3[$y]['id'];
$data4 = $xgen->db->get_array($sql);
for($z=0;$z<count($data4);$z++){
//ADD THUMB ATTRIBUTE
if($z==0){
$thumb = $dom->createAttribute("thumb");
$refnode->appendChild($thumb);
$thumbVal = $dom->createTextNode($xgen->thumbPath.$data4[$z]['thumb']);
$thumb->appendChild($thumbVal);
}
//ADD IMAGE-NODES
$image = $dom->createElement("img");
$images->appendChild($image);
$src = $dom->createAttribute("src");
$image->appendChild($src);
$srcVal = $dom->createTextNode($xgen->imgPath.$data4[$z]['file']);
$src->appendChild($srcVal);
}
//ADD TEXT
$text = $dom->createElement("text");
$refnode->appendChild($text);
$textVal = $dom->createTextNode($data3[$y]['description']);
$text->appendChild($textVal);
}
}
}
}
// save tree to file
$str = $dom->save($xgen->path);
echo "<a href=\"$xgen->path\" target=\"_BLANK\">show</a>";
?>
|