Batch 6a: application controllers base
This commit is contained in:
57
application/controllers/tools/sas/Wa_task.php
Normal file
57
application/controllers/tools/sas/Wa_task.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
class Wa_task extends MY_Controller
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
function weekly()
|
||||
{
|
||||
$edate = date("Y-m-d");
|
||||
$sdate = date("Y-m-d", strtotime("now - 7 day"));
|
||||
$this->load->library("Wa_sas");
|
||||
|
||||
$phone = "6282113702602-1584412485@g.us";
|
||||
$url_staff = "http://localhost/one-api/tools/sas/chart/staff_group/$sdate/$edate";
|
||||
// echo $url_staff . "\n";
|
||||
$resp = $this->wa_sas->send_image_group(
|
||||
$phone,
|
||||
"Staff: $sdate $edate",
|
||||
$url_staff,
|
||||
"image/png",
|
||||
"staff.png",
|
||||
".png"
|
||||
);
|
||||
if ($resp["code"] != "SUCCESS") {
|
||||
print_r($resp);
|
||||
exit;
|
||||
}
|
||||
$url_all = "http://localhost/one-api/tools/sas/chart/all/$sdate/$edate";
|
||||
$resp = $this->wa_sas->send_image_group(
|
||||
$phone,
|
||||
"Total Hour: $sdate to $edate",
|
||||
$url_all,
|
||||
"image/png",
|
||||
"all.png",
|
||||
".png"
|
||||
);
|
||||
if ($resp["code"] != "SUCCESS") {
|
||||
print_r($resp);
|
||||
exit;
|
||||
}
|
||||
$url_project = "http://localhost/one-api/tools/sas/chart/project_group/$sdate/$edate";
|
||||
$resp = $this->wa_sas->send_image_group(
|
||||
$phone,
|
||||
"Project: $sdate to $edate",
|
||||
$url_project,
|
||||
"image/png",
|
||||
"all.png",
|
||||
".png"
|
||||
);
|
||||
if ($resp["code"] != "SUCCESS") {
|
||||
print_r($resp);
|
||||
exit;
|
||||
}
|
||||
echo "task chart is ok \n";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user