I had code writen for me a few years ago and have not been able to locate the coder that wrote it. It's been working fine but I have found the need that I would like an option selection instead of edit box.
The code is very long but I put the 1st 1/2 that has the area I'm trying to get changed. I attached the full script in a zip. If you do need more I can attach it. There was only a few files with this and then the templates it uses to create the dynamic pages based on the database.
In second code listing were SUBDIR == 'Time' is located I'm hoping to get similar for each . Hour Minutes etc.... If I'm shown how to do one I should be able to do the rest if it's not to complicated.
Thanks for reading my post and your help.
<option selected value="*">No Minute Selected</option>
<option value="15">15: Minutes</option>
<option value="30">30: Minutes</option>
<option value="45">45: Minutes</option>
<option value="00">On The Hour</option>
</select>
<?php
date_default_timezone_set('UTC');
// Says which errors to report
// ini_set('error_reporting', E_ALL); // show errors/warnings/notices
// ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_WARNING); // errors only (no notices or warnings)
// top-level scripts like login will not define SUBDIR
if(!defined('SUBDIR')) { define('SUBDIR', ''); }
AdjustGPC(); // call stripslashes (if need to) on all $_GET/$_POST/$_COOKIE values
// this is the date that gets autofilled into add.php
// $date_default_timezone_set()
$curr_date = date("m/d/Y"); // 05/24/2008
$curr_time = date("h:i A"); // 05:16 PM
// Create $fields array and others
// don't need to handle username
// SUBDIR is also the name of the db table, so avoid funky chars!
// assumes 'id' and 'username' are first 2 fields
$fields = array();
$fields[] = array('name' => 'id', 'type' => 'varchar', 'len' => 20); // len will not be used, and i know id is not a varchar,
// but it can be treated like one
$date_selection_fields = array();
$totals_fields = array();
if(SUBDIR == 'Time') {
$fields[] = array('name' => 'hour', 'type' => 'varchar', 'len' => 10);
$fields[] = array('name' => 'minute', 'type' => 'varchar', 'len' => 10);
$fields[] = array('name' => 'day_of_week', 'type' => 'varchar', 'len' => 10);
$fields[] = array('name' => 'month', 'type' => 'varchar', 'len' => 10);
$fields[] = array('name' => 'email', 'type' => 'varchar', 'len' => 120);
$fields[] = array('name' => 'provider', 'type' => 'varchar', 'len' => 50);
$fields[] = array('name' => 'message', 'type' => 'varchar', 'len' => 120);
} else if(SUBDIR == '') { // top-level scripts. Do nothing
} else { // unknown SUBDIR
die("SUBDIR[" .SUBDIR . "] not supported\n");
}
// Create $field_names
$field_names = array();
foreach($fields as $index => $field_info) {
$field_names[] = $field_info['name'];
}
// Create the keyword_fields array. These are the fields that the keyword search will look at
$keyword_fields = array();
foreach($fields as $i => $field_info) {
$field = $field_info['name'];
$type = $field_info['type'];
// don't use it if it's the id field, or it's type is not varchar/text (so no date/file_upload)
$types = array('varchar', 'text');
if($field != 'id' && in_array($type, $types)) {
$keyword_fields[] = $field;
}
}
utils.php.zip