| Current Path : /var/www/html/mmishra/istore/ |
| Current File : /var/www/html/mmishra/istore/stitems1.inc |
<h3>Store Items</h3>
<?php
$myStore = new iStore();
$myStore->id = $_REQUEST['id'];
$myStore->code = $_REQUEST['code'];
$myStore->category = $_REQUEST['category'];
$myStore->subcategory = $_REQUEST['subcategory'];
$submit = $_POST['submit'];
$mm = 'readonly';
$del = '';
$edit = 0;
$delete = 0;
if (!$myStore->id) $mm = '';
if ($submit == 'ADD') {
$myStore->id = 0;
$mm = '';
} else if ($submit == 'EDIT') {
$mm = '';
$edit = 1;
} else if ($submit == 'SAVE') {
$myStore->description = $_POST['description'];
$myStore->status = $_POST['status'];
$myStore->loginID = $user;
//upload photograph
if ($myStore->photograph) upload();
//save item record
$myStore->saveItem();
//mail item alert
//if (!$myStore->id) $myStore->mailRecord();
} else if ($submit == 'DELETE') {
$del = "Are you sure?
[ <a href='?pg=$pg&delete=1&id=$myStore->id'>Yes</a> | <a href='?pg=$pg&id=$myStore->id'>No</a> ]";
$mm = '';
$edit = 1;
}
if ($_GET['delete'] == 1) {
//delete item record
$myStore->deleteItem();
}
//get item record
if ($myStore->id) $myStore->getItem();
?>
<table width='90%'><tr><th width='60%'>Item Details</th><th width='40%'>Stock Items</th></tr>
<tr valign='top'><td>
<table width='100%' border='1' style='border-collapse: collapse; background: url(uploads/<?php echo $myStore->photograph; ?>); background-size: 45% 100%; background-repeat: no-repeat; background-position: right bottom, left top;'>
<?php
echo "<tr><td width='15%'>Item Code</td><td width='85%'><input type='text' name='code' size='50' value='$myStore->code' $mm></td></tr>
<tr><td>Description</td><td><input type='text' name='description' size='50' value='$myStore->description' $mm></td></tr>
<tr><td>Category</td><td>".$myStore->selectCategory($pg)."</td></tr>";
/*
$myCalendar = new tc_calendar("dateRegistration", true, false);
$myCalendar->setIcon("images/iconCalendar.gif");
$myCalendar->setDate(date('d', strtotime($myStore->dateRegistration)), date('m', strtotime($myStore->dateRegistration)), date('Y', strtotime($myStore->dateRegistration)));
$myCalendar->setPath("calendar/");
$myCalendar->setYearInterval(2000, 2020);
$myCalendar->setAlignment('left', 'bottom');
$myCalendar->writeScript();
*/
echo "<tr><td>Subcategory</td><td>".$myStore->selectSubcategory($pg)."</td></tr>
<tr><td>Status</td><td><select name='status' $mm>";
foreach ($itemStatus as $st) {
echo "<option value='$st'".($st == $myStore->status ? ' selected' : '').">$st</option>";
}
echo "</select></td></tr>
<tr><th>";
if ($myStore->id) {
echo "<input type='submit' name='submit' value='ADD'>";
} else {
echo "<input type='reset' name='reset' value='CLEAR'>";
}
echo "</th><th>";
if ($myStore->id) {
echo "Dated: $myStore->dateCreation ";
if ($edit) {
echo "<input type='submit' name='submit' value='SAVE'> <input type='submit' name='submit' value='DELETE'>";
echo $del;
} else {
echo "<input type='submit' name='submit' value='EDIT'>";
}
echo " Updated: $myStore->dateUpdation";
} else {
echo "<input type='submit' name='submit' value='SAVE'>";
}
echo "<input type='hidden' name='id' value='$myStore->id'></th></tr>";
?>
</table>
<?php
//link to various activities related to item
echo $myStore->relatedLinks();
?>
</td><td>
<?php
//list stock items
echo $myStore->listItems('Online', $pg);
?>
</td></tr>
</table>
<?php
//other related documents in tender processing
//echo $myStore->docsItem();
?>
</center>