本文整理汇总了PHP中bd::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP bd::getInstance方法的具体用法?PHP bd::getInstance怎么用?PHP bd::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bd
的用法示例。
在下文中一共展示了bd::getInstance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: agregarM1
public function agregarM1()
{
// $this->pdf($nomb);
$time = time();
$fecha = date("Y-m-d", $time);
$bd = bd::getInstance();
/*$sql = $bd->ejecutar("INSERT INTO correos_alumno
VALUES('',
'{$this->id_destino}',
'{$this->id_modulo}',
'$fecha',
'{$this->mensaje}',
'0','1')");*/
$bd->ejecutar("INSERT INTO correos (id_Tipo,id_ModuloE,id_Envia,id_Destino,id_ModuloD,id_Recibe,fecha_Envio,Contenido,Estatus) \n\t\t\t\tVALUES({$tipo},{$moduloE},{$envia},{$destino},{$moduloD},{$recibe},current_date(),'{$contenido}',{$estatus})");
if ($sql) {
echo " <script type='text/javascript'>\n\t\t alert('Enviado Correctamente');\n\t\t window.location='../vistas/modulo2/paneladmi.php';\n\t\t </script> ";
} else {
echo " <script type='text/javascript'>\n\t\t alert('Error al Enviar');\n\t\t window.location='../vistas/modulo2/paneladmi.php';\n\t\t </script> ";
}
}
示例2: values
<?php
require '../../config/bd/connect.php';
require '../../config/bd/bd.php';
$bd = bd::getInstance();
$mod = $_GET["id_Modulo"];
$proy = $_GET["proy"];
$alum = $_GET["id_Alumno"];
$sql = "SELECT id_Modulo FROM avancemodulo WHERE id_Alumno ={$_GET['id_Alumno']} and id_Proyecto ={$_GET['proy']} and id_Modulo={$_GET['id_Modulo']}";
$activar = "insert into avancemodulo values({$_GET['id_Modulo']},{$_GET['id_Alumno']},{$_GET['proy']})";
$desactivar = "delete FROM avancemodulo WHERE id_Alumno ={$_GET['id_Alumno']} and id_Proyecto ={$_GET['proy']} and id_Modulo={$_GET['id_Modulo']}";
// echo $sql;
$stmt = $bd->ejecutar($sql);
$i = 0;
while ($resp = mysql_fetch_array($stmt)) {
$i = 1;
break;
}
if ($i == 0) {
$bd->ejecutar($activar);
//echo $activar;
} else {
$bd->ejecutar($desactivar);
//echo $desactivar;
}
$sql = "SELECT id_Modulo FROM avancemodulo WHERE id_Alumno ={$_GET['id_Alumno']} and id_Proyecto ={$_GET['proy']} order by id_Modulo asc";
// echo $sql;
$stmt = $bd->ejecutar($sql);
$modulos = "";
while ($row = mysql_fetch_array($stmt)) {
$modulos .= $row["id_Modulo"] . ",";
示例3: insertar
public function insertar()
{
$id_modulo = $_SESSION['modulo'];
if ($this->asesor == "1") {
$sql = "INSERT INTO alumno\n VALUES ('','{$this->carrera}',\n '{$this->plan}',\n '{$this->depart}',\n '1',\n '{$this->nombre}',\n '{$this->apellido}',\n '{$this->matricula}',\n '{$this->semestre}',\n '{$this->correo}',\n '{$this->pass}',\n '{$this->celular}',\n '{$this->genero}')";
mysql_query($sql);
$sql2 = $bd->ejecutar("INSERT INTO avancemodulo\n VALUES ({$id_modulo},'','0')");
} else {
$sql = "INSERT INTO alumno\n VALUES ('','{$this->carrera}',\n '{$this->plan}',\n '0',\n '{$this->nombre}',\n '{$this->apellido}',\n '{$this->matricula}',\n '{$this->semestre}',\n '{$this->correo}',\n '{$this->pass}',\n '{$this->celular}',\n '{$this->genero}')";
mysql_query($sql);
}
//Funcion que me sirve para obtener el ultimo id que se registro en la tabla alumno
$id = mysql_insert_id();
$bd = bd::getInstance();
$sql2 = $bd->ejecutar("INSERT INTO avancemodulo\n VALUES ({$id_modulo},{$id},'0')");
// mysql_query($sql);
// echo $sql;
// echo mysql_error();
// exit();
$this->insertar2($id);
if ($sql) {
echo " <script type='text/javascript'>\n alert('El registro ha sido guardado correctamente');\n window.location='../vistas/modulo1/sesion.php';\n </script> ";
} else {
echo " <script type='text/javascript'>\n alert('Error al Guardar los datos');\n window.location='../vistas/modulo1/registroAlumno.php';\n </script> ";
}
}
示例4: mensaje
public function mensaje()
{
$id = $_SESSION['id'];
$time = time();
$fecha = date("Y-m-d", $time);
$bd = bd::getInstance();
$sql3 = $bd->ejecutar("INSERT INTO correos_alumno\n \t\t\t\t\t\t\t VALUES ('',{$id},'{$this->modulo}',\n \t\t\t\t\t\t\t \t\t\t'{$fecha}',\n \t\t\t\t\t\t\t \t '{$this->mensaje}',\n \t\t\t\t\t\t\t \t '0',\n \t\t\t\t\t\t\t \t '0')");
//0 para alumno, 1 para administrador
if ($sql3) {
echo " <script type='text/javascript'>\n\t\t\t\t\talert('Mensaje Enviado Correctamente');\n\t\t\t\t\twindow.location='../vistas/modulo1/panelalumno.php';\n\t\t\t\t\t</script> ";
///pendiente de revisar que se corriga este error
} else {
echo " <script type='text/javascript'>\n\t\t\t\t\talert('Mensaje no Enviado');\n\t\t\t\t\twindow.location='../vistas/modulo1/panelalumno.php';\n\t\t\t\t\t</script> ";
}
}
示例5: loginAsesor
public function loginAsesor()
{
$bd = bd::getInstance();
$consulta = $bd->ejecutar("SELECT * FROM asesor\n\t\t\t\t WHERE correo='{$this->user}' AND password='{$this->pass}';");
$dato = $bd->recorrer($consulta);
$sql = $bd->ejecutar("SELECT * FROM priveligos\n\t\t\t\t WHERE id_Privilegio='{$dato['id_Privilegio']}';");
$pri = $bd->recorrer($sql);
if (strtolower($dato['correo']) == strtolower($this->user) and $dato['password'] == $this->pass) {
session_start();
$_SESSION['nameasesor'] = $dato['nombreA'];
$_SESSION['privi'] = $dato['id_Privilegio'];
$_SESSION['id_A'] = $dato['id_Asesor'];
$_SESSION['pri'] = $pri['nombre'];
$_SESSION["autentificado"] = "SI";
header('location: accesoasesor.php');
} else {
header('location:../vistas/asesor/sesion.php');
// header('location: ../vistas/modulo1/paneladmi.php');
}
}