-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.php
49 lines (33 loc) · 1.04 KB
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
require_once('includes/mysql.php');
require_once('includes/mysql_aid_functions.php');
require_once('includes/mail_aid_functions.php');
echo "TEST<br />";
require_once("proc_job/functions.php");
echo get_max("job","job_no","","");
echo create_job_no();
die();
send_test_mail();
die();
$to = '[email protected]';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
if(!mail($to, $subject, $message, $headers)) die("URGS!");
die();
$file = fopen("tickets_unredeemed.csv", "a");
ini_set('max_execution_time', 3*60*60);
$qry = "SELECT * FROM parcel_job_ticket
LEFT JOIN parcel_job
ON parcel_job.job_id = parcel_job_ticket.job_id
WHERE start IS NOT NULL AND end IS NOT NULL AND start <= end AND order_date > '2015-05-18'";
$res = query($qry);
while($item = mysql_fetch_object($res)){
for($i=$item->start;$i<=$item->end;$i++){
$qry = "INSERT INTO parcel_tickets(job_id,type,ticket_no) VALUES({$item->job_id}, '{$item->type}', $i);";
query($qry);
}
}
die()
?>