Example #1
0
    function getAssignedJobs($contact_id)
    {
        ob_start();
        $sql = "select * from " . EM_STAFFING . " where contact_id='{$contact_id}'";
        $result = $this->db->query($sql, __FILE__, __LINE__);
        $x = 0;
        $sql_qa1 = "select * from " . EM_QA_CHECK . " where contact_id='{$contact_id}'";
        $result_qa1 = $this->db->query($sql_qa1, __FILE__, __LINE__);
        while ($row_qa1 = $this->db->fetch_array($result_qa1)) {
            $x++;
        }
        $eve_obj = new Event();
        ?>
		<table>
		  <tr>
		    <td colspan="8"><h2>Assigned Jobs</h2></td>
			<td><b>QA</b> <?php 
        echo $this->GetQaErrorRate($contact_id);
        ?>
% error rate over <?php 
        echo $x;
        ?>
 events</td>
		  </tr>
		<?php 
        while ($row = $this->db->fetch_array($result)) {
            $sql_eve = "select * from " . EM_EVENT . " where event_id='{$row['event_id']}'";
            $result_eve = $this->db->query($sql_eve, __FILE__, __LINE__);
            $row_eve = $this->db->fetch_array($result_eve);
            $sql_cert = "select * from " . EM_CERTIFICATION_TYPE . " where certification_id='{$row['type']}'";
            $result_cert = $this->db->query($sql_cert, __FILE__, __LINE__);
            $row_cert = $this->db->fetch_array($result_cert);
            ?>
		  <tr>
		    <td>GEID <a href= "event_profile.php?event_id=<?php 
            echo $row_eve[event_id];
            ?>
"><?php 
            echo $row_eve[group_event_id];
            ?>
</a></td>
			<td>::</td>
			<td><?php 
            echo $row_cert[cert_type];
            ?>
</td>
			<td>::</td>
			<td><?php 
            $eve_obj->start_date($row_eve[event_id]);
            ?>
 - <?php 
            $eve_obj->end_date($row_eve[event_id]);
            ?>
</td>
			<td>::</td>
			<td><?php 
            echo $row_eve[city] . ', ' . $row_eve[state];
            ?>
</td>
			<td>::</td>
			<td>
			<?php 
            $sql_qa = "select * from " . EM_QA_CHECK . " where contact_id='{$this->contact_id}' and event_id='{$row_eve['event_id']}'";
            $result_qa = $this->db->query($sql_qa, __FILE__, __LINE__);
            $row_qa = $this->db->fetch_array($result_qa);
            if ($row_qa) {
                ?>
						<a href="#" onclick="javascript: em.EnterQaReport('<?php 
                echo $row_eve[event_id];
                ?>
','<?php 
                echo $contact_id;
                ?>
',
					{ onUpdate: function(response,root){
							 document.getElementById('div_credential').innerHTML=response;
		  				 	 document.getElementById('div_credential').style.display='';	
						
							var thegrid1 = new drasticGrid('grid1', {						
							path: 'grid_contact_profile_QaReport2.php',
							pathimg: '<?php 
                echo PATHDRASTICTOOLS;
                ?>
img/',
							pagelength:6, 
							addparams:'&col_name=contact_id|event_id&col_value='+<?php 
                echo $contact_id;
                ?>
+'|'+<?php 
                echo $row_eve[event_id];
                ?>
,
							columns: [
								{name : 'quantity',displayname:'Quantity', width:120 },
								{name : 'quantity_incorrect',displayname:'Quantity Incorrect', width:120  },
								{name : 'note',displayname:'Note', width:200 }
							 ]
						});

							 }, preloader: 'prl'
						} ); return false;" >
						<?php 
                echo "&nbsp;&nbsp;" . $row_qa['quantity'] . "&nbsp;Performed &nbsp; :: &nbsp;  " . $row_qa['quantity_incorrect'] . " errors";
                ?>
						</a>
						<?php 
            } else {
                ?>
			<a href="#" onclick="javascript: em.EnterQaReport('<?php 
                echo $row_eve[event_id];
                ?>
','<?php 
                echo $contact_id;
                ?>
',
					{ onUpdate: function(response,root){
							 document.getElementById('div_credential').innerHTML=response;
		  				 	 document.getElementById('div_credential').style.display='';	
						
							var thegrid1 = new drasticGrid('grid1', {						
							path: 'grid_contact_profile_QaReport.php',
							pathimg: '<?php 
                echo PATHDRASTICTOOLS;
                ?>
img/',
							pagelength:6, 
							addparams:'&col_name=contact_id|event_id&col_value='+<?php 
                echo $contact_id;
                ?>
+'|'+<?php 
                echo $row_eve[event_id];
                ?>
,
							columns: [
								{name : 'quantity',displayname:'Quantitye', width:120  },
								{name : 'quantity_incorrect',displayname:'Quantitye Incorrect', width:120  },
								{name : 'note',displayname:'Note', width:200  }
							 ]
						});

							 }, preloader: 'prl'
						} ); return false;" >enter QA Report</a>
				<?php 
            }
            ?>
			</td>
		  </tr>		
		<?php 
        }
        ?>
</table><?php 
        $html = ob_get_contents();
        ob_end_clean();
        return $html;
    }