function parseAndPrintTree($tree, $root = 0, $i = 0) { $line = $i == 0 ? '' : '-'; for ($a = 0; $a < $i; $a++) { $line .= $line; } $i++; if (!is_null($tree) && count($tree) > 0) { foreach ($tree as $child => $parent) { if ($parent->parent == $root) { unset($tree[$child]); echo '<tr> <td>' . $parent->id . '</td> <td><a href="' . action("Admin\\FieldsController@show", $parent->id) . '">' . $line . ' ' . get_trans($parent->name) . '</a></td> <td>' . $parent->slug . '</td><td>'; if ($root > 0) { echo '<input type="number" value="' . $parent->sort . '" min="-128" max="127" data-url="' . action('Admin\\CategoriesController@sort', $parent->id) . '" data-token="' . csrf_token() . '" style="width:60px;">'; } echo '</td><td>'; if ($root > 0 or Auth::user()->hasRole('Super Admin')) { echo '<a href="' . action('Admin\\CategoriesController@edit', $parent->id) . '"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></a> <a class="remove-modal" data-toggle="modal" data-target="#RemoveModal" data-url="' . action('Admin\\CategoriesController@destroy', $parent->id) . '" ><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a>'; } echo '</td>'; parseAndPrintTree($tree, $parent->id, $i); echo '</tr>'; } } } }
$r = mysql_query($q); $rr = mysql_fetch_array($r); $sdiv_id = $rr[0]; $ddiv_id = $rr[1]; mysql_free_result($r); $str = "Отгруженный багаж на транспорт <b>" . get_trans($trs) . "</b> по пункту назначения: " . get_div_parent($st) . " . <b>" . get_div_name($st) . "</b>"; $query2 = "where p.client_id=c.client_id and t.ibtbarcode=m.barcode and\n t.ibtdestdiv_id={$st} and m.trans_id={$trs} and m.prop_id=p.prop_id and\n m.div_id={$sdiv_id}\n order by p.barcode"; } if ($t == 7) { $q = "select sourcediv_id, destdiv_id from transport where trans_id={$trs}"; $r = mysql_query($q); $rr = mysql_fetch_array($r); $sdiv_id = $rr[0]; $ddiv_id = $rr[1]; mysql_free_result($r); $str = "Отгруженный багаж на транспорт <b>" . get_trans($trs) . "</b> по тарифу: <b>{$st}</b>"; $query2 = "where p.client_id=c.client_id and t.ibtbarcode=m.barcode and\n p.ibttarif={$st} and m.trans_id={$trs} and m.prop_id=p.prop_id and\n m.div_id={$sdiv_id}\n order by p.barcode"; } echo "\n Параметры обзора: {$str}\n </td>\n </tr>\n <tr>\n <td class=let_list_data2> </td>\n </tr>\n <tr>\n <td class=let_list_fixed>\n \n <table width=100% align=center valign=top border=0 cellpadding=0 cellspacing=1>\n <tr>\n <td class=let_list_fixed width=80>№ багажа</td>\n <td class=let_list_fixed width=120>Клиент</td>\n <td class=let_list_fixed width=70>Дата сдачи</td>\n <td class=let_list_fixed width=100>Назначение</td>\n <td class=let_list_fixed width=60>Мест</td>\n <td class=let_list_fixed width=60>Вес</td>\n <td class=let_list_fixed width=60>Объём</td>\n <td class=let_list_fixed width=60>Тариф</td>\n <td class=let_list_fixed width=120>Суммы</td>\n <td class=let_list_fixed width=75>Долг</td>\n </tr>\n "; $querypos = "select sum(p.ibtpos),sum(p.ibtweight), sum(p.ibtvolume) from ibag_transit t, ibag_movement m, properties p, clients c " . $query2; $respos = mysql_query($querypos); $rowpos = mysql_fetch_array($respos); echo "Выбрано мест: <b>{$rowpos['0']}</b> Общий вес: <b>{$rowpos['1']}</b> Общий объём: <b>{$rowpos['2']}</b><br>"; $query = "select t.ibtbarcode, t.ibtgetdate, t.ibtbagnum, t.ibtocenka, p.ibttarif,\n m.barcode, p.ibtzagnum, p.ibtpos, p.ibtweight, p.ibtvolume, p.ibtsummpaied,\n p.ibtfactura, p.ibtdostav, p.ibtstrahovka, p.ibtsummdept, p.ibtsummadd," . " p.ibtsummskidka, p.ibttotalsumm, c.clientname, c.xcode,\n t.ibtsourcediv_id, t.ibtdestdiv_id, t.client_id\n from ibag_transit t, ibag_movement m, properties p, clients c " . $query2; $res = mysql_query($query) or die(mysql_error()); $num = mysql_num_rows($res); $tdnum = 0; while ($row = mysql_fetch_array($res)) { $tdnum++; if ($row['ibttotalsumm'] != $row['ibtsummdept'] + $row['ibtsummpaied']) { $rowcolor = '#FFE1E1';
* @return Get List of Categories as Parent -- Children */ FormBuilder::macro('OptionCat', function ($tree, $selected, $root, $i) { $output = ''; $line = $i == 0 ? '' : '-'; for ($a = 0; $a < $i; $a++) { $line .= $line; } $i++; if (!is_null($tree) && count($tree) > 0) { foreach ($tree as $child => $parent) { if ($parent->parent == $root) { unset($tree[$child]); $sel = $this->getSelectedValue($parent->id, $selected); $options = array('value' => e($parent->id), 'selected' => $sel); $output .= '<option ' . $this->html->attributes($options) . '>' . $line . ' ' . get_trans($parent->name) . '</option>'; $output .= $this->OptionCat($tree, $selected, $parent->id, $i); } } } return $output; }); /** * @param $name * @param array $list * @param null $selected Children * @param array $options * @return Select Categories Child List Macro for FormBuilder */ FormBuilder::macro('selectChild', function ($name, $list = array(), $selected = null, $options = array()) { // When building a select box the "value" attribute is really the selected one
/** Prints out the list of other language versions contained in the current post. */ function polyglot_other_langs($none = 'none', $before = '<ul>', $after = '</ul>', $pre = '<li>(', $afters = ')</li>') { global $polyglot_settings, $post; if (!$polyglot_settings['use_helpers_in_uri']) { $uri_helper = ''; } else { $uri_helper = "{$polyglot_settings['uri_helpers']['lang_view']}/"; } $content = $post->post_content; //fred $before = polyglot_filter($before); $after = polyglot_filter($after); $pre = polyglot_filter($pre); $afters = polyglot_filter($afters); $other_langs = polyglot_filter($none); if (preg_match_all('/[<|\\[]lang_(..)[>|\\]]/', $content, $match, PREG_PATTERN_ORDER)) { $match = array_unique($match[1]); $other_langs = $before; foreach ($match as $lang) { if ($polyglot_settings['lang_pref'] != $lang) { $foo = $polyglot_settings['use_flags'] ? "<img src=\"" . $polyglot_settings['path_to_flags'] . $polyglot_settings['flags'][$lang] . "\" alt=\"" . get_trans($lang) . "\" title=\"" . get_trans($lang) . "\" />" : get_trans($lang); $other_langs .= "{$pre}<a href='" . get_permalink(); if ($polyglot_settings['lang_rewrite']) { if ($polyglot_settings['i_have_manually_edited_my_htaccess_file'] || strpos(get_permalink(), '?') === false) { $other_langs .= "{$uri_helper}{$lang}/"; } else { $other_langs .= "&lang_view={$lang}'"; } } else { if (strpos(get_permalink(), '?') === false) { $other_langs .= "?lang_view={$lang}'"; } else { $other_langs .= "&lang_view={$lang}'"; } } $other_langs .= "' rel=\"alternate\" hreflang=\"{$lang}\">{$foo}</a>{$afters}"; } } if ($other_langs != $before) { //to avoid empty <ul></ul> $other_langs .= $after; } else { $other_langs = $none; } } echo $other_langs; }
<link href='../../xl_rep0.css' type='text/css' rel='stylesheet'> <body bgcolor='#FFFFFF' text='#000000' leftmargin='0' topmargin='0'> <?php session_start(); mysql_connect($_SESSION['hostname'], $_SESSION['dbuser'], $_SESSION['dbpass']) or die(mysql_error()); mysql_select_db($_SESSION['dbname']) or die(mysql_error()); list($first_day, $first_mon, $first_year) = explode(".", $_SESSION['date1']); list($last_day, $last_mon, $last_year) = explode(".", $_SESSION['date2']); $_SESSION['type'] = $t; $_SESSION['stype'] = $st; if (!isset($trs)) { $trs = 0; } echo "\n <table width=100% align=center valign=top border=0 cellpadding=0 cellspacing=1>\n <tr>\n <td class=let_list_fixed>\n <b>Обзор багажа</b>\n </td>\n </tr>\n <tr>\n\n <td class=let_list_fixed>\n "; if ($t == 6) { $str = "Отгруженный багаж на транспорт <b>" . get_trans($trs) . "</b> по пункту назначения: " . get_div_parent($st) . " . <b>" . get_div_name($st) . "</b>"; $query2 = "where p.client_id=c.client_id and t.ibtbarcode=m.barcode and m.trans_id=tr.trans_id and m.div_id=tr.sourcediv_id and\n t.ibtdestdiv_id={$st} and m.trans_id={$trs} and m.prop_id=p.prop_id\n order by p.barcode"; } if ($t == 7) { $str = " По клиенту: <b>{$clientname}</b>"; $query2 = "where p.client_id=c.client_id and t.ibtbarcode=m.barcode and m.trans_id=tr.trans_id and m.div_id=tr.sourcediv_id\n and m.trans_id in {$trs} and m.prop_id=p.prop_id and p.client_id={$cl}\n order by p.barcode"; } echo "\n Параметры обзора: {$str}\n </td>\n </tr>\n <tr>\n <td class=let_list_data2> </td>\n </tr>\n <tr>\n <td class=let_list_fixed>\n \n <table width=100% align=center valign=top border=0 cellpadding=0 cellspacing=1>\n <tr>\n <td class=let_list_fixed width=80>№ багажа</td>\n <td class=let_list_fixed width=120>Клиент</td>\n <td class=let_list_fixed width=70>Дата сдачи</td>\n <td class=let_list_fixed width=100>Назначение</td>\n\n <td class=let_list_fixed width=60>Вес</td>\n <td class=let_list_fixed width=60>Объём</td>\n <td class=let_list_fixed width=60>Тариф</td>\n <td class=let_list_fixed width=120>Суммы</td>\n <td class=let_list_fixed width=75>Долг</td>\n </tr>\n "; $querypos = "select sum(p.ibtpos),sum(p.ibtweight), sum(p.ibtvolume) from ibag_transit t, ibag_movement m, properties p, clients c " . $query2; $respos = mysql_query($querypos); $rowpos = mysql_fetch_array($respos); echo "Выбрано мест: <b>{$rowpos['0']}</b> Общий вес: <b>{$rowpos['1']}</b> Общий объём: <b>{$rowpos['2']}</b><br>"; $query = "select t.ibtbarcode, t.ibtgetdate, t.ibtbagnum, t.ibtocenka, p.ibttarif,\n m.barcode, p.ibtzagnum, p.ibtpos, p.ibtweight, p.ibtvolume, p.ibtsummpaied,\n p.ibtfactura, p.ibtdostav, p.ibtstrahovka, p.ibtsummdept, p.ibtsummadd," . " p.ibtsummskidka, p.ibttotalsumm, c.clientname, c.xcode,\n t.ibtsourcediv_id, t.ibtdestdiv_id, t.client_id\n from ibag_transit t, ibag_movement m, properties p, transport tr, clients c " . $query2; $res = mysql_query($query) or die(mysql_error()); $num = mysql_num_rows($res); $tdnum = 0;
<?php require "../settings.php"; if (isset($_POST["key"])) { switch ($_POST["key"]) { case "record": $OUTPUT = run_trans($_POST); break; default: $OUTPUT = get_trans($_POST); } } else { $OUTPUT = get_trans($_POST); } $OUTPUT .= "<br>" . mkQuickLinks(ql("record-trans.php", "Add Replay Transaction"), ql("export-xml.php", "Export Replay Transactions To File"), ql("replay-file-trans.php", "Replay Transaction File")); require "../template.php"; function get_trans($_POST) { extract($_POST); $display = "\n\t\t\t\t\t<h2>Record Transaction</h2>\n\t\t\t\t\t<table " . TMPL_tblDflts . ">\n\t\t\t\t\t<form action='" . SELF . "' method='POST'>\n\t\t\t\t\t\t<input type='hidden' name='key' value='record'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>Select Transaction Type To Record</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<select size='4' name='transtype'>\n\t\t\t\t\t\t\t\t\t<option value='journal'>Journal Transaction</option>\n\t\t\t\t\t\t\t\t\t<option value='debtor'>Debtor Transaction</option>\n\t\t\t\t\t\t\t\t\t<option value='creditor'>Creditor Transaction</option>\n\t\t\t\t\t\t\t\t\t<option value='stock'>Stock Transaction</option>\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t" . TBL_BR . "\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><input type='submit' value='Record'></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</form>\n\t\t\t\t\t</table>\n\t\t\t\t"; return $display; } function run_trans($_POST) { extract($_POST); db_conn("exten"); #get list of all current entries $get_list = "SELECT * FROM tranreplay WHERE ttype = '{$transtype}' ORDER BY tdate"; $run_list = db_exec($get_list) or errDie("Unable to get transaction batch information"); if (pg_numrows($run_list) < 1) { $listing = "\n\t\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t\t<td colspan='6'>No Transactions Found.</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t";