function GetID($var, $adm = true)
{
    $de = bindechex($var, 3);
    $num = strlen($de);
    $num2 = $num - 2;
    $num3 = $num2 - 2;
    $type = substr($de, $num2 - 2, $num2);
    $type = GetItemType(substr($type, 0, 2));
    $item = substr($de, 0, $num2 - 2);
    $code = bindechex($item, 5);
    if ($type == '') {
        return lang('off_emptyslot');
    } else {
        return GetItemID(GetTableName($type), $code, $adm);
    }
}
Esempio n. 2
0
 function del_inven($serial, $num)
 {
     if ($num > 100) {
         redirect(base_url());
     }
     $numeric = (int) office_secure($num);
     if (!is_numeric($serial)) {
         redirect('main');
     }
     if (!secure_serial_check($serial)) {
         redirect('#warn');
     }
     $this->table->set_template(tpl_table());
     $world = get_world();
     $query = $this->MSSQL->query("SELECT K{$num},D{$num},U{$num} FROM {$world}.dbo.tbl_inven WHERE Serial = '{$serial}'");
     if ($query->num_rows() > 0) {
         $row = $query->row_array();
         $this->table->add_row(lang('off_inven_items'), GetID($row['K' . $num], false));
         $this->table->add_row(lang('off_inven_count'), $row['D' . $num]);
         $this->table->add_row(lang('off_inven_update'), show_talic(bindechex($row['U' . $num], 3)));
         $this->table->add_row(form_open('main/acceptdelitem') . form_hidden('num', $num) . form_hidden('serial', $serial) . form_submit('accept', lang('off_accept_del')) . form_close(), go_back('', true));
     }
     $this->data['title'] = lang('off_acceptdelitemtitle');
     $this->data['content'] = $this->table->generate();
     compile();
 }