<?php
    require "commonincludefiles.php";
    
    // Define the display text and their corresponding internal values
    $documentTypes = [
        ["ALL", "ALL"], 
        ["P.B.B.S.C(N)", "4"], 
        ["M.Sc.(N)", "5"]
    ];
    
    // Convert the PHP array to a JavaScript array of arrays
    $str1 = "";
    foreach ($documentTypes as $type) {
        // Properly escape quotes and other special characters
        $displayText = addslashes($type[0]);
        $value = addslashes($type[1]);
        $str1 .= "['" . $displayText . "', '" . $value . "'],";
    }
    $str1 = rtrim($str1, ','); // Remove trailing comma
?>
<script type="text/javascript" language="javascript">
    Ext.namespace('Ext.document');

    // Create the document types array with both display text and internal values
    Ext.document.type = [<?php echo $str1; ?>];
</script>
