Exemplo n.º 1
0
function print_sectionSlisting($sectionS, $id, $pp_kod)
{
    if ($sectionS->num_rows == 0) {
        echo "<span class='text-danger'>NO SECTION S REGISTERED</span>";
    } else {
        echo "<table class='table table-striped table-bordered table-hover' cellspacing='0' width='100%'>\n    <thead>\n      <tr class='primary' align='center'>\n        <td>Active Ingredient</td>\n        <td>Manufacturer</td>\n        <td>Salt Form</td>\n        <td>Strength</td>\n        <td>Strength Salt-Free</td>\n        <td>Source</td>\n        <td>Section S</td>";
        // if($id > 0) {
        //     echo "<td><i class='fa fa-check' title='Comply'></i></td>
        //     <td><i class='fa fa-close' title='Not Comply'></i></td>
        //     <td><i class='fa fa-share' title='Escalate'></i></td>
        //     <td>&nbsp;</td>";
        //   }
        echo "</tr>\n    </thead>\n    <tbody>";
        while ($rows = $sectionS->fetch_assoc()) {
            $ras_desc = isEmpty($rows["ras_desc"]);
            $os_sykt = isEmpty($rows["os_sykt"]);
            $rbaj_desc = isEmpty($rows["rbaj_desc"]);
            $pba_kekuatan = isEmpty($rows["pba_kekuatan"]);
            $pba_kekuatan_rstf = isEmpty($rows["pba_kekuatan_rstf"]);
            $rstf_desc = isEmpty($rows["rstf_desc"]);
            $pbs_kod = $rows["pbs_kod"];
            $headerstring = $rows["ras_desc"] . " / " . $rows["os_sykt"] . " / " . $rows["pba_kekuatan"];
            ?>
      <tr align="center">
        <td align="left"><?php 
            echo $ras_desc;
            ?>
</td>
        <td align="left"><?php 
            echo $os_sykt;
            ?>
</td>
        <td><?php 
            echo $rbaj_desc;
            ?>
</td>
        <td><?php 
            echo $pba_kekuatan;
            ?>
</td>
        <td><?php 
            echo $pba_kekuatan_rstf;
            ?>
</td>
        <td><?php 
            echo $rstf_desc;
            ?>
</td>
        <td>
          <?php 
            //if($id > 0) {
            ?>
                <!--<button class="btn btn-primary btn-sm" onclick="evaluateAPI('<?php 
            echo $pbs_kod;
            ?>
','<?php 
            echo $headerstring;
            ?>
','<?php 
            echo $pp_kod;
            ?>
')">View</button></td>-->
              <?php 
            //  }
            //  else {
            ?>
                <button class="btn btn-primary btn-sm" onclick="showAPI('<?php 
            echo $pbs_kod;
            ?>
','<?php 
            echo $headerstring;
            ?>
')">View</button></td>
              <?php 
            //  }
            ?>
        <?php 
            //if($id > 0) {
            ?>
        <!--<td><?php 
            echo countYes($pbs_kod);
            ?>
</td>
        <td><?php 
            echo countNo($pbs_kod);
            ?>
</td>
        <td><?php 
            echo countEscalate($pbs_kod);
            ?>
</td>
        <td><?php 
            echo checkAPI($pbs_kod);
            ?>
</td>-->
        <?php 
            //}
            ?>
      </tr>
      <?php 
        }
        echo "</tbody></table>";
    }
}
Exemplo n.º 2
0
function evaluation($pp_kod)
{
    $sql = "SELECT pbs_kod FROM p_section_s WHERE pba_pp_kod='{$pp_kod}'";
    $result = selQuery($sql);
    $apiResult = 0;
    $apiYes = 0;
    $apiNo = 0;
    $apiEscalate = 0;
    while ($row = mysqli_fetch_assoc($result)) {
        $apiResult = $apiResult + 8;
        $apiYes = $apiYes + countYes($row['pbs_kod']);
        $apiNo = $apiNo + countNo($row['pbs_kod']);
        $apiEscalate = $apiEscalate + countEscalate($row['pbs_kod']);
    }
    if ($apiResult == $apiEscalate + $apiNo + $apiYes) {
        $query = "SELECT protocol_id FROM p_protocol\n              WHERE pp_kod='{$pp_kod}' AND evaluate_e IS NOT NULL";
        if (countRow($query) == 0 && $apiEscalate == 0) {
            $query = "SELECT protocol_id FROM p_protocol\n                WHERE pp_kod='{$pp_kod}' AND evaluate_n IS NOT NULL";
            if (countRow($query) == 0 && $apiNo == 0) {
                ?>
          <button class="btn btn-primary" onclick="sendEvaluate('<?php 
                echo $code;
                ?>
','<?php 
                echo $pp_kod;
                ?>
')"><i class="fa fa-send"></i> Submit</button>
        <?php 
            } else {
                ?>
          <button class="btn btn-primary" onclick="sendRespond('<?php 
                echo $code;
                ?>
','<?php 
                echo $pp_kod;
                ?>
')"><i class="fa fa-comments-o"></i> Correspondence</button>
        <?php 
            }
        }
    }
}