Exemplo n.º 1
0
        $cli_name = preg_replace("/\\([a-z0-9\\ ]+\\)/", "", $row['cli_name']);
        // this removes the cli_id in parenthesis
        if ($row['app_attendees']) {
            $app_attendees = '<br><font size="1">' . trim(preg_replace("/\\([a-z0-9\\ ]+\\)/", "", $row['app_attendees'])) . '</font>';
            // this removes the use_id in parenthesis
        }
        if ($row['use_colour']) {
            $use_colour = '<span class="use_col" style="background-color: ' . $row['use_colour'] . ';"><img src="/images/sys/admin/blank.gif"></span>&nbsp;';
        }
        $start = explode(" ", $row['app_start']);
        $start = $start[1];
        $end = explode(" ", $row['app_end']);
        $end = $end[1];
        $first_app = strtotime($row['app_start']) - $daybegin;
        $start_pixel = $first_app / 60 * $zoom;
        $divs[] = array('id' => $row['followUpAppointmentId'] ?: $row['app_id'], 'start_stamp' => strtotime($row['app_start']), 'end_stamp' => strtotime($row['app_end']), 'start_offset' => round_to_nearest($start_time, 15) * $zoom, 'start' => date('H:i', strtotime(substr($start, 0, -3))), 'end' => date('H:i', strtotime(substr($end, 0, -3))), 'duration' => $duration, 'start_pixel' => $start_pixel, 'end_pixel' => $start_pixel + $duration * $zoom, 'app_height' => $duration * $zoom, 'colour' => $row['use_colour'], 'type' => $row['app_type'], 'subtype' => $row['ity_title'], 'notetype' => $row['app_notetype'], 'client' => $cli_name, 'addr' => str_replace("  ", " ", $pro_addr), 'tel' => $row['tel_number'], 'user' => $row['use_name'], 'contact' => $row['con_name'], 'attendees' => $row['app_attendees'], 'cv' => $row['d2a_cv'], 'subject' => format_overdiv($row['app_subject']), 'notes' => format_overdiv($row['note']), 'private' => $row['app_private'], 'bookedby' => $row['app_bookedby'], 'DIT' => $row['DIT']);
        unset($app_attendees, $use_colour, $pro_addr, $cli_name, $price);
    }
}
//print_r($divs);
// end sql
// need to loop every 15 minutes, consider not using Calendar class for this and going bespoke
$Day->build();
while ($Hour =& $Day->fetch()) {
    // show working hours only
    if (date('H', $Hour->getTimeStamp()) >= $default_workingday_start && date('H', $Hour->getTimeStamp()) <= $default_workingday_end) {
        // highlight current hour slot but only if viewing current day
        if (date('l, jS F, Y', $Day->getTimeStamp()) == date('l, jS F, Y')) {
            if (date('H', $Hour->getTimeStamp()) == date('H')) {
                $class = "calHourNow";
            } else {
Exemplo n.º 2
0
        $cli_name = preg_replace("/\\([a-z0-9\\ ]+\\)/", "", $row["cli_name"]);
        // this removes the cli_id in parenthesis
        if ($row["app_attendees"]) {
            $app_attendees = '<br><font size="1">' . trim(preg_replace("/\\([a-z0-9\\ ]+\\)/", "", $row["app_attendees"])) . '</font>';
            // this removes the use_id in parenthesis
        }
        if ($row["use_colour"]) {
            $use_colour = '<span class="use_col" style="background-color: ' . $row["use_colour"] . ';"><img src="/images/sys/admin/blank.gif"></span>&nbsp;';
        }
        $start = explode(" ", $row["app_start"]);
        $start = $start[1];
        $end = explode(" ", $row["app_end"]);
        $end = $end[1];
        $first_app = strtotime($row["app_start"]) - $daybegin;
        $start_pixel = $first_app / 60 * $zoom;
        $divs[] = array('id' => $row["app_id"], 'start_stamp' => strtotime($row["app_start"]), 'end_stamp' => strtotime($row["app_end"]), 'start_offset' => round_to_nearest($start_time, 15) * $zoom, 'start' => substr($start, 0, -3), 'end' => substr($end, 0, -3), 'duration' => $duration, 'start_pixel' => $start_pixel, 'end_pixel' => $start_pixel + $duration * $zoom, 'app_height' => $duration * $zoom, 'colour' => $row["use_colour"], 'type' => $row["app_type"], 'client' => $cli_name, 'addr' => $pro_addr, 'user' => $row["use_name"]);
        unset($app_attendees, $use_colour, $pro_addr, $cli_name, $price);
    }
}
#print_r($divs);
// end sql
// need to loop every 15 minutes, consider not using Calendar class for this and going bespoke
$Day->build();
while ($Hour =& $Day->fetch()) {
    // show working hours only
    if (date('H', $Hour->getTimeStamp()) >= $default_workingday_start && date('H', $Hour->getTimeStamp()) <= $default_workingday_end) {
        // highlight current hour slot
        if (date('l, jS of F, Y', $Day->getTimeStamp()) == date('l, jS of F, Y')) {
            if (date('H', $Hour->getTimeStamp()) == date('H')) {
                $class = "calHourNow";
            } else {
Exemplo n.º 3
0
 	) {
 	unset($db_data["cli_oldaddr"]);
 	} else {
 	// add to batch clense array, with client id as identifier
 	$addresses[$row["Client_ID"]] = $old_address;			
 	}
 */
 unset($old_address);
 // property type sales
 $PropertyType = array('Any' => '4|5|6|7|8|9|10|22|25|11|12|13|19|20|21|23|14|15|16|17', 'House' => '4|5|6|7|8|9|10|22|25', 'Apartment' => '11|12|13|19|20|21|23', 'Commercial' => '14', 'Live/Work' => '10|21');
 if (array_key_exists($row["PropertyType"], $PropertyType)) {
     $db_data["cli_saleptype"] = $PropertyType[$row["PropertyType"]];
 }
 // round prices to nearest 10000 to fit drop-downs
 $db_data["cli_salemin"] = round_to_nearest(numbers_only($row["MinPrice"]), 10000);
 $db_data["cli_salemax"] = round_to_nearest(numbers_only($row["MaxPrice"]), 10000);
 $db_data["cli_salebed"] = $row["Bedrooms"];
 if ($row["Areas"]) {
     // areas are full area titles split with hats. explode into array, match against area table in v3?
     $original_areas = explode("^", $row["Areas"]);
     foreach ($original_areas as $area_title) {
         //if (in_array($area_title,$areas)) {
         $area_array[] = array_search($area_title, $areas);
         //}
     }
     $new_areas = implode("|", $area_array);
     $new_areas = str_replace("||", "|", $new_areas);
     $new_areas = str_replace("||", "|", $new_areas);
     $new_areas = remove_firstchar($new_areas, "|");
     $new_areas = remove_lastchar($new_areas, "|");
     $db_data["cli_area"] = $new_areas;
Exemplo n.º 4
0
        $cli_name = preg_replace("/\\([a-z0-9\\ ]+\\)/", "", $row["cli_name"]);
        // this removes the cli_id in parenthesis
        if ($row["app_attendees"]) {
            $app_attendees = '<br><font size="1">' . trim(preg_replace("/\\([a-z0-9\\ ]+\\)/", "", $row["app_attendees"])) . '</font>';
            // this removes the use_id in parenthesis
        }
        if ($row["use_colour"]) {
            $use_colour = '<span class="use_col" style="background-color: ' . $row["use_colour"] . ';"><img src="/images/sys/admin/blank.gif"></span>&nbsp;';
        }
        $start = explode(" ", $row["app_start"]);
        $start = $start[1];
        $end = explode(" ", $row["app_end"]);
        $end = $end[1];
        $first_app = strtotime($row["app_start"]) - $daybegin;
        $start_pixel = $first_app / 60 * $zoom;
        $divs[] = array('id' => $row["app_id"], 'start_stamp' => strtotime($row["app_start"]), 'end_stamp' => strtotime($row["app_end"]), 'start_offset' => round_to_nearest($start_time, 15) * $zoom, 'start' => date('H:i', strtotime(substr($start, 0, -3))), 'end' => date('H:i', strtotime(substr($end, 0, -3))), 'duration' => $duration, 'start_pixel' => $start_pixel, 'end_pixel' => $start_pixel + $duration * $zoom, 'app_height' => $duration * $zoom, 'colour' => $row["use_colour"], 'type' => $row["app_type"], 'client' => $cli_name, 'addr' => str_replace("  ", " ", $pro_addr), 'user' => $row["use_name"], 'contact' => $row["con_name"], 'attendees' => $row["app_attendees"], 'cv' => $row["d2a_cv"], 'subject' => format_overdiv($row["app_subject"]), 'notes' => format_overdiv($row["note"]), 'subtype' => $row["ity_title"], 'private' => $row["app_private"], 'bookedby' => $row["app_bookedby"]);
        unset($app_attendees, $use_colour, $pro_addr, $cli_name, $price);
    }
}
//print_r($divs);
// end sql
// need to loop every 15 minutes, consider not using Calendar class for this and going bespoke
$Day->build();
while ($Hour =& $Day->fetch()) {
    // show working hours only
    if (date('H', $Hour->getTimeStamp()) >= $default_workingday_start && date('H', $Hour->getTimeStamp()) <= $default_workingday_end) {
        // highlight current hour slot but only if viewing current day
        if (date('l, jS of F, Y', $Day->getTimeStamp()) == date('l, jS of F, Y')) {
            if (date('H', $Hour->getTimeStamp()) == date('H')) {
                $class = "calHourNow";
            } else {
 } elseif ($row["PropertyType"] == 'Flat/House' || $row["PropertyType"] == 'House/Flat') {
     $db_data["cli_saleptype"] = $PropertyType['House'] . '|' . $PropertyType['Apartment'];
 } elseif ($row["PropertyType"] == 'House') {
     $db_data["cli_saleptype"] = $PropertyType['House'];
 } elseif ($row["PropertyType"] == 'shop' || $row["PropertyType"] == 'shop commercial ?') {
     $db_data["cli_saleptype"] = "29";
 } elseif ($row["PropertyType"] == 'House Semi-detached') {
     $db_data["cli_saleptype"] = "5";
 } elseif ($row["PropertyType"] == 'House Terraced') {
     $db_data["cli_saleptype"] = "6";
 } else {
     $db_data["cli_saleptype"] = '';
 }
 // round prices to nearest 10000 to fit drop-downs
 $db_data["cli_salemin"] = round_to_nearest(numbers_only($row["StartRange"]), 10000);
 $db_data["cli_salemax"] = round_to_nearest(numbers_only($row["EndRange"]), 10000);
 $db_data["cli_salebed"] = $row["Beds"];
 // dates are not already be in the correct format
 $date = explode(" ", $row["DateReceived"]);
 $date_parts = explode("/", $date[0]);
 $DateReceived = $date_parts[2] . '-' . $date_parts[1] . '-' . $date_parts[0] . ' ' . $date[1];
 $db_data["cli_created"] = $DateReceived;
 // all these people are having email updates set to no
 // if they regsitered before 2006, they are set to inactive
 if ($date_parts[2] > 2005) {
     if ($row["Buying"] == 1) {
         $db_data["cli_sales"] = 'Yes';
         if ($db_data["cli_email"]) {
             $db_data["cli_saleemail"] = 'Yes';
         } else {
             $db_data["cli_saleemail"] = 'No';
Exemplo n.º 6
0
 function makeField($_type, $_name, $_label = NULL, $_value = NULL, $_attr = NULL, $_opt = NULL)
 {
     #echo $_type.'='.$_value.'<br>';
     // remove slashes from value for display 14/06/06
     $_value = str_replace("\\", "", $_value);
     // get attributes from array and create html formatted string (key="val")
     if (is_array($_attr)) {
         foreach ($_attr as $_key => $_val) {
             $_attributes .= ' ' . $_key . '="' . $_val . '"';
         }
     }
     // text field
     if ($_type == "text") {
         $_output .= '<input type="text" name="' . $_name . '" id="' . $_name . '" value="' . $_value . '"' . $_attributes . ' />' . "\n";
     } elseif ($_type == "textarea") {
         $_output .= '<textarea name="' . $_name . '" id="' . $_name . '"' . $_attributes . '>' . $_value . '</textarea>' . "\n";
     } elseif ($_type == "radio") {
         // get options from $_opt array	(required)
         foreach ($_opt as $_optkey => $_optval) {
             $_output .= '<label for="' . $_name . '' . $_optval . '"><input type="radio" name="' . $_name . '" id="' . $_name . '' . $_optval . '" value="' . $_optval . '"';
             if ($_optkey == $_value) {
                 $_output .= ' checked="checked"';
             }
             $_output .= '' . $_attributes . ' />' . $_optkey . '</label>' . "\n";
         }
     } elseif ($_type == "checkbox") {
         $value_array = explode('|', $_value);
         // get options from $_opt array	(required)
         foreach ($_opt as $_optkey => $_optval) {
             $_output .= '<label for="' . $_name . '' . $_optval . '"><input type="checkbox" name="' . $_name . '[]" id="' . $_name . '' . $_optval . '" value="' . $_optval . '"';
             if (in_array($_optkey, $value_array)) {
                 $_output .= ' checked="checked"';
             }
             $_output .= '' . $_attributes . ' />' . $_optkey . '</label>' . "\n";
         }
     } elseif ($_type == "checkbox_table") {
         $columns = 4;
         $count = 1;
         $value_array = explode('|', $_value);
         // get options from $_opt array	(required)
         foreach ($_opt as $_optkey => $_optval) {
             $_output .= '<td width="' . 100 / $columns . '%"><label for="' . $_name . '' . $_optval . '"><input type="checkbox" name="' . $_name . '[]" id="' . $_name . '' . $_optval . '" value="' . $_optval . '"';
             if (in_array($_optkey, $value_array)) {
                 $_output .= ' checked="checked"';
             }
             // special function for dea_status
             if ($_optkey == "Under Offer with Other") {
                 $_optkey = "U/O with Other";
             }
             $_output .= '' . $_attributes . ' />' . $_optkey . '</label></td>' . "\n";
             if ($count % $columns == 0) {
                 $_output .= '</tr><tr>';
             }
             $count++;
         }
         $_output = '<table class="checkbox_table"><tr>' . $_output . '</tr></table>';
     }
     // file
     if ($_type == "file") {
         $_output .= '<input type="file" name="' . $_name . '" id="' . $_name . '" value="' . $_value . '"' . $_attributes . ' />' . "\n";
     } elseif ($_type == "hidden") {
         $_output .= '<input type="hidden" name="' . $_name . '" id="' . $_name . '" value="' . $_value . '"' . $_attributes . ' />' . "\n";
     } elseif ($_type == "submit" || $_type == "reset" || $_type == "button") {
         $_output .= '<input type="' . $_type . '" name="' . $_name . '" id="' . $_name . '" value="' . $_value . '"' . $_attributes . ' />' . "\n";
     } elseif ($_type == "select") {
         // adding a blank value to top of list if "blank" is present in options array
         if ($_opt['blank']) {
             $_options .= '  <option value=""></option>' . "\n";
             array_shift($_opt);
         }
         // adding a blank value to top of list if no value is selected (ie stored in db)
         if (!$_value) {
             #$_options .= '  <option value=""></option>'."\n";
         }
         // get options from $_opt array	(required)
         foreach ($_opt as $_optkey => $_optval) {
             $_options .= '  <option value="' . $_optkey . '"';
             if ($_optkey == $_value) {
                 $_options .= ' selected="selected"';
             }
             $_options .= '>' . $_optval . '</option>' . "\n";
         }
         $_output .= '<select name="' . $_name . '" id="' . $_name . '"' . $_attributes . '>' . "\n";
         $_output .= $_options . '</select>' . "\n";
     } elseif ($_type == "select_multi") {
         // get output from $_opt array
         // the output comes from other functions, which get specific info as required and return html
         $_output .= $_opt['dd1'] . ' ' . $_opt['dd2'];
     } elseif ($_type == "select_number") {
         // default min and max to 0 => 10
         if (!$_opt['min']) {
             $_opt['min'] = '0';
         }
         if (!$_opt['max']) {
             $_opt['max'] = '10';
         }
         // adding a blank value to top of list if "blank" is present in options array, or if no value is stored
         if ($_opt['blank'] || !$_value) {
             $_options .= '  <option value=""></option>' . "\n";
         }
         for ($_i = $_opt['min']; $_i <= $_opt['max']; $_i++) {
             $_options .= '  <option value="' . $_i . '"';
             if ($_i == "{$_value}") {
                 $_options .= ' selected="selected"';
             }
             $_options .= '>' . $_i . '</option>' . "\n";
         }
         $_output .= '<select name="' . $_name . '" id="' . $_name . '"' . $_attributes . '>' . "\n" . $_options . '</select>' . "\n";
     } elseif ($_type == "select_price") {
         // get default value from options array
         $_scope = $_opt['scope'];
         $_term = $_opt['term'];
         $_default = $_opt['default'];
         if ($_default) {
             $_options .= '  <option value="">' . $_default . '</option>';
         }
         // loop through price brackets
         if ($_scope == 'sales') {
             /*
             for ($i = 80000; $i <= 500000;) { 
             	$_options .= '<option value="'.$i.'"';
             	if ($i == $_value) {
             		$_options .= ' selected="selected"';
             		}
             	$_options .= '>'.format_price($i).'</option>
             	'; 
             	$i = $i+5000;
             	}
             */
             for ($i = 80000; $i <= 990000;) {
                 $_options .= '  <option value="' . $i . '"';
                 if ($i == $_value) {
                     $_options .= ' selected="selected"';
                 }
                 $_options .= '>' . format_price($i) . '</option>' . "\n";
                 $i = $i + 10000;
             }
             for ($i = 1000000; $i <= 3000000;) {
                 $_options .= '  <option value="' . $i . '"';
                 if ($i == $_value) {
                     $_options .= ' selected="selected"';
                 }
                 $_options .= '>' . format_price($i) . '</option>' . "\n";
                 $i = $i + 1000000;
             }
         } elseif ($_scope == 'lettings') {
             for ($i = 100; $i <= 1000;) {
                 $_options .= '  <option value="' . $i . '"';
                 if ($i == $_value) {
                     $_options .= ' selected="selected"';
                 }
                 if ($_term == "pcm") {
                     $_options .= '>' . format_price(pw2pcm($i)) . '</option>' . "\n";
                 } else {
                     $_options .= '>' . format_price($i) . '</option>' . "\n";
                 }
                 $i = $i + 50;
             }
             for ($i = 1000; $i <= 5000;) {
                 $_options .= '  <option value="' . $i . '"';
                 if ($i == $_value) {
                     $_options .= ' selected="selected"';
                 }
                 if ($_term == "pcm") {
                     $_options .= '>' . format_price(pw2pcm($i)) . '</option>' . "\n";
                 } else {
                     $_options .= '>' . format_price($i) . '</option>' . "\n";
                 }
                 $i = $i + 250;
             }
         }
         $_output .= '<select name="' . $_name . '" id="' . $_name . '"' . $_attributes . '>' . "\n" . $_options . '</select>' . "\n";
     } elseif ($_type == "select_duration") {
         for ($i = 15; $i <= 55;) {
             $_options .= '  <option value="' . $i . '"';
             if ($i == $_value) {
                 $_options .= ' selected="selected"';
             }
             $_options .= '>' . $this->duration($i, $_opt['format']) . '</option>' . "\n";
             $i = $i + 5;
         }
         for ($i = 60; $i <= 300;) {
             $_options .= '  <option value="' . $i . '"';
             if ($i == $_value) {
                 $_options .= ' selected="selected"';
             }
             $_options .= '>' . $this->duration($i, $_opt['format']) . '</option>' . "\n";
             $i = $i + 15;
         }
         $_output .= '<select name="' . $_name . '" id="' . $_name . '"' . $_attributes . '>' . "\n" . $_options . '</select>' . "\n";
     } elseif ($_type == "select_branch") {
         $_sql_branch = "SELECT * FROM branch WHERE branch.bra_status = 'Active'";
         $_result_branch = mysql_query($_sql_branch);
         if (!$_result_branch) {
             die("MySQL Error:  " . mysql_error() . "<pre>db_query: " . $_sql_branch . "</pre>");
         }
         while ($_row_branch = mysql_fetch_array($_result_branch)) {
             $_options .= '<option value="' . $_row_branch["bra_id"] . '" style="background-color: #' . $_row_branch["bra_colour"] . '"';
             if ($_row_branch["bra_id"] == "{$_value}") {
                 $_options .= ' selected="selected"';
             }
             $_options .= '>' . $_row_branch["bra_title"] . '</option>' . "\n";
         }
         $_output .= '<select name="' . $_name . '" id="' . $_name . '"' . $_attributes . '>' . "\n" . $_options . '</select>' . "\n";
     } elseif ($_type == "select_user") {
         // adding a blank value to top of list if "blank" is present in options array
         if ($_opt) {
             foreach ($_opt as $_optkey => $_optval) {
                 $_options .= '  <option value="' . $_optkey . '">' . $_optval . '</option>' . "\n";
                 #array_shift($_opt);
             }
         }
         /*
         if (!$_value) {
         	$_options .= '  <option value=""></option>'."\n";
         	}
         */
         $_sql_user = "******";
         $_result_user = mysql_query($_sql_user);
         if (!$_result_user) {
             die("MySQL Error:  " . mysql_error() . "<pre>db_query: " . $_sql_user . "</pre>");
         }
         while ($_row_user = mysql_fetch_array($_result_user)) {
             $_options .= '<option value="' . $_row_user["use_id"] . '"';
             if ($_row_user["use_id"] == "{$_value}") {
                 $_options .= ' selected="selected"';
             }
             $_options .= '>' . $_row_user["use_name"] . '</option>' . "\n";
         }
         $_output .= '<select name="' . $_name . '" id="' . $_name . '"' . $_attributes . '>' . "\n" . $_options . '</select>' . "\n";
     } elseif ($_type == "select_colour") {
         $_sql_colour = "SELECT col_colour,col_title FROM colour";
         $_sql_colour = "SELECT \n\t\t\tuser.use_colour, \n\t\t\tcolour.col_colour\n\t\t\tFROM user\n\t\t\tLEFT JOIN colour ON user.use_colour != colour.col_colour\n\t\t\tGROUP BY colour.col_colour";
         $_result_colour = mysql_query($_sql_colour);
         if (!$_result_colour) {
             die("MySQL Error:  " . mysql_error() . "<pre>db_query: " . $_sql_colour . "</pre>");
         }
         while ($_row_colour = mysql_fetch_array($_result_colour)) {
             $_options .= '<option value="' . $_row_colour["col_colour"] . '" style="background-color: #' . $_row_colour["col_colour"] . '"';
             if ($_row_colour["col_colour"] == "{$_value}") {
                 $_options .= ' selected="selected"';
             }
             $_options .= '>' . $_row_colour["col_title"] . '</option>' . "\n";
         }
         $_output .= '<select name="' . $_name . '" id="' . $_name . '"' . $_attributes . '>' . "\n" . $_options . '</select>' . "\n";
     } elseif ($_type == "datetime") {
         $_output .= '<input type="text" name="' . $_name . '" id="' . $_name . '" value="' . $_value . '"' . $_attributes . ' onClick="popcal' . $_name . '.select(document.forms[0].' . $_name . ',\'' . $_name . '\',\'dd/MM/yyyy\',\'' . $_value . '\'); return false;" />' . "\n";
         #$_output .= '<a href="javascript:void();" onClick="popcal.select(document.forms[0].'.$_name.',\'anchor\',\'dd/MM/yyyy\',\''.$_value.'\'); return false;" name="anchor" id="anchor"><img src="'.GLOBAL_URL.'img/icons/calendar.gif" width="16" height="16" border="0"></a>'."\n";
         $_output .= '<div id="popCalDiv' . $_name . '" style="position:absolute;visibility:hidden;background-color:white;layer-background-color:white;"></div>' . "\n";
     } elseif ($_type == "time") {
         $_split = explode(":", $_value);
         // show hours during working day
         for ($_h = 8; $_h <= 20;) {
             $_hours .= '  <option value="' . $_h . '"';
             if ($_h == $_split[0]) {
                 $_hours .= ' selected="selected"';
             }
             $_hours .= '>' . str_pad($_h, 2, "0", STR_PAD_LEFT) . '</option>' . "\n";
             $_h++;
         }
         for ($_m = 0; $_m <= 55;) {
             $_minutes .= '  <option value="' . $_m . '"';
             if ($_m == round_to_nearest($_split[1])) {
                 $_minutes .= ' selected="selected"';
             }
             $_minutes .= '>' . str_pad($_m, 2, "0", STR_PAD_LEFT) . '</option>' . "\n";
             $_m = $_m + 5;
         }
         $_output .= '<select name="' . $_name . '_hour" id="' . $_name . '_hour"' . $_attributes . '>' . "\n" . $_hours . '</select> : ';
         $_output .= '<select name="' . $_name . '_min" id="' . $_name . '_min"' . $_attributes . '>' . "\n" . $_minutes . '</select>' . "\n";
     } elseif ($_type == "htmlarea") {
         require_once "inx/fckeditor/fckeditor.php";
         $htmlarea = new FCKeditor($_name, $_value, $_attr);
         $_output .= $htmlarea->CreateHtml();
     } elseif ($_type == "tel") {
         $count = 1;
         $rows = count($_value);
         if (is_array($_value)) {
             foreach ($_value as $key => $val) {
                 $_tels .= $this->makeField('text', 'tel' . $count, 'Telephone ' . $count, $val['number']);
                 $_tels .= $this->makeField('select', 'tel' . $count . 'type', '', $val['type'], '', db_enum("tel", "tel_type", "array")) . ' ';
                 // make the first field look required. it will be validated if required is set in formData
                 if ($count == 1) {
                     $_tels = '<span class="required">' . "\n" . $_tels . '</span>';
                 }
                 if ($rows > 1) {
                     // delete
                     if ($rows > 1) {
                         $_tels .= '<a href="tel.func.php?action=delete&tel_id=' . $val['id'] . '"><img src="' . GLOBAL_URL . 'img/icons/cross_sm.gif" border="0" alt="Delete this Telephone Number" /></a>';
                     } else {
                         $_tels .= '<img src="' . GLOBAL_URL . 'img/icons/cross_sm_grey.gif" border="0" alt="Delete this Telephone Number" />';
                     }
                     // move up
                     if ($count == 1) {
                         $_tels .= '<img src="' . GLOBAL_URL . 'img/icons/arrow_up_sm_grey.gif" border="0" alt="I can\'t get no higher" />';
                     } else {
                         $_tels .= '<a href="tel.func.php?action=reorder&tel_id=' . $val['id'] . '&cur=' . $count . '&new=' . ($count - 1) . '"><img src="' . GLOBAL_URL . 'img/icons/arrow_up_sm.gif" border="0" alt="Move Up" /></a>';
                     }
                     // move down
                     if ($count == $rows) {
                         $_tels .= '<img src="' . GLOBAL_URL . 'img/icons/arrow_down_sm_grey.gif" border="0" alt="I\'m as low as I can go" />';
                     } else {
                         $_tels .= '<a href="tel.func.php?action=reorder&tel_id=' . $val['id'] . '&cur=' . $count . '&new=' . ($count + 1) . '"><img src="' . GLOBAL_URL . 'img/icons/arrow_down_sm.gif" border="0" alt="Move Down" /></a>';
                     }
                 }
                 $_output .= $this->addLabel('tel' . $count, 'Telephone ' . $count, $_tels);
                 $_tels = '';
                 $count++;
             }
         }
         // add blank for new $_type,$_name,$_label=NULL,$_value=NULL
         if (!is_array($_value)) {
             $_singlevalue = $_value;
         }
         $_tels .= $this->makeField('text', 'telnew', 'New', $_singlevalue);
         $_tels .= $this->makeField('select', 'telnewtype', '', '', '', db_enum("tel", "tel_type", "array")) . ' ';
         if ($_value) {
             $newtel_label = 'Add New &raquo;';
         } else {
             $newtel_label = 'Telephone';
         }
         $tel_output .= $this->addLabel('New', $newtel_label, $_tels);
         $_output .= $tel_output;
     }
     //echo $_name." = ".$this->required[$_name]."<br>";
     if ($this->requiredFields[$_name] == "2" || $this->requiredFields[$_name] == "3") {
         $_output = '<span class="required">' . "\n" . $_output . '</span>' . "\n";
     }
     return $_output;
 }