/**
  * loads available cash types
  * 
  * @return void
  */
 protected function loadCashTypes()
 {
     $tmpArr = zb_CashGetAlltypes();
     if (!empty($tmpArr)) {
         foreach ($tmpArr as $io => $each) {
             $this->cashtypes[$each['id']] = $each['cashtype'];
         }
     }
 }
Beispiel #2
0
/**
 * Returns cash type selector for manual payments
 * 
 * @return string
 */
function web_CashTypeSelector()
{
    $allcashtypes = zb_CashGetAlltypes();
    $cashtypes = array();
    if (!empty($allcashtypes)) {
        foreach ($allcashtypes as $io => $each) {
            $cashtypes[$each['id']] = __($each['cashtype']);
        }
        $defaultCashtype = zb_StorageGet('DEF_CT');
        //if no default cashtype selected
        if (empty($defaultCashtype)) {
            $defaultCashtype = 'NOP';
        }
        $selector = wf_Selector('cashtype', $cashtypes, '', $defaultCashtype, false);
    }
    return $selector;
}
Beispiel #3
0
            $editform .= wf_Link('?module=cashtypes', 'Back', true, 'ubButton');
            show_window(__('Edit') . ' ' . __('Cash type'), $editform);
        }
    }
    //creating new cash type
    if (isset($_POST['newcashtype'])) {
        $newcashtype = mysql_real_escape_string($_POST['newcashtype']);
        if (!empty($newcashtype)) {
            zb_CashCreateCashType($newcashtype);
            rcms_redirect("?module=cashtypes");
        } else {
            show_error(__('No all of required fields is filled'));
        }
    }
    //setting default cashtype
    if (wf_CheckPost(array('setdefaultcashtype'))) {
        zb_StorageSet('DEF_CT', $_POST['setdefaultcashtype']);
        log_register("CASHTYPE SET DEFAULT [" . $_POST['setdefaultcashtype'] . "]");
        rcms_redirect("?module=cashtypes");
    }
    // Edit form construct
    $fieldname = __('Cash type');
    $fieldkey = 'cashtype';
    $formurl = '?module=cashtypes';
    $olddata = zb_CashGetAlltypes();
    $form = web_EditorTableDataFormOneField($fieldname, $fieldkey, $formurl, $olddata);
    show_window(__('Edit payment types'), $form);
    show_window(__('Default cash type'), web_CashCashtypeDefaultForm());
} else {
    show_error(__('You cant control this module'));
}