TABLE rawExp LEFT JOIN chipRun using(exp_id) LEFT JOIN camRun using(chip_id) LEFT JOIN fakeRun using(cam_id) LEFT JOIN warpRun using(fake_id) LEFT JOIN diffInputSkyfile AS diffInput ON diffInput.warp1 = warp_id LEFT JOIN diffRun AS diffInputRun ON diffInput.diff_id = diffInputRun.diff_id LEFT JOIN diffInputSkyfile AS diffTemplate ON diffTemplate.warp2 = warp_id LEFT JOIN diffRun AS diffTemplateRun ON diffTemplate.diff_id = diffTemplateRun.diff_id LEFT JOIN publishRun ON stage_id=diffInput.diff_id AND (client_id=1 OR client_id=5) LEFT JOIN publishRun AS pubRun2 ON pubRun2.stage_id=diffTemplate.diff_id AND (pubRun2.client_id=1 OR pubRun2.client_id=5) LEFT JOIN magicDSRun ON magicDSRun.magic_ds_id=camRun.magicked
TITLE MOPS Status
FILE mopsStatus.php
MENU ipp.imfiles.dat

UNRESTRICTED WHERE 0=1

# OP  OP1   ($ddiff_id > 0 ? $ddiff_id : $tdiff_id)
# OP  OP1   $ddiffId.":".$tdiffId
OP OP1 ($row[8]>$row[9]?$row[8]. "(1)":($row[9]!=0?$row[9]. "(2)":"0"))
# $diffInput.diff_id+$diffTemplate.diff_id
# PUB ID
OP OP2 ($row[12]>$row[13]?$row[12]. "(I)":($row[13]!=0?$row[13]. "(T)":"0"))
#($row[13]>$row[14])

#     field                    width format  name          show         link to                   extras
FIELD dateobs, 		       13,   %T,     Date Obs
FIELD exp_name, 	       5,    %s,     Exp Name
FIELD rawExp.exp_id, 	       5,    %d,     Exp ID
FIELD chipRun.data_group,      5,    %s,     Data grp
FIELD chip_id, 		       5,    %d,     Chip ID (Stage 1)
FIELD camRun.cam_id AS camID, 		       5,    %d,     Cam ID (Stage 2)
FIELD fake_id, 		       5,    %d,     Fake ID (Stage 3)
FIELD warp_id, 		       5,    %d,     Warp ID (Stage 4)
FIELD diffInput.diff_id AS ddiff_id,       5,    %d,     ddiff_id, none
FIELD diffTemplate.diff_id AS tdiff_id,    5,    %d,     tdiff_id, none
FIELD *,		       5,    %s,     Diff ID (Stage 5),		op=OP1
FIELD camRun.magicked, 	       5,    %d,     Magick ID (Stage 6)
FIELD magicDSRun.magic_ds_id,       5,    %d, DestreakID (Stage 7)
FIELD publishRun.pub_id AS pubId1,       5,    %d,     pubId1, none
FIELD pubRun2.pub_id AS pubId2,       5,    %d,     pubId2, none
FIELD *,	     		10, %s, Pub ID, op=OP2
FIELD filter, 		       5,    %s,     Filter
FIELD object, 		       15,    %s,     Object
FIELD obs_mode, 	       5,    %s,     Obs Mode
FIELD comment, 		       40,    %s,     Comment

#FIELD diffInput.diff_id AS ddiffId,       5,    %s,     ddiffId,	none
#FIELD diffTemplate.diff_id AS tdiffId,    5,    %s,     tdiffId, 	none

MODE summary
GROUP rawExp.exp_id
