function setParams($products_id, $param_code)
 {
     use_class('products_minierp');
     $class_pm = new products_minierp();
     if ($param_code == 'M') {
         $param_id_arrays = $class_pm->loadProductMaterials($products_id);
         $field_name = 'material';
     } elseif ($param_code == 'C') {
         $param_id_arrays = $class_pm->loadColorPattern($products_id);
         $field_name = 'color';
     } else {
         $param_id_arrays = array();
         $field_name = '';
     }
     if ($field_name != '') {
         if (count($param_id_arrays) == 0) {
             $sda = array($field_name => '');
             tep_db_perform('jng_sp_catalog', $sda, 'update', "products_id = {$products_id}");
         } else {
             use_class('jng_sp_catalog');
             $class_jc = new jng_sp_catalog();
             $q = tep_db_query("SELECT jng_sp_catalog_id, jng_sp_id FROM jng_sp_catalog WHERE products_id = {$products_id}");
             $sp_list = array();
             while ($row = tep_db_fetch_array($q)) {
                 $sp_list[$row['jng_sp_catalog_id']] = $row['jng_sp_id'];
             }
             foreach ($sp_list as $catalog_id => $jng_sp_id) {
                 $sp_params_raw = $this->load($jng_sp_id, $param_code);
                 $sp_params = array();
                 foreach ($sp_params_raw as $spr) {
                     if (in_array($spr['param_id'], $param_id_arrays)) {
                         $sp_params[] = $spr['param_value'];
                     }
                 }
                 $sda = array($field_name => implode(', ', $sp_params));
                 $class_jc->updateField($catalog_id, $sda);
             }
         }
     }
 }
<?php

#########################################
#  Author  : D3W4 & SAHAT               #
#  Created : Dec 1, 2011 2:33:19 PM     #
#########################################
//IMPORTANT NOTES by Sahat:
//For unknown reason retrieving the navigation will break the module
//on my local development. Most likely due to the broken umlaut data
//being mixed utf8 and htmlspecialchars issue. For now I leave it as
//it is because it's working fine in Live
use_class('Product');
use_class('products_search');
use_class('products_minierp');
use_class('jng_sp_catalog');
$class_jc = new jng_sp_catalog();
$jng_sp_id = 5;
function getDisplay($pid, $spid, $amvd_provision_rate, $row_class = 'o')
{
    global $class_jc;
    $result = '';
    $obj_product = new Product($pid);
    $have_amvd_catalog = $obj_product->isAddedToSalesPartner($spid);
    $is_active = $obj_product->isActiveInSalesPartner($spid);
    $products_image = $obj_product->displayImage(IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1);
    $info = '<div style="margin-bottom:20px;">' . $obj_product->displayIDAndCode() . '</div>';
    $info .= '<div class="w150" style="margin:0 auto;">' . $obj_product->displayRecentSoldTable() . '</div>';
    $navids = array('0' => 'Please select a navigation...');
    $navids_opts = retrieveNavIDs($spid, 'bn');
    foreach ($navids_opts as $n_id => $n_name) {
        //if doesn't work in dev environment, it could be caused by umlauts
$jng_sp_id = '5';
//NEW PROCESS WITH NEW CALC METHOD
use_class('jng_sp_orders');
$class_jo = new jng_sp_orders();
$orders_query = tep_db_query("SELECT jng_sp_orders_id FROM jng_sp_orders WHERE jng_sp_id={$jng_sp_id}");
$orders_count = 0;
while ($row = tep_db_fetch_array($orders_query)) {
    $orders_count++;
    $dataArray = $class_jo->calculateAnalysisData($row['jng_sp_orders_id']);
    $class_jo->saveAnalysisData($dataArray);
}
echo "{$orders_count} Order(s) are Processed";
echo '<br />';
//OLD PROCESS WITH OLD CALC METHOD
use_class('jng_sp_catalog');
$class_jc = new jng_sp_catalog();
$joi = array();
$joi_query = "SELECT joi.*";
$joi_query .= " FROM jng_sp_orders jo";
$joi_query .= " INNER JOIN jng_sp_orders_items joi ON joi.jng_sp_orders_id=jo.jng_sp_orders_id";
$joi_query .= " WHERE jo.jng_sp_id={$jng_sp_id}";
$joi_result = tep_db_query($joi_query);
while ($row = tep_db_fetch_array($joi_result)) {
    if (!isset($joi[$row['products_id']])) {
        $joi[$row['products_id']] = array();
    }
    $joi[$row['products_id']][] = $row;
}
$catalog_update = array();
$catalog = $class_jc->retrieveCatalog($jng_sp_id);
foreach ($catalog as $cat) {
<?php

global $db;
require_once '../confy.php';
require_once '../functions.php';
require_once '../functions-2.php';
tep_db_connect();
$spid = '1';
use_class('jng_sp_catalog');
$class_jc = new jng_sp_catalog();
$class_jc->recalcReplacementDays();
tep_db_close();
<?php

global $db;
require_once '../confy.php';
require_once '../functions.php';
require_once '../functions-2.php';
require_once '../functions-xml.php';
require_once DIR_WS_FUNCTIONS . 'html_output.php';
tep_db_connect();
use_class('jng_sp_catalog');
$class_jsc = new jng_sp_catalog();
$products1_200 = '15047,15075,15077,15085,15211,15216,15217,15249,15253,15254,15257,15259,15260,15261,15264,15265,15269,15270,15271,15272,15274,15281,15284,15285,15288,15289,15290,15291,15292,15293,15294,15295,15297,15300,15301,15302,15303,15306,15308,15313,15314,15315,15319,15320,15321,15322,15325,15326,15332,15333,15347,15348,15352,15355,15356,15357,15363,15364,15365,15366,15368,15370,15371,15372,15373,15374,15375,15376,15380,15384,15388,15389,15393,15394,15407,15409,15410,15413,15416,15418,15419,15423,15424,15434,15435,15436,15437,15440,15444,15445,15446,15496,15506,15510,15625,15631,15632,15637,15640,15642,15646,15647,15650,15672,15682,15685,15961,15964,15967,15969,15971,15973,15974,15976,15977,15980,15984,15985,15986,15987,15988,15993,15994,15995,16001,16004,16007,16012,16015,16019,16027,16028,16029,16030,16099,16100,16101,16103,16274,16276,16279,16285,16292,16306,16308,16312,16313,16335,16410,16411,16412,16419,16423,16428,16429,16433,16537,16538,16540,16543,16574,16575,16577,16578,16579,16581,16583,16584,16585,16586,16587,16589,16591,16592,16593,16600,16606,16646,16652,16653,16655,16656,16658,16664,16667,17427,17428,17529,17530,17532,17535,17541,17542,17543,17544,17602,17777,17780,17781,17834';
$products201_400 = '17835,17838,17839,17945,17950,17956,17958,17960,17961,17963,17964,17965,17976,17981,17986,17999,18011,18014,18016,18022,18024,18025,18028,18029,18035,18041,18122,18124,18125,18131,18215,20908,20909,20910,20913,21090,21092,21093,21104,21173,21176,21182,21204,21288,21289,21309,21392,21393,21394,21395,21397,21398,21399,21400,21404,21407,21695,21774,21776,21777,21779,21793,21795,21796,22020,22021,22498,23038,23186,23188,23189,23190,23191,24011,24016,24017,24021,24022,24070,24071,24072,24074,24084,24237,24294,24295,24843,24847,24848,24850,25429,25584,25622,25623,25670,25673,25677,25678,25681,25685,25688,25691,25859,25903,26269,26270,26271,26272,26273,26274,26275,26277,26278,26283,26285,26290,26292,26295,26296,26300,26365,26366,26374,26375,26378,26381,26384,26386,26387,26390,26391,26438,26442,26449,26495,26550,26551,26556,26558,26559,26562,26563,26566,26568,26569,26571,26576,26580,26582,26583,26587,26665,26666,26669,26675,26677,26680,27017,27025,27035,27036,27037,27038,27046,27058,27065,27074,27096,27107,27117,27128,27252,27261,27271,27634,27636,27639,27685,27761,27762,27763,27764,28027,28030,28032,28033,28035,28038,28114,28207,28209,28211,28274,28653,28724,28725,28727,28728,28729,28730';
$products401_600 = '28731,28732,28733,28735,28736,29053,29057,29058,29063,29064,29067,29158,29162,29169,29173,29175,29237,29238,29242,29243,29244,29245,29263,29332,29335,29336,29337,29339,29341,29343,29344,29345,29348,29360,29361,29363,29366,29367,29373,29374,29375,29376,29378,29455,29456,29458,29460,29464,29467,29472,29473,29475,29479,29668,29671,29672,29674,29675,29676,29678,29818,29819,29828,29836,29837,29838,29839,29841,29842,29961,29966,29970,30301,30303,30305,30306,30317,30319,30320,30328,30330,30389,30403,30409,30412,30413,30414,30416,30418,30627,30632,30738,30741,30742,30888,30890,30891,30904,30905,30906,30909,31280,31316,31440,31545,31857,31859,31875,32315,32323,32324,32328,32330,32331,32336,32558,32561,32563,32914,32934,33058,33059,33063,33227,33296,33647,33649,33650,33652,33654,33656,33657,33660,33672,33884,33904,34352,34354,34356,34357,34359,34360,34469,35162,35166,35167,35316,35466,35472,35596,35605,35613,35616,35617,37458,37755,37757,37758,37759,38673,38832,38834,39008,39009,39627,39631,39637,40675,40676,40679,40682,40825,40828,41356,41271,41275,41286,41291,41293,41294,41295,41296,41297,41299,41348,41349,41355,41357,41358,41688,41689,41690,41691,41743,41744,41808,41810,41813,41815,41825';
$products601_1100 = '41826,41834,41835,41836,41837,41838,41839,42050,42169,42170,42171,42172,42175,42178,42182,42183,42184,42186,42188,42191,42405,42855,42860,42929,42930,42932,42933,42943,43110,43111,43114,43128,43445,43459,43464,43465,43466,43468,43469,43470,43472,43473,43476,43478,43479,43480,43482,43484,43489,43491,43494,43495,43563,43573,43574,43580,43587,43608,43609,43610,43611,43613,43614,43684,43691,43697,43700,43702,43703,43704,43705,43707,43723,43725,43780,43781,43782,43783,43784,43785,43786,43787,43788,43789,43792,43793,43795,43797,43799,43800,43801,43803,43806,43807,43883,43887,43888,43893,43902,44097,44099,44100,44101,44104,44117,44118,44119,44120,44181,44182,44191,44267,44268,44320,44321,44322,44323,44326,44328,44589,44592,44593,44594,44596,44688,44690,44692,44694,44893,44895,44896,44899,44902,45063,45065,45067,45081,45094,45175,45178,45179,45181,45185,45186,45189,45190,45201,45331,45332,45333,45340,45344,45347,45348,45349,45350,45358,45361,45363,45366,45372,45403,45412,45424,45703,45740,45743,45826,45828,45834,45852,45853,45856,45865,46415,46417,46418,46419,46420,46421,46590,46437,46493,46494,46495,46496,46497,46500,46502,46542,46546,46548,46604,46751,46753,46778,46783,46789,46844,46846,46848,46858,46862,46901,46905,46918,46944,46946,47193,47194,47209,47211,47212,47213,47214,47223,47296,47299,47300,47301,47302,47304,47306,47308,47310,47313,47315,47320,47333,47339,47345,47463,47469,47477,47478,47480,47481,47484,47488,47489,47490,47492,47498,47501,47556,47558,47561,47562,47563,47564,47566,47567,47568,47569,47570,47571,47716,47718,47720,47858,47859,47966,47971,47985,47991,47992,47996,47997,47998,47999,48127,48129,48130,48135,48185,48189,48190,48196,48201,48202,48207,48209,48210,48211,48215,48280,48281,48291,48301,48302,48306,48308,48310,48391,48392,48399,48402,48453,48459,48460,48461,48621,48631,48636,48792,48787,48793,48795,48798,48799,48800,48858,48870,48880,48886,48941,48943,48944,48945,48950,48986,48987,48990,48994,49222,49229,49246,49278,49363,49366,49384,49385,49386,49387,49388,49389,49390,49392,49393,49394,49440,49446,49447,49448,49451,49452,49453,49457,49460,49461,49462,49463,49611,49615,49672,49674,49675,49676,49677,49733,49734,49743,49750,49754,49767,49768,49770,49844,49848,49849,49853,49858,49860,49863,49864,49865,49866,49867,49868,49877,49897,49908,49915,49916,50053,50119,50160,50162,50165,50167,50169,50170,50207,50209,50220,50221,50222,50223,50224,50225,50226,50227,50228,50274,50275,50276,50289,50297,50300,50302,50304,50305,50308,50309,50312,50313,50314,50315,50321,50322,50324,50326,50327,50328,50329,50330,50332,50333,50334,50347,50352,50357,50361,50388,50449,50450,50452,50453,50454,50455,50456,50460,50463,50464,50465,50468,50469,50470,50471,50473,50474,50477,50482,50484,50489,50494,50496,50497,50504,50506,50513,50553,50554,50558,50559,50565,50572,50573,50581,50589,50629,50631,50632,50644,50647,50649,50650,50742,50747,50748,50751,50753,50769,50780,50783,50786,50798,50799,50802,50803,50913,50917,50965,50966,50970,50971,50972,50981,50983,50984';
$products1101_1600 = '50986,50987,51000,51002,51004,51012,51016,51050,51052,51054,51055,51057,51058,51059,51067,51073,51081,51083,51085,51091,51093,51146,51149,51152,51212,51213,51214,51215,51216,51217,51218,51219,51220,51221,51222,51223,51224,51225,51226,51227,51228,51229,51230,51231,51234,51308,51309,51310,51311,51312,51313,51314,51315,51316,51318,51321,51324,51325,51331,51332,51336,51375,51378,51380,51381,51383,51388,51390,51430,51431,51442,51443,51444,51446,51453,51454,51455,51458,51462,51465,51483,51489,51492,51494,51496,51497,51551,51553,51554,51555,51556,51557,51558,51559,51560,51561,51562,51568,51569,51571,51572,51573,51574,51575,51579,51581,51582,51583,51585,51587,51588,51589,51590,51592,51627,51630,51631,51632,51635,51637,51640,51643,51645,51646,51648,51650,51651,51659,51819,51820,51821,51824,51843,51844,51845,51846,51847,51848,51849,51850,52041,52484,52485,52490,52491,52493,52503,52536,53255,53256,53257,53258,53259,53260,53261,53262,53263,53264,53265,53268,53269,53270,53271,53273,53274,53276,53277,53278,53322,53323,53325,53326,53327,53328,53329,53330,53331,53343,53350,53352,53359,53403,53409,53416,53459,53464,53472,53473,53474,53475,53478,53480,53481,53488,53502,53507,53508,53513,53515,53525,53526,53540,53610,53634,53635,53641,53719,53720,53721,53723,53724,53727,53728,53729,53731,53732,53735,53737,53741,53742,53743,53744,53748,53749,53752,53753,53756,53763,53764,53765,53766,53767,53769,53770,53771,53772,53773,53818,53819,53820,53821,53823,53824,53827,53830,53833,53837,53838,53840,53843,53846,53847,53851,53852,53853,53854,53857,53858,53954,53993,54004,54016,54020,54039,54040,54043,54044,54047,54048,54049,54056,54060,54063,54065,54067,54070,54071,54075,54076,54077,54078,54079,54080,54082,54083,54087,54089,54103,54105,54107,54112,54118,54119,54120,54124,54125,54126,54127,54128,54130,54132,54133,54138,54139,54148,54187,54188,54197,54200,54202,54205,54207,54208,54209,54213,54214,54215,54216,54217,54218,54219,54228,54233,54234,54235,54280,54301,54304,54305,54306,54307,54308,54321,54323,54328,54329,54343,54352,54354,54363,54364,54365,54366,54369,54370,54371,54372,54391,54393,54395,54402,54410,54452,54462,54451,54413,54414,54420,54427,54435,54445,54446,54512,54526,54527,54529,54533,54535,54536,54537,54539,54540,54549,54551,54567,54570,54571,54583,54590,54600,54631,54633,54648,54649,54652,54676,54679,54680,54681,54686,54688,54696,54698,54700,54703,54704,54706,54707,54709,54751,54761,54771,54773,54775,54777,54797,54798,54799,54801,54803,54804,54806,54812,54814,54816,54817,54819,54822,54826,54829,54831,54842,54847,54856,54864,54865,54868,54873,54878,54894,54895,54896,54897,54898,54899,54900,54901,54902,54904,54909,54963,54964,54970,54977,54979,54984,54985,54992,54998,55004,55005,55010,55016,55017,55019,55022,55023,55024,55092,55094,55142,55169,55174,55231,55238,55244,55245,55246,55247,55248,55249,55250,55251,55252,55253,55254,55257,55258,55260,55261,55262,55263,55267,55273,55274,55281,55282,55283,55284,55285,55286,55287,55288,55289,55290,55291,55293,55294,55295,55296';
$products1601_2100 = '55298,55299,55301,55302,55336,55340,55354,55357,55363,55367,55372,55383,55384,55387,55388,55390,55393,55394,55399,55400,55401,55402,55403,55406,55411,55412,55413,55418,55421,55425,55426,55428,55429,55430,55431,55434,55437,55438,55439,55440,55441,55442,55443,55448,55449,55450,55453,55454,55455,55463,55464,55465,55466,55467,55470,55471,55474,55475,55476,55477,55478,55479,55480,55482,55484,55485,55486,55487,55488,55489,55490,55492,55493,55509,55510,55512,55514,55515,55534,55539,55542,55551,55556,55557,55558,55559,55561,55562,55563,55565,55567,55570,55571,55573,55574,55575,55576,55577,55582,55583,55596,55602,55609,55611,55615,55616,55619,55620,55635,55639,55643,55644,55647,55650,55668,55669,55672,55673,55674,55675,55678,55679,55680,55681,55682,55683,55684,55688,55690,55691,55692,55693,55694,55695,55701,55703,55704,55705,55706,55707,55709,55712,55713,55716,55717,55718,55719,55720,55721,55728,55741,55779,55790,55804,55805,55806,55810,55811,55812,55814,55815,55825,55826,55836,55862,55864,55871,55879,55881,55890,55898,55899,55902,55909,55911,55913,55919,55920,55923,55924,55928,55929,55930,55931,55948,55966,55972,55974,55978,55979,55984,55988,55994,55997,55999,56001,56003,56004,56012,56013,56014,56017,56019,56020,56025,56031,56065,56066,56071,56074,56080,56082,56092,56099,56102,56119,56123,56130,56141,56169,56172,56173,56174,56195,56196,56197,56285,56287,56289,56329,56348,56349,56359,56365,56392,56427,56435,56440,56522,56536,56538,56548,56552,56554,56555,56560,56565,56567,56574,56578,56579,56599,56604,56636,56637,56638,56639,56642,56649,56666,56707,56718,56751,56772,56812,56819,56820,56822,56824,56925,56940,56945,56957,56973,56999,57003,57004,57014,57074,57092,57093,57106,57150,57156,57157,57158,57159,57167,57169,57179,57282,57283,57335,57336,57337,57338,57420,57426,57429,57430,57431,57441,57443,57444,57446,57536,57550,57553,57564,57576,57586,57589,57593,57594,57595,57617,57619,57624,57625,57629,57637,57650,57693,57695,57697,57703,57705,57706,57707,57708,57719,57728,57730,57737,57787,57794,57796,57801,57812,57820,57822,57824,57835,57836,57837,57840,57847,57868,57876,57882,57917,57929,57932,57933,57935,57936,57938,57940,57941,57942,57943,57944,57946,57949,57952,57953,57975,57983,57992,57993,57996,57997,57999,58001,58007,58013,58016,58025,58026,58035,58036,58038,58068,58078,58081,58088,58089,58091,58114,58149,58156,58157,58162,58167,58173,58200,58205,58233,58236,58244,58287,58288,58294,58297,58300,58301,58304,58328,58348,58355,58405,58457,58459,58471,58472,58474,58483,58484,58485,58486,58490,58491,58494,58497,58498,58499,58500,58501,58502,58520,58522,58527,58536,58537,58540,58583,58587,58588,58589,58593,58603,58604,58605,58607,58608,58618,58622,58624,58625,58630,58640,58635,58655,58677,58679,58680,58683,59083,58691,58697,58699,58706,58708,58710,58713,58716,58721,58723,58724,58725,58726,58727,58733,59080,58753,58764,58765,58766,58772,58779,59120,58802,58813,58822,58828,59107,58831,58850,58853,58871,58872,58874,58876,58895,58914,58915,58916,59290,58927,58930';
$products2101_2600 = '58931,59126,58950,58951,58955,58956,58962,58966,58967,58969,58970,58971,58972,58973,58974,58975,58976,59115,58987,58989,58992,58995,58996,58998,59000,59008,59012,59014,59101,59100,59091,59105,59042,59044,59049,59051,59052,59085,59056,59058,59121,59060,59112,59122,59123,59124,59127,59132,59139,59140,59142,59144,59154,59157,59158,59173,59174,59175,59176,59177,59179,59180,59181,59182,59183,59187,59188,59192,59194,59196,59201,59202,59204,59209,59210,59212,59227,59228,59230,59235,59238,59247,59248,59249,59250,59251,59259,59260,59265,59268,59270,59271,59272,59276,59283,59291,59301,59307,59314,59321,59323,59330,59332,59340,59341,59342,59343,59344,59345,59347,59350,59351,59352,59353,59354,59355,59356,59357,59358,59359,59361,59363,59365,59366,59367,59369,59370,59371,59372,59373,59380,59386,59390,59396,59397,59399,59400,59401,59402,59403,59404,59405,59409,59410,59413,59420,59421,59424,59425,59426,59436,59437,59446,59447,59490,59494,59495,59496,59500,59505,59506,59507,59515,59531,59533,59534,59535,59536,59537,59546,59547,59691,59556,59560,59561,59562,59563,59565,59566,59572,59574,59575,59576,59579,59583,59588,59592,59593,59611,59612,59687,59619,59620,59621,59622,59625,59626,59628,59634,59636,59659,59661,59663,59671,59676,59689,59677,59686,59698,59710,59716,59717,59718,59720,59726,59736,59738,59739,59746,59747,59764,59766,59767,59776,59777,59778,59804,59805,59808,59810,59811,59812,59813,59814,59821,59833,59835,59857,59837,59841,59842,59849,59850,59866,59867,59870,59871,59872,59873,59876,59900,59901,59905,59907,59908,59909,59910,59913,59926,59942,59949,59954,59963,59970,59972,59973,59975,59976,59977,59983,59992,59993,59994,59995,59998,59999,60002,60003,60004,60005,60012,60013,60037,60045,60051,60065,60066,60067,60070,60071,60079,60084,60086,60088,60089,60091,60093,60094,60095,60096,60098,60099,60102,60103,60111,60112,60117,60118,60119,60123,60124,60125,60126,60127,60129,60138,60140,60141,60144,60148,60153,60156,60157,60159,60160,60164,60168,60174,60176,60178,60190,60192,60195,60198,60199,60200,60201,60202,60209,60213,60214,60220,60222,60232,60233,60243,60249,60250,60251,60252,60253,60254,60255,60256,60257,60265,60266,60269,60276,60277,60278,60279,60281,60282,60292,60293,60294,60299,60300,60301,60306,60315,60318,60319,60321,60323,60326,60327,60342,60352,60365,60386,60387,60391,60394,60396,60397,60398,60403,60405,60406,60408,60409,60413,60414,60415,60416,60418,60429,60430,60431,60432,60449,60451,60452,60456,60490,60480,60483,60486,60488,60496,60514,60527,60528,60529,60530,60531,60532,60533,60534,60541,60548,60549,60556,60563,60574,60575,60578,60579,60586,60588,60592,60594,60595,60596,60597,60608,60609,60614,60615,60625,60626,60629,60633,60634,60636,60639,60647,60648,60650,60652,60654,60655,60656,60658,60659,60660,60663,60664,60667,60669,60673,60677,60678,60681,60682,60683,60684,60685,60689,60690,60691,60692,60693,60698,60699,60722,60721,60703,60704,60706,60707,60708,60709,60710,60711,60712,60713,60715,60716,60717,60718,60719,60731,60739,60736,60737,60740,60741';
$products2601_3100 = '60744,60746,60763,60766,60767,60768,60769,60771,60774,60779,60782,60783,60801,60804,60805,60818,60821,60825,60828,60830,60832,60833,60834,60836,60837,60838,60839,60841,60843,60845,60850,60851,60854,60855,60856,60857,60858,60859,60860,60862,60865,60866,60867,60868,60869,60870,60871,60872,60873,60876,60877,60878,60879,60880,60881,60882,60883,60884,60885,60886,60887,60896,60906,60910,60914,60915,60916,60917,60923,60949,60950,60953,60955,60956,60957,60960,60971,60972,60973,60979,60981,60983,60986,60988,61002,61004,61005,61007,61010,61024,61025,61030,61031,61033,61036,61222,61221,61040,61041,61049,61053,61054,61067,61068,61069,61095,61101,61102,61111,61113,61115,61116,61121,61123,61124,61127,61133,61137,61138,61139,61142,61143,61144,61148,61149,61150,61151,61183,61194,61196,61198,61204,61208,61212,61214,61215,61216,61218,61219,61220,61231,61232,61235,61239,61241,61242,61243,61247,61248,61251,61252,61256,61257,61258,61259,61261,61262,61263,61264,61265,61266,61269,61275,61276,61277,61279,61287,61288,61289,61290,61294,61295,61303,61306,61307,61308,61310,61311,61314,61315,61318,61319,61326,61335,61337,61338,61339,61340,61348,61350,61358,61359,61361,61362,61366,61376,61371,61379,61381,61435,61439,61445,61451,61323,61480,61481,61483,61503,61495,61441,61450,61599,61608,61616,61612,61723,61702,61740,61670,61732,61750,61713,61751,61753,61764,61765,61754,61677,61571,61794,61793,61850,61885,61888,61875,61634,61842,61478,61915,61917,61936,61974,61970,62037,62038,62012,61922,62024,62009,62052,62093,62069,62094,61968,62021,62095,62126,62127,62129,62125,62119,62140,62151,62149,62163,62176,62183,62197,62200,62201,62202,62204,62205,62206,62208,62209,62210,62214,62213,62212,62216,62217,62236,61972,62282,62283,62317,62318,62322,62265,62266,62368,62378,62388,62383,62408,62409,62457,62446,62351,62452,62482,62497,62503,61973,62522,62528,62529,62530,62507,62460,62413,62447,62511,62512,62513,62515,62516,62548,62547,62560,62559,62566,61971,62592,61454,61455,62590,62563,62599,62596,61472,62600,62606,62608,62620,62615,62625,62656,62668,62671,62672,62673,62674,62675,62670,62652,62651,62694,62701,62688,62712,62710,62723,62722,62721,62720,62602,62717,62718,62635,62735,62747,62763,62778,62782,62802,62639,62815,62818,62798,62812,62820,62794,62830,62839,62842,62862,62833,62878,62889,62894,62891,62903,62896,62915,62922,62913,62912,62917,62926,62925,62934,62936,62942,62941,62944,62957,62973,62969,62921,63007,63005,62983,63014,63016,63011,63015,63023,63026,63069,63066,63032,63037,63039,63038,63048,63091,63089,63097,63114,63103,63119,63120,63109,63111,63126,63135,63033,63143,61413,63154,63163,63169,63184,63142,63170,63216,63189,63193,63220,61659,61660,61839,62078,62079,63179,63214,63224,63228,62995,63260,63258,63208,63218,62711,62709,62708,62669,62699,62444,62292,62276,62275,62256,62226,62224,61957,61782,61784,61636,61560,63219,61490,61473,63271,61355,61843,61844,61845,62552,63272,63274,62272,61899,63294,63299,63304,63342,63336,63223,63345,63344,63326,63351,63367,53962,63372,63384,63390';
$products3101_3600 = '63392,63391,62453,62454,62827,62764,62567,62003,62002,63402,63331,63422,63406,63407,63396,63434,63432,63440,63448,63449,63460,63458,63478,63469,63470,61570,63507,63513,62304,62554,63547,63549,63559,63542,63543,63567,63569,63579,62611,62610,62612,63593,63618,63598,63597,63145,63675,63613,63654,63655,63641,62901,63725,63693,63759,63753,63781,63782,63714,63807,63846,63873,63793,63795,63825,63584,63929,63930,63924,63871,62982,63842,63838,62089,63595,63923,63963,64040,64014,63882,63880,63879,63876,63877,63993,63996,63950,63951,64033,64065,64048,64046,64120,64056,64055,64057,64123,64124,64173,64185,64213,64207,64199,64217,63410,64205,63927,64241,63445,64259,64246,64267,63385,64273,64283,64177,64082,64085,64308,64294,64342,64332,64340,64335,64355,63303,64313,64314,64316,64102,63587,63589,64396,64397,64384,64378,64403,64399,64372,64406,64415,64401,64427,64441,64418,64421,64437,64457,64439,64470,64468,63610,64497,64503,64517,64520,64526,64566,64551,64537,64598,63594,63244,64591,64601,64588,51926,64613,64622,63278,64633,64652,64632,64630,64644,64643,64542,64663,64669,64665,63256,64676,64707,64704,64705,62897,64711,64713,64736,64743,64744,64746,64737,64747,64755,64762,64794,64776,64792,64784,64785,64786,64789,63463,64769,53874,53936,53937,64864,64865,64901,64919,64924,64926,62791,64856,64959,64960,64968,64969,64974,64977,64978,64997,64941,64994,65001,65016,65039,65041,65043,65047,65015,65014,65049,64990,64992,65073,65080,65095,65102,65105,65098,65097,65107,65135,65130,65136,65146,64602,65009,64319,64318,64317,64323,64324,64325,64326,65186,65251,65257,65252,65341,65304,65335,65351,65265,65266,65319,65426,63280,65440,65443,65447,65451,65423,65396,65455,65466,64593,65471,65472,65492,65261,65262,65495,65506,65508,65530,65531,65541,65544,64846,65557,65578,65577,65572,65573,65583,65646,65233,65253,65650,65631,65635,65642,65641,65648,65614,65706,65712,65714,65731,65735,65740,65741,65700,65759,65491,65782,65555,64671,64772,65850,65855,65490,64670,65806,65812,65870,65904,65929,65854,61722,65959,65910,65957,65970,66004,65321,65322,65320,66036,66038,66043,66044,65961,65962,66014,66015,66019,66051,66064,66070,66072,66086,66087,66088,66091,64125,66092,66094,66099,66110,65777,66114,64787,66115,66117,66118,66121,65972,66131,66133,66134,66113,66109,66098,66156,66161,66167,66169,66173,66174,66178,66198,66199,66214,66216,66219,66224,66242,66250,66252,66255,66260,66261,66269,66270,66271,66272,66282,66287,66289,66315,66331,66343,66333,66375,66379,66387,66409,66411,66420,66421,65746,65748,65747,66429,66432,66436,66438,66440,66439,66442,66443,66444,66445,66463,66470,66476,66480,66481,66500,66503,66528,66530,66541,66542,66545,66546,66549,66550,66551,66562,66578,66581,66583,66608,61566,62895,66634,66635,66644,66646,66647,66655,66659,62155,66666,66430,66668,66680,66683,66685,66688,66619,66691,66693,66694,66152,66700,66709,65232,66714,66728,66730,66734,66737,66748,66771,61744,66775,66777,66778,66780,66793,66794,66795,66796,63187,66806,66811,66813,66815,66816,66817,66818,62420,66822';
$products3601_4100 = '66826,66828,66830,66831,66832,66834,63734,66853,66854,66855,66861,66878,66891,66892,66909,66911,66918,66929,66930,66933,62553,64002,66942,65558,51056,51090,53324,53955,53956,53957,53958,53960,53961,53963,53964,53994,53995,53996,54000,54001,54003,54007,54279,55209,58629,60637,60638,61385,61386,61393,61408,61410,61420,61425,61427,61440,61446,61456,61458,61468,61487,61493,61494,61496,61497,61498,61500,61501,61502,61504,61506,61507,61508,61509,61512,61521,61580,61533,61534,61543,61594,61555,61564,61586,61598,61602,61603,61604,61605,61606,61607,61611,61623,61662,61694,61704,61705,61706,61712,61733,61734,61739,61747,61759,61787,61792,61796,61806,61809,61814,61815,61816,61817,61852,61853,61854,61857,61862,61863,61864,61874,61876,61880,61884,61886,61904,61916,61918,61919,61946,61950,61952,61962,61969,61988,61997,62005,62006,62007,62014,62017,62023,62025,62029,62042,62043,62045,62053,62068,62081,62082,62087,62101,62102,62110,62112,62122,62124,62128,62135,62137,62141,62152,62156,62164,62168,62169,62171,62182,62184,62196,62199,62203,62207,62211,62215,62218,62220,62253,62254,62261,62271,62284,62287,62300,62305,62306,62308,62333,62367,62380,62382,62404,62407,62416,62417,62418,62445,62478,62490,62491,62502,62504,62505,62506,62514,62517,62520,62527,62555,62562,62564,62587,62589,62598,62614,62618,62634,62645,62655,62667,62719,62740,62741,62742,62743,62744,62745,62746,62750,62755,62765,62772,62773,62775,62776,62793,62797,62799,62804,62805,62806,62832,62836,62838,62844,62845,62847,62855,62863,62864,62875,62877,62879,62880,62892,62902,62914,62920,62933,62935,62939,62945,62946,62956,62958,62960,62961,62967,62968,62978,62984,62989,63004,63008,63010,63012,63017,63018,63019,63022,63024,63029,63073,63042,63044,63045,63049,63052,63053,63055,63063,63065,63070,63074,63075,63076,63077,63080,63082,63085,63090,63092,63093,63094,63105,63106,63118,63121,63125,63136,63139,63151,63159,63162,63166,63173,63178,63183,63201,63207,63213,63215,63217,63225,63226,63227,63245,63250,63252,63253,63254,63257,63261,63262,63266,63284,63290,63305,63307,63308,63310,63313,63329,63339,63341,63346,63347,63348,63350,63354,63356,63362,63363,63364,63365,63370,63371,63373,63398,63399,63405,63408,63428,63433,63437,63441,63443,63444,63450,63451,63452,63453,63471,63472,63473,63476,63477,63491,63492,63493,63494,63495,63502,63504,63506,63512,63536,63537,63539,63540,63541,63546,63553,63566,63568,63580,63581,63592,63596,63599,63600,63601,63602,63607,63614,63615,63623,63624,63625,63629,63634,63635,63636,63639,63646,63648,63650,63651,63652,63656,63658,63659,63661,63662,63663,63664,63678,63686,63696,63702,63706,63720,63724,63730,63733,63737,63738,63743,63748,63752,63758,63761,63810,63815,63817,63831,63832,63833,63834,63852,63860,63861,63862,63863,63884,63891,63898,63922,63925,63958,63962,63964,63997,63998,64001,64004,64005,64006,64013,64021,64023,64031,64032,64034,64039,64043,64045,64064,64080,64081,64091,64098,64103,64104,64105,64106,64107,64109,64111,64117,64118,64119,64128,64149,64172,64174,64178,64179,64180';
$products4101_4600 = '64182,64188,64190,64191,64196,64198,64204,64206,64214,64238,64239,64244,64245,64254,64266,64270,64280,64275,64281,64286,64287,64290,64302,64368,64370,64334,64336,64339,64341,64352,64354,64357,64358,64364,64374,64375,64382,64412,64413,64428,64436,64438,64443,64450,64454,64456,64461,64467,64476,64479,64481,64487,64498,64499,64500,64501,64502,64508,64529,64550,64569,64573,64575,64576,64578,64580,64583,64587,64600,64620,64621,64625,64627,64629,64631,64640,64651,64655,64662,64668,64672,64673,64675,64677,64678,64679,64694,64715,64716,64730,64733,64734,64741,64750,64753,64754,64756,64757,64758,64763,64765,64767,64775,64781,64782,64812,64818,64829,64830,64831,64836,64848,64858,64859,64861,64872,64878,64891,64909,64910,64912,64913,64914,64916,64917,64918,64921,64922,64923,64929,64939,64986,64953,64955,64956,64957,64958,64961,64962,64963,64964,64966,64970,64996,64973,64975,64981,64998,65000,65003,65004,65005,65031,65032,65036,65037,65038,65040,65042,65044,65053,65054,65061,65063,65065,65076,65077,65078,65079,65084,65085,65086,65087,65088,65089,65090,65091,65093,65094,65534,65109,65114,65128,65129,65132,65133,65134,65145,65165,65166,65187,65188,65200,65208,65241,65254,65285,65300,65301,65313,65325,65337,65340,65356,65358,65373,65386,65387,65389,65393,65394,65395,65397,65398,65399,65400,65402,65489,65405,65409,65434,65444,65446,65452,65457,65458,65462,65467,65468,65470,65475,65480,65485,65496,65497,65505,65509,65521,65523,65524,65525,65526,65536,65537,65543,65550,65556,65559,65566,65575,65576,65579,65581,65587,65590,65591,65593,65752,65602,65606,65607,65608,65609,65611,65612,65616,65618,65620,65621,65628,65630,65634,65753,65647,65757,65676,65679,65694,65701,65702,65705,65716,65726,65732,65738,65739,65751,65776,65783,65785,65791,65793,65794,65795,65804,65831,65832,65845,65846,65853,65857,65859,65862,65909,65925,65922,65912,65919,65921,65926,65927,65931,65937,65967,65968,65969,65978,65998,66042,66003,66017,66018,66040,66050,66058,66061,66079,66100,66130,66132,66139,66140,66149,66153,66155,66160,66172,66186,66197,66238,66239,66247,66268,66273,66286,66290,66293,66316,66320,66414,66427,66428,66435,66437,66458,66477,66499,66501,66502,66504,66514,66539,66597,66624,66627,66630,66642,66643,66645,66702,66703,66704,66732,66740,66742,66776,66779,66800,66827,66845,66958,66974,66984,66781,66985,66988,66991,66994,67003,67013,67015,67018,67029,67031,66756,67033,67045,67048,67049,67051,67057,67069,67078,67080,67086,67089,67091,67092,67093,67094,67098,67047,66797,67106,67107,67116,67117,67118,67125,67129,67134,67135,67144,67146,67083,67152,67153,67155,67157,67160,67161,67162,67164,67190,67223,67226,67230,67231,67232,67235,67256,67259,67263,67273,67275,67280,67281,67284,67286,67288,67295,67298,67300,67301,67302,67316,67317,67318,67319,67321,67324,67328,67331,67332,67340,67369,67370,67371,67372,67389,67415,67417,67419,67423,67426,67436,67441,67442,67445,67450,67461,67471,67474,67476,67480,67482,67484,67485,67490,67494,67496,67497,67502,67503,67518,67521,67523,67524,67537,67538';
$products4601_5100 = '67545,67547,67548,67549,67551,67552,67555,67556,67557,67559,67563,67564,67565,67568,67588,67603,67604,67605,67609,67624,67636,67662,67667,67719,67720,67729,67733,67777,67779,67781,67795,67798,67812,67840,67850,67851,67853,67854,67930,67932,67933,67940,67956,67985,67987,68024,68031,68032,68037,68041,68061,68073,68074,68076,68082,68088,68096,68103,68107,68109,68104,68173,68175,68177,68178,68180,68184,68185,68201,68210,68213,68225,68227,68233,68262,68263,68264,68266,68269,68270,68272,68274,68275,68276,68277,68286,68291,68313,68315,68321,68327,68330,68339,68346,68348,68350,68351,68352,68359,68361,68385,68386,68397,68417,68420,68421,68422,68423,68425,68426,68427,68428,68429,68430,68431,68438,68440,68451,68457,68463,68464,68482,68484,68506,68510,68511,68534,68532,68538,68539,68548,68550,68556,68565,68572,68573,68571,68578,68589,68600,68588,68602,68603,68604,68605,68606,68607,68608,68609,68610,68611,68614,68615,68616,68618,68619,68620,68621,68622,68624,68625,68628,68633,68638,68640,68653,68658,68673,68679,68356,68730,68486,68742,68779,68783,68789,68790,68791,68796,68797,68798,68799,68802,68803,68804,68805,68806,68817,68823,68824,68825,68826,68828,68829,68830,68831,68832,68833,68834,68372,68837,68843,68847,68848,68849,68851,68853,68859,68860,68861,68865,68866,68868,68864,68869,68870,68871,68873,68890,68889,68885,68904,68907,68918,68932,68978,68979,68984,68991,68988,69001,69003,69012,69018,69004,69033,69041,69040,69049,69055,69056,69058,69052,69097,69099,69100,69107,69109,69110,69111,69112,69115,69123,69124,69125,69126,69131,69127,69132,69141,69142,69151,69161,69164,69165,69168,69170,69187,69188,69191,69196,69216,69230,69231,69232,69233,69237,69234,69240,69241,69246,69247,69254,69256,69259,69260,69262,69263,69264,69266,69271,69272,69275,69285,69291,69292,69293,69295,69297,69294,69308,69309,69310,69317,69322,69323,69338,69335,69339,69344,69354,69357,69359,69364,69365,69366,69369,69371,69379,69385,69388,69392,69397,69398,69401,69414,69415,69418,69422,69425,69426,69427,69428,69429,69432,69435,69327,69290,69448,69451,69452,69453,69460,49228,69462,69463,69464,69466,69477,69481,69484,69485,69487,69488,69490,69489,69494,69495,69496,69497,69498,69499,69501,69509,69520,69522,69523,69524,69525,69526,69534,69547,69548,69549,69552,69556,69559,69566,69570,69572,69571,69578,69583,69516,69590,69605,69609,69613,69616,69617,69611,69619,69625,69627,69630,69631,69633,69634,69637,69636,69505,69649,69651,69652,69671,69678,69679,69681,69682,69685,69692,69712,69713,69715,69716,69718,69720,69721,69722,69727,69728,69729,69733,69734,69735,69736,69737,69739,69742,69743,69744,69745,69746,69750,69751,69749,69752,69753,69757,69758,69759,69766,69783,69784,69785,69782,69786,69787,69789,69797,69798,69796,69802,69805,69808,69809,49232,63575,66412,67567,67571,67718,67910,67916,68292,69811,69814,69818,69821,69823,69824,69820,69827,69828,69826,69831,69832,69833,69835,69836,69837,69838,69839,69840,69843,69842,69860,69861,69862,69863,69879,69880,69882,69883,69884,69886,69888,69890,69885,69899';
$products5101_5600 = '69901,69902,69904,69905,69909,69913,69914,69915,69917,69918,69921,69923,69928,69930,69931,69932,69933,69934,69941,69946,69947,69948,69949,69951,69953,69955,69956,69959,69968,69981,69982,69988,69995,69996,70003,70004,70006,70009,70011,70015,70024,70025,70035,70047,70075,70076,70077,70080,70081,70082,70079,70084,70086,70087,70088,70085,70091,70092,70093,70094,70100,70112,70115,70122,70123,70124,70126,70131,70132,70130,70133,70134,70135,70137,70142,70143,70144,70145,70146,70157,70158,70163,70164,70166,70168,70176,70173,70180,70181,70184,70185,70183,70186,70191,70193,70194,70196,70197,70198,70200,70202,70201,70210,70211,70213,70214,70215,70216,70217,70221,70229,70235,70236,70234,70237,70238,70239,70241,70240,70258,70259,70260,70264,70266,70268,70269,70274,70275,70276,70277,70273,70280,70283,70284,70287,70289,70290,70291,70298,70300,70302,70303,70295,70306,70308,70309,70310,70311,70313,70312,70314,70307,70315,70319,70248,70320,70323,70321,70324,70327,70328,70329,70333,70335,70336,70338,70337,70339,70346,70348,70350,70353,70370,70372,70374,70375,70376,70381,70386,70387,70392,70396,70399,70403,70423,70424,70427,70430,70431,70429,70433,70434,70435,70436,70432,70438,70442,70444,70448,70450,70452,70455,70456,70458,70460,70461,70466,70467,70470,70471,70473,70472,70484,70486,70487,70489,70490,70492,70493,70491,70495,70496,70500,70501,70502,70505,70506,70513,70514,70515,70516,70522,70524,70525,70527,70528,70529,70530,70532,70533,70535,70543,70553,70556,70563,70564,70565,70562,70573,70574,70572,70583,70584,70592,70593,70594,70608,70609,70606,70612,70615,70621,70628,70631,70632,70630,70633,70634,70635,70638,70649,70650,70645,70653,70654,70661,70662,70663,70664,70660,70672,70675,70678,70680,70681,70683,70692,70697,70695,70700,70701,70703,70699,70717,70720,70721,70723,70725,70726,70733,70734,70735,70741,70744,70745,70753,70754,70755,70756,70757,70761,70758,70764,70762,70772,70770,70775,70776,70805,70810,70811,70815,70816,70821,70828,70837,70838,70839,70840,70842,70843,70844,70845,70848,70850,70854,70859,70883,70887,70897,70898,70908,70910,70907,70847,70924,70938,70944,70945,70946,70947,70948,70949,70943,70950,70891,70976,70977,70995,70997,71010,71012,71014,71016,71025,71026,71028,71029,71031,71030,71033,71035,71034,71036,71037,71039,71040,71038,71042,70890,71027,71056,71067,71068,71071,71072,71073,71076,71080,71084,71085,71104,71105,71107,71123,71124,71130,71137,71142,71145,71146,71147,71144,71148,71149,71150,71163,71165,71170,71191,71197,71198,71199,71211,71212,71213,71214,71215,71217,71224,71230,71229,71243,71244,71246,71257,71258,71259,71271,71272,71273,71276,71277,71278,71270,71283,71285,71288,68579,71289,71290,71291,71295,71296,71312,71331,71335,71354,71355,71357,71359,71366,71369,71387,71388,71391,71389,71392,71396,71397,71399,71402,71419,71420,71421,71422,71423,71424,71425,71430,71433,71434,71429,71435,71438,71439,71454,71455,71456,71457,71458,71460,71468,71471,71472,71473,71474,71573,71574,71575,71576,71577,71580,71581,71590,71592,71625,71642,71643,71652';
$products5601_6100 = '71653,71654,71651,71655,71656,71657,71658,71662,71660,71663,71664,71666,71667,71671,71672,71673,71674,71676,71682,71685,71690,71688,71704,71710,71711,71712,71722,71726,71734,71735,71736,71737,71738,71739,71740,71746,71748,71750,71751,71752,71754,71757,71758,71761,71765,71767,71768,71769,71770,71771,71772,71775,71780,71781,71783,71784,71793,71795,71799,71800,71808,71809,71813,71819,71827,71835,71857,71859,71856,71861,71895,71898,71903,71905,71907,71913,71916,71935,71934,71937,71948,71949,71955,71958,71961,71962,71965,71969,71970,71980,71981,71982,71987,71988,72004,72005,72006,72007,72012,72011,72016,72019,72022,72036,72041,72042,72043,72047,72048,72049,72050,72051,72062,72063,72064,72070,72071,72072,72074,72080,72097,72104,72106,72109,72110,72111,72117,72118,72120,72122,72123,72124,72125,72126,72127,72130,72133,72129,72134,72135,72136,72141,72157,72158,72160,72161,72162,72164,72182,72183,72184,72186,72187,72188,72189,72192,72193,72196,72198,72199,72200,72202,72203,72204,72207,72209,72210,72214,72215,72216,72213,72220,72218,72226,72227,72229,72230,72231,72234,72236,72237,72241,72243,72240,72252,72253,72254,72255,72261,72264,72265,72267,72269,72270,72272,72273,72277,72282,72289,72297,72300,72329,72330,72336,72339,72341,72343,72350,72353,72355,72360,72367,72368,72369,72370,72374,72379,72392,72396,72397,72399,72404,72405,72414,72417,72420,72422,72424,72426,72428,72429,72463,72466,72477,72480,72481,72488,72489,72492,72498,72499,72501,72502,72503,72506,72507,72508,72512,72517,72522,72523,72530,72531,72536,72538,72539,72543,72546,72549,72552,72553,72554,72555,72556,72557,72559,72563,72564,72565,72566,72576,72577,72578,72606,72608,72611,72612,72614,72626,72649,72650,72651,72652,72653,72654,72655,72656,72660,72661,72667,72682,72684,72698,72704,72705,72707,72716,72718,72722,72723,72724,72727,72728,72734,72741,72742,72757,72758,72765,72768,72769,72770,72808,72810,72811,72813,72814,72816,72817,72818,72819,72821,72822,72826,72829,72830,72832,72847,72849,72851,72853,72854,72856,72857,72858,72860,72861,72866,72867,72868,72869,72870,72871,72872,72873,72874,72875,72882,72883,72884,72894,72902,72903,72904,72905,72906,72909,72917,72925,72926,72927,72930,72932,72935,72936,72937,72938,72944,72946,72950,72951,72967,72970,72976,72977,72987,72991,73001,73002,73003,73004,73005,73006,73008,73009,73011,73024,73025,73031,73041,73042,73044,73045,73046,73052,73059,73060,73062,73063,73064,73065,73066,73067,73068,73071,73078,73080,73082,73083,73084,73088,73090,73091,73092,73093,73094,73096,73097,73098,73099,73100,73101,73102,73103,73104,73110,73111,73112,73113,73114,73115,73125,73126,73136,73137,73138,73139,73145,73147,73148,73150,73155,73162,73164,73165,73172,73176,73181,73183,73185,73186,73187,73188,73189,73190,73191,73192,73193,73194,73196,73200,73211,73222,73228,73229,73231,73238,73239,73240,73244,73248,73251,73255,73257,73262,73264,73265,73269,73270,73288,73291,73293,73294,73295,73297,73300,73310,73321,73322,73330,73332,73334,73335,73336,73338,73343,73347,73353,73358,73359';
//$class_jsc->setContentNeedReupload('2', $products5601_6100);
//echo "Done";
$products_swaro_1_200 = '15249,15288,15306,15984,16411,16540,18028,18029,18041,22970,24011,24022,26562,43464,43465,43466,43468,43469,43470,43472,43473,43476,43478,43479,43480,43482,43484,43489,43491,43494,43495,43608,43609,43610,43611,43613,43614,43684,43697,43700,43702,43703,43704,43705,43707,43780,43781,43782,43783,43784,43785,43786,43787,43788,43789,43792,43793,43795,43797,43799,43800,43801,45175,45178,45179,45181,45185,45186,45189,45190,45201,45331,45332,45333,45340,45344,45347,45348,45349,45350,45358,45403,45424,46496,48945,48950,49462,49677,50917,51146,51149,51152,51212,51213,51214,51215,51216,51217,51218,51219,51220,51221,51222,51223,51224,51225,51226,51227,51228,51229,51230,51231,51234,51308,51309,51310,51311,51312,51313,51314,51315,51316,51318,51321,51324,51325,51331,51332,51336,51375,51378,51380,51381,51383,51388,51390,51430,51431,51462,51551,51553,51554,51555,51556,51557,51558,51559,51560,51561,51562,51568,51569,51571,51572,51573,51574,51575,51579,51581,51582,51583,51585,51587,51588,51589,51590,51592,51650,51824,52041,52484,52485,52490,52491,52493,52503,53255,53256,53257,53258,53259,53260,53261,53262,53263,53264,53265,53268,53269,53270,53271,53273,53274,53276,53277,53278,53322,53323,53324,53325,53326,53327,53328,53329,53330,53331,53459,53464,53472,53473,53474,53475,53480,53481,53488,53502,53507,53508,53515,53525,53526,53540,53610,53635,53641,53719,53720,53723,53724,53727,53728,53729,53731,53732,53735,53737,53741,53743,53744,53748,53749,53752,53753,53756,53763,53764,53765,53766,53767,53769,53770,53771,53772,53773,53833,53837,53838,53840,53843,53846,53847,53851,53852,53853,53854,53857,53858,53874,53936,53937,53954,53955,53956,53957,53958,53960,53961,53962,53963,53964,54004,54007,54016,54047,54049,54056,54060,54063,54065,54067,54070,54105,54148,54187,54188,54197,54200,54202,54205,54207,54208,54209,54213,54214,54215,54216,54217,54218,54219,54228,54233,54234,54235,54321,54323,54328,54329,54343,54352,54354,54363,54364,54391,54393,54395,54402,54410,54452,54462,54451,54435,54445,54446,54512,54526,54527,54529,54533,54535,54536,54537,54539,54540,54549,54551,54567,54570,54571,54583,54676,54679,54680,54681,54686,54688,54700,54703,54704,54706,54707,54709,54771,54773,54775,54777,54797,54798,54799,54801,54803,54804,54806,54812,54814,54816,54817,54819,54822,54826,54829,54831,54847,54856,54864,54865,54868,54894,54895,54896,54897,54898,54899,54900,54901,54902,54904,55245,55246,55247,55248,55249,55250,55251,55252,55253,55254,55257,55258,55260,55261,55262,55263,55267,55273,55274,55281,55282,55283,55284,55285,55286,55287,55288,55289,55290,55291,55293,55294,55295,55296,55298,55299,55301,55302,55336,55340,55357,55363,55367,55429,55492,55556,55557,55558,55559,55561,55562,55563,55565,55571,55573,55574,55575,55576,55678,55679,55680,55681,55682,55683,55684,55688,55690,55691,55692,55693,55694,55695,55701,55703,55704,55705,55706,55707,55709,55712,55930,55966,55999,56001,56003,56004,56065,56066,56071,56074,56080,56082,56130,56195,56196,56197,56283,56285,56287,56289,56440,56565,56642,56707';
$class_jsc->setContentNeedReupload('2', $products_swaro_1_200);
echo "Swaro Done";
<?php

if (!class_exists('jng_sp')) {
    use_class('jng_sp');
    $class_sp = new jng_sp();
    use_class('jng_sp_catalog');
    $class_jc = new jng_sp_catalog();
    use_class('products_brand');
    $class_pb = new products_brand();
    $jng_sp_id = tep_db_prepare_input($_GET['sp']);
    $products_id = tep_db_prepare_input($_GET['id']);
    $sp_info = $class_sp->retrieveDetail($jng_sp_id);
    $catalog = $class_jc->retrieveDetail(null, $jng_sp_id, $products_id);
    $title = "Total VC Prediction";
}
$SCENARIO_STEP_MARGIN = 3;
$SCENARIO_STEP_PRICE = 5;
$SCENARIO_STEP_RETURN_RATE = 10;
$cat_query = "SELECT p.products_image";
$cat_query .= ", MAX(jo.order_date) AS latest_date";
$cat_query .= ", IFNULL(AVG(joi.price), 0) AS selling_price";
$cat_query .= ", IFNULL(SUM(joi.order_quantity),0) AS total_sold";
$cat_query .= ", IFNULL(SUM(joi.return_quantity),0) AS total_returns";
$cat_query .= ", IFNULL(SUM(joi.order_quantity-joi.return_quantity),0) AS total_net_sold";
$cat_query .= ", IFNULL(SUM((joi.order_quantity-joi.return_quantity)*joi.net_sales),0) AS total_net_sales";
$cat_query .= ", IFNULL(AVG(joi.net_sales),0) AS average_net_sales";
$cat_query .= ", IFNULL(SUM((joi.order_quantity-joi.return_quantity)*joi.material_expenses),0) AS total_material_expenses";
$cat_query .= ", IFNULL(AVG(joi.material_expenses),0) AS average_material_expenses";
$cat_query .= ", IFNULL(SUM(joi.order_quantity*joi.cost_logistic),0) AS total_cost_logistic";
$cat_query .= ", IFNULL(AVG(joi.cost_logistic),0) AS average_cost_logistic";
$cat_query .= ", IFNULL(SUM(joi.order_quantity*joi.cost_distribution),0) AS total_cost_distribution";
<?php

global $db;
require_once '../confy.php';
require_once '../functions.php';
tep_db_connect();
use_class('jng_sp_catalog');
$class_jc = new jng_sp_catalog();
use_class('products_articles');
$class_pa = new products_articles();
use_class('products_ean');
$class_ean = new products_ean();
$jng_sp_id = '1';
$products = $class_jc->retrieveCatalogForUpload($jng_sp_id);
$counter_p = 0;
$counter_a = 0;
foreach ($products as $p) {
    if ($p['products_ean'] == '') {
        $class_ean->attachToProduct($p['products_id']);
        $counter_p++;
    }
    $articles = $class_pa->retrieveList($p['products_id']);
    foreach ($articles as $a) {
        if ($a['length'] != $p['length']) {
            if ($a['products_ean'] == '') {
                $class_ean->attactToArticle($a['products_articles_id']);
                $counter_a++;
            }
        }
    }
    echo '.';
tep_db_connect();
use_class('logger');
$logger = new logger('cron', 'tradebyte-catalog-uploader');
use_class('xml_tools');
use_class('ProductAttribute');
use_class('Category');
use_class('products_minierp');
use_class('products_articles');
use_class('products_materials');
use_class('products_family');
use_class('jng_sp_catalog');
use_class('styles');
$class_pm = new products_minierp();
$class_pa = new products_articles();
$class_pmat = new products_materials();
$class_jc = new jng_sp_catalog();
$class_s = new styles();
$lid = '2';
$materials_name = array();
$materials_list = $class_pmat->retrieveList();
foreach ($materials_list as $mat) {
    //take only materials in german language
    $tmp_mat_name = explode(',', $mat['material_name']);
    $mat_name = trim($tmp_mat_name[0]);
    $materials_name[$mat['products_materials_id']] = $mat_name;
}
/**
 * Function to send message to responsible PIC
 * @global type $TB_CATUPLOAD_ADD_SUPERVISORS
 * @param type $messages
 */
<?php

global $db;
require_once '../confy.php';
require_once '../functions.php';
require_once '../functions-2.php';
tep_db_connect();
use_class('jng_sp_catalog');
$class_jc = new jng_sp_catalog();
$products_ids = explode(',', tep_db_prepare_input($_GET['pids']));
foreach ($products_ids as $pid) {
    $check = tep_db_query("SELECT * FROM products_removed WHERE products_id = '{$pid}'");
    if (tep_db_num_rows($check) == 0) {
        $r_data = array();
        $r_data['products_id'] = $pid;
        $r_data['removed_date'] = date('Y-m-d H:i:s');
        tep_db_perform('products_removed', $r_data);
        $catalog_ids = $class_jc->retrieveProductCatalogIDs($pid);
        foreach ($catalog_ids as $catalog_id) {
            $class_jc->updateField($catalog_id, array('active_status' => '0'));
        }
        tep_db_perform('products', array('products_status' => '0'), 'update', "products_id = '{$pid}'");
        //HIDE FROM JnG SHOWROOM
        echo "Products {$pid} is KILLED succesfully !<br/>";
    }
}
<?php

/**
 * Description of products reupload
 *
 * @author IT TEAM BONOFACTUM
 * @created Jun 2, 2015 11:05:00 AM
 */
use_class('jng_sp_catalog');
use_class('products_search');
$class_ps = new products_search($session_userinfo);
$class_jc = new jng_sp_catalog();
$header = array();
$header['img'] = 'Product';
$header['name'] = 'Info';
$header['prcup'] = 'Reupload Data';
$header['imgup'] = 'Reupload Image';
function loadProductRow($pid, $spid, $pos, $curgroup_id)
{
    global $class_jc, $header;
    use_class('Product');
    $product = new Product($pid);
    $sp_catalog = $class_jc->retrieveCatalog($spid, "jc.products_id = '{$pid}'");
    $cols = array();
    foreach ($header as $hk => $hv) {
        $value = '';
        switch ($hk) {
            case 'img':
                $value .= $product->displayImage(IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1);
                break;
            case 'name':
require_once '../functions.php';
require_once '../functions-2.php';
require_once '../functions-xml.php';
require_once DIR_WS_FUNCTIONS . 'html_output.php';
tep_db_connect();
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;
use_class('jng_sp_catalog');
use_class('jng_sp_upload');
use_class('products_minierp');
use_class('products_articles');
use_class('products_linking');
use_class('jng_sp');
$class_jc = new jng_sp_catalog();
$class_ju = new jng_sp_upload();
$class_pm = new products_minierp();
$class_pa = new products_articles();
$class_pl = new products_linking();
$class_sp = new jng_sp();
$jng_sp_id = '1';
$sp_detail = $class_sp->retrieveDetail($jng_sp_id);
$jng_sp_name = $sp_detail["name"];
$timestamp = date('d.m.Y H:i:s');
$datenow = date('ymd');
$HOURSTART = SP_NECKERMANN_CATUPLOAD_HOURSTART;
$HOUREND = SP_NECKERMANN_CATUPLOAD_HOUREND;
$hour_now = date('H');
//$hour_now = 04;
$max_pid_processed_per_run = 2000;
<?php

/**
 * This module used to manage Product Images
 * @author IT TEAM BONOFACTUM
 * @created Jun 14, 2013 12:32:42 PM
 */
$uploaddir = DIR_WS_IMAGES;
$product_folder = 'products_photos/';
use_class('products_minierp');
use_class('jng_sp_catalog');
$class_pm = new products_minierp();
$class_jc = new jng_sp_catalog();
$max_extra_image = 6;
//maximum image we ever have (for previous extra images in case we have a smaller current settings)
$max_ei_now = 6;
//currently maximum image allowed
//CHECK RULE WIDTH MUST BE 1600px
$minimagewidth = MIN_PRODUCT_IMAGE_WIDTH;
$minimagepurewidth = MIN_PRODUCT_FLAT_WIDTH;
if (strpos($_SERVER['HTTP_REFERER'], 'designs-graphics') !== false) {
    $accessed = CONST_ACCESS_DESIGNS_MANAGEMENT;
}
function createBoxImage($image_label, $image_name, $image_path = '', $current_image = '', $image_png_path = '', $current_image_png = '', $hidden_input = '', $additional = '')
{
    $have_png = false;
    $box_height = 400;
    if ($image_label == 'mi1') {
        $image_label = 'Main Image 1 (Default)';
        $box_height = 480;
    } elseif ($image_label == 'mi2') {
<?php

use_class('products_minierp');
$class_pm = new products_minierp();
use_class('jng_sp_catalog');
$class_jc = new jng_sp_catalog();
use_class('products_brand');
$class_pb = new products_brand();
//AJAX ACTION
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'PRODUCTSLINKADD') {
        $products_id = tep_db_prepare_input($_POST['products_id']);
        $type = tep_db_prepare_input($_POST['link_type']);
        $links_id = tep_db_prepare_input($_POST['links_id']);
        use_class('products_linking');
        $class_pl = new products_linking();
        $added = $class_pl->add($products_id, $type, $links_id, true);
        if (count($added) == 0) {
            $links_id = '!' . $links_id;
        }
        echo utf8_encode($links_id);
        exit;
    }
}
//GET PAGE
$session_page = 'sp-products-links-popup';
$page = 1;
if (isset($_GET['page'])) {
    $page = $_GET['page'];
}
//START TEMPLATE
<?php

use_class('jng_sp');
$class_sp = new jng_sp();
use_class('jng_sp_catalog');
$class_jc = new jng_sp_catalog();
//SP SETTING
salesPartnerCombo();
//GET PAGE
$page = 1;
if (isset($_GET['page'])) {
    $page = $_GET['page'];
}
//SUBMIT ACTION
$keywords = '';
$filter_query = " WHERE jc.jng_sp_id={$jng_sp_id} AND jc.active_status!='1' AND pr.products_id IS NULL";
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'SEARCHPRODUCTS') {
        $keywords = tep_db_prepare_input($_POST['keywords']);
        if ($keywords == '') {
            unset($_SESSION['sp-products-finalize']['keywords']);
        } else {
            $_SESSION['sp-products-finalize']['keywords'] = $keywords;
        }
    } elseif ($_POST['me_action'] == 'UPDATEACTIVESTATUS') {
        //first deactivate all products in the current page
        $all_cids = explode(',', tep_db_prepare_input($_POST['cids']));
        $cids_to_activate = isset($_POST['cb_product']) && is_array($_POST['cb_product']) ? $_POST['cb_product'] : array();
        foreach ($all_cids as $cid) {
            $catalog = $class_jc->retrieveDetail($cid);
            if (in_array($cid, $cids_to_activate)) {
<?php

//WE ARE NOW USING THIS MODULE TO HANDLE MULTIPLE SP (NOT ONLY ZALANDO/ZA.DE)
use_class('Product');
use_class('products_minierp');
use_class('jng_sp');
use_class('jng_sp_catalog');
$class_pm = new products_minierp();
$class_sp = new jng_sp();
$class_jc = new jng_sp_catalog();
//cam be used for adding for other SP as well
if (isset($_GET['jng_sp_id']) && $_GET['jng_sp_id'] > 0) {
    $jng_sp_id = tep_db_prepare_input($_GET['jng_sp_id']);
} else {
    //default is always ZA.DE
    $jng_sp_id = '8';
}
$sp_detail = $class_sp->retrieveDetail($jng_sp_id);
$sp_code = $sp_detail['package_prefix'];
$sp_name = $sp_detail['name'];
$header = array();
$header['img'] = 'Product';
$header['nm w300'] = 'Info';
$header['ps w150'] = 'Pieces Sold';
$header['st w100'] = 'Stock';
$header['act w150'] = 'Add/Remove';
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'ADDALLTOZADE') {
        $pids = explode(',', tep_db_prepare_input($_POST['products']));
        $total_catalog = 0;
        foreach ($pids as $pid) {
<?php

global $db;
require_once '../confy.php';
require_once '../functions.php';
require_once '../functions-2.php';
tep_db_connect();
use_class('jng_sp_catalog');
$class_jc = new jng_sp_catalog();
$jng_sp_id = '1';
$filter_query = " jc.active_status='1' AND jc.products_id IN (621,2744,3103,3116,3118,3361,3511,3516,3691,3731,3781,3977,4063,4295,5333,5497,5583,5948,5987,5989,5995,6030,6375,6575,6885,7131,7668,7957,8002,8045,8062,8083,8137,8293,8403,8416,8604,8696,8888,9262,9519,9614,9615,9879,10370,10769,10898,11052,11088,11192,11233,11542,11649,11847,12109,12216,12268,12269,12309,12473,12474,12706,12838,12968,13233,13528,13694,358,359,951,1031,1109,1129,1157,2770,3099,4378,16468,15820,15815,17379,17338,17209,17179,16759,17329,17619,17723,17638,17639,17762,17302,17085,17340,16704,16392,22808,22465,22735,20258,17792,17595,17474,17157,16451,27307,27304,29061,24618,31332)";
$nm_cat = $class_jc->retrieveCatalog($jng_sp_id, $filter_query);
$new_sp_id = '3';
$copy_counter = 0;
foreach ($nm_cat as $c) {
    $sda = array('description' => $c['description']);
    tep_db_perform('jng_sp_catalog', $sda, 'update', "jng_sp_id={$new_sp_id} AND products_id={$c['products_id']}");
    $update_counter++;
}
echo "{$update_counter} Products is updated.";
echo '<br />';
tep_db_close();
<?php

use_class('jng_sp');
$class_sp = new jng_sp();
use_class('jng_sp_catalog');
$class_jc = new jng_sp_catalog();
//SP SETTING
salesPartnerCombo();
//SUBMIT ACTION
if (isset($_POST['me_action']) && $_POST['me_action'] == 'IMPORTTOCATALOGUE') {
    $products = explode(',', tep_db_prepare_input($_POST['products']));
    $products = implode(',', $products);
    $new_ids = $class_jc->addProduct($jng_sp_id, $products);
    $product_total = count($new_ids);
    $msgtype = $product_total > 0 ? 'green' : 'red';
    $messagebox->add("{$product_total} Products have been added to Catalog", $msgtype);
}
//START TEMPLATE
$content = '';
$content .= '<div class="float-box"><form name="" action="?open=sp-products-import" method="post">';
$content .= '<input type="hidden" name="me_action" value="IMPORTTOCATALOGUE" />';
$content .= '<div>Please type in Product ID seperated by comma:</div>';
$content .= '<div style="margin-top:5px;"><input type="text" name="products" value="" style="width:600px;"/></div>';
$content .= '<div style="margin-top:5px;">';
$content .= '<input type="submit" name="submit" value="Import Products" />';
$content .= '<input type="button" name="cancel" value="Back to Catalog" class="red" onclick="location.href=\'?open=sp-products-finalize\';" />';
$content .= '</div>';
$content .= '</form></div>';
$title = "{$sp_title} Add Multiple Products to Catalog";
use_class('design_draft');
use_class('products_minierp');
use_class('products_articles');
use_class('products_brand');
use_class('element');
use_class('jng_sp');
use_class('jng_sp_catalog');
use_service('color_pattern');
use_class('production_instruction_manual');
use_class('styles');
use_class('design');
$class_pm = new products_minierp();
$class_pa = new products_articles();
$class_pb = new products_brand();
$class_sp = new jng_sp();
$class_jc = new jng_sp_catalog();
$class_cp = new color_pattern();
$class_s = new styles();
$class_d = new design();
$default_SP = array('1', '2', '3');
$target_group['1'] = $NAV_TARGET_GROUP_NMDE;
$target_group['2'] = $NAV_TARGET_GROUP_OTDE;
$colpaterns = $class_cp->retrieveListGrid(SERVICECLIENTCODE, null, LANGUAGEID);
$colpats = $colpaterns['Data'];
function getDetailData($products_id, $type)
{
    global $class_pm, $class_pa, $class_pb, $class_sp, $target_group, $colpats, $class_s;
    $result = array();
    $detail_is_complete = false;
    $r_dt = '';
    switch ($type) {
<?php

use_class('jng_sp');
$class_sp = new jng_sp();
use_class('jng_sp_catalog');
$class_jc = new jng_sp_catalog();
use_class('products_minierp');
$class_pm = new products_minierp();
use_class('products_articles');
$class_pa = new products_articles();
//SUBMIT ACTION
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'UPDATECATALOG') {
        $catalog_id = tep_db_prepare_input($_POST['id']);
        $fieldName = tep_db_prepare_input($_POST['field_name']);
        $fieldValue = tep_db_prepare_input($_POST['field_value']);
        if (strpos($fieldName, '-') === false) {
            $dataArray = array($fieldName => $fieldValue);
            if ($fieldName == 'price') {
                $dataArray['status_price'] = '1';
            }
            $class_jc->updateField($catalog_id, $dataArray);
        } else {
            $data = explode('-', $fieldName);
            if ($data[0] == 'pa') {
                $products_articles_id = $data[2];
                switch ($data[1]) {
                    case 'price':
                        $price = $fieldValue;
                        $price_old = null;
                        break;
Beispiel #20
0
<?php

use_class('jng_sp');
use_class('jng_sp_catalog');
use_class('jng_sp_upload');
use_class('CategoryTop');
use_class('SalesPartner');
$class_sp = new jng_sp();
$class_jc = new jng_sp_catalog();
$class_ju = new jng_sp_upload();
//SP SETTING
salesPartnerCombo();
//GET PAGE
$page = 1;
if (isset($_GET['page'])) {
    $page = $_GET['page'];
}
//SUBMIT ACTION
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'SETSPUPLOADSTATUS') {
        if ($_POST['submit'] == 'Reupload') {
            $upload_sp_id = $_POST['upload_sp_id'];
            header("Location: ?open=sp-catalog-generator&jng_sp_id={$upload_sp_id}&reupload=true");
            exit;
        } else {
            $upload_id = tep_db_prepare_input($_POST['upload_id']);
            $status = $_POST['submit'] == 'Success' ? 'S' : 'F';
            $class_ju->updateStatus($upload_id, $status, $session_userinfo['username']);
            header("Location: ?open=sp-catalog");
            exit;
        }
 * Description of orderscancelation
 *
 * @author IT TEAM BONOFACTUM
 * @created Nov 20, 2013 10:33:28 AM
 */
use_class('logger');
use_class('jng_sp');
use_class('jng_sp_orders');
use_class('jng_sp_download');
use_class('jng_sp_catalog');
use_class('products_minierp');
use_class('products_ean');
$class_sp = new jng_sp();
$class_jo = new jng_sp_orders();
$class_jd = new jng_sp_download();
$class_jc = new jng_sp_catalog();
$class_pm = new products_minierp();
$class_ean = new products_ean();
$whid = WAREHOUSE_ID_PRODUCTS_HAMBURG;
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'UPDATEOVERVIEW') {
        $jng_sp_id = tep_db_prepare_input($_POST['jng_sp_id']);
        $order_date = generateMysqlDateFromGerman($_POST['order_date']);
        $q = "SELECT SUM(joi.order_quantity) AS total_orders";
        $q .= ", SUM(IF(joi.status NOT IN (10,12), joi.order_quantity, 0)) AS total_confirmed";
        $q .= ", SUM(IF(joi.status IN (10,12), joi.order_quantity, 0)) AS total_cancels";
        $q .= " FROM jng_sp_orders jo";
        $q .= " INNER JOIN jng_sp_orders_items joi ON joi.jng_sp_orders_id=jo.jng_sp_orders_id";
        $q .= " WHERE jo.jng_sp_id={$jng_sp_id} AND jo.order_date LIKE '{$order_date}%' AND jo.confirm_status='0'";
        $r = tep_db_query($q);
        $row = tep_db_fetch_array($r);
<?php

//ini_set('display_errors',1); error_reporting(E_ALL);
use_class('logger');
use_class('jng_sp');
use_class('jng_sp_download');
use_class('jng_sp_catalog');
use_class('jng_sp_preorders');
use_class('jng_sp_orders');
use_class('jng_sp_customers');
use_class('products_minierp');
use_class('products_ean');
$class_sp = new jng_sp();
$class_jd = new jng_sp_download();
$class_jc = new jng_sp_catalog();
$class_jo = new jng_sp_orders();
$class_jcust = new jng_sp_customers();
$class_pm = new products_minierp();
$class_ean = new products_ean();
//settings for amazon stock file
$amvd_report_type = array();
$amvd_report_type[] = 'Week-to-Date';
$amvd_report_type[] = 'Yesterday';
$amvd_report_type[] = 'Last Week';
$amvd_report_type[] = 'Month-to-Date';
$amvd_report_type[] = 'Last Month';
$amvd_report_type[] = 'Quarter-to-Date';
$amvd_report_type[] = 'Year-to-Date';
$amvd_report_type[] = 'Last 12 Months';
$default_sp_id = '5';
$download_status_to_generate = 'R';
Beispiel #23
0
<?php

use_class('jng_sp');
$class_sp = new jng_sp();
use_class('jng_sp_catalog');
$class_jc = new jng_sp_catalog();
use_class('products_brand');
$class_pb = new products_brand();
//SP SETTING
salesPartnerCombo();
//GET PAGE
$session_page = 'analysis-vc';
$page = 1;
if (isset($_GET['page'])) {
    $page = $_GET['page'];
}
//FILTER OPTIONS
$keywords = '';
$filter_query = " WHERE jc.jng_sp_id={$jng_sp_id} AND jc.active_date!='0000-00-00 00:00:00'";
if (isset($_POST['nav-filter'])) {
    $navfiltered = tep_db_prepare_input($_POST['nav-filter']);
    if ($navfiltered != '') {
        $_SESSION[$session_page]['nav-filter'] = $navfiltered;
    } else {
        unset($_SESSION[$session_page]['nav-filter']);
    }
} elseif (isset($_SESSION[$session_page]['nav-filter'])) {
    $navfiltered = $_SESSION[$session_page]['nav-filter'];
}
if ($navfiltered != '') {
    $filter_query .= " AND (jc.navigation='{$navfiltered}' OR jc.navigation2 LIKE '%{$navfiltered}%')";
             $nav2 .= ComboBoxneckermannAtNavIDs('s', 'navid0', $product_nav_secondary[0], 'input2');
             $nav2 .= '</td></tr>';
             break;
         case '4':
             //AM.DE
             $nav2 .= '<tr><td>Secondary Nav ID</td><td>';
             $nav2 .= ComboBoxAmazonDeNavIDs('navid0', $product_nav_secondary[0], 'input2');
             $nav2 .= '</td></tr>';
             break;
     }
     $nav2 .= '</table>';
     echo utf8_encode($nav2);
     exit;
 } elseif ($_POST['me_action'] == 'ADDNAV2') {
     use_class('jng_sp_catalog');
     $class_jc = new jng_sp_catalog();
     $type = $_POST['type'];
     $params = $_POST['params'];
     $post_nav2 = $_POST['post_nav2'];
     list($jng_sp_id, $pids) = split(";", $params);
     $products_ids = explode(",", $pids);
     $q = "SELECT jng_sp_catalog_id, navigation2";
     $q .= " FROM jng_sp_catalog WHERE jng_sp_id = '{$jng_sp_id}' AND products_id IN ('" . implode("','", $products_ids) . "')";
     $dbq = tep_db_query($q);
     $navs_updated = '';
     $total_updated = 0;
     while ($r = tep_db_fetch_array($dbq)) {
         $catalog_id = $r['jng_sp_catalog_id'];
         $cur_nav2 = $r['navigation2'];
         $cur_nav2_arr = explode(",", $cur_nav2);
         $new_nav2_arr = explode(",", $post_nav2);
Beispiel #25
0
<?php

use_class('jng_sp');
$class_sp = new jng_sp();
use_class('jng_sp_catalog');
$class_jc = new jng_sp_catalog();
use_class('products_minierp');
$class_pm = new products_minierp();
use_class('products_brand');
$class_pb = new products_brand();
use_class('products_articles');
$class_pa = new products_articles();
//SP SETTING
salesPartnerCombo();
$url_link_path = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
if (isset($_GET['id'])) {
    $product_id = tep_db_prepare_input($_GET['id']);
} elseif (isset($_POST['product_id'])) {
    $product_id = tep_db_prepare_input($_POST['product_id']);
}
//SUBMIT ACTION
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'ADDTOCATALOGUE') {
        $suppliers_products_id = tep_db_prepare_input($_POST['suppliers_products_id']);
        //sp_addProductToCatalog($jng_sp_id, $product_id, $suppliers_products_id);
        $class_jc->addProduct($jng_sp_id, $product_id, $suppliers_products_id);
        header("Location: ?open=sp-product&id={$product_id}");
        exit;
    } elseif ($_POST['me_action'] == 'UPDATECATALOG') {
        $field_id = null;
        $catalog_id = tep_db_prepare_input($_POST['jng_sp_catalog_id']);
use_class('products_minierp');
use_class('products_articles');
use_class('products_brand');
use_class('styles');
use_class('minierp_users');
use_class('production_instruction_manual');
use_class('jng_sp_catalog');
use_class('jng_sp_catalog_params');
use_class('depot_orders');
use_class('elements_stock');
$class_pm = new products_minierp();
$class_pa = new products_articles();
$class_pb = new products_brand();
$class_s = new styles();
$class_mu = new minierp_users();
$class_jc = new jng_sp_catalog();
$class_jcp = new jng_sp_catalog_params();
$class_do = new depot_orders();
$class_es = new elements_stock();
$ebay_name_max_chars = 80;
$ebay_language_id = '2';
function delete_extra_image($pei_id, $pei_name = '')
{
    global $uploaddir;
    $deletion = false;
    $del_image_query = tep_db_query("SELECT * FROM products_extra_images WHERE products_extra_images_id = {$pei_id}");
    $del_image = tep_db_fetch_array($del_image_query);
    $check_double_query = tep_db_query("SELECT * FROM products_extra_images WHERE products_extra_image = '{$del_image['products_extra_image']}'");
    if (tep_db_num_rows($check_double_query) <= 1) {
        if ($pei_name != $del_image['products_extra_image']) {
            $delete_file = $uploaddir . $del_image['products_extra_image'];
<?php

global $db;
require_once '../confy.php';
require_once '../functions.php';
require_once '../functions-2.php';
tep_db_connect();
use_class('jng_sp_catalog');
$class_jc = new jng_sp_catalog();
$jng_sp_id = '1';
$filter_query = " jc.active_status='1'";
$nm_cat = $class_jc->retrieveCatalog($jng_sp_id, $filter_query);
$new_sp_id = '2';
$update_counter = 0;
foreach ($nm_cat as $c) {
    $check_query = tep_db_query("SELECT jng_sp_catalog_id, status_price, price, price_old FROM jng_sp_catalog WHERE jng_sp_id={$new_sp_id} AND products_id={$c['products_id']}");
    if (tep_db_num_rows($check_query) > 0) {
        $check_result = tep_db_fetch_array($check_query);
        $catalog_id = $check_result['jng_sp_catalog_id'];
        if ($check_result['status_price'] == '0' || $check_result['price'] != $c['price'] || $check_result['price_old'] != $c['price_old']) {
            $sda = array();
            $sda['status_price'] = '1';
            $sda['price'] = $c['price'];
            $sda['price_old'] = $c['price_old'];
            $class_jc->updateField($catalog_id, $sda);
            $update_counter++;
        }
    }
}
echo "{$update_counter} Products Price is updated.";
tep_db_close();
<?php

#########################################
#  Author  : D3W4                       #
#  Created : Mar 8, 2010 3:07:30 PM     #
#########################################
global $db;
require_once '../confy.php';
require_once '../functions.php';
require_once '../functions-2.php';
tep_db_connect();
use_class('jng_sp_catalog');
$class_jc = new jng_sp_catalog();
$jng_sp_id = '2';
$product_ids = array();
//$product_ids = '44892,44891,44890,44888,44889,44886,44887,44880,44881,44882,44883,44885,44884,44773,44776,44775,44774,44772,44771,44764,44770,44769,44763,45184,45183,45182,45181,45180,45179,45178,45177,45176,45175,45194,45193,45192,45191,45190,45189,45188,45187,45186,45185,45208,45207,45206,45205,45204,45202,45201,45200,45198,45197,45196,45195,45331,45332,45333,45334,45335,45336,45337,45338,45339,45340,45341,45342,45343,45344,45345,45346,45347,45348,45349,45350,45403,45360,45359,45358,45357,45356,45355,45354,45353,45404,45352,45351,45406,45407,45409,45410,45411,45412,45414,45413,45419,45418,45417,45416,45415,45165,45164,45166,45167,45169,45160,45170,45168,45163,45162,45161,45086,45084,45085,45083,45087,45075,45076,45077,45078,45079,45080,45082,45081,44692,44687,44688,44691,44690,44689,44693,44694,44695,44696,44600,44601,44604,44603,44320,44319,44321,44322,44323,44263,44268,44270,44267,44264,44261,44260,33300,33299,33298,33297,33057,33056,33055,33054,33049,33048,33047,33046,32321,32320,32319,32318,44258,32316,32317,32314,32315';
$product_ids[] = 45361;
$product_ids[] = 45362;
$product_ids[] = 45373;
$product_ids[] = 45372;
$product_ids[] = 45371;
$product_ids[] = 45370;
$product_ids[] = 45369;
$product_ids[] = 45367;
$product_ids[] = 45368;
$product_ids[] = 45366;
$product_ids[] = 45365;
$product_ids[] = 45364;
$product_ids[] = 45363;
$product_ids[] = 44892;
$product_ids[] = 44891;
Beispiel #29
0
/**
 * Flag product for next sp cat reupload to update image
 * @param int or array $products_id
 */
function catalogNeedImageReupload($products_id)
{
    use_class('jng_sp_catalog');
    $class_jc = new jng_sp_catalog();
    $class_jc->imageNeedReupload($products_id);
}
 function copyFromProducts($products_id_to_copied, $products_id_to_applied, $options = '*', $elements_id_to_exclude = '', $skip_same_add_length_composition = false)
 {
     use_class('products_articles');
     $class_pa = new products_articles();
     $have_element_to_exclude = false;
     if ($elements_id_to_exclude != '' && !is_array($elements_id_to_exclude)) {
         $elements_id_to_exclude = explode(',', $elements_id_to_exclude);
         $have_element_to_exclude = true;
     }
     $product = $this->retrieveDetail($products_id_to_copied, 'p,pd,pnc,cat');
     $product_to_applied = $this->retrieveDetail($products_id_to_copied, 'cat');
     $categories_is_same = $product['categories_id'] == $product_to_applied['categories_id'];
     $articles = $class_pa->retrieveList($products_id_to_copied);
     $articles_to_applied = $class_pa->retrieveList($products_id_to_applied);
     $add_length = array();
     $add_length_to_applied = array();
     if (isset($articles) && is_array($articles) && count($articles) > 0) {
         foreach ($articles as $a) {
             $add_length[] = $a['length'];
         }
     }
     if (isset($articles_to_applied) && is_array($articles_to_applied) && count($articles_to_applied) > 0) {
         foreach ($articles_to_applied as $ata) {
             $add_length_to_applied[] = $ata['length'];
         }
     }
     if (!is_array($products_id_to_applied)) {
         $products_id_to_applied = explode(',', $products_id_to_applied);
     }
     if ($options != '*') {
         $options = explode(',', $options);
     }
     //START UPDATE PRODUCT DETAIL TO ALL PRODUCTS WHICH PRODUCT DETAIL IS NOT FILLED
     foreach ($products_id_to_applied as $pid) {
         if ($options == '*' || in_array('cp', $options)) {
             //APPLY COLOR PATTERN
             $cps = $this->loadColorPattern($products_id_to_copied);
             if (count($cps) > 0) {
                 saveColors($pid, implode(',', $cps));
             }
         }
         if ($options == '*' || in_array('b', $options)) {
             //APPLY BRAND
             use_class('products_brand');
             $class_pb = new products_brand();
             $class_pb->updateProductBrand($pid, $product['p']['products_brand_id']);
         }
         if (($options == '*' || in_array('l', $options)) && $categories_is_same) {
             //APPLY LENGTH
             $def_length = $product['pnc']['products_length'];
             $this->saveLength($pid, $def_length, $add_length);
         }
         if ($options == '*' || in_array('eu', $options)) {
             //TODO: CHECK HOW TO ALSO COPY ELEMENTS IF OTHER PRODUCTS STILL DOESN'T HAVE ANY
             //APPLY ELEMENT USED & QTY
             $el_used = $this->retrieveElementsUsage($products_id_to_copied);
             if (count($el_used) > 0) {
                 $elids = array();
                 $elqtys = array();
                 foreach ($el_used as $elid => $el_data) {
                     if ($have_element_to_exclude) {
                         $check_key = array_search($elid, $elements_id_to_exclude);
                         if ($check_key !== false) {
                             continue;
                         }
                     }
                     $elids[] = $elid;
                     $elqtys[] = $el_data['quantity'];
                 }
                 $this->addElementToProducts($pid, $elids, $elqtys);
             }
             //APPLY OVERRIDE ELEMENTS (IF EXISTS) AND HAVE SAME ADDITIONAL LENGTH COMPOSITION
             if (count($add_length) > 0 && $categories_is_same) {
                 $have_same_add_length_composition = true;
                 if (count($add_length) == count($add_length_to_applied)) {
                     foreach ($add_length as $al) {
                         if (!in_array($al, $add_length_to_applied)) {
                             $have_same_add_length_composition = false;
                             break;
                         }
                     }
                 } else {
                     $have_same_add_length_composition = false;
                 }
                 if ($have_same_add_length_composition || $skip_same_add_length_composition) {
                     foreach ($add_length as $length) {
                         $dbq_o = tep_db_query("SELECT * FROM products_articles WHERE products_id = {$products_id_to_copied} AND length = {$length}");
                         $dbq_c = tep_db_query("SELECT * FROM products_articles WHERE products_id = {$pid} AND length = {$length}");
                         if (tep_db_num_rows($dbq_o) > 0 && tep_db_num_rows($dbq_c) > 0) {
                             $r_o = tep_db_fetch_array($dbq_o);
                             $r_c = tep_db_fetch_array($dbq_c);
                             $products_articles_id = $r_c['products_articles_id'];
                             $dbq_ovr = tep_db_query("SELECT * FROM products_articles_use_elements WHERE products_articles_id = {$r_o['products_articles_id']}");
                             while ($r_ovr = tep_db_fetch_array($dbq_ovr)) {
                                 $ovr_elid = $r_ovr['elements_id'];
                                 $dbq_pue_o = tep_db_query("SELECT * FROM products_use_elements WHERE products_use_elements_id = {$r_ovr['products_use_elements_id']}");
                                 $r_pue_o = tep_db_fetch_array($dbq_pue_o);
                                 $dbq_pue_c = tep_db_query("SELECT * FROM products_use_elements WHERE products_id = {$pid} AND elements_id = {$r_pue_o['elements_id']}");
                                 $r_pue_c = tep_db_fetch_array($dbq_pue_c);
                                 $products_use_elements_id = $r_pue_c['products_use_elements_id'];
                                 $ovr_data = array();
                                 if ($have_element_to_exclude) {
                                     $check_key = array_search($r_ovr['elements_id'], $elements_id_to_exclude);
                                     if ($check_key !== false) {
                                         continue;
                                     }
                                 }
                                 $ovr_data['elements_id'] = $r_ovr['elements_id'];
                                 $ovr_data['quantity'] = $r_ovr['quantity'];
                                 $ovr_data['products_articles_id'] = $products_articles_id;
                                 $ovr_data['products_use_elements_id'] = $products_use_elements_id;
                                 $class_pa->overrideElement($products_articles_id, $products_use_elements_id, $ovr_data);
                             }
                         }
                     }
                 }
             }
         }
         if ($options == '*' || in_array('mp', $options)) {
             //APPLY MANUAL PI
             $dbqmp = tep_db_query("SELECT * FROM products_non_configurator pnc WHERE pnc.products_id={$products_id_to_copied}");
             $mpi = tep_db_fetch_array($dbqmp);
             saveManualPI($pid, $mpi['products_instruction']);
         }
         if ($options == '*' || in_array('pl', $options)) {
             //APPLY PRODUCTS LINKING
             use_class('products_linking');
             $class_pl = new products_linking();
             $dbqpl = tep_db_query("SELECT * FROM products_linking WHERE products_id={$products_id_to_copied}");
             while ($r = tep_db_fetch_array($dbqpl)) {
                 $links_id = $r['links_id'];
                 $type = $r['type'];
                 $class_pl->add($pid, $type, $links_id, true);
             }
         }
         if ($options == '*' || in_array('ni', $options)) {
             //APPLY NAVID's
             use_class('jng_sp_catalog');
             $class_jc = new jng_sp_catalog();
             $dbq = tep_db_query("SELECT jng_sp_id, navigation, navigation2, navigation3 FROM jng_sp_catalog WHERE products_id={$products_id_to_copied} ORDER BY jng_sp_id");
             while ($r = tep_db_fetch_array($dbq)) {
                 $nav = $r['navigation'];
                 $nav2 = $r['navigation2'];
                 $nav3 = $r['navigation3'];
                 $class_jc->addProduct($r['jng_sp_id'], $pid);
                 $p_cat = $class_jc->retrieveCatalog($r['jng_sp_id'], "jc.products_id = '{$pid}'");
                 saveCatalog($p_cat[0]['jng_sp_catalog_id'], 'navigation', $nav);
                 saveCatalog($p_cat[0]['jng_sp_catalog_id'], 'navigation2', $nav2);
                 saveCatalog($p_cat[0]['jng_sp_catalog_id'], 'navigation3', $nav3);
             }
         }
     }
 }