Beispiel #1
0
function process_addnewaward_form($smarty)
{
    global $Link;
    global $SEASON;
    $errors = array();
    $award = format_doublequotes($_POST['award']);
    $recipient = format_doublequotes($_POST['recipient']);
    $seasonID = $_POST['season'];
    $priority = $_POST['priority'];
    $about = format_paragraph(format_doublequotes($_POST['about']));
    $awardInsert = 'INSERT INTO ' . AWARDS . ' (`seasonID`, `award`, `recipient`, `priority`, `about`';
    if ($_FILES['image']['size'] > 0 && ($_FILES['image']['type'] == 'image/jpeg' || $_FILES['image']['type'] == 'image/gif')) {
        $awardInsert .= ', `image`, `imageWidth`, `imageHeight`';
    }
    $awardInsert .= ') VALUES (' . $seasonID . ', "' . $award . '", "' . $recipient . '", "' . $priority . '", "' . $about . '"';
    if ($_FILES['image']['size'] > 0 && ($_FILES['image']['type'] == 'image/jpeg' || $_FILES['image']['type'] == 'image/gif')) {
        $awardInsert .= get_image_sql_info();
    }
    $awardInsert .= ')';
    $awardResult = mysql_query($awardInsert, $Link) or die("sp_clubs (Line " . __LINE__ . "): " . mysql_errno() . ": " . mysql_error());
    return $errors;
}
Beispiel #2
0
function process_editaward_form($smarty)
{
    global $Link;
    global $AWARD;
    $errors = array();
    $award = format_doublequotes($_POST['awardName']);
    $recipient = format_doublequotes($_POST['recipient']);
    $seasonID = $_POST['season'];
    $priority = $_POST['priority'];
    $about = format_paragraph(format_doublequotes($_POST['about']));
    $awardNameUpdate = 'UPDATE ' . AWARDS . ' SET award="' . $award . '", recipient="' . $recipient . '", about="' . $about . '", priority="' . $priority . '", seasonID=' . $seasonID . '';
    if ($_FILES['image']['size'] > 0 && ($_FILES['image']['type'] == 'image/jpeg' || $_FILES['image']['type'] == 'image/gif')) {
        $awardNameUpdate .= get_image_sql_info();
    }
    $awardNameUpdate .= ' WHERE awardID=' . $AWARD;
    $awardNameResult = mysql_query($awardNameUpdate, $Link) or die("sp_clubs (Line " . __LINE__ . "): " . mysql_errno() . ": " . mysql_error());
    return $errors;
}