Jump to content

sso

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sso's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. you see with the $output array .. [2] => Array ([OPTID] => 5 [EMPID1] => 00696 [PCS1] => 1000 [EMPID2] => [PCS2] =>) is different from .. [11] => Array ([OPTID] => 16 [EMPID1] => 00098 [PCS1] => 360 [EMPID2] => 00341 [PCS2] => 200) [12] => Array ([OPTID] => 16 [EMPID1] => 00465 [PCS1] => 160 [EMPID2] => 00474 [PCS2] => 80) [13] => Array ([OPTID] => 16 [EMPID1] => 00473 [PCS1] => 1080 [EMPID2] => [PCS2] =>) .. This depends on the $info because the number of times EMPID appears is not fixed so I need $output to be repeated depending on how many times EMPID appears? I am sorry if I am not clear.. I suspect there is a modulo in there somewhere.. what I got so far is counting the number of times EMPID corresponds with an OPTID and then hardcoding it in.. I am not sure if that is the most elegant way to do it.. Thanks for any further help you can give
  2. Thanks Teamomatic for the quick reply. My problem is that with the first array there are some OPTIDs that have 1 or 2 or even 5 EMPIDs and I need to put them into sets of 2s into the new array. Do you think I need to run through the first array counting the number of EMPIDs first then somehow create the new array using the counted EMPIDs?
  3. Hey guys, I need help with coding an array, I just cannot wrap my head around it. I got the following array $info = Array ( [0] => Array ( [AOCODE] => 3123121209-1 [OPTID] => 2 [EMPID] => 00675 [PCS] => 1060 [AMT] => 7.95 [PRICE] => 0.15 ) [1] => Array ( [AOCODE] => 3123121209-1 [OPTID] => 3 [EMPID] => 00696 [PCS] => 980 [AMT] => 4.90 [PRICE] => 0.10 ) [2] => Array ( [AOCODE] => 3123121209-1 [OPTID] => 5 [EMPID] => 00696 [PCS] => 1000 [AMT] => 5.00 [PRICE] => 0.10 ) [3] => Array ( [AOCODE] => 3123121209-1 [OPTID] => 6 [EMPID] => 00675 [PCS] => 1060 [AMT] => 5.30 [PRICE] => 0.10 ) [4] => Array ( [AOCODE] => 3123121209-1 [OPTID] => 7 [EMPID] => 00690 [PCS] => 1220 [AMT] => 4.88 [PRICE] => 0.08 ) [5] => Array ( [AOCODE] => 3123121209-1 [OPTID] => 8 [EMPID] => 00069 [PCS] => 300 [AMT] => 8.25 [PRICE] => 0.55 ) [6] => Array ( [AOCODE] => 3123121209-1 [OPTID] => 8 [EMPID] => 00336 [PCS] => 220 [AMT] => 6.05 [PRICE] => 0.55 ) [7] => Array ( [AOCODE] => 3123121209-1 [OPTID] => 8 [EMPID] => 00569 [PCS] => 240 [AMT] => 6.60 [PRICE] => 0.55 ) [8] => Array ( [AOCODE] => 3123121209-1 [OPTID] => 8 [EMPID] => 00727 [PCS] => 300 [AMT] => 8.25 [PRICE] => 0.55 ) [9] => Array ( [AOCODE] => 3123121209-1 [OPTID] => 9 [EMPID] => 00029 [PCS] => 1200 [AMT] => 8.40 [PRICE] => 0.14 ) [10] => Array ( [AOCODE] => 3123121209-1 [OPTID] => 10 [EMPID] => 00092 [PCS] => 980 [AMT] => 6.86 [PRICE] => 0.14 ) [11] => Array ( [AOCODE] => 3123121209-1 [OPTID] => 11 [EMPID] => 00059 [PCS] => 600 [AMT] => 6.00 [PRICE] => 0.20 ) [12] => Array ( [AOCODE] => 3123121209-1 [OPTID] => 11 [EMPID] => 00704 [PCS] => 600 [AMT] => 6.00 [PRICE] => 0.20 ) [13] => Array ( [AOCODE] => 3123121209-1 [OPTID] => 12 [EMPID] => 00356 [PCS] => 460 [AMT] => 2.76 [PRICE] => 0.12 ) [14] => Array ( [AOCODE] => 3123121209-1 [OPTID] => 12 [EMPID] => 00716 [PCS] => 460 [AMT] => 2.76 [PRICE] => 0.12 ) [15] => Array ( [AOCODE] => 3123121209-1 [OPTID] => 16 [EMPID] => 00098 [PCS] => 360 [AMT] => 5.40 [PRICE] => 0.30 ) [16] => Array ( [AOCODE] => 3123121209-1 [OPTID] => 16 [EMPID] => 00341 [PCS] => 200 [AMT] => 3.00 [PRICE] => 0.30 ) 17] => Array ( [AOCODE] => 3123121209-1 [OPTID] => 16 [EMPID] => 00465 [PCS] => 160 [AMT] => 2.40 [PRICE] => 0.30 ) [18] => Array ( [AOCODE] => 3123121209-1 [OPTID] => 16 [EMPID] => 00474 [PCS] => 80 [AMT] => 1.20 [PRICE] => 0.30 ) [19] => Array ( [AOCODE] => 3123121209-1 [OPTID] => 16 [EMPID] => 00473 [PCS] => 1080 [AMT] => 1.20 [PRICE] => 0.30 ) ) and I would like to use it to output the below array $output = Array ( [0] => Array ([OPTID] => 2 [EMPID1] => 00675 [PCS1] => 1060 [EMPID2] => [PCS2] =>) [1] => Array ([OPTID] => 3 [EMPID1] => 00696 [PCS1] => 980 [EMPID2] => [PCS2] =>) [2] => Array ([OPTID] => 5 [EMPID1] => 00696 [PCS1] => 1000 [EMPID2] => [PCS2] =>) [3] => Array ([OPTID] => 6 [EMPID1] => 00675 [PCS1] => 1060 [EMPID2] => [PCS2] =>) [4] => Array ([OPTID] => 7 [EMPID1] => 00690 [PCS1] => 1220 [EMPID2] => [PCS2] =>) [5] => Array ([OPTID] => 8 [EMPID1] => 00069 [PCS1] => 300 [EMPID2] => 00336 [PCS2] => 220) [6] => Array ([OPTID] => 8 [EMPID1] => 00569 [PCS1] => 240 [EMPID2] => 00727 [PCS2] =>300) [7] => Array ([OPTID] => 9 [EMPID1] => 00029 [PCS1] => 1200 [EMPID2] => [PCS2] =>) [8] => Array ([OPTID] => 10 [EMPID1] => 00092 [PCS1] => 980 [EMPID2] => [PCS2] =>) [9] => Array ([OPTID] => 11 [EMPID1] => 00704 [PCS1] => 600 [EMPID2] => 00704 [PCS2] => 600) [10] => Array ([OPTID] => 12 [EMPID1] => 00356 [PCS1] => 460 [EMPID2] => 00716 [PCS2] => 460) [11] => Array ([OPTID] => 16 [EMPID1] => 00098 [PCS1] => 360 [EMPID2] => 00341 [PCS2] => 200) [12] => Array ([OPTID] => 16 [EMPID1] => 00465 [PCS1] => 160 [EMPID2] => 00474 [PCS2] => 80) [13] => Array ([OPTID] => 16 [EMPID1] => 00473 [PCS1] => 1080 [EMPID2] => [PCS2] =>) ) I have been trying for the last couple of days to figure this out. Appreciate it if anyone could help to look at it. Thanks
  4. Hey all, I am writing a php-gtk app and I am reading a xml file in to represent the users todo list. My problem is i can read the file in fine, but i do not know how to change the xml file when the user changes part of it.. here is a little bit of code.. function create_tree()     {     //------------------load the tasks ------------------         $toDoList = simplexml_load_file('list2.xml');         //-------------------end loading tasks --------------                 //add some data to the data store         foreach ($toDoList->task as $task)         {         // i add stuff to show it on the screen         }        } ... these code here will allow me to add or append to the xml file $toDoList = simplexml_load_file('list2.xml');             $index = 0;                 foreach ($toDoList->task as $task)         {        $intID = (int)$task->id;         if ($index <= $intID)         {         $index = $intID +1;         }         }             echo $index;             $newTask = $toDoList->addChild('task');             $newTask->addChild('id',$index);     $newTask->addChild('done', 0);     $newTask->addChild('toDo', $toDo);     $newTask->addChild('priority',$priority);     $newTask->addChild('date',$dateString);     file_put_contents('list2.xml',$toDoList->asXML()); But what i am really hoping for is to be able to edit the xml file so when the user clicks done on a certain task I can write that to xml . Would appreciate any ideas or directions on where to go. Kind regards, Sso
  5. totally agree koobi.. i have always been stuck on the  graphics and reporting portion of my php web apps.. but now no more Its good stuff
  6. Hello all, After a little bit more googling, i found this http://wiki.svg.org/Server_Configuration:Apache and its basically but and paste on the httpd.conf and it works now. If anyone wants info on how to setup php + firebird + pdf + svg + apache, leave a note. thanks again, sso The correct updated httpd.conf file is also attached here [attachment deleted by admin]
  7. Hello all, Long time reader of this forum, first time poster. I apologise before hand on the noobiness of my questions. I have searched and seem unable to find the answers that I am looking for. I am trying to write an in-house reporting tool for our manufacturing database which uses firebird. I am currently using php + firebird + pdf + apache and everything is great so far. I would like to add svg as our internal computers are all running linux with firefox browsers. This will mean that I am able to generate graphs using SVG that can be embeded into the page. I have looked around a bit on google and is able to get apache to show svg and I am even able to get firefox to show a php generate a page which embeds an svg (the svg file is not generated by php such as box.svg) file correctly as well as use php to generate an svg file (box.psvg, this does not load on the page, it asks for an external application). The problem however comes when i am trying to embed a non-static svg file generated by php using the .psvg extension and getting the .psvg to load in the page itself. At the moment I am getting the page with nothing showing up. I am thinking that i might have stuffed up the apache httpd.conf file as i know that firefox is able to embed non-static .psvg file. example : http://www.carto.net/papers/svg/samples/serverside_svg_php.shtml I am running php version 4.39 with apache 1.3.27 as the webserver and client on a pretty stock fedora core 5 system. I have also included the following files from the webserver =================================================== /etc/httpd/conf/httpd.conf =============== box.svg which shows up on firefox box.psvg which firefox loads but not in the browser, instead asking me to open an external application svg.php which is supposed to embed the box.psvg =================================================== I am thinking that it might be the httpd.conf file that I have messed up. Would really appreciate any and all help that can be given. Apologise again if I missed a search or this might not be the right place to ask. regards, sso [attachment deleted by admin]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.