Exemplo n.º 1
0
 function execute()
 {
     $receiptNum = $this->formArray[receiptNum];
     echo "receiptNum={$receiptNum}<br>";
     $collection = new Collections();
     $collectionID = $collection->selectWhereReceiptNum($receiptNum);
     $collection->cancelRecord();
     echo "collectionID={$collectionID}<br>";
 }
Exemplo n.º 2
0
 function execute()
 {
     $collection = new Collections();
     if ($collection->purge()) {
         echo "Purge successfully completed.<br>";
     } else {
         echo "Purge errors were encountered.<br>";
     }
 }
 public final function getClientFieldNamesForEnhancedClass(Clazz $clazz)
 {
     if (is_null($this->clientFields)) {
         return null;
     }
     $fieldNames = $this->clientFields->get($clazz);
     return is_null($fieldNames) ? null : Collections::unmodifiableSet($fieldNames);
 }
Exemplo n.º 4
0
 public static function get_instance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new Collections();
         self::$instance->load();
     }
     return self::$instance;
 }
Exemplo n.º 5
0
 public function executeSetInstitution(sfWebRequest $request)
 {
     if (!$this->getUser()->isAtLeast(Users::MANAGER)) {
         $this->forwardToSecureAction();
     }
     $collection = new Collections();
     $collection->setInstitutionRef(Doctrine::getTable('Collections')->getInstitutionNameByCollection($request->getParameter('parent_ref'))->getId());
     $this->form = new CollectionsForm($collection);
     $this->setLayout(false);
 }
 function displayTree(Collections $elem, $html, $value, $name, $user = null)
 {
     $img_expand = 'blue_expand.png';
     $img_expand_up = 'blue_expand_up.png';
     if ($elem->hasChild()) {
         $html .= '<ul>';
         foreach ($elem->getChilds() as $child) {
             $html .= "<li class=\"rid_" . $child->getId() . "\"";
             if ($child->isEncodable()) {
                 $html .= ' data-enc="true" ';
             }
             $html .= "><div class=\"col_name\">";
             $html .= image_tag($img_expand, array('alt' => '+', 'class' => 'tree_cmd collapsed'));
             $html .= image_tag($img_expand_up, array('alt' => '-', 'class' => 'tree_cmd expanded hidden'));
             $html .= "<span>" . $child->getName() . "</span>";
             $options = array('type' => 'checkbox', 'class' => 'col_check', 'value' => $child->getId(), 'name' => $name);
             if (is_array($value) && in_array($child->getId(), $value)) {
                 $options['checked'] = "checked";
             }
             if ($name != '') {
                 $html .= '<label class="chk">' . $this->renderTag('input', $options) . '</label>';
             } else {
                 if (!$this->getOption('is_choose')) {
                     $html .= ' ' . image_tag('info.png', array('title' => 'info', 'class' => 'extd_info', 'data-manid' => $child->getMainManagerRef(), 'data-staffid' => $child->getStaffRef()));
                     if ($user->isA(Users::ADMIN) || $user->isAtLeast(Users::MANAGER) && $child->getTypeInCol() >= Users::MANAGER) {
                         $html .= link_to(image_tag('edit.png', array('title' => 'Edit Collection', 'class' => 'collection_edit')), 'collection/edit?id=' . $child->getId());
                         $html .= link_to(image_tag('duplicate.png', array('title' => 'Duplicate Collection')), 'collection/new?duplicate_id=' . $child->getId());
                     }
                 }
             }
             $html .= "</div>";
             $html .= $this->displayTree($child, '', $value, $name, $user) . '</li>';
         }
         $html .= '</ul>';
     }
     return $html;
 }
Exemplo n.º 7
0
 /**
  * Get a count for the specified key
  *
  * @param   string   $what  Key name [following, followers, collectios, posts]
  * @return  integer
  */
 public function count($what = 'following')
 {
     $what = strtolower(trim($what));
     $value = $this->get($what);
     switch ($what) {
         case 'following':
             if ($value === null) {
                 $value = $this->_tbl->count(array('follower_type' => $this->get('following_type'), 'follower_id' => $this->get('following_id')));
                 $this->set($what, $value);
             }
             break;
         case 'followers':
             if ($value === null) {
                 $value = $this->_tbl->count(array('following_type' => $this->get('following_type'), 'following_id' => $this->get('following_id')));
                 $this->set($what, $value);
             }
             break;
         case 'collections':
             if ($value === null && $this->get('following_type') != 'collection') {
                 $model = Collections::getInstance($this->get('following_type'), $this->get('following_id'));
                 $value = $model->collections(array('count'));
                 $this->set($what, $value);
             }
             break;
         case 'posts':
             if ($value === null) {
                 if ($this->get('following_type') != 'collection') {
                     $model = Archive::getInstance($this->get('following_type'), $this->get('following_id'));
                     $value = $model->posts(array('count'));
                     $this->set($what, $value);
                 } else {
                     $model = Collection::getInstance($this->get('following_id'));
                     $value = $model->posts(array('count'));
                     $this->set($what, $value);
                 }
             }
             break;
     }
     if ($value === null) {
         $value = 0;
     }
     return $value;
 }
Exemplo n.º 8
0
 /**
  * Removes all given items from collection.
  *
  * @param array|\stekycz\collections\ArrayObject $items
  * @return \stekycz\collections\ArrayObject
  */
 public function removeAll($items)
 {
     $items = Collections::toArrayObject($items);
     $this->items = array_diff($this->items, $items->items);
     return $this;
 }
Exemplo n.º 9
0
<?php

include dirname(__FILE__) . '/../../bootstrap/Doctrine.php';
$t = new lime_test(4, new lime_output_color());
$t->info('getLevel');
$col1 = new Collections();
$col1->setPath('/12/13/');
$t->is($col1->getLevel(), 3, 'Get the level of the collection with parents');
$col1->setPath('/');
$t->is($col1->getLevel(), 1, 'Get the level of the collection at root');
$t->info('__toString');
$col1->setName("Malaco");
$t->is("" . $col1, 'Malaco', "To string of collection get name for root levels");
$col1->setPath('/12/13/');
$t->is("" . $col1, '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Malaco', "To string of collection add spaces for childrens levels");
Exemplo n.º 10
0
<?php

/**
 * Created by Kent M. Patrick
 * Project: BPU
 * Company: Fingerprints Ltd
 * Date: 21/09/2016
 * Time: 9:58 AM
 */
require_once 'header.php';
$collections = new Collections();
if (isset($_POST['submit'])) {
    switch ($_GET['c']) {
        case 'add':
            if ($_POST['name'] != "") {
                $name = str_ireplace('/', '-', $_POST['name']);
                $db->insert("collections", "name,user_id", "{$name}||" . $_SESSION['userid']);
                $html->redirection("collections.php?c={$db->affected_id}");
            } else {
                $alerts->display("danger", "error", "Please enter new collections name.");
                echo "<div id='page-title' class='row'>";
                echo "<div class='col-xs-12 col-sm-6'>";
                $html->title("collections", null, "left");
                echo "</div>";
                echo "<div class='col-xs-12 col-sm-6'>";
                $collections->create();
                echo "</div>";
                echo "</div>";
                $collections->listing();
            }
            break;
Exemplo n.º 11
0

});
</script>
<div class="container">
  <?php 
foreach ($institutions as $institution) {
    ?>
    <h2><?php 
    echo $institution->getFormatedName();
    ?>
</h2>
    <div class="treelist">
    <?php 
    $w = new sfWidgetCollectionList(array('choices' => array(), 'is_choose' => $is_choose));
    $root = $tree = new Collections();
    foreach ($institution->Collections as $item) {
        $it = sfOutputEscaper::unescape($item);
        $anc = $tree->getFirstCommonAncestor($it);
        $anc->addChild($it);
        $tree = $it;
    }
    echo $w->displayTree($root, '', array(), '', $sf_user);
    ?>

    </div>
  <?php 
}
?>
  <?php 
if ($sf_user->isAtLeast(Users::MANAGER)) {
Exemplo n.º 12
0
require_once 'header.php';
$rename_path = '../media/magmi-import';
$rename_files = scandir($rename_path);
foreach ($rename_files as $key => $name) {
    $oldName = $name;
    $newName = strtolower($name);
    if ($oldName !== $newName) {
        rename("{$rename_path}/{$oldName}", "{$rename_path}/{$newName}");
    }
}
if (isset($_GET['c'])) {
    $products = $db->select('products', "`collection_id` = " . $_GET['c']);
} else {
    $html->redirection("./collections.php");
}
$collections = new Collections();
$collections->get_data($_GET['c']);
echo "<div id='page-title' class='row'>";
echo "<div class='col-xs-12 col-sm-6'>";
$html->title("collection", "- {$collections->name}", "left");
echo "</div>";
echo "<div class='col-xs-12 col-md-6 text-right'>";
$html->button("collections.php", "back", "default");
echo "</div>";
echo "</div>";
echo "<hr />";
echo '<div class="row">';
if ($products) {
    foreach ($products as $product) {
        $filename = $_SESSION['settings']['filenames'] ? $product['filename'] : $product['sku'];
        $image = "../media/catalog/product/" . strtolower($filename) . ".jpg";
Exemplo n.º 13
0
 function closeReceipt($varValues)
 {
     #Step 5
     $this->tpl->set_var('paymentPeriod', $varValues['paymentPeriod']);
     $this->tpl->set_var('rptopID', $varValues['rptopID']);
     $this->tpl->set_var('rptopNum', $varValues['rptopNum']);
     $this->tpl->set_var('prevORNum', $varValues['prevORNum']);
     $this->tpl->set_var('prevORDate', $varValues['prevORDate']);
     $this->tpl->set_block('step5', 'TDID', 'TDIDs');
     $tdID = $varValues['tdID'];
     if (is_array($tdID)) {
         foreach ($tdID as $key => $id) {
             # set/pass tdIDs to form
             $this->tpl->set_var(tdID, $id);
             $this->tpl->parse('TDIDs', 'TDID', 'true');
         }
     }
     # get collectionID and use it to update payments made in dues table, update receiptNum in collections and payments table
     $collections = new Collections();
     $collections->setCollectionID($varValues['collectionID']);
     $collections->setReceiptNum($varValues['receiptNo']);
     $collections->updateReceiptNum();
 }
Exemplo n.º 14
0
$cbgroup = new CBGroups();
$adsObj = new AdsManager();
$formObj = new formObj();
$cbplugin = new CBPlugin();
$eh = new EH();
$sess = new Session();
$cblog = new CBLogs();
$imgObj = new ResizeImage();
$cbvideo = $cbvid = new CBvideo();
$cbplayer = new CBPlayer();
$cbemail = new CBEmail();
$cbsearch = new CBSearch();
$cbpm = new cb_pm();
$cbpage = new cbpage();
$cbindex = new CBreindex();
$cbcollection = new Collections();
$cbphoto = new CBPhotos();
$cbfeeds = new cbfeeds();
//	$cbmenu		= new MenuHandler();
check_install('after');
require 'defined_links.php';
@(include "clipbucket.php");
$Cbucket->cbinfo = array("version" => VERSION, "state" => STATE, "rev" => REV, "release_date" => RELEASED);
//Holds Advertisment IDS that are being Viewed
$ads_array = array();
if (phpversion() < '5.2.0') {
    require_once $Cbucket->BASEDIR . '/includes/classes/Services_JSON.php';
    $json = new Services_JSON();
}
//Website Details
define('CB_VERSION', $row['version']);
Exemplo n.º 15
0
 /**
  * Returns an array of values belonging to a given property of each item in a collection.
  *
  * @param array $collection array
  * @param string $property property
  *
  * @return array|object
  *
  */
 public static function pluck($collection = [], $property = '')
 {
     $plucked = \array_map(function ($value) use($property) {
         return Collections::get($value, $property);
     }, (array) $collection);
     if (Objects::isObject($collection)) {
         $plucked = (object) $plucked;
     }
     return $plucked;
 }
Exemplo n.º 16
0
 /**
  * Returns a fixed size ListI based on the content of the give array
  *
  * @param array|\blaze\collections\ArrayI $array The contents of the array which should be used as content for the list
  * @return blaze\collections\ListI An immutable list with the contents of the array.
  */
 public static function asList($array)
 {
     return Collections::immutableList(new lists\ArrayList($array));
 }
session_start();
require_once "header.php";
$failedGoTo = "home.php";
$successGoTo = "collections.php";
$logoutGoTo = "home.php";
$access = new Access();
$logonUser = $access->isInitAccess();
if ($logonUser) {
    $typeUser = $access->isAdminUser();
}
$access->processLogout($logoutGoTo);
$access->processLogonRestriction($failedGoTo);
$access->processSendAccess($successGoTo, $failedGoTo);
unset($access);
$collectionsArray = array();
$collections = new Collections();
$cuntryArray = $collections->getCountrys();
//unset($collections);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/Main.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- InstanceBeginEditable name="doctitle" -->
<title>CIP (Collector and Injection Panel)</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<?php 
?>
<!-- InstanceEndEditable -->
<style type="text/css">