if($cao!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$cao'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$cao'";}
} //===END====$CAO
if($xo!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$xo'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$xo'";}
} //===END====$XO
if($pem101!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$pem101'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$pem101'";}
} //===END====$X101
if($pem102!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$pem102'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$pem102'";}
} //===END====$102
if($pem103!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$pem103'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$pem103'";}
} //===END====$103
if($pem104!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$pem104'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$pem104'";}
} //===END====$104
if($pem105!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$pem105'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$pem105'";}
} //===END====$105
if($pmw101!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$pmw101'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$pmw101'";}
} //===END====$pmw101
if($pmw102!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$pmw102'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$pmw102'";}
} //===END====$pmw102
if($pmw103!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$pmw103'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$pmw103'";}
} //===END====$pmw103
if($p200!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$p200'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$p200'";}
} //===END====$200_1
if($p300!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$p300'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$p300'";}
} //===END====$200_wh
if($p402!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$p402'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$p402'";}
} //===END====$401
//if($tom_ja!=""){
//if($whereQrm==""){$whereQrm=" Where position_qmr.div='$tom_ja'";}
//if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$tom_ja'";}
//} //===END====$402
if($p500!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$p500'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$p500'";}
} //===END====$500
if($p600!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$p600'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$p600'";}
} //===END====$600
if($p701!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$p701'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$p701'";}
} //===END====$701
if($p702!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$p702'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$p702'";}
} //===END====$702
if($p800!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$p800'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$p800'";}
} //===END====$800
if($p900!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$p900'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$p900'";}
} //===END====$p900
if($ci101!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$ci101'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$ci101'";}
} //===END====$ci01
if($pmwxo!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$pmwxo'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$pmwxo'";}
} //===END====$pmwxo
if($cixo!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$cixo'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$cixo'";}
} //===END====$cixo
if($ptd!=""){
if($whereQrm==""){$whereQrm=" Where position_qmr.div='$ptd'";}
if($whereQrm!=""){$whereQrm.=" OR position_qmr.div='$ptd'";}
} //===END====$ptd
"pQmr =". $divSql="Select*from position_qmr $whereQrm";
$divSt=mysql_db_query($db,$divSql);
$s=1;
while($divRow=mysql_fetch_array($divSt)){
"nUserr =". $poSql="Select*from nuke_users Where pn_user_aim='".$divRow['div']."'and pn_user_yim='".$divRow['position']."' order by pn_user_aim ASC " ;
FROM
nuke_users
INNER JOIN useract ON (nuke_users.user_code = useract.user_code)
INNER JOIN record_doc ON (useract.record_code = record_doc.record_code)
Where useract.record_code='$record_code' and useract.useract_pri='$last_useract_pri' and pn_user_aim='$divQmr' and qmr_app='y' and $type_view!='4' order by nuke_users.pn_user_aim ASC ";
record_doc.qmr_app,
record_doc.div_app,
record_doc.doc_type,
record_doc.type,
useract.record_code,
useract.user_code,
useract.useract_act,
useract.useract_date,
useract.useract_time,
useract.useract_pri,
useract.useract_attch,
nuke_users.pn_user_aim
FROM
nuke_users
INNER JOIN useract ON (nuke_users.user_code = useract.user_code)
INNER JOIN record_doc ON (useract.record_code = record_doc.record_code)
Where useract.record_code='$record_code' and useract.useract_pri='$last_useract_pri_ja' and pn_user_aim='$divQmr' and qmr_app='y' and $type_view!='4' order by nuke_users.pn_user_aim ASC ";