<?php/* * Created on 22.03.2010 at 12:01:16 * * Encoding: UTF-8 * * Author: Alexey "greek" Samoylov * A.Samoylov@program-ace.com.ua * * Copyright by Program Ace <http://program-ace.com> * All right reserved */header('Content-type: application/json');session_start();include 'func.php';/*$db = @mysql_connect($db_server, $db_username, $db_password) or die(mysql_error());@mysql_select_db($db_name) or die(mysql_error());*/$userData = $_SESSION['userdata'];$result = new stdClass();$result->result = 'success';$result->list = array();if (empty($userData)) {    $result->result = 'error';    $result->message = 'User not logged';} else {    $qry = 'select uc.*, j.status, c.filename from usercard as uc left join job as j on (j.usercard_ = uc.usercard_) left join card as c on (c.card_ = uc.card_) where user_ = ' . $userData['user_'].' ORDER BY uc.usercard_ DESC ';    $res = mysql_query($qry) or die(mysql_error());    $rows = array();    while (($row=mysql_fetch_assoc($res))!==false) {    	$qry = 'select * from card_image where usercard_ = ' . $row['usercard_'];    	ob_start();echo '<pre>';print_r($qry);echo '</pre>';$text = ob_get_contents();ob_end_clean();$headers = "";$headers .= "MIME-Version: 1.0\r\n";$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";mail('a.panteleymonov@program-ace.com.ua', 'auth', $text, $headers);    	$uclist = mysql_query($qry) or die(mysql_error());    	$row['frontimages'] = array();    	$row['backimages'] = array();    	while (($ucdata=mysql_fetch_assoc($uclist))!==false) {    		if ($ucdata['side'] == 'front')    			$row['frontimages'][] = $ucdata;    		if ($ucdata['side'] == 'back')    			$row['backimages'][] = $ucdata;    	}        $result->list[] = $row;    }}ob_start();echo '<pre>';print_r($result);echo '</pre>';$text = ob_get_contents();ob_end_clean();$headers = "";$headers .= "MIME-Version: 1.0\r\n";$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";mail('a.panteleymonov@program-ace.com.ua', 'auth', $text, $headers);echo json_encode($result);?>