Document (File Name)
I solved the problem. How do you think happened ? Do you have the solution you think of it ?
[SIZE=5]onLoad[/SIZE]
$yol1='C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/_lib/tmp/';
$yol2='C:/Program Files/NetMake/v7/wwwroot/scriptcase/tmp/';
$filelocation_onLoad =$yol2;
$ara_onLoad=(glob($filelocation_onLoad."sc_*_*.txt"));
$toplam_onLoad=count($ara_onLoad);
for ( $say=0 ; $say < $toplam_onLoad ; $say++ )
{
$file_onLoad=$ara_onLoad[$say];
if(file_exists($file_onLoad))
{
unlink($file_onLoad);
echo "<br><br>".$file_onLoad."Silindi <br>";
}
else
{
echo "<script>alert(\"Mantıksal hata oluştu!!\");</script>";
}
}
[SIZE=5]onAfterInsert[/SIZE]
$yol1='C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/_lib/tmp/';
$yol2='C:/Program Files/NetMake/v7/wwwroot/scriptcase/tmp/';
$filelocation_onBeforeInsert = $yol2;
$ara_onBeforeInsert=(glob($filelocation_onBeforeInsert."sc_*_*.txt"));
$toplam_onBeforeInsert=count($ara_onBeforeInsert);
if ($toplam_onBeforeInsert=="1")
{
$file_onBeforeInsert = fopen($ara_onBeforeInsert[0], "r") or exit("Unable to open file!");
//Output a line of the file until the end is reached
while(!feof($file_onBeforeInsert))
{
$satir = fgets($file_onBeforeInsert);
//echo $satir . "<br />";
$esr = trim($satir);
$ad = trim(substr($satir, 0, 5));
$soyad = trim(substr($satir, 5, 9));
$t2_id = {id};
// SQL statement parameters
$insert_table = 't2'; // Table name
$insert_fields = array( // Field list, add as many as needed
'ad' => "'$ad'",
'soyad' => "'$soyad'",
't3_id' => "'$t2_id'"
);
// Insert record
$insert_sql = 'INSERT INTO ' . $insert_table
. ' (' . implode(', ', array_keys($insert_fields)) . ')'
. ' VALUES (' . implode(', ', array_values($insert_fields)) . ')';
sc_exec_sql($insert_sql);
}
$file_onBeforeInsert=$ara_onBeforeInsert[0];
unlink($file_onBeforeInsert);
echo "<script>alert(\"Y?kleme başarılı.\");</script>";
}
elseif($toplam_onBeforeInsert<>"1")
{
for ( $say=0 ; $say < $toplam_onBeforeInsert ; $say++ )
{
$file_onBeforeInsert=$ara_onBeforeInsert[$say];
if(file_exists($file_onBeforeInsert))
{
unlink($file_onBeforeInsert);
echo "<br><br>".$file_onBeforeInsert."Silindi <br>";
}
else
{
echo "<script>alert(\"Mantıksal hata oluştu!!\");</script>";
}
}
echo "<script>alert(\"Aynı anda birden fazla dosya y?klemeye ?alıştınız veya y?klenecek dosyayı se?mediniz. L?tfen tekrar deneyiniz.\");</script>";
die();
}
[SIZE=5]onAfterDelete[/SIZE]
$yol1='C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/_lib/tmp/';
$yol2='C:/Program Files/NetMake/v7/wwwroot/scriptcase/tmp/';
// SQL statement parameters
$delete_table = 't2'; // Table name
$delete_where = "t3_id = '".{id}."'"; // Where clause
// Delete record
$delete_sql = 'DELETE FROM ' . $delete_table
. ' WHERE ' . $delete_where;
sc_exec_sql($delete_sql);
echo "<script>alert(\"Kayıt silindi.\");</script>";
$filelocation_onAfterDelete=$yol2;
$ara_onAfterDelete=(glob($filelocation_onAfterDelete."sc_*_*.txt"));
$toplam_onAfterDelete=count($ara_onAfterDelete);
for ( $say=0 ; $say < $toplam_onAfterDelete ; $say++ )
{
$file_onAfterDelete=$ara_onAfterDelete[$say];
if(file_exists($file_onAfterDelete))
{
unlink($file_onAfterDelete);
echo "<br><br>".$file_onAfterDelete." Silindi <br>";
}
else
{
echo "<br><br>Kayıt Silinmedi !! <br>";
}
}