// 			<th width='5%'>No.</th>
 // 			<th width='5%'> <input type='checkbox' name='selectAll' id='selectAll' /> </th>
 // 			<th width='5%'> <input type='button' value='+ -' onclick='toggleAll()' class='btn btn-sm'/> </th>
 // 			<th width='85%'>Description</th>
 // 		</tr>
 // 	</thead>
 // 	<tbody>";
 $table = "<div class='panel'><div class='panel-body'><form method='POST' action='adr_dq_custQ_list_export.php' >\n\t\t\t\t\t\t\t\t\t\t\t<table id='resultTable' class='table table-condensed table-hover'>\n\t\t\t\t\t\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<tr class='info'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<th width='5%'>No.</th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<th width='5%'> <input type='checkbox' name='selectAll' id='selectAll' /> </th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<th width='5%'> </th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<th width='85%'>Description</th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t\t\t\t\t\t<tbody>";
 $c = 0;
 $generateButton = "";
 if (mysqli_num_rows($res) > 0) {
     $generateButton = "<input type='submit' name='export' value='Generate Report' class='btn btn-success'/>";
     $c = 1;
     while ($row = mysqli_fetch_array($res)) {
         $formID = $row['adrFormID'];
         $drugStr = getDrugStrByFormID($con, $formID);
         $reacStr = getReactionStrByFormID($con, $formID);
         $adrNo = $row['Adrno'];
         if ($adrNo == "" || $adrNo == NULL || empty($adrNo)) {
             $adrNo = $formID;
         }
         $age = $row['age'];
         if ($age == "NULL") {
             $age = "";
         }
         $ageUnit = getAgeUnitByValue($con, $row['age_unit']);
         $sex = $row['sex'];
         if ($sex == 1) {
             $sex = "Male";
         } else {
             if ($sex == 2) {
 }
 if (!empty($actvIngredient)) {
     $query .= " AND adruglist.actvIngredient LIKE '%{$actvIngredient}%'";
 }
 if (!empty($relatedness)) {
     $query .= " AND adruglist.relatedness = {$relatedness}";
 }
 $res = mysqli_query($con, $query) or die(mysqli_error($con));
 if ($res) {
     $table = "<form method='POST' action='adr_dq_icsr_export.php' >\n\t\t\t\t\t\t\t\t\t<table id='resultTable' class='table table-condensed table-hover'>\n\t\t\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<th width='5%'>No.</th>\n\t\t\t\t\t\t\t\t\t\t\t<th width='5%'> <input type='checkbox' name='selectAll' id='selectAll' /> </th>\n\t\t\t\t\t\t\t\t\t\t\t<th width='5%'> <input type='button' value='+ -' onclick='toggleAll()' class='btn btn-sm' disabled/> </th>\n\t\t\t\t\t\t\t\t\t\t\t<th width='85%'>Description</th>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t\t\t<tbody>";
     $c = 0;
     if (mysqli_num_rows($res) > 0) {
         $c = 1;
         while ($row = mysqli_fetch_array($res)) {
             $formID = $row['adrFormID'];
             $drugStr = getDrugStrByFormID($formID);
             $reacStr = getReactionStrByFormID($formID);
             $adrNo = $row['Adrno'];
             if ($adrNo == "" || $adrNo == NULL || empty($adrNo)) {
                 $adrNo = $formID;
             }
             $age = $row['age'];
             $ageUnit = $row['age_unit'];
             if ($ageUnit == 801) {
                 $ageUnit = "Year";
             } else {
                 if ($ageUnit == 802) {
                     $ageUnit = "Month";
                 } else {
                     if ($ageUnit == 803) {
                         $ageUnit = "Week";