function onrectavatar() { @header("Expires: 0"); @header("Cache-Control: private, post-check=0, pre-check=0, max-age=0", FALSE); @header("Pragma: no-cache"); header("Content-type: application/xml; charset=utf-8"); //init_input(getgpc('agent')); $uid = intval(getgpc('input', 'G')); if (empty($uid)) { return '<root><message type="error" value="-1" /></root>'; } $home = get_home($uid); if (!is_dir(UC_DATADIR . './avatar/' . $home)) { set_home($uid, UC_DATADIR . './avatar/'); } $avatartype = getgpc('avatartype', 'G') == 'real' ? 'real' : 'virtual'; $bigavatarfile = UC_DATADIR . './avatar/' . get_avatar($uid, 'big', $avatartype); $middleavatarfile = UC_DATADIR . './avatar/' . get_avatar($uid, 'middle', $avatartype); $smallavatarfile = UC_DATADIR . './avatar/' . get_avatar($uid, 'small', $avatartype); $bigavatar = flashdata_decode(getgpc('avatar1', 'P')); $middleavatar = flashdata_decode(getgpc('avatar2', 'P')); $smallavatar = flashdata_decode(getgpc('avatar3', 'P')); if (!$bigavatar || !$middleavatar || !$smallavatar) { return '<root><message type="error" value="-2" /></root>'; } $success = 1; $fp = @fopen($bigavatarfile, 'wb'); @fwrite($fp, $bigavatar); @fclose($fp); $fp = @fopen($middleavatarfile, 'wb'); @fwrite($fp, $middleavatar); @fclose($fp); $fp = @fopen($smallavatarfile, 'wb'); @fwrite($fp, $smallavatar); @fclose($fp); $biginfo = @getimagesize($bigavatarfile); $middleinfo = @getimagesize($middleavatarfile); $smallinfo = @getimagesize($smallavatarfile); if (!$biginfo || !$middleinfo || !$smallinfo || $biginfo[2] == 4 || $middleinfo[2] == 4 || $smallinfo[2] == 4) { file_exists($bigavatarfile) && unlink($bigavatarfile); file_exists($middleavatarfile) && unlink($middleavatarfile); file_exists($smallavatarfile) && unlink($smallavatarfile); $success = 0; } $filetype = '.jpg'; @unlink(UC_DATAURL . '/avatar/tmp/upload' . $uid . $filetype); if ($success) { return '<?xml version="1.0" ?><root><face success="1"/></root>'; } else { return '<?xml version="1.0" ?><root><face success="0"/></root>'; } }
</tr> <?php } ?> </tbody> </table> <?php /* JQuery */ ?> <script> $("#form-equipe").on("change", function(e){ //Popula Líderes de Tribo $.ajax({ url: "<?php echo get_home(); ?> /json/return-json.php", type: "POST", data: {opt: "ldt", arg: $(this).val()}, beforeSend: function(){ $("#form-lider-tribo").html("<option>Carregando...</option>"); }, error: function(){ alert("Erro na requisição! Tente novamente."); }, success: function(result){ var view = "<option value=\"\">-- Selecione uma opção --</option>"; $.each($.parseJSON(result), function(key, value){ view += "<option value=\"" +value.id+ "\">" +value.ldt+ "</option>"; });
<?php require '../model/functions.php'; get_header(); get_home(); get_footer();
} else { if ($level == 'dev') { //DESENVOLVEDOR try { $rs = $conx->prepare('SELECT nome FROM fj_dev WHERE id = ? LIMIT 1'); $rs->bindParam(1, $fk_dev); $rs->execute(); $row = $rs->fetchAll(); foreach ($row as $r) { $_SESSION['nome'] = $r['nome']; } } catch (PDOException $e) { msgLogin(ERR_IDENT_USU); } } else { msgLogin(ERR_IDENT_LEVEL); } } } } header('Location: ' . get_home()); exit; } else { msgLogin(ERR_VERIFY_DIG); } } catch (PDOException $e) { exit('<h3>Erro de conexão com o Banco de Dados!</h3>'); } } else { msgLogin(ERR_VERIFY_DIG); }