function detail()
    {
        $id = addslashes($_GET['id']);
        //        echo "in".$id;
        $nn = new PushLogger();
        $arrLogs = $nn->getWhere("log_multicast_id = '{$id}' ORDER BY log_id ASC");
        //        pr($arrLogs);
        foreach ($arrLogs as $log) {
            $acc = new LL_Account();
            $acc->getByID($log->log_macc_id);
            ?>
            <div class="hasil">
                ID : <?php 
            echo $acc->macc_id;
            ?>
 <?php 
            echo $acc->macc_first_name;
            ?>
 <?php 
            echo $acc->macc_last_name;
            ?>
<br>
                Status : <?php 
            echo $this->arrStatus[$log->log_status];
            ?>
<br>
                Message : <?php 
            echo $log->log_text;
            ?>
            </div>
            <?php 
        }
    }
 public function exportIt($return)
 {
     $id = addslashes($_GET['cid']);
     //        echo $id;
     if ($id == "" || $id < 1) {
         die("no id");
     }
     $camp = new PushNotCamp();
     $camp->getByID($id);
     $arrStatus = array("0" => "Not Pushed", "1" => "Pushed");
     if ($camp->camp_app_id != AppAccount::getAppID()) {
         die("camp mismatched");
     }
     //        pr($camp);
     $onDate = "";
     if ($camp->camp_status == 1) {
         $onDate = " on " . indonesian_date($camp->camp_send_date);
     }
     //hitung openrate dll
     $targetedDev = count(explode(",", $camp->camp_dev_ids));
     $gcm = new GCMResult();
     $arrGCM = $gcm->getWhere("camp_id = '{$id}' ORDER BY gcm_date DESC");
     $succ = 0;
     $fail = 0;
     $seen_by = 0;
     foreach ($arrGCM as $cc) {
         $succ += $cc->success;
         $fail += $cc->failure;
         $seen_by += $cc->seen_by;
     }
     $openrate = round($seen_by / $succ * 100, 3);
     $del = round($succ / ($succ + $fail) * 100, 3);
     $filename = urlencode(str_replace(" ", "_", $camp->camp_name)) . "_" . date('Ymd') . ".xls";
     header("Content-Disposition: attachment; filename=\"{$filename}\"");
     header("Content-Type: application/vnd.ms-excel");
     $flag = false;
     print "Campaign Name : \t" . $camp->camp_title;
     //judul
     print "\n";
     print "Status : \t" . $arrStatus[$camp->camp_status] . $onDate;
     //status and delieverd date
     print "\n";
     print "Content : \t" . $camp->camp_title;
     print "\n";
     print "Open Rate : \t" . $openrate;
     print "\n";
     print "Seen By : \t" . $seen_by;
     print "\n";
     print "Deliverable Percentage : \t" . $del;
     print "\n";
     print "Targeted Devices : \t" . $targetedDev;
     print "\n";
     print "Success : \t" . $succ;
     print "\n";
     print "Failed : \t" . $fail;
     print "\n";
     print "\n";
     $logs = new PushLogger();
     $objs = $logs->getWhere("log_camp_id = '{$id}'");
     $filter = explode(",", $logs->exportList);
     foreach ($objs as $key => $obj) {
         foreach ($obj as $name => $value) {
             if (in_array($name, $filter)) {
                 echo Lang::t($name) . "\t";
             }
         }
         break;
     }
     print "\n";
     foreach ($objs as $key => $obj) {
         foreach ($obj as $name => $value) {
             if (in_array($name, $filter)) {
                 echo $value . "\t";
             }
         }
         print "\n";
     }
     exit;
 }