本文整理匯總了PHP中Conectar::Insertar_descripcion方法的典型用法代碼示例。如果您正苦於以下問題:PHP Conectar::Insertar_descripcion方法的具體用法?PHP Conectar::Insertar_descripcion怎麽用?PHP Conectar::Insertar_descripcion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Conectar
的用法示例。
在下文中一共展示了Conectar::Insertar_descripcion方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Conectar
<?php
include_once 'conectar.php';
if (isset($_POST['inp_prod'], $_POST['slt_marca'], $_POST['std_referen'], $_POST['inp_prec'], $_POST['inp_cant'], $_POST['inp_desc_prod'])) {
$conectar = new Conectar();
$id = $_POST['inp_prod'];
$marca = $_POST['slt_marca'];
$refe = $_POST['std_referen'];
$preci = $_POST['inp_prec'];
$canti = $_POST['inp_cant'];
$descrip = $_POST['inp_desc_prod'];
$last_id_descrip = $conectar->Insertar_descripcion($descrip);
$conectar->Insertar_precio($id, $preci);
$exito = $conectar->Insertar_producto($id, $last_id_descrip['last_cod_id'], $marca, $refe, "null", $preci);
//
$last_id_canti = $conectar->Insertar_cantidad($id, $canti);
if (isset($exito['exito'])) {
echo json_encode($exito);
}
}
// actualiza producto
include_once '../models/Productos.php';
if (isset($_POST['nombre'], $_POST['codigo'], $_POST['cost'], $_POST['cant'], $_POST['refe'], $_POST['marc'])) {
$producto = new Productos();
$nomb = $_POST['nombre'];
$codi = $_POST['codigo'];
$cost = $_POST['cost'];
$cant = $_POST['cant'];
$refe = $_POST['refe'];
$marc = $_POST['marc'];
$data = $producto->update_producto($codi, $nomb, $cost, $cant, $refe, $marc);
示例2: Conectar
$conecta = new Conectar();
$inputFileName = 'LISTA_ENERO_2016.xls';
//$objPHPExcel->createSheet()
$objPhpExcel_load = new PHPExcel();
$objPhpExcel_load = PHPExcel_IOFactory::load($inputFileName);
$objWorksheet = $objPhpExcel_load->getActiveSheet(0);
for ($i = 2; $i <= 979; $i++) {
$var = $objWorksheet->getCellByColumnAndRow(0, $i)->getValue();
if ($var != "") {
echo " - " . $i . " - ";
$codigo = trim($objWorksheet->getCellByColumnAndRow(0, $i)->getValue());
$descrip = utf8_encode(trim($objWorksheet->getCellByColumnAndRow(1, $i)->getValue()));
$marca = utf8_encode(trim($objWorksheet->getCellByColumnAndRow(2, $i)->getValue()));
$refer = utf8_encode(trim($objWorksheet->getCellByColumnAndRow(3, $i)->getValue()));
$precio = $objWorksheet->getCellByColumnAndRow(4, $i)->getValue();
$respon1 = $conecta->Insertar_descripcion($descrip);
if (isset($respon1['last_cod_id'])) {
$codi_desc = $respon1['last_cod_id'];
} else {
$select_desc = 'SELECT Descri_id FROM produc_descripcion_ WHERE Descri_nomb = "' . $descrip . '"';
$busc1 = $conecta->consultas($select_desc);
$codi_desc = $busc1["Descri_id"];
//var_dump($codi_desc);
//echo " descuen ".$codi_desc." ";
}
$respon2 = $conecta->Insertar_marca($marca);
if (isset($respon2['last_cod_id'])) {
$codi_marc = $respon2['last_cod_id'];
} else {
$select_marc = 'SELECT Marca_id FROM produc_marca WHERE Marca_nomb = "' . $marca . '"';
$busc2 = $conecta->consultas($select_marc);