예제 #1
0
 function show($params)
 {
     $params['id'] ? $this->data->payment = new Payment($params['id']) : Bail('Required parameter $params["id"] missing.');
     $this->data->company = $this->data->payment->getCompany();
     $this->data->new_payment = new Payment();
     $this->data->new_payment->set(array('date' => date('Y-m-d'), 'company_id' => $this->data->company->id));
 }
예제 #2
0
 function show($params)
 {
     $params['id'] ? $this->data->charge = new Charge($params['id']) : Bail('Required parameter "id" is missing.');
     $this->data->company = new Company($this->data->charge->get('company_id'));
     $this->data->new_charge = new Charge();
     $this->data->new_charge->set(array('date' => date('Y-m-d'), 'company_id' => $this->data->company->id));
 }
예제 #3
0
 function show($params)
 {
     $params['id'] ? $this->data->project = new Project($params['id']) : Bail('Required parameter $params["id"] missing.');
     $this->data->new_estimate = new Estimate();
     $this->data->new_estimate->set(array('project_id' => $params['id']));
     $this->data->new_hour = new Hour();
     $this->data->new_hour->set(array('staff_id' => Session::getUserId(), 'date' => date('Y-m-d')));
 }
School: {$dbFeedbackSchool}
User: {$dbFeedbackUser}
Type: {$dbFeedbackType}
Content:

{$fd}

----{$rspv}

Love,
Solar Feedback System
EEMMAAIILLSS;
$headers = "To: Admin <{$to}>" . "\r\n";
$headers .= "From: Solar Feedback <{$from}>" . "\r\n";
if (!mail($to, $subject, $message, $headers)) {
    Bail('Couldn\'t send notification email.');
} else {
    DebugPrint('<p>Sending email...</p>');
}
// SHOW CONFIRMATION //
include 'feedback-received.html';
// FIXME there are many ways we can do this, change to be consistent with rest of site
/* FIXME an alternative method
    echo '<h3>Thank you for your feedback</h3>';

    if ( $dbFeedbackResponse == 1 )
    {
        echo '<p>We will get back to you soon</p>';
    }
     */
$con->close();
 function correct_mistake($params)
 {
     $d = $this->data;
     $params['id'] ? $d->contract = new SupportContract($params['id']) : Bail('required parameter $params["id"] missing.');
 }
    return $con->query("SELECT 1 FROM `{$tableName}`");
}
if (!TableExists($con, TABLE_NAME)) {
    DebugPrint('<p>Creating table...</p>');
    $sql = 'CREATE TABLE `' . TABLE_NAME . '`
            (
                feedback_id INT NOT NULL AUTO_INCREMENT,
                PRIMARY KEY(feedback_id),
                school VARCHAR(50),
                user VARCHAR(50),
                type VARCHAR(15),
                content TEXT,
                response BOOL
            )';
    if (!$con->query($sql)) {
        Bail('Couldn\'t create table: ' . $con->error);
    }
}
echo '<h3>Solar Feedback Form</h3>';
echo '<p>Current Feedback</p>';
// Get and print data //
$result = $con->query('SELECT * FROM ' . TABLE_NAME);
echo '<table>';
while ($row = $result->fetch_array()) {
    echo '<tr>';
    echo '<td>' . $row['school'] . '</td>';
    echo '<td>' . $row['user'] . '</td>';
    echo '<td>' . $row['type'] . '</td>';
    echo '<td>' . $row['content'] . '</td>';
    echo '<td>' . $row['response'] . '</td>';
    echo '</tr>';