// chdir('..');
require_once 'include/entryPoint.php';
require_once 'data/SugarBean.php';
require_once 'modules/Documents/Document.php';
function create_array($bean)
{
    $data = array();
    foreach ($bean->field_defs as $field_def) {
        $fieldname = $field_def['name'];
        $data[] = array($fieldname => $bean->{$fieldname});
    }
    return $data;
}
function toJSON($data)
{
    require_once 'include/utils.php';
    $json = getJSONobj();
    return $json->encode($data);
}
function findEntity()
{
    $document = new Document();
    // Dokument wiederfinden -> Todo: anhand der field_defs generisch suchen
    $result = $document->get_list('', 'document_name = "' . $_REQUEST['document_name'] . '"');
    return $result['list'][0];
}
header("Content-type: application/json");
echo toJSON(create_array(findEntity()));
session_write_close();
?>
 
function toJSON($data)
{
    require_once 'include/utils.php';
    $json = getJSONobj();
    return $json->encode($data);
}
function findEntity()
{
    $document = new Document();
    // Dokument wiederfinden -> Todo: anhand der field_defs generisch suchen
    $result = $document->get_list('', 'document_name = "' . $_REQUEST['document_name'] . '"');
    return $result['list'][0];
}
function getRevisionBean()
{
    $document = new Document();
    // Dokument wiederfinden -> Todo: anhand der field_defs generisch suchen
    if ($_REQUEST['return_id'] != "" && $_REQUEST['return_id'] != "undefined") {
        $document_id = $_REQUEST['return_id'];
        if ($document->retrieve($document_id)) {
            return $document;
        }
    } else {
        die('Could not get document id!');
    }
}
header("Content-type: application/json");
echo toJSON(create_array(getRevisionBean()));
session_write_close();
?>
 
                    <span style="color: #CD0000">*</span><label style="color: #330066">Last Name: <input type="text" id="lastname" name="lastname" size="50" maxlength="50" tabindex="2" onblur="check_reqd(\'lastname\',\'Last Name\')" required/></label><br /><br />
                    <span style="color: #CD0000">*</span><label style="color: #330066">Street Address: 
                    <input type="text" tabindex="3" id="address1" name="address1" id="address1" value="" size="30" maxlength="30" required onblur="check_reqd('AVSADDR','Street Address')"/></label><br /><br />
                    <label style="color: #330066">Street Address Line 2:
                    <input type="text" tabindex="4" id="address2" name="address2" id="address2" value="" size="30" maxlength="30" /></label><br /><br />
                    <span style="color: #CD0000">*</span><label style="color: #330066">City: 
                    <input type="text" tabindex="5" id="city" name="city" value="" id="city" size="30" maxlength="30" required onblur="check_reqd('city','City')" /></label>
                    <span style="color: #CD0000">*</span><label style="color: #330066">State: 
                    <input type="text" tabindex="6" id="state" name="state" value="" id="state" size="3" maxlength="30" required onblur="check_reqd('state','State')" /></label>
                    <span style="color: #CD0000">*</span><label style="color: #330066">Zip: 
                    <input type="text" tabindex="7" id="zip" name="zip" value="" id="zip" size="9" maxlength="9" required onblur="check_reqd('AVSZIP','Zip Code')" /></label><br /><br />
                    <span style="color: #CD0000">*</span><label style="color: #330066">E-mail Address: <input type="text" id="email" name="email" size="50" maxlength="75" tabindex="8" onblur="check_reqd(\'email\',\'Email\')" required/></label><br /><br />
                    <span style="color: #CD0000">*</span><label style="color: #330066">Parish (choose one): 
                    <?php 
require '../../../pmtproc/filereadingfxcolon.php';
$churches = create_array('../../../files/churches.csv');
echo '<select tabindex="9" id="churches" onchange="getParishName(\'churches\', \'Other\', \'parishName\', \'added\',\'pNameLbl\', \'Enter the name of your parish: \', \'churches\')" onblur="check_reqd(\'churches\',\'Parish\')" required>';
foreach ($churches as $key => $value) {
    echo '<option value="' . $key . '">' . $value . '</option>';
}
echo '</select>';
?>
</label><br /><br />
                   <span style="color: #CD0000">*</span><label style="color: #330066">Please choose whether you will attend the Deacons Retreat:</label><br /><br />
                    <input type="radio" name="RSVP" id="y" value="will attend" tabindex="10" onclick="addRoomieReqAndSpecNeeds('yesLbl','added','roommate','Roommate request (please check with potential roomate first!): ','n','physneeds','Please indicate any special physical accommodations you require: ','dietneeds','Please indicate any special dietary needs you have: ','#330066',['br','label','textarea']);"/>
                    <label style="color: #330066" id="yesLbl" for="y">Yes, I will be attending the 2015 Deacon's Retreat.</label><br />
                    <input type="radio" name="RSVP" id="n" value="will not attend" tabindex="14" onclick="addExcuse('noLbl','added','excuse','You must be excused from the retreat by Bishop Dan. Please enter your request for being excused here: ','#330066',['br','label','textarea']);"/>
                    <label style="color: #330066" id="noLbl" for="n">No, I will be unable to attend the 2015 Deacon's Retreat.</label>
                    <br />
                    <?php 
$filename = 'combfields.txt';
Пример #4
0
function create_array($number, $data)
{
    $result = array();
    foreach ($data as $row) {
        if ($row['enroller_id'] == $number) {
            $result[$row['id']] = create_array($row['id'], $data);
        }
    }
    return $result;
}