Example #1
0
<?php

include 'chai.php';
$template = addslashes($_POST['template'] == '' ? 1 : $_POST['template']);
$topic = addslashes($_POST['topic'] == '' ? 1 : $_POST['topic']);
$image_1 = addslashes($_POST['image_1'] == '' ? '' : $_POST['image_1']);
$image_2 = addslashes($_POST['image_2'] == '' ? 0 : $_POST['image_2']);
$text_1 = addslashes($_POST['text_1']);
$text_2 = addslashes($_POST['text_2']);
$uid = 'SH-' . date('His-dmY') . rand(1000, 9999);
$chai = create_chai($template, $topic, $image_1, $image_2, $text_1, $text_2, $uid, TRUE);
if ($chai != NULL) {
    echo $chai;
} else {
    echo "fail";
}
Example #2
0
			`from` = '$from',
			`to` = '$to',
			`from_name` = '$from_name',
			`from_add` = '$from_add',
			`from_tel` = '$from_tel',
			`from_mail` = '$from_mail',
			`to_name` = '$to_name',								
			`to_add` = '$to_add',
			`to_tel` = '$to_tel',
			`to_mail` = '$to_mail',
			`updttime` = NOW()
		WHERE order_id = '$order_id'
	";
	$is_ok = mysql_query($query, $con);
	if($save == 1 && $inf_ok){
		$gallery_id = create_chai($template, $topic, $image_1, $image_2, $text_1, $text_2, $obj->user_info_id);
		if($gallery_id != NULL){
			$query = "select * from gallery_image where name_image = '$gallery_id'";
			$flag_gallery = mysql_num_rows(mysql_query($query, $con));
			if(!$flag_gallery){
				 $insert_gallery_query = "INSERT INTO gallery_image (`name_image`, `show`) VALUES ('$gallery_id', $save)";
				 mysql_query($insert_gallery_query, $con);
			}
		}
	}
}
if ($is_ok) {
	echo 'success';
}
else {
	echo "fail";