Пример #1
0
    $listTypeKey .= $data["project_image_type_value"];
    if ($key < count($arrProjectImageType) - 1) {
        $listPost .= "|";
        $listTypeKey .= "|";
    }
}
$patternPost = '/(' . $listPost . ')/';
$patternTypeKey = '/(' . $listTypeKey . ')/';
//POST
if (!empty($_POST)) {
    $action = "";
    $return = false;
    $arrData = $_POST;
    $arrData['project_id'] = $_POST['content_id'];
    $id = $arrData['project_id'];
    $arrData['project_date'] = $objUtil->dateLocaleToDB($_POST['project_date']);
    foreach ($_POST as $key => $value) {
        $width = "";
        $height = "";
        /* 
        [FileName-Image-mini] => decoration_stickers_mini.jpg
        [FileName-Image-popup_1_0] => 1b4605b0e20ceccf91aa278d10e81fad64e24e27.jpg
        */
        //Search in Post Key For Image
        preg_match($patternPost, $key, $matches);
        if (count($matches) > 0) {
            //found, check which type of image it is
            preg_match($patternTypeKey, $matches[0], $matches1);
            $project_image_type_id = $objProj->getImageType(array("project_image_type_value" => $matches1[0]), "project_image_type_id");
            if (!empty($project_image_type_id)) {
                if (!empty($value)) {
Пример #2
0
//Object Back
$objExp = new bExperience();
//Object Front UTIL
$objUtil = new Util();
// Arrays
$arrData = array();
$arrErrors = array();
//POST
if (!empty($_POST)) {
    $action = "";
    $return = false;
    $arrData = $_POST;
    $arrData['experience_id'] = $_POST['content_id'];
    $id = $arrData['experience_id'];
    //date FROM and TO
    $arrData['experience_date_from'] = $objUtil->dateLocaleToDB($_POST['experience_date_from']);
    if (!empty($_POST['experience_date_to'])) {
        $arrData['experience_date_to'] = $objUtil->dateLocaleToDB($_POST['experience_date_to']);
    }
    if (empty($arrErrors)) {
        try {
            if (empty($arrData['experience_id'])) {
                //add
                $objExp->add($arrData);
                $action = "create";
                $return = false;
            } else {
                //update
                $objExp->update($arrData);
                $action = "update";
            }