Esempio n. 1
0
 public function form_content()
 {
     $dbc = $this->connection;
     $dbc->selectDB($this->config->get('OP_DB'));
     $model = new DepartmentsModel($dbc);
     $dlist = array();
     foreach ($model->find('dept_no') as $dept) {
         $dlist[$dept->dept_no()] = $dept->dept_name();
     }
     $ret = '<form method="get" action="ScaleItemsReport.php">
         <div class="panel panel-default">
             <div class="panel-heading">Filters</div>
             <div class="panel-body">
                 <div class="form-group form-inline">
                     <label>Search Text</label>
                     <input type="text" name="search" value="" 
                         class="form-control" placeholder="optional" />
                 </div>
                 <div class="form-group form-inline">';
     $ret .= '<label>Dept Start</label> 
         <input type="text" size="3" name="dept1" id="dept1" class="form-control" />';
     $ret .= '<select onchange="$(\'#dept1\').val(this.value);" class="form-control">';
     foreach ($dlist as $id => $label) {
         $ret .= sprintf('<option value="%d">%d %s</option>', $id, $id, $label);
     }
     $ret .= '</select>';
     $ret .= '</div>
                 <div class="form-group form-inline">';
     $ret .= '<label>Dept End</label>: 
         <input type="text" size="3" name="dept2" id="dept2" class="form-control" />';
     $ret .= '<select onchange="$(\'#dept2\').val(this.value);" class="form-control">';
     foreach ($dlist as $id => $label) {
         $ret .= sprintf('<option value="%d">%d %s</option>', $id, $id, $label);
     }
     $ret .= '</select>';
     $ret .= '</div>';
     $ret .= '</div>';
     $ret .= '</div>';
     $ret .= '<p>
         <button type="submit" name="submit" value="1" 
             class="btn btn-default">Get Report</button>
         </p>
         </form>';
     return $ret;
 }
Esempio n. 2
0
 public function get_length_number_view()
 {
     global $FANNIE_OP_DB;
     $ret = '<div class="well">Open range found starting at ' . $this->start_plu . '</div>';
     $ret .= '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">';
     $ret .= '<input type="hidden" name="start" value="' . $this->start_plu . '" />';
     $ret .= '<input type="hidden" name="number" value="' . $this->number . '" />';
     $ret .= '<div class="form-group">
         <label>Placeholder Desc.</label>
         <input type="text" name="description" class="form-control" required />
         </div>';
     $ret .= '<div class="form-group">
         <label>Department</label>
         <select name="department" class="form-control">';
     $depts = new DepartmentsModel(FannieDB::get($FANNIE_OP_DB));
     foreach ($depts->find('dept_no') as $dept) {
         $ret .= sprintf('<option value="%d">%d %s</option>', $dept->dept_no(), $dept->dept_no(), $dept->dept_name());
     }
     $ret .= '</select></div>';
     $ret .= '<p><button type="submit" class="btn btn-default">Reserve PLUs</button></p>';
     $ret .= '</form>';
     return $ret;
 }