Example #1
0
 public function form($contact_id = null)
 {
     $form = parent::getForm('property');
     if ($contact_id) {
         $form->addHidden('contact_id', $contact_id);
         $form->addHidden('cop', 'save_property');
         $form->addHidden('k', $_SESSION['Contact_User']->getKey());
     } else {
         $contacts = User::getContacts();
         if (empty($contacts)) {
             return 'Please <a href="index.php?module=properties&aop=edit_contact">create a new contact</a>.';
         }
         $form->addSelect('contact_id', $contacts);
         $form->setMatch('contact_id', $this->contact_id);
         $form->setLabel('contact_id', 'Property contact');
         $form->addHidden('aop', 'save_property');
     }
     if ($this->id) {
         $form->addHidden('pid', $this->id);
         $form->addSubmit('Update property');
     } else {
         $form->addSubmit('Add property');
     }
     $form->addText('address', $this->address);
     $form->setLabel('address', 'Address');
     $form->setSize('address', 50);
     $form->setRequired('address');
     $form->addText('admin_fee_amt', $this->getAdminFeeAmt());
     $form->setLabel('admin_fee_amt', 'Administrative fee');
     $form->setSize('admin_fee_amt', 8, 8);
     $form->addCheck('admin_fee_refund', 1);
     $form->setLabel('admin_fee_refund', 'Fee refunded');
     $form->setMatch('admin_fee_refund', $this->admin_fee_refund);
     $bath['1'] = '1';
     $bath['1.5'] = '1 1/2';
     $bath['2'] = '2';
     $bath['2.5'] = '2 1/2';
     $bath['3'] = '3';
     $bath['3.5'] = '3 1/2';
     $bath['4'] = '4';
     $bath['4.5'] = '4 1/2';
     $bath['5'] = '5';
     $bath['5.5'] = '5 1/2';
     $form->addSelect('bathroom_no', $bath);
     $form->setMatch('bathroom_no', $this->bathroom_no);
     $form->setLabel('bathroom_no', 'Bathrooms');
     $count = range(0, 8);
     unset($count[0]);
     $form->addSelect('bedroom_no', $count);
     $form->setMatch('bedroom_no', $this->bedroom_no);
     $form->setLabel('bedroom_no', 'Bedrooms');
     $form->addText('clean_fee_amt', $this->getCleanFeeAmt());
     $form->setLabel('clean_fee_amt', 'Clean fee amount');
     $form->setSize('clean_fee_amt', 8, 8);
     $form->addCheck('clean_fee_refund', 1);
     $form->setLabel('clean_fee_refund', 'Fee refunded');
     $form->setMatch('clean_fee_refund', $this->clean_fee_refund);
     $form->addCheck('efficiency', 1);
     $form->setLabel('efficiency', 'Efficiency');
     $form->setMatch('efficiency', $this->efficiency);
     $form->addCheck('furnished', 1);
     $form->setLabel('furnished', 'Furnished');
     $form->setMatch('furnished', $this->furnished);
     $form->addRadioAssoc('lease_type', array(JOINT_LEASE => 'Per unit', INDIVIDUAL_LEASE => 'Per person'));
     $form->setMatch('lease_type', $this->lease_type);
     $form->addTextarea('other_fees', $this->other_fees);
     $form->setLabel('other_fees', 'Other fees');
     $form->addText('parking_fee', $this->getParkingFee());
     $form->setLabel('parking_fee', 'Parking fee');
     $form->setSize('parking_fee', 8, 8);
     $parking = range(0, 10);
     unset($parking[0]);
     $parking[NO_LIMIT_PARKING] = 'No limit';
     $form->addSelect('parking_per_unit', $parking);
     $form->setLabel('parking_per_unit', 'Parking spaces available per unit');
     $form->setMatch('parking_per_unit', $this->parking_per_unit);
     // Pet deposits are always refundable
     /*
      $form->addCheck('pet_dep_refund', 1);
      $form->setLabel('pet_dep_refund', 'Fee refunded');
      $form->setMatch('pet_dep_refund', $this->pet_dep_refund);
     */
     $form->addText('pet_deposit', $this->getPetDeposit());
     $form->setLabel('pet_deposit', 'Pet deposit');
     $form->setSize('pet_deposit', 8, 8);
     $form->addText('pet_fee', $this->getPetFee());
     $form->setLabel('pet_fee', 'Pet fee');
     $form->setSize('pet_fee', 8, 8);
     $form->addTextArea('pet_type', $this->pet_type);
     $form->setRows('pet_type', '5');
     $form->setCols('pet_type', 20);
     $form->setLabel('pet_type', 'Allowed pet types');
     $form->addText('security_amt', $this->getSecurityAmt());
     $form->setLabel('security_amt', 'Security deposit amount');
     $form->setSize('security_amt', 8, 8);
     $form->addCheck('security_refund', 1);
     $form->setMatch('security_refund', $this->security_refund);
     $form->setLabel('security_refund', 'Fee refunded');
     $form->addRadioAssoc('student_type', array(NO_STUDENT_PREFERENCE => 'No preference', UNDERGRAD => 'Undergraduate', GRAD_STUDENT => 'Graduate'));
     $form->setMatch('student_type', $this->student_type);
     $form->addCheck('utilities_inc', 1);
     $form->setMatch('utilities_inc', $this->utilities_inc);
     $form->setLabel('utilities_inc', 'Utilities included in rent');
     $form->addText('util_cable', $this->getUtilCable());
     $form->setLabel('util_cable', 'Cable');
     $form->setSize('util_cable', 8, 8);
     $form->addText('util_fuel', $this->getUtilFuel());
     $form->setLabel('util_fuel', 'Fuel');
     $form->setSize('util_fuel', 8, 8);
     $form->addText('util_internet', $this->getUtilInternet());
     $form->setLabel('util_internet', 'Internet');
     $form->setSize('util_internet', 8, 8);
     $form->addText('util_phone', $this->getUtilPhone());
     $form->setLabel('util_phone', 'Phone');
     $form->setSize('util_phone', 8, 8);
     $form->addText('util_power', $this->getUtilPower());
     $form->setLabel('util_power', 'Power');
     $form->setSize('util_power', 8, 8);
     $form->addText('util_trash', $this->getUtilTrash());
     $form->setLabel('util_trash', 'Trash');
     $form->setSize('util_trash', 8, 8);
     $form->addText('util_water', $this->getUtilWater());
     $form->setLabel('util_water', 'Water');
     $form->setSize('util_water', 8, 8);
     $hl[HT_HVAC] = 'HVAC (heat pump)';
     $hl[HT_OIL] = 'Oil';
     $hl[HT_PROPANE] = 'Propane';
     $hl[HT_ELEC_BASE] = 'Electric baseboard';
     $hl[HT_KEROSENE] = 'Kerosene';
     $hl[HT_WOODSTOVE] = 'Woodstove/Fireplace';
     $hl[HT_GAS] = 'Natural gas';
     $form->addCheck('heat_type', array_keys($hl));
     $form->setLabel('heat_type', $hl);
     $form->setMatch('heat_type', $this->heat_type);
     // necessary since there used to be a count instead of a bool
     $window_number = (int) (bool) $this->window_number;
     $form->addCheck('window_number', 1);
     $form->setMatch('window_number', $window_number);
     $form->setLabel('window_number', 'Windows in unit');
     $form->setLabel('sublease', 'Subleasing permitted');
     $tpl = $form->getTemplate();
     if (!empty($this->errors)) {
         foreach ($this->errors as $key => $message) {
             $new_key = strtoupper($key) . '_ERROR';
             $tpl[$new_key] = $message;
         }
     }
     return \PHPWS_Template::process($tpl, 'properties', 'edit_property.tpl');
 }
Example #2
0
    ?>
">
                                </div>
                            </div>
                        </div>
                        <div id="contactDiv" style="display: none;">
                            <div class="col-md-6">
                                <div class="field form-group">
                                    <label for="contact">Személy:</label>
                                    <select id='ddlContacts' name="ddlContacts" class="form-control">
                                    <option <?php 
    echo Input::get('ddlContacts') == "" ? 'selected' : '';
    ?>
 value="">-- Vállaszon --</option>
                                    <?php 
    $contacts = $user->getContacts($user->data()->ID);
    for ($i = 0; $i < count($contacts); $i++) {
        $selected = Input::get('ddlContacts') == $contacts[$i][2] ? 'selected' : '';
        echo "<option " . $selected . " value=" . $contacts[$i][2] . ">" . $contacts[$i][3] . "</option>";
    }
    ?>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <div class="field form-group">
                                <label for="description">Leírás:</label>
                                <textarea class="form-control noresize" rows="3" name="description" id="description"></textarea>
Example #3
0
 ?>
 <div class="transcationForm">
     <div class="row">
         <div class="col-xs-12">
             <table class="table">
             <thead class="table-invers">
                 <tr>
                     <th>#</th>
                     <th>Név</th>
                     <th>Számlaszám</th>
                     <th>Akció</th>
                 </tr>
             </thead>
             <tbody>
                 <?php 
 $contacts = $user->getContacts($data->ID);
 if (count($contacts) > 0) {
     for ($i = 0; $i < count($contacts); $i++) {
         echo '<tr id="con' . $contacts[$i][0] . '">
                             <th scope="row">' . ($i + 1) . '</th>
                             <td>' . $contacts[$i][3] . ' </td>
                             <td>' . $contacts[$i][2] . '</td>
                             <td>' . '<a class="pointer trash" data-id="' . $contacts[$i][0] . '"><i class="fa fa-trash"></i></a> </td>
                             </tr>';
     }
 }
 ?>
             </tbody>
         </table>
         </div>
     </div>