예제 #1
0
 function export_xls()
 {
     ini_set('memory_limit', '-1');
     require "../assets/export-xls.class.modif.php";
     $filename = 'LIST_INDIVIDUAL_' . date('Ymd_His') . '.xls';
     $xls = new ExportXLS($filename);
     $header[] = "NO";
     $header[] = "INDIVIDUAL CODE";
     $header[] = "CAMPAIGN";
     $header[] = "MOP ID";
     $header[] = "FIRSTNAME";
     $header[] = "LASTNAME";
     $header[] = "NICKNAME";
     $header[] = "SEX";
     $header[] = "DAY OF BIRTH";
     $header[] = "ID TYPE";
     $header[] = "ID NUMBER";
     $header[] = "TELEPHONE";
     $header[] = "EMAIL";
     $header[] = "FB";
     $header[] = "TW";
     $header[] = "ADDRESS";
     $header[] = "CITY";
     $header[] = "POS CODE";
     $header[] = "BRAND";
     $header[] = "BRAND 2";
     $header[] = "SOURCE TYPE";
     $header[] = "SOURCE USER";
     $header[] = "SOURCE EMAIL";
     $header[] = "SURVEY DATE";
     $header[] = "UPLOAD DATE";
     $header[] = "ENTRY DATE";
     $header[] = "VERIFIKASI DATE";
     $header[] = "REFERRED BY";
     $header[] = "DRN NUMBER";
     $header[] = "STATUS VERIFIKASI";
     $header[] = "AGE";
     $xls->addHeader($header);
     $result = $this->mdl_individual->export()->result();
     $i = 1;
     foreach ($result as $r) {
         $row[] = $i++;
         $row[] = $r->id;
         $row[] = $r->campaign_id;
         $row[] = $r->mop_id;
         $row[] = $r->firstname;
         $row[] = $r->lastname;
         $row[] = $r->nickname;
         $row[] = $r->sex;
         $row[] = format_tanggal_excel($r->dob);
         $row[] = $r->id_type;
         $row[] = $r->id_number;
         $row[] = $r->tlp;
         $row[] = $r->email;
         $row[] = $r->fb;
         $row[] = $r->tw;
         $row[] = $r->address;
         $row[] = $r->city;
         $row[] = $r->pos_code;
         $row[] = $r->brand;
         $row[] = $r->brand_;
         $row[] = $r->source_type;
         $row[] = $this->mdl_sba->get_sba_name($r->source_user);
         $row[] = $r->source_user;
         $row[] = format_tanggal_excel($r->survey_date);
         $row[] = format_tanggal_excel($r->upload_date);
         $row[] = format_tanggal_excel($r->entry_date);
         $row[] = format_tanggal_excel($r->verifikasi_date);
         $row[] = $r->referred;
         $row[] = $r->drn_number;
         $row[] = $r->status_verifikasi;
         $row[] = get_age($r->dob);
         $xls->addRow($row);
         unset($row);
     }
     $xls->sendFile();
 }
예제 #2
0
				$dateReceived=0;
				$dateReceived=($receivedFacilityID?getRawFormattedDateLessDay(getDetailedTableInfo2("vl_samples","formNumber='$formNumber' limit 1","receiptDate")):"N/A");
				$dateCreated=0;
				$dateCreated=getRawFormattedDateLessDay($q["created"]);
				
				//add rows
				$row=array();
				//form number
				$row[]=$formNumber;
				//reference number
				$row[]=$refNumber;
				//facility
				$row[]=$facility;
				//date dispatched
				$row[]=$dateDispatched;
				//Received from Facility
				$row[]=$receivedFacility;
				//Date Received
				$row[]=$dateReceived;
				//date created
				$row[]=$dateCreated;
				//append
				$xls->addRow($row);
			}
			//output to browser
			$xls->sendFile();
		}
	break;
}
?>