Files
WrenchBoardPromo/app/Controllers/Home.php
T
CHIEFSOFT\ameye 18f5a4bb8f status_message
2024-10-02 12:25:41 -04:00

37 lines
1016 B
PHP

<?php
namespace App\Controllers;
class Home extends BaseController
{
public function index(): string
{
return view('welcome_message');
}
public function promoIndex($promo,$promoOwner=''){
// if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
// echo 'This is a server using Windows!';
// } else {
// echo 'This is a server not using Windows!';
// }
$in["promo"] = $promo;
$in["promo_owner"] = $promoOwner;
$out = $this->APIcall('POST', $this->wrenchApiServer(). 'start',$in);
$out["promo"] = $promo;
$out["promo_owner"] = $promoOwner;
var_dump( $out );
if ( !isset($out) || !isset($out["status_message"]) || $out["status_message"] != "VALID_LINK_FOUND"){
return redirect()->to($out["user_server_name"]);
}
$out["task"] = $this->APIcall('POST', $this->wrenchApiServer(). 'tasks',$in)["result_list"];
return view('welcome_message', $out);
}
}