Esempio n. 1
0
function printQueue($queue, $path)
{
    if (sizeof($queue) > 0) {
        foreach ($queue as $file) {
            printFile($file, $path);
        }
    }
}
                            // Outside, an unhandled error can cause faculty with > $countIncrement pubs
                            // to spin into an infinite loop requesting more and more
                            if ($totalResults - $countTotal > 0) {
                                $offset += $countIncrement;
                            } else {
                                $loopThrough = 0;
                            }
                        }
                    }
                    // End CURLRESPONSE structure
                }
                // End LOOPTHROUGH control structure
                curl_close($openCurl);
            }
            // End data_try while loop
        }
        // End SCOPUSID loop
        printFile($outputFile, "\tADDED " . $addedPubCount . " faculty publication record(s)\n");
    }
    // end if(count(scopusId)>0)
    printStatus($thisCount, $facultyCount);
}
// End FACULTYIDS loop
// Record end of process
$eventEnd = date("Y-m-d H:i:s");
$endProcess = "UPDATE events_master SET eventFinish = '{$eventEnd}' WHERE eventID = {$processNumber}";
runQuery($con, $endProcess);
closeDB($con);
printFile($outputFile, "All processes complete.\n");
printFile($outputFile, "Process end: " . $eventEnd . "\n");
Esempio n. 3
0
            $content = "<pre>{$content}</pre>";
        }
        echo '<div style="font-size:small;">';
        echo $content;
        echo '</div>';
        print '<ul><li><a href=?file=' . $_GET['file'] . '&more=' . (int) ($more + 1) . '> 次の100件 (' . $more * 100 . '~' . ($more + 1) * 100 . ')</a></li><li><a href=?full=1&file=' . $_GET['file'] . '>全て表示</li></li><li><a href=?full>戻る</li></ul>';
    } else {
        print "<pre>{$content}</pre>";
        print '<ul><li><a href="?">戻る</li></ul>';
    }
}
/**
 * Log Print Mode
 */
if (isset($_GET['file'])) {
    printFile($file[$_GET['file']]);
    exit;
}
if (function_exists('memcache_get_version')) {
    $memcache = new Memcache();
    $memcache->addServer('localhost', 11211);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">
body {
	background-color: #ffffff;
	color: #000000;
}
Esempio n. 4
0
function listPosts($request, $filter)
{
    $match;
    $offset;
    $postNumber;
    //Navigating back and forth.
    if (preg_match("/.+offset\\/(\\d+)(\\/display\\/\\d+)?[\\/]?\$/", $request, $match)) {
        $offset = $match[1];
    }
    if (preg_match("/(.+offset\\/\\d+)?\\/display\\/(\\d+)[\\/]?\$/", $request, $match)) {
        $postNumber = $match[2];
    }
    $dir = BASE_PATH . BLOG_DIR;
    $allFiles = getFileList(BASE_PATH . BLOG_DIR, $filter);
    rsort($allFiles);
    if (!isset($offset)) {
        $offset = 0;
    }
    if (!isset($postNumber)) {
        $postNumber = BLOG_POST_NUMBER;
    }
    $printCount = 0;
    $itemCount = 0;
    $usedToMatch = false;
    //$html= printBlogNav($offset,$offset+$postNumber,count($allFiles),"left");
    $html .= "<br/>";
    foreach ($allFiles as $file) {
        if ($itemCount >= $offset && $printCount < $postNumber) {
            $html .= printFile($dir, $file, $uri);
            $printCount++;
            $usedToMatch = true;
        } else {
            if ($usedToMatch == true) {
                break;
            }
        }
        $itemCount++;
    }
    $html .= "<br/></div>";
    #end id=blog div
    $html .= printBlogNav($offset, $offset + $postNumber, count($allFiles), "right");
    return $html;
}
Esempio n. 5
0
    header('Content-type: text/html; charset=utf-8');
}
if (!isCli()) {
    $l_PassOK = false;
    if (strlen(PASS) > 8) {
        $l_PassOK = true;
    }
    if ($l_PassOK && preg_match('|[0-9]|', PASS, $l_Found) && preg_match('|[A-Z]|', PASS, $l_Found) && preg_match('|[a-z]|', PASS, $l_Found)) {
        $l_PassOK = true;
    }
    if (!$l_PassOK) {
        echo sprintf(AI_STR_009, generatePassword());
        exit;
    }
    if (isset($_GET['fn']) && $_GET['ph'] == crc32(PASS)) {
        printFile();
        exit;
    }
    if ($_GET['p'] != PASS) {
        $generated_pass = generatePassword();
        echo sprintf(AI_STR_010, $generated_pass, $generated_pass);
        exit;
    }
}
if (!is_readable(ROOT_PATH)) {
    echo AI_STR_011;
    exit;
}
if (isCli()) {
    if (defined('REPORT_PATH') and REPORT_PATH) {
        if (!is_writable(REPORT_PATH)) {
        // Calculate total publications for current year cumulatively through current quarter
        $currentYearStart = $currentYear . "-01-01";
        $totalPubs_cumulative = "SELECT COUNT(DISTINCT publication_data.mpid) AS quarterCumulativeTotal FROM faculty_publications INNER JOIN publication_data ON faculty_publications.mpid = publication_data.mpid WHERE faculty_publications.record_valid = 1 AND faculty_publications.internetID IN ({$facultyIdList}) AND publication_data.pubDate >= '{$currentYearStart}' AND publication_data.pubDate <= '{$endDate}'";
        print $totalPubs_cumulative . "\n";
        $result = runQuery($con, $totalPubs_cumulative);
        $obj = mysqli_fetch_object($result);
        $affils[$ind]["cumulativeQuarter"]["totalPublications"] = $obj->quarterCumulativeTotal;
        mysqli_free_result($result);
        // Calculate first/last author publications for current year cumulatively through current quarter
        $flPubs_cumulative = "SELECT COUNT(DISTINCT publication_data.mpid) AS quarterCumulativeFlTotal FROM faculty_publications INNER JOIN publication_data ON faculty_publications.mpid = publication_data.mpid WHERE faculty_publications.record_valid = 1 AND faculty_publications.internetID IN ({$facultyIdList}) AND publication_data.pubDate >= '{$currentYearStart}' AND publication_data.pubDate <= '{$endDate}' AND (faculty_publications.authorPosition = faculty_publications.authorCount OR faculty_publications.authorPosition = 1)";
        print $flPubs_cumulative . "\n";
        $result = runQuery($con, $flPubs_cumulative);
        $obj = mysqli_fetch_object($result);
        $affils[$ind]["cumulativeQuarter"]["flPublications"] = $obj->quarterCumulativeFlTotal;
        mysqli_free_result($result);
    }
}
file_put_contents("../reports/deptReports/" . $outputFileName, json_encode($affils, true));
printFile($logFile, "Data recorded; stored in reports/deptReports/" . $outputFileName . "\n");
// Update data source in table
$update_data_source_sql = "UPDATE reports SET report_dataURL = '{$outputFileName}' WHERE reportID = 'R0001'";
runQuery($con, $update_data_source_sql);
// Record end of process
$eventEnd = date("Y-m-d H:i:s");
printFile($logFile, "Process end: " . $eventEnd . "\n");
$endProcess = "UPDATE events_master SET eventFinish = '{$eventEnd}' WHERE eventID = {$processNumber}";
runQuery($con, $endProcess);
closeDB($con);
printFile($logFile, "Data update for quarterly department reports complete.\n");
printFile($logFile, "Process end: " . $eventEnd . "\n");
foreach ($facultyArray as $internetId => $data) {
    $hIndex = $data['hIndex'];
    if ($hIndex > 0) {
        $getCitationCount = "SELECT SUM(subtable.citedByCount) as hCitations FROM (SELECT publication_data.citedByCount FROM publication_data INNER JOIN faculty_publications ON faculty_publications.mpid = publication_data.mpid WHERE faculty_publications.record_valid = 1 AND faculty_publications.internetID = '{$internetId}' ORDER BY publication_data.citedByCount DESC LIMIT {$hIndex}) AS subtable";
        if (!mysqli_query($con, $getCitationCount)) {
            die(mysqli_error($con));
        } else {
            $result = mysqli_query($con, $getCitationCount);
            $obj = mysqli_fetch_object($result);
            $hCitations = $obj->hCitations;
            if (is_null($hCitations)) {
                $hCitations = 0;
            }
            $facultyArray[$internetId]['totalCount'] = $obj->hCitations;
        }
    }
    $hCitationCount = $facultyArray[$internetId]['totalCount'];
    $output = $internetId . "\t" . $hIndex . "\t" . $hCitationCount . "\t" . $data["pubCount"] . "\t" . $data["firstName"] . "\t" . $data["lastName"] . "\t" . $data["dept"] . "\n";
    printFile($outputFile, $output);
}
// Now update data source in visualizations table
$update_vis_data_sql = "UPDATE visualizations SET vis_dataURL = '{$outputFileName}' WHERE visID = 'V0005'";
runQuery($con, $update_vis_data_sql);
// Record end of process
$eventEnd = date("Y-m-d H:i:s");
printFile($logFile, "Process end: " . $eventEnd . "\n");
$endProcess = "UPDATE events_master SET eventFinish = '{$eventEnd}' WHERE eventID = {$processNumber}";
runQuery($con, $endProcess);
closeDB($con);
printFile($logFile, "H-matrix data update complete. Data stored in {$outputFileName}.\n");
Esempio n. 8
0
function printQueue($queue, $path, $chatType)
{
    foreach ($queue as $file) {
        printFile($file, $path, $chatType);
    }
}
Esempio n. 9
0
 function printInputTable($contest, $input_table)
 {
     $this->load->helper('file');
     $this->load->helper(array('phpprintipp', 'file'));
     $filepath = './output/' . $contest['contest_id'] . '/input_tables/' . $input_table;
     $printing = printFile($filepath, false);
     return $printing;
 }
Esempio n. 10
0
 function composeMessage()
 {
     if ($this->session->userdata('loggedInUser')) {
         $this->form_validation->set_rules('user', 'user', 'required|trim');
         $this->form_validation->set_rules('subject', 'subject', 'required|trim');
         $this->form_validation->set_rules('message', 'message', 'required|trim');
         $this->form_validation->set_message('user', $this->lang->line('select_user'));
         $this->form_validation->set_message('subject', $this->lang->line('subject'));
         $this->form_validation->set_message('message', $this->lang->line('message'));
         if (isset($_GET['fileid']) && $_GET['fileid'] != '') {
             $client = $this->google_client;
             $client->setAccessToken($this->session->userdata('accessToken'));
             $service = new Google_DriveService($client);
             /* Show all files with folder */
             //$folderid =$_GET['fldrid'];
             $fileid = $_GET['fileid'];
             $user_file_list = printFile($service, $fileid);
             $data['file_detail']['title'] = $user_file_list->title;
             $data['file_detail']['fileId'] = $user_file_list->id;
             //pre($user_file_list);
         }
         if ($this->form_validation->run() == false) {
             //page title
             $data['title'] = $this->lang->line('add_message');
             $data['submenu'] = '9c';
             /* Get all client's user list of the login user client */
             $data['users'] = $this->usermodel->getAllUsers_byClientID($this->session->userdata('clientId'), $this->session->userdata('userId'));
             // print_r($clientusers);die;
             //$admin = $this->usermodel->getAdminDetail();
             //$data['users'] = array_merge($admin, $clientusers);
             $this->load->view('users/add_message', $data);
         } else {
             // check for upload file---------------------------upload attached file in folder if any
             $uploaded_data['upload_data']['file_name'] = '';
             if ($_FILES['attach']['name'] != '') {
                 $uploaded_data = $this->do_file_upload('attachment/', 'attach');
             }
             $notification_flag = 0;
             $receiver = $this->input->post('user');
             if ($this->input->post('gmailFile') != '') {
                 $uploadfilename = $this->input->post('gmailFile');
             } else {
                 $uploadfilename = $uploaded_data['upload_data']['file_name'];
             }
             /*Get reciever Email Id */
             $recieverDetail = '';
             $toEmail = '';
             $toUser = '';
             $recieverId = $this->input->post('user');
             if ($recieverId == '0') {
                 $recieverId = 1;
             }
             $recieverDetail = $this->usermodel->getUserDetails($recieverId);
             //pr($recieverDetail);
             if ($recieverDetail) {
                 $toEmail = $recieverDetail->userEmail;
                 $toUser = $recieverDetail->userName;
             }
             $insert_msg = array('user_id' => $this->session->userdata('userId'), 'subject' => $this->input->post('subject'), 'message' => $this->input->post('message'), 'attachment' => $uploadfilename, 'message_type' => 'inbox', 'show_in_inbox' => 'y', 'created_date' => date('Y-m-d H:i:s'), 'notification_flag' => $notification_flag, 'receiver' => $receiver);
             $insertID = $this->usermodel->addMessage($insert_msg);
             if ($insertID) {
                 //$to = '*****@*****.**';
                 $subject = $this->input->post('subject');
                 $data = 'You have one new message in your numera account.<br/><br/> Please <a href="' . base_url() . '">click here </a> to view you message.<br/><br/><b>From : ' . $this->session->userdata('userName') . '</b> ';
                 $dataArray = array('ToEmail' => $toEmail, 'subject' => $subject, 'userName' => $toUser, 'message' => $data);
                 $this->Send_emai_notification($dataArray);
                 $this->session->set_flashdata('message', '<div class="alert-success" style="margin-left:5px;margin-right: 5px;" >' . $this->lang->line('msg_send_success') . '</div>');
             } else {
                 $this->session->set_flashdata('message', '<div class="alert-error" style="margin-left:5px;margin-right: 5px;">' . $this->lang->line('msg_send_fail') . '</div>');
             }
             redirect('users/messagebox');
         }
     } else {
         redirect('/users/login');
     }
 }