Search the Community
Showing results for tags 'simultaneous functions'.
-
Hi, In the below code, each PdfGen2, 3, 4.. function starts only after the previous one ends.. And the result of the previous function comes in 3-4 seconds (it posts some info to a plugin and receives some info back), so it delays a lot when it comes to the 7th or 8th function. How can I make the functions to start at the same time and doesn't require to wait each other to finish their own functions. #Explanation.. This is where the code checks if there is more than 1 pdf. If there is, it sends it to different functions (PdfGen2, PdfGen3..) but the problem is it waits to previous function to be finished and return the necessary stamped new pdf's url. The new function only works after that and each time it takes 2-3 seconds to do that. if ($tarih_sql == true) { $urun_id = $db->VeriCek($Id, 'siparisler', 'urun_id'); $pdf_url = $ykd->PdfGen($Id); $urun_pdf_url2 = $db->VeriCek($urun_id, 'urunler', 'pdf_url2'); if ($urun_pdf_url2 != '') { $pdf_url2 = $ykd->PdfGen2($Id, '0', '2'); $pdf_url_sql .= ", pdf_url2='$pdf_url2'"; } $urun_pdf_url3 = $db->VeriCek($urun_id, 'urunler', 'pdf_url3'); if ($urun_pdf_url3 != '') { $pdf_url3 = $ykd->PdfGen3($Id, '0', '3'); $pdf_url_sql .= ", pdf_url3='$pdf_url3'"; } $urun_pdf_url4 = $db->VeriCek($urun_id, 'urunler', 'pdf_url4'); if ($urun_pdf_url4 != '') { $pdf_url4 = $ykd->PdfGen4($Id, '0', '4'); $pdf_url_sql .= ", pdf_url4='$pdf_url4'"; } $urun_pdf_url5 = $db->VeriCek($urun_id, 'urunler', 'pdf_url5'); if ($urun_pdf_url5 != '') { $pdf_url5 = $ykd->PdfGen5($Id, '0', '5'); $pdf_url_sql .= ", pdf_url5='$pdf_url5'"; } $urun_pdf_url6 = $db->VeriCek($urun_id, 'urunler', 'pdf_url6'); if ($urun_pdf_url6 != '') { $pdf_url6 = $ykd->PdfGen6($Id, '0', '6'); $pdf_url_sql .= ", pdf_url6='$pdf_url6'"; } $urun_pdf_url7 = $db->VeriCek($urun_id, 'urunler', 'pdf_url7'); if ($urun_pdf_url7 != '') { $pdf_url7 = $ykd->PdfGen7($Id, '0', '7'); $pdf_url_sql .= ", pdf_url7='$pdf_url7'"; } $urun_pdf_url8 = $db->VeriCek($urun_id, 'urunler', 'pdf_url8'); if ($urun_pdf_url8 != '') { $pdf_url8 = $ykd->PdfGen8($Id, '0', '8'); $pdf_url_sql .= ", pdf_url8='$pdf_url8'"; } $urun_pdf_url9 = $db->VeriCek($urun_id, 'urunler', 'pdf_url9'); if ($urun_pdf_url9 != '') { $pdf_url9 = $ykd->PdfGen9($Id, '0', '9'); $pdf_url_sql .= ", pdf_url9='$pdf_url9'"; } $urun_pdf_url10 = $db->VeriCek($urun_id, 'urunler', 'pdf_url10'); if ($urun_pdf_url10 != '') { $pdf_url10 = $ykd->PdfGen10($Id, '0', '10'); $pdf_url_sql .= ", pdf_url10='$pdf_url10'"; } $urun_pdf_url11 = $db->VeriCek($urun_id, 'urunler', 'pdf_url11'); if ($urun_pdf_url11 != '') { $pdf_url11 = $ykd->PdfGen11($Id, '0', '11'); $pdf_url_sql .= ", pdf_url11='$pdf_url11'"; } $urun_pdf_url12 = $db->VeriCek($urun_id, 'urunler', 'pdf_url12'); if ($urun_pdf_url12 != '') { $pdf_url12 = $ykd->PdfGen12($Id, '0', '12'); $pdf_url_sql .= ", pdf_url12='$pdf_url12'"; } $urun_pdf_url13 = $db->VeriCek($urun_id, 'urunler', 'pdf_url13'); if ($urun_pdf_url13 != '') { $pdf_url13 = $ykd->PdfGen13($Id, '0', '13'); $pdf_url_sql .= ", pdf_url13='$pdf_url13'"; } $guncelle = $db->Sorgu("Update siparisler Set pdf_url='$pdf_url' $pdf_url_sql Where id='$Id' Limit 1"); $eposta = $db->VeriCek($Id, 'siparisler', 'eposta'); $essiz_id = $db->VeriCek($Id, 'siparisler', 'essiz_id'); $urun_adi = $db->VeriCek($urun_id, 'urunler', 'baslik'); $destek_mail = $db->VeriCek($urun_id, 'urunler', 'destek_mail'); $indir_link = _SiteDomain_.'indir/'.$Id.'/'.$essiz_id.'/'; $mail_kime = $eposta; $mail_kimden = $destek_mail; $mail_konu = 'İndirme Bağlantınız'; $mail_mesaj = ' Alttaki Bağlantıya Tıklayıp Dosyanızı İndirebilirsiniz.<br /><br /> Bağlantı:<br /> <a href="'.$indir_link.'">'.$indir_link.'</a> <br /><br /> Bize '.$destek_mail.' mail adresinden ulaşabilirsiniz. <br /><br /> <b>'.$urun_adi.' Yönetimi</b> '; $mail->Gonder($mail_kime, $mail_konu, $mail_mesaj, $mail_kimden); }