Exemplo n.º 1
0
     break;
 case "get_delay":
     $value = $api->get_delay();
     exit($value);
     break;
 case "set_delay":
     if (isset($_REQUEST["delay"]) && isset($_REQUEST["project_id"])) {
         $value = $api->set_delay($_REQUEST["delay"], $_REQUEST["project_id"]);
     } else {
         $value = array("Response" => "Error", "message" => "Invalid arguments");
     }
     exit(json_encode($value));
     break;
 case "update_profile":
     if (isset($_REQUEST["audience_phone"])) {
         $value = $api->update_profile($_REQUEST["audience_phone"]);
     } else {
         $value = "Missing argument";
     }
     break;
 case "select_message_feeds":
     if (isset($_REQUEST["type"])) {
         $value = $api->select_message_feeds($_REQUEST["type"]);
         exit(json_encode($value));
     } else {
         $value = "Missing argument";
     }
     break;
 case "select_messages":
     if (isset($_REQUEST["message_feed_id"])) {
         $value = $api->select_messages($_REQUEST["message_feed_id"]);
Exemplo n.º 2
0
             imagedestroy($tmp);
             $relativefilepath = preg_replace('/styles\\/' . $project_id . '\\//', '', $newfilename);
             $sql_str[] = "profile_image='" . $relativefilepath . "'";
         }
     }
     $db = new PDO('mysql:host=' . MYSQL_DBHOST . ';dbname=' . MYSQL_DBNAME, MYSQL_USER, MYSQL_PASS);
     foreach ($_POST['field'] as $field_name => $field_value) {
         if ($field_value != "") {
             $sql_str[] = "{$field_name}= '{$field_value}'";
         }
     }
     $query = "UPDATE audience SET " . implode(' , ', $sql_str) . " WHERE id = '" . $audience_id . "'";
     $st = $db->prepare($query);
     $st->execute();
 }
 $data = $api->update_profile(isset($_POST['update']));
 //print_r($data);
 if (!empty($data)) {
     $audience_email = $data[0]['audience_email'];
     $audience_phone = $data[0]['audience_phone'];
     $audience_first_name = $data[0]['audience_first_name'];
     $audience_last_name = $data[0]['audience_last_name'];
     $profile_image = $data[0]['profile_image'];
     $roles = $data[0]['roles'];
 }
 if (isset($_POST['rotate_photo'])) {
     $filepath = "styles/" . $project_id . "/" . $data[0]['profile_image'];
     $type = exif_imagetype($filepath);
     //var_dump($type);
     $allowedTypes = array(1, 2, 3, 6);
     if (!in_array($type, $allowedTypes)) {