public function overwriteForm($return, $returnfull) { $return = parent::overwriteForm($return, $returnfull); $appAccount = new AppAccount(); $arrApp = $appAccount->getWhere("app_active = 2"); $as = array(); foreach ($arrApp as $app) { $as[$app->app_id] = $app->app_id . " " . $app->app_name; } $return['camp_app_id'] = new \Leap\View\InputSelect($as, "camp_app_id", "camp_app_id", $this->camp_app_id); $return['camp_client_id'] = new \Leap\View\InputText("hidden", "camp_client_id", "camp_client_id", $this->camp_client_id); // $return['camp_acc_id'] = new \Leap\View\InputTextArea("camp_acc_id", "camp_acc_id", $this->camp_acc_id); $return['camp_start'] = new \Leap\View\InputText("date", "camp_start", "camp_start", $this->camp_start); for ($x = 0; $x < 24; $x++) { if ($x < 10) { $arrs[$x] = "0" . $x . ".00"; } else { $arrs[$x] = $x . ".00"; } } $return['camp_hour'] = new \Leap\View\InputSelect($arrs, "camp_hour", "camp_hour", $this->camp_hour); $return['camp_active'] = new \Leap\View\InputSelect($this->arrayYesNO, "camp_active", "camp_active", $this->camp_active); $return['camp_img'] = new \Leap\View\InputFoto("camp_img", "camp_img", $this->camp_img); $return['camp_msg'] = new \Leap\View\InputTextArea("camp_msg", "camp_msg", $this->camp_msg); $return['camp_url'] = new \Leap\View\InputText("text", "camp_url", "camp_url", $this->camp_url); //apps url // $arrv = array("none"=>"None","offer"=>"Offer","news"=>"News"); // $return['camp_apps_menu'] = new \Leap\View\InputSelect($arrv,"camp_apps_menu", "camp_apps_menu", $this->camp_apps_menu); // $return['camp_apps_menu'] = new \Leap\View\InputText("hidden","camp_apps_menu", "camp_apps_menu", $this->camp_apps_menu); // $return['camp_account_file'] = new \Leap\View\InputFile("camp_account_file", "camp_account_file", $this->camp_account_file); $return['camp_create_by'] = new \Leap\View\InputText("text", "camp_create_by", "camp_create_by", Account::getMyID()); $return['camp_status'] = new \Leap\View\InputSelect($this->arrStatus, "camp_status", "camp_status", $this->camp_status); $return['spdivider']['camp_app_id'] = "Applications"; $return['spdivider']['camp_start'] = "Campaign"; // $return['spdivider']['camp_acc_id'] = "Accounts"; // $return['spdivider']['camp_filter_gender'] = "Filter"; return $return; }
function free() { $app = new AppAccount(); $arrApp = $app->getWhere("app_active = 1 AND app_type = 1 ORDER BY app_contract_start ASC"); // pr($arrApp); ?> <h1>Free Approval Queue</h1> <div class="table-responsive"> <table class="table table-striped"> <thead> <tr> <th> App Details </th> <th> Organization Details </th> <th> User & Agent </th> <th> Contract </th> <th> Paket </th> <th> Status </th> </tr> </thead> <tbody> <?php foreach ($arrApp as $app) { $paket = new Paket(); $paket->getByID($app->app_paket_id); $acc = new Account(); $acc->getByID($app->app_client_id); $agent = new Account(); if ($acc->admin_marketer != "") { $agent->getByUsername($acc->admin_marketer); } $vp = new VpTransaction(); $arrT = $vp->getWhere("order_app_id = '{$app->app_id}'"); $free = new AppFree(); $free->getByID($app->app_id); ?> <tr> <td> ID :<?php echo $app->app_id; ?> <br> <?php echo $app->app_name; ?> </td> <td> Apply Date : <?php echo $free->free_date; ?> <br> Org Name : <?php echo $free->free_org_name; ?> <br> Org Type : <?php echo $free->free_org_type; ?> <br> Address : <?php echo $free->free_address; ?> <br> Contact Name : <?php echo $free->free_org_name; ?> <br> Phone : <?php echo $free->free_org_name; ?> <br> Email : <?php echo $free->free_org_name; ?> <br> Docs : <br><?php $exp = explode(",", $free->free_org_docs); foreach ($exp as $x) { ?> <a href="<?php echo _SPPATH . _PHOTOURL . "inputfiles/" . $x; ?> " target="_blank"> <img src="<?php echo _SPPATH . _PHOTOURL . "inputfiles/" . $x; ?> " width="100px"> </a> <?php } ?> </td> <td> <?php echo $acc->admin_username; ?> <?php echo $acc->admin_nama_depan; ?> <br> <?php echo $acc->admin_email; ?> <br> <?php echo $acc->admin_phone; ?> <hr> Agent <br> <?php echo $agent->admin_username; ?> <?php echo $agent->admin_nama_depan; ?> <br> <?php echo $agent->admin_email; ?> <br> <?php echo $agent->admin_phone; ?> </td> <td>Start : <?php echo $app->app_contract_start; ?> <br> End : <?php echo $app->app_contract_end; ?> </td> <td><?php echo $paket->paket_name; ?> </td> <td> <?php echo $app->app_active; ?> <br> <button onclick="accept_free('<?php echo $app->app_id; ?> ');" class="btn btn-default">Accept App</button><br> <button onclick="reject_free('<?php echo $app->app_id; ?> ');" class="btn btn-default">Reject App</button><br> <button onclick="view_free('<?php echo $app->app_id; ?> ');" class="btn btn-default">View App</button> </td> </tr> <?php } ?> </tbody> </table> </div> <script> function accept_free(id){ if(confirm("this will accept the app")) $.post("<?php echo _SPPATH; ?> JobBE/actionfree",{app_id:id,action : "accept"},function(data){ console.log(data); if(data.bool){ alert("Sukses"); lwrefresh('Accept_Free_Apps'); }else{ alert("Gagal"); } },'json'); } function reject_free(id){ if(confirm("this will reject the app")) $.post("<?php echo _SPPATH; ?> JobBE/actionfree",{app_id:id,action : "reject"},function(data){ console.log(data); if(data.bool){ alert("Sukses"); lwrefresh('Accept_Free_Apps'); }else{ alert("Gagal"); } },'json'); } function view_free(id){ } </script> <?php }