本文整理汇总了PHP中logFile函数的典型用法代码示例。如果您正苦于以下问题:PHP logFile函数的具体用法?PHP logFile怎么用?PHP logFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了logFile函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadExcel
function loadExcel($file = false)
{
// error_reporting(E_ALL ^ E_NOTICE);
global $CONFIG, $EXCEL;
if (!$file) {
return false;
}
if (!in_array($_FILES[$file]['type'], $EXCEL[0]['filetype'])) {
return false;
}
if (array_key_exists('admin', $CONFIG)) {
$this->configkey = 'admin';
}
if (array_key_exists('dashboard', $CONFIG)) {
$this->configkey = 'dashboard';
}
$excel = "";
$filename = $_FILES[$file]['tmp_name'];
$excelEngine = LIBS . 'excel/excel_reader' . $CONFIG[$this->configkey]['php_ext'];
if (is_file($excelEngine)) {
require_once $excelEngine;
$excel = new Spreadsheet_Excel_Reader($filename);
logFile('load excel success');
} else {
logFile('excel lib not found');
}
return $excel;
}
示例2: insert_data
function insert_data($data, $table)
{
$check = $this->insert($data, $table);
logFile($check);
if ($check) {
return true;
} else {
return false;
}
}
示例3: inputgallery
function inputgallery($judul, $deskripsi, $namafile, $id_album, $jns_file)
{
$query = "INSERT INTO gallery(id_album,nm_gallery,jns_file,path_lokasi,deskripsi)\n\t\t\t\t\tVALUES('" . $id_album . "','" . $judul . "','" . $jns_file . "','" . $namafile . "','" . $deskripsi . "')";
//eksekusi query
logFile($query);
$exec = $this->query($query, 0);
//kondisi apabila eksekusi berhasil mengembalikan notif 1, jika gagal mencetak query gagal
if ($exec) {
return 1;
} else {
pr('query gagal');
}
}
示例4: logout
function logout()
{
global $basedomain;
$doLogout = $this->userHelper->logoutUser();
if ($doLogout) {
redirect($basedomain . 'logout.php');
exit;
} else {
redirect($basedomain);
logFile('can not logout user');
exit;
}
}
示例5: inputgallery
function inputgallery($judul, $deskripsi, $filename, $id_gmb, $jns_file, $status, $tipe_album)
{
$date = date("Y-m-d H:i:s");
$query = "INSERT INTO gallery(other_id,judul,jns_file,filename,deskripsi,status,date_upload,tipe_album)\n\t\t\t\t\tVALUES('" . $id_gmb . "','" . $judul . "','" . $jns_file . "','" . $filename . "','" . $deskripsi . "','" . $status . "', '{$date}', '" . $tipe_album . "')";
//eksekusi query
logFile($query);
$exec = $this->query($query, 0);
//kondisi apabila eksekusi berhasil mengembalikan notif 1, jika gagal mencetak query gagal
if ($exec) {
return 1;
} else {
pr('query gagal');
}
}
示例6: dataAset
function dataAset($oldSatker, $newSatker, $debug = false)
{
/*
- ambil aset di satker lama
- looping asetid, ambil kode kelompok untuk menentukan no register baru
- ambil noregister terakhir di satker baru dengan kode kelompok
- bentuk satker, lokasi, no register
- insert ke tabel tmp_merger
execute
- select data dari tmp_merger
- update ke tabel masing2
*/
$sql = array('table' => "aset AS a", 'field' => "a.Aset_ID, a.kodeKelompok, a.kodeSatker, a.kodeLokasi, a.noRegister, a.TipeAset, a.Tahun", 'condition' => "a.kodeSatker = '{$oldSatker}'");
$aset = $this->db->lazyQuery($sql, $debug);
if ($aset) {
foreach ($aset as $key => $value) {
$listTableAbjad = array('A' => 1, 'B' => 2, 'C' => 3, 'D' => 4, 'E' => 5, 'F' => 6);
$sql = array('table' => "aset AS a, satker AS s", 'field' => "a.kodeLokasi, s.NamaSatker", 'condition' => "a.kodeSatker = '{$newSatker}' AND s.kd_Ruang IS NULL", 'joinmethod' => 'LEFT JOIN', 'join' => 'a.kodeSatker = s.kode', 'limit' => 1);
$satker = $this->db->lazyQuery($sql, $debug);
$table = $this->getTableKibAlias($listTableAbjad[$value['TipeAset']]);
$tmpKodeLokasi = explode('.', $satker[0]['kodeLokasi']);
$tmpKodeSatker = explode('.', $newSatker);
$prefix = $tmpKodeLokasi[0] . '.' . $tmpKodeLokasi[1] . '.' . $tmpKodeLokasi[2];
$prefixkodesatker = $tmpKodeSatker[0] . '.' . $tmpKodeSatker[1];
$prefixTahun = substr($value['Tahun'], 2, 2);
$postfixkodeSatker = $tmpKodeSatker[2] . '.' . $tmpKodeSatker[3];
$implLokasi = $prefix . '.' . $prefixkodesatker . '.' . $prefixTahun . '.' . $postfixkodeSatker;
$data[$key]['Aset_ID'] = $value['Aset_ID'];
$data[$key]['kodeSatker'] = $newSatker;
$data[$key]['oldKodeSatker'] = $oldSatker;
$data[$key]['NamaSatker'] = $satker[0]['NamaSatker'];
$data[$key]['kodeKelompok'] = $value['kodeKelompok'];
$data[$key]['kodeLokasi'] = $implLokasi;
$data[$key]['TipeAset'] = $listTableAbjad[$value['TipeAset']];
}
$totalAset = count($aset);
$dataevent = serialize($data);
$shufle = str_shuffle('ABCDEFGHIJKLMNOPQR');
logFile($dataevent, $shufle);
$date = date('Y-m-d H:i:s');
$sql = array('table' => "tmp_merger", 'field' => "Aset, event, target, data, create_date", 'value' => "{$totalAset}, '{$oldSatker}', '{$newSatker}', '{$shufle}','{$date}'");
usleep(100);
$res = $this->db->lazyQuery($sql, $debug, 1);
if ($res) {
echo "Sukses insert data \n";
}
}
}
示例7: select_data_selesai
function select_data_selesai($years, $month)
{
$filter = "";
if ($years and $years != 3) {
$filter .= " AND YEAR(tanggal) = '{$years}'";
}
if ($month and $month != 15) {
$filter .= " AND MONTH(tanggal) = '{$month}'";
}
$query = "SELECT COUNT(1) AS total FROM bsn_pengaduan WHERE status = '4' {$filter}";
logFile($query);
$result = $this->fetch($query);
// pr($result);
return $result;
}
示例8: forgotPassword
function forgotPassword()
{
global $CONFIG;
$token = _p('token');
$this->view->assign('status', true);
if ($token) {
// pr($_POST);
$getToken = $this->loginHelper->getUserEmail(_p('email'), true);
if ($getToken) {
// send mail before activate account
$dataArr['email'] = $getToken['email'];
$dataArr['username'] = $getToken['username'];
$dataArr['password'] = $getToken['password'];
$dataArr['token'] = sha1('reset' . $getToken['email']);
$dataArr['validby'] = $getToken['email_token'];
$dataArr['regfrom'] = 1;
$dataArr['reset'] = 1;
$inflatData = encode(serialize($dataArr));
logFile($inflatData);
$to = $getToken['email'];
$from = $CONFIG['email']['EMAIL_FROM_DEFAULT'];
// $msg = "To activate your account please <a href='{$basedomain}login/validate/?ref={$inflatData}'>click here</a>";
$this->view->assign('email', $getToken['email']);
$this->view->assign('username', $getToken['username']);
$this->view->assign('encode', $inflatData);
$this->view->assign('content', "reset");
$msg = "<p>Hi " . $getToken['username'] . "!</p>";
$msg .= $this->loadView('emailTemplate');
// try to send mail
// pr($getToken);
// exit;
$sendMail = sendGlobalMail($to, $from, $msg, true);
logFile('mail reset account send ' . serialize($sendMail));
$this->view->assign('status', true);
} else {
$this->view->assign('status', false);
}
// $this->activityHelper->updateEmailLog(false,$to,'account',0);
/*$verifiedData = $this->loginHelper->resetAccount($to);
if ($verifiedData){
echo 'true';
}*/
}
return $this->loadView('forgot-password');
}
示例9: generateEmail
function generateEmail($email = false, $username = false, $regfrom = 1, $token = CODEKIR)
{
global $CONFIG, $basedomain;
if (!$email && !$username) {
return false;
}
$dataArr['email'] = $email;
$dataArr['username'] = $username;
$dataArr['token'] = sha1('register' . $email);
$dataArr['validby'] = $token;
$dataArr['regfrom'] = $regfrom;
logFile('token ori : ' . $token);
$inflatData = encode(serialize($dataArr));
logFile(serialize($dataArr));
$return['to'] = $email;
$return['from'] = $CONFIG['email']['EMAIL_FROM_DEFAULT'];
$return['subject'] = "[NOTIFICATION]";
$return['msg'] = "To activate your account please <a href='{$basedomain}login/validate/?ref={$inflatData}'>click here</a>";
$return['encode'] = $inflatData;
return $return;
}
示例10: VALUES
$query2 = "INSERT INTO Satker VALUES (NULL, NULL, '$data->KodeSektor', '$data->KodeSatker', ".$NamaSatker.", NULL,
0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, {$Gudang}, ".$KodeUnit.", '$tmp_kode', ".$KotaSatker.", ".$BuatKIB.",NULL)";
// pr($query2);
$result2 = mysql_query($query2) or die (mysql_error());
usleep(500);
*/
// pr($data);
// pr($_POST);
$tmpKodeRuang ="$data->KodeSatker.$_POST[KodeUnit].$_POST[KodeUPB].$_POST[KodeRuangan]";
$tmp_kode = "$data->KodeSatker.$_POST[KodeUnit].$_POST[KodeUPB]";
$query3 = "INSERT INTO Satker (Satker_ID, Tahun, KodeSektor, KodeSatker, NamaSatker, AlamatSatker, NGO, RAND_ID, IndukSatker, NGO1_ID, NGO2_ID, NGO3_ID, NGO4_ID, CNOTE1, CNOTE2, Gudang, KodeUnit, Tmp_KodeSatker, KotaSatker, BuatKIB, Kd_Ruang, kode) VALUES (NULL, NULL, '$data->KodeSektor', '$data->KodeSatker', ".$NamaSatker.", NULL,
0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, {$Gudang}, ".$KodeUnit.", '$tmpKodeRuang', ".$KotaSatker.", ".$BuatKIB.",{$KodeRuangan},'$tmp_kode')";
// pr($query3);
logFile($query3);
$result3 = mysql_query($query3) or die (mysql_error());
// exit;
if ($result3 > 0) echo "<script type='text/javascript'>alert('Sukses'); window.location.href='?page=$_GET[page]&a=v'; </script>" ;
else echo '<script type=text/javascript>alert("Gagal");</script>';
}
else
{
echo '<script type=text/javascript>alert("Silahkan mengisi form Ruang");</script>' ;
}
/*
$query = "INSERT INTO Satker VALUES (NULL, NULL, ".$KodeSektor.", NULL, ".$NamaSatker.", NULL,
0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, 0)";
$result = mysql_query($query) or die (mysql_error());
$query1 = "INSERT INTO Satker VALUES (NULL, NULL, ".$KodeSektor.", ".$KodeSatker.", ".$NamaSatker.", NULL,
示例11: sendGlobalMail
function sendGlobalMail($to, $from, $msg, $config = true)
{
global $CONFIG, $LOCALE;
if (!$config) {
@mail($to, "[ NOTIFICATION ] Flora Kalbar", $msg, "From: {$from}\n");
return array('message' => 'success send mail', 'result' => true);
}
require_once LIBS . "PHPMailer/class.phpmailer.php";
if ($from != '') {
$from = $from;
} else {
$from = $CONFIG['email']['EMAIL_FROM_DEFAULT'];
}
$mail = new PHPMailer(true);
$mail->IsSMTP();
// telling the class to use SMTP
try {
logFile('ready to send mail');
$mail->Host = $CONFIG['email']['EMAIL_SMTP_HOST'];
// SMTP server
$mail->SMTPDebug = 1;
// enables SMTP debug information (for testing)
$mail->SMTPAuth = true;
// enable SMTP authentication
$mail->SMTPSecure = "ssl";
// sets the prefix to the servier
$mail->Host = "smtp.gmail.com";
// sets GMAIL as the SMTP server
$mail->Port = 465;
// set the SMTP port for the GMAIL server
$mail->Username = $CONFIG['email']['EMAIL_FROM_DEFAULT'];
// GMAIL username
$mail->Password = $CONFIG['email']['EMAIL_SMTP_PASSWORD'];
// GMAIL password
$mail->AddAddress($to);
$mail->SetFrom($CONFIG['email']['EMAIL_FROM_DEFAULT'], 'No Reply Account');
$mail->Subject = "[ NOTIFICATION ] Flora Kalbar";
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!';
// optional - MsgHTML will create an alternate automatically
$mail->MsgHTML($msg);
$result = $mail->Send();
logFile('status send = ' . $result);
if ($result) {
return array('message' => 'success send mail', 'result' => true, 'res' => $result);
} else {
return array('message' => 'error mail setting', 'result' => false, 'res' => $mail->ErrorInfo);
}
} catch (phpmailerException $e) {
// echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
// echo $e->getMessage(); //Boring error messages from anything else!
}
}
示例12: extract
/**
* @todo extract zip function basedomain/zip/extract
*
* @see s_linux_unzip Function
* @see unzip Function
* @see createFolder Function
* @see getContents Function
* @see resize & crop Function
* @see validateUsername Function
* @see imagezip class
*
* */
function extract($status = NULL, $msg = NULL, $data = NULL)
{
global $CONFIG;
$name = $_POST['imagezip'];
$path = '';
$path_file = $CONFIG['default']['upload_path'];
//get data user from session
$session = new Session();
//$sess_user = $session->get_session();
//$sess_data = $sess_user['ses_user'];
$sess_data = $session->get_session();
$username = $sess_data['login']['username'];
$personID = $sess_data['login']['id'];
$password = $sess_data['login']['password'];
if (empty($username) || empty($personID) || empty($password)) {
$status = "error";
$msg = "Kesalahan terjadi saat validasi data pengguna, silakan logout kemudian login kembali";
echo json_encode(array('status' => $status, 'message' => $msg));
exit;
}
//$email = $_POST['email'];
/*$username = $_POST['username'];
$validateUsername = $this->validateUsername($username);
if($validateUsername['status'] != 'success'){
$status = "error";
$msg = "Error occured while validating username";
echo json_encode(array('status' => $status, 'message' => $msg));
exit;
}
$personID = $validateUsername['personID'];*/
// input with email
/*$validateEmail = $this->validateEmail($email);
if($validateEmail['status'] != 'success'){
$status = "error";
$msg = "Error occured while validating email";
echo json_encode(array('status' => $status, 'message' => $msg));
exit;
}
$personID = $validateEmail['personID'];
$username = $validateEmail['short_namecode'];*/
//end input with email
//move zip file to tmp folder
$copy_zip = sftpServices($CONFIG['default']['hostname'], $username, $password, $name);
logFile($copy_zip);
if (!$copy_zip) {
$status = "error";
$msg = "Kesalahan saat mengambil file zip atau file zip tidak ditemukan";
echo json_encode(array('status' => $status, 'message' => $msg));
exit;
}
if (!empty($name)) {
if (preg_match('#\\.(zip|ZIP)$#i', $name)) {
$tmp_path = md5($name);
$path_extract = $path_file . 'imgprocess/' . $tmp_path;
$file = $path_file . $name;
//check file zip exist
if (!file_exists($file)) {
$status = "error";
$msg = "Sistem tidak dapat menemukan file yang ditentukan";
echo json_encode(array('status' => $status, 'message' => $msg));
exit;
}
if ($CONFIG['default']['unzip'] == 's_linux_unzip') {
s_linux_unzip($file, $path_extract);
} elseif ($CONFIG['default']['unzip'] == 'zipArchive') {
unzip($file, $path_extract);
}
$path_data = 'public_assets/';
//$path_user = $path_data.$username;
$path_img = $path_data . '/img';
$path_img_ori = $path_img . '/ori';
$path_img_1000px = $path_img . '/1000px';
$path_img_500px = $path_img . '/500px';
$path_img_100px = $path_img . '/100px';
$toCreate = array($path_img, $path_img_ori, $path_img_1000px, $path_img_500px, $path_img_100px);
$permissions = 0755;
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
createFolder($toCreate, $permissions);
} else {
shell_createFolder($toCreate);
}
$images = $this->GetContents($path_extract);
$list = count($images);
//.........这里部分代码省略.........
示例13: commitTransaction
/**
* @todo commit sql transaction
*
* @return boolean true/false
*
* */
function commitTransaction()
{
$this->commit();
logFile('====COMMIT TRANSACTION====');
return true;
}
示例14: checkTwitter
/**
* @todo check if twitter of user exist or not
*
* @param $data = inputted twitter
* @return boolean
*/
function checkTwitter($data)
{
if ($data == '') {
return true;
} else {
$sql = "SELECT COUNT(`id`) AS total FROM `person` WHERE `twitter` = '" . $data . "' ";
$res = $this->fetch($sql, 0);
if ($res['total'] > 0) {
logFile('Twitter EXIST/');
return false;
}
}
return true;
}
示例15: loadUssdSender
$_SESSION['menu-Opt'] = $menuName;
//Assign previous session menu name
break;
}
if ($receiver->getMessage() == "000") {
$responseExitMsg = "Exit Program!";
$response = loadUssdSender($sessionId, $responseExitMsg);
session_destroy();
}
if ($receiver->getMessage() == "exit") {
$responseExitMsg = "Exit Program!";
$response = loadUssdSender($sessionId, $responseExitMsg);
session_destroy();
} else {
logFile("Selected response message := " . $responseMsg[$menuName]);
logFile("cat" . $_SESSION['cat']);
//$response = loadUssdSender($sessionId, $responseMsg[$menuName]);
$response = send($sessionId, $responseMsg[$menuName], $address);
}
}
/*
Get the session id and Response message as parameter
Create sender object and send ussd with appropriate parameters
**/
function send($sessionId, $responseMessage, $destinationAddress)
{
$password = "password";
if ($responseMessage == "000") {
$ussdOperation = "mt-fin";
} else {
$ussdOperation = "mt-cont";