当前位置: 首页>>代码示例>>PHP>>正文


PHP Report::entry方法代码示例

本文整理汇总了PHP中Report::entry方法的典型用法代码示例。如果您正苦于以下问题:PHP Report::entry方法的具体用法?PHP Report::entry怎么用?PHP Report::entry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Report的用法示例。


在下文中一共展示了Report::entry方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: report

 public function report()
 {
     $errors = count($this->errors['sku']) + count($this->errors['name']);
     $success = count($this->products) - $errors;
     $tab = new Tabs();
     $report = new Report();
     $tab->start();
     $tab->start("buttons");
     $tab->button("info", false, true);
     $success > 0 ? $tab->button("success", $success) : $tab->button("success");
     $errors > 0 ? $tab->button("errors", $errors) : $tab->button("errors");
     $tab->end("buttons");
     $tab->start("entries");
     $tab->entry("info", true);
     $report->start("import data");
     $report->entry("info", "info", "Products to be added: " . count($this->products));
     $report->entry($errors > 0 ? "warning" : "success", $errors > 0 ? "warning" : "success", "Products added: {$success}");
     $report->entry($errors > 0 ? "warning" : "info", $errors > 0 ? "warning" : "info", "Errors: {$errors}");
     $report->entry("info", "info", "Clearing parsed data and import file");
     if (unlink($_SESSION['upload_file'])) {
         unset($_SESSION['upload_file']);
         unset($_SESSION['products']);
         $report->entry("success", "success", "Cleared parsed data");
     }
     if ($errors == 0) {
         $report->entry("success", "success", "Import completed without errors");
     } else {
         $report->entry("warning", "warning", "Import completed with errors please review");
     }
     $report->end();
     $tab->entry("end");
     $tab->entry("success");
     $report->start("Successful product creation");
     foreach ($this->products as $key => $product) {
         if (!in_array($product['sku'], $this->errors['sku']) && !in_array($product['name'], $this->errors['name'])) {
             $report->entry("success", "product: {$key}", "Added: " . $product['name']);
         }
     }
     if ($success == 0) {
         $report->entry("info", "info", "No products we're added");
     }
     $report->end();
     $tab->entry("end");
     $tab->entry("errors");
     if (count($this->errors['sku']) > 0) {
         $report->start("Sku duplicates");
         foreach ($this->products as $key => $product) {
             if (in_array($product['sku'], $this->errors['sku'])) {
                 $report->entry("warning", "product: {$key}", "Failed to add product: " . $product['name'] . "<br />Due to duplicated sku: " . $product['sku'] . "<br/>Existing product: " . $this->duplicates[$product['sku']]);
             }
         }
         $report->end();
     }
     if (count($this->errors['name']) > 0) {
         $report->start("Name duplicates");
         foreach ($this->products as $key => $product) {
             if (in_array($product['name'], $this->errors['name'])) {
                 $report->entry("warning", "product: {$key}", "Failed to add product: " . $product['name'] . "<br />Due to not having a valid sku and provided name already exists<br/>Existing product: " . $product['sku']);
             }
         }
         $report->end();
     }
     if ($errors == 0) {
         $report->start("Import errors");
         $report->entry("info", "info", "No products have errors");
         $report->end();
     }
     $tab->entry("end");
     $tab->end("entries");
     $tab->end();
 }
开发者ID:HQPDevCrew,项目名称:BPU,代码行数:71,代码来源:Uploads.class.php

示例2: check_flux

 public function check_flux()
 {
     $report = new Report();
     $report->start("flux files");
     $report->entry("info", "Flux Settings", "Off");
     $report->entry("info", "Flux Settings", "Checking for existing files");
     $files['Up'] = "../var/magmi-import/flux-up/Flux - {$this->collection_name}.csv";
     $files['Down'] = "../var/magmi-import/flux-down/Flux - {$this->collection_name}.csv";
     foreach ($files as $key => $file) {
         if (is_file($file)) {
             $report->entry("success", "{$key} File", "File exists, deleting file");
             unlink($file);
         } else {
             $report->entry("default", "{$key} File", "File does not exist, doing nothing");
         }
     }
     $report->end();
 }
开发者ID:HQPDevCrew,项目名称:BPU,代码行数:18,代码来源:Exports.class.php

示例3: foreach

    }
} else {
    $mp = $results;
}
$ai = $mage_db->select("m2epro_amazon_listing_product", null, "listing_product_id,sku");
if ($mp and $ai) {
    if ($_SESSION['display']) {
        $report->start("Comparing Amazon Item Sku's to Products", 3);
    }
    foreach ($ai as $si) {
        $result = $mage_db->select("m2epro_listing_product", $si['listing_product_id'], "product_id", 1);
        $si['product_id'] = $result['product_id'];
        if ($mp[$si['product_id']] !== $si['sku']) {
            if ($_SESSION['display']) {
                $entry = $mp[$si['product_id']] . "||" . $si['sku'];
                $report->entry("warning", $si['product_id'], $entry);
            } else {
                $mage_db->delete("m2epro_amazon_listing_product", "`listing_product_id` = " . $si['listing_product_id']);
                $mage_db->delete("m2epro_listing_product", $si['listing_product_id']);
                $html->redirection("../scripts.php");
            }
        }
        // else if($_SESSION['display']) {
        // 	$entry = $mp[$si['product_id']]."||".$si['sku'];
        // 	$report->entry("info", "skipping", $entry);
        // }
    }
    if ($_SESSION['display']) {
        $report->end();
    }
}
开发者ID:HQPDevCrew,项目名称:BPU,代码行数:31,代码来源:m2e.php

示例4: manage

 public function manage()
 {
     global $db;
     $blacklist = $db->select("blacklist");
     $report = new Report();
     $report->start("words & phrases", 3);
     if ($blacklist) {
         foreach ($blacklist as $phrase) {
             if (strpos($phrase['word'], " ") !== false) {
                 $format = "phrase";
             } else {
                 $format = "word";
             }
             $report->entry("default", $format, $phrase['word'] . "||<a class='btn btn-xs btn-danger' href='blacklist.php?d=" . $phrase['id'] . "' role='button'>delete</a>");
         }
     } else {
         $report->entry("danger", "error", "You seriously need to sit down and think about your life.");
     }
     $report->end();
 }
开发者ID:HQPDevCrew,项目名称:BPU,代码行数:20,代码来源:Blacklist.class.php

示例5: array

///////////////////
require "../../app/Mage.php";
Mage::register('isSecureArea', true);
umask(0);
Mage::app();
$categoryCollection = Mage::getModel('catalog/category')->getCollection()->addAttributeToSelect('*')->addFieldToFilter('level', array('gteq' => 2));
//greater than root category id
$report->start("Deleting Empty Categories");
$deleted = 0;
foreach ($categoryCollection as $category) {
    $cname = strtolower($category->getName());
    if ($cname !== "ebay listings" and $cname !== "amazon listings") {
        if ($category->getProductCount() === 0) {
            $deleted++;
            if (!$disable) {
                $report->entry("success", $category->getName(), "Deleted");
                $category->delete();
            } else {
                $report->entry("info", $category->getName(), $category->getProductCount());
            }
        } else {
            $report->entry("info", $category->getName(), $category->getProductCount());
        }
    }
}
if (!$disable) {
    $report->entry("default", "Categories Deleted", $deleted);
}
$report->end();
// echo 'Empty Categories Deleted!';
////////////////
开发者ID:HQPDevCrew,项目名称:BPU,代码行数:31,代码来源:category.php


注:本文中的Report::entry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。