Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $v1 = 1;
- ksort($this->_vendors);
- $combinations = array();
- foreach ($this->_vendors as $val) {
- for ($v2 = $v1; $v2 < sizeof($this->_vendors); $v2++) {
- if (isset($this->_vendors[$v2 + 1])) {
- $this->_updateCombinations(
- array($v1, $v2 + 1),
- $val,
- $combinations
- );
- }
- if (sizeof($this->_vendors) > 3) {
- for ($v3 = $v2; $v3 < sizeof($this->_vendors); $v3++) {
- if (isset($this->_vendors[$v3 + 2])) {
- $this->_updateCombinations(
- array($v1, $v2 + 1, $v3 + 2),
- $val,
- $combinations
- );
- }
- if (sizeof($this->_vendors) > 4) {
- for ($v4 = $v3; $v4 < sizeof($this->_vendors); $v4++) {
- if (isset($this->_vendors[$v4 + 3])) {
- $this->_updateCombinations(
- array($v1, $v2 + 1, $v3 + 2, $v4 + 3),
- $val,
- $combinations
- );
- }
- if (sizeof($this->_vendors) > 5) {
- for ($v5 = $v4; $v5 < sizeof($this->_vendors); $v5++) {
- if (isset($this->_vendors[$v5 + 3])) {
- $this->_updateCombinations(
- array($v1, $v2 + 1, $v3 + 2, $v4 + 3, $v5 + 3),
- $val,
- $combinations
- );
- }
- }
- }
- }
- }
- }
- }
- }
- $v1++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement