Esempio n. 1
0
function edit_item($id, $field, $value)
{
    $parvaz_det_id = $GLOBALS['parvaz_det_id'];
    mysql_class::ex_sql('select `id` from `parvaz_jid` where `parvaz_det_id` = ' . $parvaz_det_id . ' and `jid` = ' . $value, $q);
    if (!($r = mysql_fetch_array($q))) {
        mysql_class::ex_sqlx('update `parvaz_jid` set `jid` = ' . $value . ' where `id` = ' . $id);
    }
}
$parvaz_det_id = (int) $_REQUEST['parvaz_det_id'];
$GLOBALS['parvaz_det_id'] = $parvaz_det_id;
$grid = new jshowGrid_new("parvaz_jid", "grid1");
$grid->whereClause = " `parvaz_det_id` = {$parvaz_det_id}";
$grid->columnHeaders[0] = null;
$grid->columnHeaders[1] = null;
$grid->columnHeaders[2] = "پرواز برگشت";
$grid->columnLists[2] = loadParvazDets($parvaz_det_id);
$grid->canAdd = $is_modir;
$grid->canDelete = $is_modir;
$grid->canEdit = $is_modir;
$grid->addFunction = "add_item";
$grid->editFunction = "edit_item";
//	$grid->deleteFunction = "delete_item";
$grid->intial();
$grid->executeQuery();
$out = $grid->getGrid();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<!-- Style Includes -->
Esempio n. 2
0
    if ($j_id == 0) {
        $my->ex_sqlx("delete from `parvaz_jid` where `parvaz_det_id`='{$parvaz_det_id}' ");
    }
    die("{$j_id}");
}
$gname = 'grid_parvaz_jid';
$input = array($gname => array('table' => 'parvaz_jid', 'div' => 'parvaz_jid_div'));
$xgrid = new xgrid($input);
$xgrid->whereClause[$gname] = "`parvaz_det_id`='{$parvaz_det_id}'";
$xgrid->eRequest[$gname] = array('parvaz_det_id' => $parvaz_det_id);
$id = $xgrid->column[$gname][0];
//$xgrid->alert = TRUE;
$xgrid->column[$gname][0]['name'] = '';
$xgrid->column[$gname][1]['name'] = '';
$xgrid->column[$gname][2]['name'] = 'پرواز';
$xgrid->column[$gname][2]['clist'] = loadParvazDets();
$xgrid->canEdit[$gname] = TRUE;
$xgrid->canAdd[$gname] = TRUE;
$xgrid->canDelete[$gname] = TRUE;
$xgrid->addFunction[$gname] = 'add';
$out = $xgrid->getOut($_REQUEST);
if ($xgrid->done) {
    die($out);
}
?>
<script>
var parvaz_det_id = <?php 
echo $parvaz_det_id;
?>
;
	$("#sabt").click(function(){