<?php

@session_start();
if (empty($_SESSION['username']) and empty($_SESSION['password'])) {
    header("location:login.php");
} else {
    include "controller/reportController.php";
    $page = @$_GET['page'];
    $report = new reportController();
    if (@$_SESSION['level'] == 'admin') {
        if ($page == 'report_all_kas') {
            $report->reportKasAll();
        } else {
            if ($page == 'report_per_kas') {
                $report->reportKasPer();
            } else {
                if ($page == 'report_all_petugas') {
                    $report->reportPetugasAll();
                } else {
                    if ($page == 'report_per_petugas') {
                        $report->reportPerPetugas();
                    } else {
                        if ($page == 'report_petugas') {
                            $report->reportPetugas();
                        } else {
                            if ($page == 'report_all_zakat_fitrah') {
                                $report->reportZakatFitrahAll();
                            } else {
                                if ($page == 'report_per_zakat_fitrah') {
                                    $report->reportZakatFitrahPer();
                                } else {
include "controller/login.php";
include "controller/jabatanController.php";
include "controller/petugasController.php";
include "controller/kasController.php";
include "controller/zakatFitrahController.php";
include "controller/zakatMalController.php";
include "controller/reportController.php";
include "controller/userController.php";
include "controller/hitungZakatController.php";
$login = new login();
$jabatan = new jabatanController();
$petugas = new petugasController();
$kas = new kasController();
$zakatFitrah = new zakatFitrahController();
$zakatMal = new zakatMalController();
$report = new reportController();
$user = new userController();
$hitung = new hitungZakatController();
$page = @$_GET['page'];
$act = @$_GET['act'];
$id = @$_GET['id'];
if (@$_SESSION['level'] == 'admin') {
    if ($page == '') {
        include "view/beranda.php";
    } else {
        if ($page == 'logout') {
            $login->logout();
        } else {
            if ($page == 'struktur_jabatan') {
                //Struktur Jabatan
                if ($act == '') {
예제 #3
0
파일: report.php 프로젝트: EgiAndriana/BBS
<?php

require_once "controller/reportController.php";
$report = new reportController();
$page = @$_GET['page'];
$act = @$_GET['act'];
$id = @$_GET['id'];
if ($page == 'cetak') {
    $report->cetak();
}
 function importProduct($file)
 {
     $handle = fopen($file->path, "r");
     $data = fgetcsv($handle, 10000, ",");
     //eDebug($data);
     foreach ($data as $key => $value) {
         $dataset[$value] = '';
     }
     //eDebug($dataset,true);
     $count = 1;
     $errorSet = array();
     $successSet = array();
     //$createCats = array();
     $product = null;
     /*
     0= id    
     1=parent_id    
     2=child_rank    
     3=title    
     4=model    
     5=warehouse_location    
     6=sef_url    
     7=meta_title    
     8=meta_keywords    
     9=meta_description    
     10=base_price    
     11=special_price    
     12=use_special_price    
     13=active_type    
     14=product_status_id    
     15=category1    
     16=category2    
     17=category3    
     18=category4    
     19=surcharge                                        
     20=rank   
     21=feed_title
     22=feed_body   
     */
     while (($data = fgetcsv($handle, 10000, ",")) !== FALSE) {
         $count++;
         //eDebug($data, true);
         if (isset($data[0]) && $data[0] != 0) {
             $product = new product($data[0], false, false);
             if (empty($product->id)) {
                 $errorSet[$count] = $product->id . " is not a valid product ID.";
                 continue;
             }
         } else {
             //$errorSet[$count] = "Product ID not supplied.";
             //continue;
             $product = new product();
             //$product->save(false);
         }
         $checkTitle = trim($data[3]);
         if (empty($checkTitle)) {
             $errorSet[$count] = "No product name (title) supplied, skipping this record...";
             continue;
         }
         $product->parent_id = $data[1];
         $product->child_rank = $data[2];
         $product->title = stripslashes(stripslashes($data[3]));
         $product->body = utf8_encode(stripslashes(reportController::parseAndTrimImport($data[4], true)));
         //$product->body = utf8_encode(stripslashes(stripslashes(($data[4]))));
         $product->model = stripslashes(stripslashes($data[5]));
         $product->warehouse_location = stripslashes(stripslashes($data[6]));
         $product->sef_url = stripslashes(stripslashes($data[7]));
         $product->meta_title = stripslashes(stripslashes($data[8]));
         $product->meta_keywords = stripslashes(stripslashes($data[9]));
         $product->meta_description = stripslashes(stripslashes($data[10]));
         $product->tax_class_id = $data[11];
         $product->quantity = $data[12];
         $product->availability_type = $data[13];
         $product->base_price = $data[14];
         $product->special_price = $data[15];
         $product->use_special_price = $data[16];
         $product->active_type = $data[17];
         $product->product_status_id = $data[18];
         $product->surcharge = $data[31];
         $product->feed_title = stripslashes(stripslashes($data[33]));
         $product->feed_body = stripslashes(stripslashes($data[34]));
         if (empty($product->id)) {
             $product->minimum_order_quantity = 1;
         }
         if ($product->parent_id == 0) {
             $createCats = array();
             $createCatsRank = array();
             for ($x = 19; $x <= 30; $x++) {
                 if (!empty($data[$x])) {
                     $result = $this->parseCategory($data[$x]);
                 } else {
                     continue;
                 }
                 if (is_numeric($result)) {
                     $createCats[] = $result;
                     $createCatsRank[$result] = $data[32];
                 } else {
                     $errorSet[$count][] = $result;
                     continue 2;
                 }
             }
         }
         /*[0] => id
           [1] => parent_id
           [2] => child_rank
           [3] => title
           [4] => model
           [5] => warehouse_location
           [6] => sef_url
           [7] => meta_title
           [8] => meta_keywords
           [9] => meta_description
           [10] => base_price
           [11] => special_price
           [12] => use_special_price
           [13] => active_type
           [14] => product_status_id
           [15] => category1
           [16] => category2
           [17] => category3
           [18] => category4
           [19] => surcharge*/
         //eDebug($createCats,true);
         if (!empty($product->user_input_fields) && is_array($product->user_input_fields)) {
             $product->user_input_fields = serialize($product->user_input_fields);
         }
         //eDebug($product->user_input_fields);
         if (!empty($product->user_input_fields) && !is_array($product->user_input_fields)) {
             $product->user_input_fields = str_replace("'", "\\'", $product->user_input_fields);
         }
         //eDebug($product->user_input_fields,true);
         $product->save(false);
         //eDebug($product->body);
         //sort order and categories
         if ($product->parent_id == 0) {
             $product->saveCategories($createCats, $createCatsRank);
             //eDebug($createCatsRank);
         }
         echo "Sucessfully imported row " . $count . ", product: " . $product->title . "<br/>";
         //eDebug($product);
     }
     if (count($errorSet)) {
         echo "<br/><hr><br/><font color='red'>The following records were NOT imported:<br/>";
         foreach ($errorSet as $row => $err) {
             echo "Row: " . $row . ". Reason:<br/>";
             if (is_array($err)) {
                 foreach ($err as $e) {
                     echo "--" . $e . "<br/>";
                 }
             } else {
                 echo "--" . $err . "<br/>";
             }
         }
         echo "</font>";
     }
 }