build artistworks_models_lookup

<--?php /* if (preg_match('/^SUB1SEM(\S+)$/', $sku, $matches)) { $abbrev = $matches[1]; } else if (preg_match('/^SUB(12|6|3|1)MO(\S+?)(_upsell|BETA|PRE|RAF)?$/', $sku, $matches)) { $abbrev = $matches[2]; } else if (preg_match('/^(\S+?)SUB(1MO2MO|3MO4MO|6MO7MO|12MO13MO)(PROMO_upsell|PROMO|RAF)$/', $sku, $matches)) { $abbrev = $matches[1]; } */ //db_query('TRUNCATE artistworks_models_lookup'); $result = //db_query("select * from artistworks_groups_groups where type='school' and integration='' order by abbreviation"); while ($row = db_fetch_object($result)) { $ab = strtoupper($row->abbreviation); if (in_array($ab, array('JDUS','AWTH','BCSD','DNMS','DSMS','JGMS','MKMS','MMS','SLMS','TEST','TLMS','TLSD','XXXX'))) continue; if ($ab == 'EMSJ') $ab = 'EMSS'; $artist_name = $row->artist_first_name; if ($row->artist_last_name != '-') $artist_name .= ' ' . $row->artist_last_name; if ($artist_name == 'Craig Sarah') $artist_name = 'Craig Chee & Sarah Maisel'; $sql = "INSERT INTO artistworks_models_lookup VALUES(NULL, $row->nid, 0, '$artist_name', 'SUB1SEM$ab"; foreach (array('1','3','6','12') as $dur) { foreach (array('','_upsell','BETA','PRE','RAF') as $suf) { $sql .= ",SUB${dur}MO${ab}${suf}"; } } foreach (array('1MO2MO','3MO4MO','6MO7MO','12MO13MO') as $dur) { foreach (array('PROMO','PROMO_upsell','RAF') as $suf) { $sql .= ",${ab}SUB${dur}${suf}"; } } $sql .= "')"; print "$sql
\n"; //db_query($sql); } ?>