示例#1
0
    $row = $update->trim($row);
    extract($row);
    list(, $year, $month, $day) = $update->preg_match('#([0-9]+)\\-([0-9]+)\\-([0-9]+)#si', $fec_exe);
    $cdate = gmmktime(6, 0, 0, $month, $day, $year);
    $cdate = $cdate > 0 ? $cdate : 0;
    $null = empty($concepto) || strstr(strtolower($concepto), 'nula') || !$nit ? true : false;
    $nit = !$null ? $nit : '0';
    $concepto = !$null ? strtoupper($concepto) : 'ANULADO';
    $insert = array('c_exe' => (int) $exencion, 'c_null' => $null, 'c_date' => (int) $cdate, 'c_nit' => $nit, 'c_text' => $concepto);
    $sql = 'INSERT INTO _constancia' . $db->sql_build_array('INSERT', $insert);
    echo $sql . '<br />';
    //	$db->sql_query($sql);
    $ce++;
    //
    if ($nit) {
        if (!$update->nit_exists($nit, $nombre)) {
            $insert = array('p_nit' => $nit, 'p_name' => $nombre);
            $sql = 'INSERT INTO _prov' . $db->sql_build_array('INSERT', $insert);
            echo $sql . '<br />';
            //			$db->sql_query($sql);
            $cp++;
        }
    }
}
echo 'Exenciones: ' . $ce . ' ---- Proveedores: ' . $cp;
echo '<br /><br /><br />';
//
// Factura
//
foreach ($deleted as $item) {
    $sql = 'SELECT *