Xtremer360 Posted April 21, 2011 Share Posted April 21, 2011 I'm having a hard time getting the masterArray to be formed. http://pastebin.com/XuxBRt5b Quote Link to comment https://forums.phpfreaks.com/topic/234359-arrays/ Share on other sites More sharing options...
Xtremer360 Posted April 21, 2011 Author Share Posted April 21, 2011 For an example of how I'm wanting my final masterArray to look like here it is: http://pastebin.com/e2B5zsFc I'm not getting any errors. Quote Link to comment https://forums.phpfreaks.com/topic/234359-arrays/#findComment-1204532 Share on other sites More sharing options...
Xtremer360 Posted April 25, 2011 Author Share Posted April 25, 2011 I am really hoping someone is willing to take the time to read this post and take a minute to take a look at my code. What is happening is there are some matches for a script I made and then an area for segments during an event. If you notice on the segment part of the form is that there is a dropdown that asks for where in the event that segment needs to go. With the Introduction or the different numbered matches. What I need to happen for a subArray I need it to take the introduction, all the matches, and all the segments and order them accordingly. With the introduction first, the matches in order based off there match number and then the segments in between the introduction or matches based off the user's input. Quote Link to comment https://forums.phpfreaks.com/topic/234359-arrays/#findComment-1205706 Share on other sites More sharing options...
Xtremer360 Posted April 28, 2011 Author Share Posted April 28, 2011 I can't find any syntax for how to sort something with JQuery but here's a description of what I'm wanting to do. 1. Start with the list of matches, in order. Introduction comes first. 2. Sort the segments by segmentOrder first, segmentNum second. 3. Insert each segment after match #(segmentOrder), in the same order. Introduction: type=M, m=I, n=0 Matches: type=M, m=match number, n=0 Segments: type=S, m=segmentOrder, n=segmentNum Sort: 1. m (ascending; I first) 2. type (M first, S second) 3. n (ascending) Before After -------------------- -------------------- I: type=M, m=I, n=0 I: type=M, m=I, n=0 M1: type=M, m=1, n=0 S1: type=S, m=I, n=1 M2: type=M, m=2, n=0 M1: type=M, m=1, n=0 M3: type=M, m=3, n=0 S2: type=S, m=1, n=2 M4: type=M, m=4, n=0 S3: type=S, m=1, n=3 M5: type=M, m=5, n=0 M2: type=M, m=2, n=0 M6: type=M, m=6, n=0 M3: type=M, m=3, n=0 M7: type=M, m=7, n=0 S4: type=S, m=3, n=4 S1: type=S, m=I, n=1 M4: type=M, m=4, n=0 S2: type=S, m=1, n=2 M5: type=M, m=5, n=0 S3: type=S, m=1, n=3 M6: type=M, m=6, n=0 S4: type=S, m=3, n=4 S5: type=S, m=6, n=5 S5: type=S, m=6, n=5 M7: type=M, m=7, n=0 Quote Link to comment https://forums.phpfreaks.com/topic/234359-arrays/#findComment-1207653 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.