Exemple #1
0
/**
 * Returns ahent selector for registration form
 * 
 * @param string $name
 * @param int $selected
 * @return string
 */
function zb_RegContrAhentSelect($name, $selected = '')
{
    $allagents = zb_ContrAhentGetAllData();
    $agentArr = array();
    if (!empty($allagents)) {
        foreach ($allagents as $io => $eachagent) {
            $agentArr[$eachagent['id']] = $eachagent['contrname'];
        }
    }
    $select = wf_Selector($name, $agentArr, '', $selected, false);
    return $select;
}
 /**
  * Returns year/month selectors form
  * 
  * @return string
  */
 public function renderCorpsFlowsDateForm()
 {
     $allagents = zb_ContrAhentGetAllData();
     $tmpArr = array();
     $tmpArr[''] = __('Any');
     if (!empty($allagents)) {
         foreach ($allagents as $io => $eachagent) {
             $tmpArr[$eachagent['id']] = $eachagent['contrname'];
         }
     }
     /**
      * Again and again we're drowning in this web
      * Again and again we make the same mistake
      * Always hunting the same lamb
      * All we get is the same crap....
      */
     $inputs = wf_YearSelector('yearsel', __('Year'), false) . ' ';
     $inputs .= wf_MonthSelector('monthsel', __('Month'), '', false) . ' ';
     $inputs .= wf_Selector('agentsel', $tmpArr, __('Contrahent name'), '', false);
     $inputs .= wf_Submit(__('Show'));
     $result = wf_Form('', 'POST', $inputs, 'glamour');
     return $result;
 }
 /**
  * loads contragent data into protected prop
  * 
  * @return void
  */
 protected function loadAgents()
 {
     $tmpArr = array();
     $tmpArr = zb_ContrAhentGetAllData();
     if (!empty($tmpArr)) {
         foreach ($tmpArr as $io => $each) {
             $this->agents[$each['id']] = $each;
         }
     }
 }