function fncDesignComboMultiple($query, $name, $function, $prefix, $suffix, $selected, $error)
{
    include 'app_db_config.php';
    require_once 'dbops.php';
    $MyOps = new DBOps($usr_name, $usr_pwd, $target_db, $target_host);
    $count = 0;
    $combo = "<select multiple id ='" . $name . "' name ='" . $name . "' " . $function . "  class='select2' style='width:275px;'>";
    $combo .= $prefix;
    $res = $MyOps->list_orders($query);
    if ($res) {
        while ($row = mysql_fetch_assoc($res)) {
            $count++;
            if ($selected == $row['id']) {
                $combo .= "<option value='" . $row['id'] . "' selected>" . $row["name"] . " *</option>";
            } else {
                $combo .= "<option value='" . $row['id'] . "'>" . $row["name"] . "</option>";
            }
        }
    }
    $combo .= $suffix . "</select>";
    if ($count == 0) {
        $alert = "<SCRIPT LANGUAGE=\"JavaScript\">Alertify.dialog.labels.ok ='Aceptar';Alertify.dialog.alert('<img src=\\'general_repository/image/stop_48x48.png\\'><b><big>Error en  " . $error . "</big></b>');</SCRIPT>";
        $combo .= $alert . " <img src='general_repository/image/stop_24x24.png'> <font color =red><b>Error en el Selector</b></font>";
    }
    return $combo;
}
Beispiel #2
0
    </script>

</head>
<body>
<table id="usrtable" class="display" cellspacing="0" width="100%">
    <thead><tr>
        <th>EmployeeID</th>
        <th>First Name</th>
        <th>Last Name</th>
        <th>Phone Number</th>
        <th>Street</th>
        <th>City</th>
        <th>State</th>
        <th>Zip</th>
        <th>Last Modified</th>
    </tr></thead>
    <tbody>
    <?php 
include "DBOps.php";
$DB = new DBOps();
$EmployeeList = $DB->GetEmployeeList();
foreach ($EmployeeList as $row) {
    echo "<tr><td>" . $row['EID'] . '</td><td>' . $row['Fname'] . '</td><td>' . $row['Lname'] . '</td><td>' . $row['PhoneNum'] . '</td><td>' . $row['Adr_Street'] . '</td><td>' . $row['Adr_City'] . '</td><td>' . $row['Adr_State'] . '</td><td>' . $row['Adr_Zip'] . '</td><td>' . $row['LastModified'] . "</td></tr>";
}
?>
    </tbody>
</table>
<a href="Menu.php">Go back to the menu</a>
</body>
</html>
<?php

include "app_page.php";
include 'general_repository/php/app_db_config.php';
require_once 'general_repository/php/dbops.php';
$MyOps = new DBOps($usr_name, $usr_pwd, $target_db, $target_host);
$query = "SELECT carnet FROM estudiante order by 1 desc limit 1 ;";
$res = $MyOps->list_orders($query);
if ($res) {
    while ($row = mysql_fetch_assoc($res)) {
        $ultimo_carne = $row["carnet"];
    }
}
$query = " INSERT INTO estudiante ( Nombres, Apellidos, Sexo, FechaNacimiento) \n\t\t\tVALUES ('" . $_POST["nombre"] . "', '" . $_POST["apellido"] . "', '" . $_POST["sexo"] . "', '" . $_POST["fecha"] . "');";
if ($MyOps->insert_to_db($query)) {
    echo "Se Creo";
}