public function __construct($sync = true)
 {
     $this->type_array[] = array('id' => 'c', 'text' => TEXT_CUSTOMER);
     $this->type_array[] = array('id' => 'v', 'text' => TEXT_VENDOR);
     $this->type_array[] = array('id' => 'e', 'text' => TEXT_EMPLOYEE);
     $this->type_array[] = array('id' => 'b', 'text' => TEXT_BRANCH);
     parent::__construct($sync);
 }
 public function build_form_html($action, $id = '')
 {
     $output = parent::build_form_html($action, $id = '');
     $output .= '<table style="border-collapse:collapse;width:100%;">' . chr(10);
     $output .= '  <thead class="ui-widget-header"><tr><th>' . TEXT_OPTIONS . "</th></tr></thead>\n";
     $output .= '  <tbody class="ui-widget-content"><tr><td>' . "\n";
     $output .= html_checkbox_field('use_in_inventory_filter', true, $this->use_in_inventory_filter, '') . '&nbsp;' . TEXT_USE_IN_FILTER . "<br />\n";
     $output .= '  </td></tr></tbody>' . "\n";
     $output .= "</table>\n";
     return $output;
 }
 public function __construct()
 {
     gen_pull_language('assets');
     $this->type_array[] = array('id' => 'vh', 'text' => TEXT_VEHICLE);
     $this->type_array[] = array('id' => 'bd', 'text' => TEXT_BUILDING);
     $this->type_array[] = array('id' => 'fn', 'text' => TEXT_FURNITURE);
     $this->type_array[] = array('id' => 'pc', 'text' => TEXT_COMPUTER);
     $this->type_array[] = array('id' => 'te', 'text' => TEXT_EQUIP);
     $this->type_array[] = array('id' => 'ld', 'text' => TEXT_LAND);
     $this->type_array[] = array('id' => 'sw', 'text' => TEXT_SOFTWARE);
     $this->type_desc = ASSETS_ENTRY_ASSETS_TYPE;
     parent::__construct();
 }
Beispiel #4
0
 public function deleteCustomFields()
 {
     if (!empty($_POST['del'])) {
         mysql_query("DELETE FROM `" . DB_PREFIX . "cusfields` \n    WHERE `id` IN(" . implode(',', $_POST['del']) . ") \n\t") or die(mswMysqlErrMsg(mysql_errno(), mysql_error(), __LINE__, __FILE__));
         $rows = mysql_affected_rows();
         mysql_query("DELETE FROM `" . DB_PREFIX . "ticketfields` \n    WHERE `fieldID` IN(" . implode(',', $_POST['del']) . ") \n\t") or die(mswMysqlErrMsg(mysql_errno(), mysql_error(), __LINE__, __FILE__));
         if (mswRowCount('cusfields') == 0) {
             @mysql_query("TRUNCATE TABLE `" . DB_PREFIX . "cusfields`");
         }
         if (mswRowCount('ticketfields') == 0) {
             @mysql_query("TRUNCATE TABLE `" . DB_PREFIX . "ticketfields`");
         }
         // Rebuild sequence..
         fields::rebuildSequence();
         return $rows;
     }
     return '0';
 }
Beispiel #5
0
// You should have received a copy of the ProEthos License along with the ProEthos
// Software. If not, see
// https://raw.githubusercontent.com/bireme/proethos/master/LICENSE.txt
require "cab.php";
/* Admin Common */
$ok = ($perfil->valid('#ADM') or $perfil->valid('#SCR') or $perfil->valid('#COO'));
if ($ok == 0) {
    redirecina('main.php');
}
require "_class/_class_submit_manuscrito_field.php";
global $acao, $dd, $cp, $tabela;
require $include . 'sisdoc_colunas.php';
require $include . '_class_form.php';
$form = new form();
require "form_css.php";
$cl = new fields();
$cp = $cl->cp();
$tabela = $cl->tabela;
$http_edit = 'admin_submit_ed.php';
$http_redirect = '';
$tit = msg("titulo");
/** Comandos de Edi��o */
$tela = $form->editar($cp, $tabela);
/** Caso o registro seja validado */
if ($form->saved > 0) {
    echo 'Salvo';
    $cl->updatex();
    redirecina('admin_submit_1.php');
} else {
    echo $tela;
}
Beispiel #6
0
    function editOrder($a, $items, $pageNav)
    {
        global $mainframe, $mosConfig_list_limit, $mosConfig_absolute_path;
        display::header();
        $cid = JRequest::getVar('cid', array(0), '', 'array');
        $edit = $cid != array(0);
        $text = $edit ? JText::_('Edit') : JText::_('New');
        JToolBarHelper::title(JText::_("SimpleCaddy {$text}"), 'generic.png');
        JToolBarHelper::save('save', 'Save');
        JToolBarHelper::apply();
        if ($edit) {
            // for existing items the button is renamed `close`
            JToolBarHelper::cancel('cancel', 'Close');
        } else {
            JToolBarHelper::cancel();
        }
        $cfg = new sc_configuration();
        $currency = $cfg->get("currency");
        $tsep = $cfg->get("thousand_sep");
        $decsep = $cfg->get("decimal_sep");
        $decs = $cfg->get("decimals");
        $align = $cfg->get("curralign");
        // before amount==1
        // hardcoded fields from old simplecaddy <1.7
        $standardfields = array("name", "email", "address", "codepostal", "city", "telephone", "ipaddress");
        $statuses = explode("\n", $cfg->get("ostatus"));
        ?>
		<form method="post" name="adminForm" action="index2.php">
		<table class="adminform" width="100%"><tr><th class="title"><?php 
        echo JText::_('SC_ORDER');
        ?>
</th><th><?php 
        echo $a->id;
        ?>
</th></tr>
		<tr>
			<td width="185"><?php 
        echo JText::_('SC_DATE');
        ?>
</td>
			<td>
			<?php 
        echo date("d-m-Y H:i:s", $a->orderdt);
        ?>
			</td>
		</tr>
		<tr>
			<td width="185"><?php 
        echo JText::_('SC_USERID');
        ?>
</td>
			<td><?php 
        echo $a->j_user_id;
        ?>
</td>
		</tr>
		<tr>
			<td width="185"><?php 
        echo JText::_('SC_NAME');
        ?>
</td>
			<td><?php 
        echo $a->name;
        ?>
</td>
		</tr>
		<tr>
			<td width="185"><?php 
        echo JText::_('SC_EMAIL');
        ?>
</td>
			<td><?php 
        echo "<a href='mailto:{$a->email}'>{$a->email}</a>";
        ?>
</td>
		</tr>
		<tr>
			<td width="185"><?php 
        echo JText::_('SC_ADDRESS');
        ?>
</td>
			<td>
			<?php 
        echo $a->address;
        ?>
			</td>
		</tr>
		<tr>
			<td width="185"><?php 
        echo JText::_('SC_ZIPCODE');
        ?>
</td>
			<td>
			<?php 
        echo $a->codepostal;
        ?>
			</td>
		</tr>
		<tr>
			<td width="185"><?php 
        echo JText::_('SC_CITY');
        ?>
</td>
			<td>
			<?php 
        echo $a->city;
        ?>
			</td>
		</tr>
		<tr>
			<td width="185"><?php 
        echo JText::_('SC_PHONE');
        ?>
</td>
			<td>
			<?php 
        echo $a->telephone;
        ?>
			</td>
		</tr>
		<tr>
			<td width="185"><?php 
        echo JText::_('SC_IP_ADDRESS');
        ?>
</td>
			<td>
			<?php 
        $iplink = '&nbsp;<a href="http://whois.domaintools.com/' . $a->ipaddress . '" target="_blank" class="scbutton">' . JText::_("SC_CHECKIP") . "</a>";
        echo $a->ipaddress;
        echo $iplink;
        ?>
 			<input type="hidden" name="ipaddress" value="<?php 
        echo $a->ipaddress;
        ?>
" />
			</td>
		</tr>
		<tr>
			<td width="185"><?php 
        echo JText::_('SC_SHIP_REGION');
        ?>
</td>
			<td>
			<?php 
        echo $a->shipRegion;
        ?>
			</td>
		</tr>
		<tr>
			<td width="185"><?php 
        echo JText::_('SC_SHIP_COST');
        ?>
</td>
			<td>
			<?php 
        if ($align == 1) {
            echo $currency . "&nbsp;";
        }
        echo number_format($a->shipCost, $decs, $decsep, $tsep);
        if ($align == 0) {
            echo "&nbsp;" . $currency;
        }
        ?>
			</td>
		</tr>
		<tr>
			<td width="185"><?php 
        echo JText::_('SC_SUBTOTAL');
        ?>
</td>
			<td>
			<?php 
        if ($align == 1) {
            echo $currency . "&nbsp;";
        }
        echo number_format($a->total, $decs, $decsep, $tsep);
        if ($align == 0) {
            echo "&nbsp;" . $currency;
        }
        ?>
 
			</td>
		</tr>
		<tr>
			<td width="185"><?php 
        echo JText::_('SC_TAX');
        ?>
</td>
			<td>
			<?php 
        if ($align == 1) {
            echo $currency . "&nbsp;";
        }
        echo number_format($a->tax, $decs, $decsep, $tsep);
        if ($align == 0) {
            echo "&nbsp;" . $currency;
        }
        ?>
 
			</td>
		</tr>
		<tr>
			<td width="185"><?php 
        echo JText::_('SC_TOTAL');
        ?>
</td>
			<td>
			<?php 
        if ($align == 1) {
            echo $currency . "&nbsp;";
        }
        echo number_format($a->total + $a->tax, $decs, $decsep, $tsep);
        if ($align == 0) {
            echo "&nbsp;" . $currency;
        }
        ?>
 
			</td>
		</tr>
		<tr>
			<td width="185"><?php 
        echo JText::_('SC_PAYMENT_ID');
        ?>
</td>
			<td>
			<?php 
        echo $a->ordercode;
        ?>
 
			</td>
		</tr>
		<?php 
        if (@$a->customfields) {
            echo "<tr><th>" . JText::_('Custom fields') . "</th><th>&nbsp;</th></tr>";
            $fields = new fields();
            $fieldlist = $fields->getPublishedFieldsArray();
            $acfields = unserialize($a->customfields);
            foreach ($fieldlist as $key => $cfield) {
                if (!in_array($cfield, $standardfields)) {
                    // show only the fields that are not hardcoded
                    if (isset($acfields[$cfield])) {
                        echo "<tr>";
                        echo "<td width=\"185\">{$cfield}</td>";
                        echo "<td>" . $acfields[$cfield] . "</td>";
                        echo "</tr>";
                    }
                }
            }
        }
        ?>
		<tr>
		<td><a href="index.php?option=com_caddy&action=orders&task=email&oid=<?php 
        echo $a->id;
        ?>
" class="scbutton"><?php 
        echo JText::_('Resend order confirmation email');
        ?>
</a></td>
		</tr>
		<tr>
			<td width="185"><?php 
        echo JText::_('SC_ORDER_STATUS');
        ?>
</td>
			<td>
			<?php 
        echo "<select name='edtostatus'>";
        foreach ($statuses as $status) {
            $selected = strtolower($a->status) == strtolower(trim($status)) ? " selected" : "";
            echo "<option value='" . trim($status) . "' {$selected}>{$status}</option>\n";
        }
        echo "</select>";
        ?>
			</td>
		</tr>
		</table>
		<table class="adminlist" width="100%" cellpadding="4" cellspacing="0" border="0" >
		<tr><th colspan="7"><?php 
        echo JText::_('SC_DETAILS');
        ?>
</th></tr>
		<tr>
			<th class="title"><?php 
        echo JText::_('SC_CODE');
        ?>
</th>
			<th class="title"><?php 
        echo JText::_('SC_QUANTITY');
        ?>
</th>
			<th class="title tdright"><?php 
        echo JText::_('SC_PRICE_PER_UNIT');
        ?>
</th>
			<th class="title tdright"><?php 
        echo JText::_('SC_TOTAL');
        ?>
</th>
			<th class="title"><?php 
        echo JText::_('SC_PRODUCT_NAME');
        ?>
</th>
			<th class="title"><?php 
        echo JText::_('SC_PRODUCT_OPTION');
        ?>
</th>
			<th class="title"><?php 
        echo JText::_('SC_ACTION');
        ?>
</th>
			<th class="title">&nbsp;</th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($items); $i < $n; $i++) {
            $row =& $items[$i];
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td width="10%">
					<?php 
            echo $row->prodcode;
            ?>
				</td>
				<td width="30">
					<?php 
            echo $row->qty;
            ?>
				</td>
				<td width="10%" class="tdright">
					<?php 
            echo number_format($row->unitprice, $decs, $decsep, $tsep);
            ?>
				</td>
				<td class="tdright">
					<?php 
            echo number_format($row->total, $decs, $decsep, $tsep);
            ?>
				</td>
				<td width="40%">
					<?php 
            echo $row->shorttext;
            ?>
				</td>
				<td>
					<?php 
            echo $row->option;
            ?>
&nbsp;
				</td>
				<td>
					<?php 
            echo "<a class=\"scbutton\" href=\"index2.php?option=com_caddy&action=products&task=decstore&pid={$row->prodcode}&qty={$row->qty}&order={$a->id}\">" . JText::_('SC_DECSTORE') . "</a>";
            ?>
				</td>
				<td>
					&nbsp;
				</td>
				<?php 
            $k = 1 - $k;
        }
        ?>
			</tr>
			<?php 
        $field = JRequest::getVar('field', '');
        $order = JRequest::getVar('order', '');
        ?>
		</table>
		<input type="hidden" name="id" value="<?php 
        echo $a->id ? "{$a->id}" : "-1";
        ?>
">
		<input type="hidden" name="option" value="com_caddy" />
		<input type="hidden" name="action" value="orders" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="order" value="<?php 
        echo $order;
        ?>
" />
		<input type="hidden" name="field" value="<?php 
        echo $field;
        ?>
" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />
		</form>
	<?php 
    }
Beispiel #7
0
<?php

defined('IN_DESTOON') or exit('Access Denied');
$tb = isset($tb) ? trim($tb) : '';
$tb or msg();
$len = strlen($DT_PRE);
if (substr($tb, 0, $len) == $DT_PRE) {
    $tb = substr($tb, $len);
}
$do = new fields();
$do->tb = $tb;
$menus = array(array('添加字段', '?file=' . $file . '&tb=' . $tb . '&action=add'), array('字段列表', '?&file=' . $file . '&tb=' . $tb));
$this_forward = '?moduleid=' . $moduleid . '&file=' . $file . '&tb=' . $tb;
switch ($action) {
    case 'add':
        if ($submit) {
            if ($do->pass($post)) {
                $do->add($post);
                dmsg('添加成功', $this_forward);
            } else {
                msg($do->errmsg);
            }
        } else {
            include tpl('fields_add');
        }
        break;
    case 'edit':
        $itemid or msg();
        $do->itemid = $itemid;
        if ($submit) {
            if ($do->pass($post)) {
Beispiel #8
0
 function ordertostring($cids)
 {
     $field = new fields();
     $aflds = $field->getFieldNames();
     $afields = unserialize($this->customfields);
     $this->afields = $aflds;
     foreach ($aflds as $key => $value) {
         $this->{$value} = $afields["{$value}"];
     }
     $csv = "";
     $fldsep = ",";
     $recsep = "\r\n";
     $csvheader = "orderid" . $fldsep . "orderdate" . $fldsep . "total" . $fldsep . "tax" . $fldsep . "Shipping Cost" . $fldsep . "Shipping Region" . $fldsep . "status";
     foreach ($aflds as $key => $value) {
         $csvheader .= $fldsep . "{$value}";
     }
     $csvheader .= $fldsep . "productcode" . $fldsep . "qty" . $fldsep . "unitprice" . $fldsep . "total" . $fldsep . "shorttext" . $fldsep . "option" . $recsep;
     $f = fopen("components/com_caddy/exports/export.txt", "w+");
     fwrite($f, $csvheader);
     foreach ($cids as $key => $orderid) {
         $this->load($orderid);
         //			printf("<pre>%s</pre>", print_r($this, 1));
         $csvline = "{$this->id}" . $fldsep . "{$this->orderdt}" . $fldsep . "{$this->total}" . $fldsep . "{$this->tax}" . $fldsep . "{$this->shipCost}" . $fldsep . "{$this->shipRegion}" . $fldsep . "{$this->status}" . $fldsep;
         foreach ($aflds as $key => $value) {
             $csvline .= $this->{$value} . $fldsep;
         }
         $detlin = "";
         $details = new orders();
         $lst = $details->getOrderDetails($this->id);
         $afields = unserialize($this->customfields);
         foreach ($lst as $d) {
             $detlin .= $csvline . $d->prodcode . $fldsep . $d->qty . $fldsep . $d->unitprice . $fldsep . $d->total . $fldsep . $d->shorttext . $fldsep . $d->option;
             foreach ($aflds as $key => $value) {
                 $detlin .= $fldsep . $afields["{$value}"];
             }
             $detlin .= $recsep;
             fwrite($f, $detlin);
             $detlin = "";
         }
     }
     fclose($f);
     //	$csvline .= $recsep;
     $csv = $csvheader;
     $csv .= $detlin;
     return $csv;
 }
 public function init($value)
 {
     parent::init((string) $value);
 }
Beispiel #10
0
             break;
         case "remove":
             $fields = new fields();
             $fields->removeFields($cid);
             $mainframe->redirect("index.php?option=com_caddy&action=fields&task=show&field={$field}&order={$order}&search={$search}", JText::_('SC_FIELDDELETED'));
             break;
         case "publish":
         case "unpublish":
             $fields = new fields();
             $fields->publishfield($cid, $task == 'publish');
             $mainframe->redirect("index.php?option=com_caddy&action=fields&task=show&field={$field}&order={$order}&search={$search}");
             break;
         case "show":
         default:
             JRequest::setvar('task', "fields");
             $fields = new fields();
             $alist = $fields->getAllFields();
             display::showFields($alist);
             break;
     }
     break;
 case "options":
 case "optiongroups":
     if (!$task) {
         $task = "show";
     }
     // make sure we have a task value here
     $c = new $action();
     $c->{$task}();
     // execute the task
     // no redirect!
Beispiel #11
0
if (strlen($adm) == 0) {
    return 'admin.php';
}
/* Admin Common */
$ok = ($perfil->valid('#ADM') or $perfil->valid('#SCR') or $perfil->valid('#COO'));
if ($ok == 0) {
    redirecina('main.php');
}
/* Redireciona se 008 */
if ($adm == '008') {
    redirecina('admin_submit_blocked.php');
    exit;
}
require "_class/_class_submit_manuscrito_field.php";
/* Dados da Classe */
$clx = new fields();
$tabela = $clx->tabela;
echo '<h1>' . msg('amendment_' . $adm) . '</h1>';
/* Nao alterar - dados comuns */
$label = msg($tabela);
$http_edit = 'admin_submit_000_ed.php';
//$http_ver = 'pibic_bolsa_tipo_detalhe.php';
$editar = True;
$http_redirect = page();
$clx->row();
$busca = true;
$offset = 20;
//$pre_where = " e_mailing = '".$cl->mail_codigo."' ";
if ($order == 0) {
    $order = $cdf[1];
}
<?php

namespace fajr\controller\studium;

fields::autoload();
class StudiumUtils
{
    /**
     * ked odhlasujeme z predmetu, narozdiel od AISu robime opat
     * inicializaciu vsetkych aplikacii. Just for sure chceme
     * okontrolovat, ze sa nic nezmenilo a ze sme dostali rovnake data
     * ako predtym!
     */
    public static function hashNaOdhlasenie($mojeTerminyRow)
    {
        $data = array($mojeTerminyRow[MojeTerminyFields::INDEX], $mojeTerminyRow[MojeTerminyFields::DATUM], $mojeTerminyRow[MojeTerminyFields::CAS], $mojeTerminyRow[MojeTerminyFields::PREDMET_SKRATKA]);
        return md5(implode('|', $data));
    }
    public static function hashNaPrihlasenie($predmetSkratka, $zoznamTerminovRow)
    {
        $data = array($zoznamTerminovRow[ZoznamTerminovFields::INDEX], $zoznamTerminovRow[ZoznamTerminovFields::DATUM], $zoznamTerminovRow[ZoznamTerminovFields::CAS], $predmetSkratka);
        return md5(implode('|', $data));
    }
}
Beispiel #13
0
  Software Website: http://www.maiansupport.com
  Script Portal: http://www.maianscriptworld.co.uk

  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  
  This File: fields.php
  Description: System File

  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
if (!defined('PARENT')) {
    $HEADERS->err403(true);
}
// Access..
if (!in_array($cmd, $userAccess) && $MSTEAM->id != '1') {
    $HEADERS->err403(true);
}
// Class..
include_once PATH . 'control/classes/class.fields.php';
$MSFIELDS = new fields();
if (isset($_POST['process']) && $_POST['fieldInstructions']) {
    $MSFIELDS->addCustomField();
    $OK1 = true;
}
if (isset($_POST['update']) && $_POST['fieldInstructions']) {
    $MSFIELDS->editCustomField();
    $OK2 = true;
}
$title = isset($_GET['edit']) ? $msg_customfields11 : $msg_customfields2;
include PATH . 'templates/header.php';
include PATH . 'templates/system/fields/fields.php';
include PATH . 'templates/footer.php';
Beispiel #14
0
 * @author Rene Faustino Gabriel Junior  (Analista-Desenvolvedor)
 * @copyright © Pan American Health Organization, 2013. All rights reserved.
 * @access public
 * @version v0.13.46
 * @package ProEthos-Admin
 * @subpackage Unit Register
 */
require "cab.php";
/* Admin Common */
$ok = ($perfil->valid('#ADM') or $perfil->valid('#SCR') or $perfil->valid('#COO'));
if ($ok == 0) {
    redirecina('main.php');
}
require "_class/_class_submit_manuscrito_field.php";
/* Dados da Classe */
$clx = new fields();
$tabela = $clx->tabela;
$pag = round('0' . $dd[10]);
if ($pag < 2) {
    $pag = 2;
}
if ($pag > 7) {
    $pag = 7;
}
/* Nao alterar - dados comuns */
$label = msg($tabela);
$http_edit = 'admin_submit_1_ed.php';
//$http_ver = 'pibic_bolsa_tipo_detalhe.php';
$editar = True;
$http_redirect = 'admin_submit_1.php';
$clx->row2();
Beispiel #15
0
function checkerrors()
{
    $errors = 0;
    // this is a very simple check, you can add any kind of checking method to refine and enhance your security
    // first start by getting the published fields
    $fields = new fields();
    $fieldlist = $fields->getPublishedFields();
    // now check if they are required, and if so, check if they are filled
    // default function is "checkfilled" see below!
    foreach ($fieldlist as $field) {
        if ($field->required == 1) {
            // required field
            // now get the required function, this is set in the DB for each field
            if (function_exists($field->checkfunction)) {
                //check if you defined this function
                $errors = $errors + call_user_func($field->checkfunction, $field);
            }
        }
    }
    return $errors;
}
Beispiel #16
0
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  
  This File: fieldsman.php
  Description: System File

  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
if (!defined('PARENT')) {
    $HEADERS->err403(true);
}
// Access..
if (!in_array($cmd, $userAccess) && $MSTEAM->id != '1') {
    $HEADERS->err403(true);
}
// Class..
include_once PATH . 'control/classes/class.fields.php';
$MSFIELDS = new fields();
// Enable/disable (Ajax)..
if (isset($_GET['changeState'])) {
    $MSFIELDS->enableDisable();
    echo $JSON->encode(array('ok'));
    exit;
}
// Delete..
if (isset($_POST['delete']) && USER_DEL_PRIV == 'yes') {
    $count = $MSFIELDS->deleteCustomFields();
    $OK1 = true;
}
if (isset($_POST['update-order'])) {
    $MSFIELDS->orderSequence();
    $OK2 = true;
}