Selasa, 10 Desember 2013

Day 12–Edit Modul Tes Online in Progress

edit modul tes online digilib in progress..

Untuk jumlah soal lebih dari 5 masih ada eror.

image

image

Minggu, 08 Desember 2013

Day 11

Editing Tampilan Tes Online Digilib

image

image

image

Day 10–Membenahi Login User dan Form Test Online

membenahi login user dan form test online digilib

progress:

navigation user sudah bisa, tetapi untuk child tab belum berfungsi

image

form test online sudah muncul, tetapi masih berantakan di tampilan

image

Rabu, 04 Desember 2013

Day 9– Progress Login Box

Progress Login Box Admin dan Member DIgilib

image

Pilihan Login

image

Form Login Admin:

image

Form Login Member:

image

Form Registrasi Member

image

Selasa, 03 Desember 2013

Day 8 Migrasi Tampilan

Belajar migrasi tampilan di code igniter

dari tampilan

digilib

menjadi

digital library

progress –> baru bisa edit link header

image

Senin, 02 Desember 2013

Footer yang bandel

Memperbaiki footer yang bandel

image

Mengapa footer tersebut tidak terletak di bawah tapi malah disamping kanan ?, ternyata permasalahannya ada sidebar yang tidak di load.

function index(){
        if ($this->session->userdata('id_member') == '') {
        $this->session->set_flashdata('error','<p style="color:red;">Silahkan login untuk bisa melakukan review paper online. </p>');
        redirect('frontend/login');
        } else {

    $this->form_validation->set_rules('judul_paper', 'judul_paper', 'Wajib Di isi');
    if ( $this->form_validation->run() == TRUE ) {
    $this->load->library('paperrater');
    //print_r($_POST);
    $judul      = $this->input->post('judul_paper');
    $isi          = $this->input->post('isi_paper');
    $tempat   = $this->input->post('kota_paper');
    $level       = $this->input->post('level_edukasi');
    $tipe        = $this->input->post('tipe_paper');
    $opsi        = $this->input->post('opsi_pilihan');
   
    print_r(json_decode($this->paperrater->get($judul,$isi,$tempat,$level,$tipe,$opsi)));
    }
   
    $data['page'] = "frontend/paper/paper-1";
    $data['sidebar'] = "frontend/theme/sidebar";
    $this->load->view('frontend/template', $data);
}

ket:

bagian yang diberi label kuning bila tidak di load menyebabkan footer tidak tampil di tempat semestinya. Oleh karena itu, sidebar juga perlu ditampilkan.

image

Bila tidak ingin menampilkan sidebar dan footer tetap di posisi bawah, saya belum tau caranya..mungkin teman2 yang tau bisa memberi saran/masukan

terima kasih

Minggu, 01 Desember 2013

Day 6– File PDF Online bisa DiLihat Orang Banyak

Sebelumnya telah kita bahas mengupload file ke folder tertentu di google drive dengan php dan google drive API. Sekarang kita lanjutkan agar pdf yang sudah diupload bisa dilihat oleh orang banyak

<?php

session_start();
$url_array = explode('?', 'http://'.$_SERVER ['HTTP_HOST'].$_SERVER['REQUEST_URI']);
$url = $url_array[0];

require_once 'google-api-php-client/src/Google_Client.php';
require_once 'google-api-php-client/src/contrib/Google_DriveService.php';

$client = new Google_Client();
$client->setClientId('your client id');
$client->setClientSecret('your client secret');
$client->setRedirectUri($url);
$client->setScopes(array('https://www.googleapis.com/auth/drive'));

if (isset($_GET['code'])) {
    $_SESSION['accessToken'] = $client->authenticate($_GET['code']);
    header('location:'.$url);exit;
} elseif (!isset($_SESSION['accessToken'])) {
    $client->authenticate();
}


if (!empty($_POST)) {

    $fileName = $_FILES['dokumen']['name'];    

    if (move_uploaded_file($_FILES['dokumen']['tmp_name'], $fileName)) {
    echo "File is valid, and was successfully uploaded.\n";
} else {
    echo "Possible file upload attack!\n";
}

   $client->setAccessToken($_SESSION['accessToken']);
   $service = new Google_DriveService($client);
   $finfo = finfo_open(FILEINFO_MIME_TYPE);
   $file_path = str_replace('/','\\',dirname($_SERVER['SCRIPT_FILENAME'])).'/'.$fileName;
   $parentId="0Bx3dFOUzrPOidEMwY2Y1d1hGRVE";
   $mime_type = finfo_file($finfo, $file_path);
   
  $file = new Google_DriveFile();
  $file->setTitle($fileName);
  $file->setDescription('This is a '.$mime_type.' document');
  $file->setMimeType($mime_type);

  // Set the parent folder.
  if ($parentId != null) {
    $parent = new Google_ParentReference();
    $parent->setId($parentId);
    $file->setParents(array($parent));
  }

  try {
    $data = file_get_contents($fileName);

    $createdFile = $service->files->insert($file, array(
      'data' => file_get_contents($file_path),
      'mimeType' => $mime_type,
    ));

    //Uncomment the following line to print the File ID
    //print 'File ID: %s' % $createdFile->getId();
    if ($createdFile != null) {
   echo "<a href='https://drive.google.com/file/d/".$createdFile[id]."'>open file</a>";
  }   
    return $createdFile;
   
  } catch (Exception $e) {
    print "An error occurred: " . $e->getMessage();
  }
    finfo_close($finfo);
    //unlink($fileName); 
    header('location:'.$url);exit;
}

include 'index.phtml';
?>

Hasil

image

image

image