Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //...
- $in_field=array('stswaranty','stscontractfull','stscontractsoft','stscontracthard','stsnoncon');
- $in_array=array();
- foreach($in_field as $inf){
- if(!empty($_POST[$inf]))
- $in_array[]=$_POST[$inf];
- }
- $query = "SELECT s.datecreated, c.CustomerName, s.descissue, s.statusjobs, "
- ." s.status, s.dateofissue, s.visitdate, s.picoutlet, s.picoutlettel "
- ."FROM support s "
- ."INNER JOIN customer c ON s.outletid=c.CusID "
- ."WHERE 1=1 "
- .(!empty($_POST['attendedname'])?" AND s.attendedname='{$_POST['attendedname']}'":"")
- .((!empty($_POST['rfromdate']) && !empty($_POST['rtodate']))?" AND s.datecreated BETWEEN '{$_POST['rfromdate']}' AND '{$_POST['rtodate']}'":"")
- .(count($in_array)>0?" AND s.status IN('".implode("','",$in_array)."')";
- $sql=mysql_query($query);
- echo $query;
- //...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement