function get_permission()
{
    $perm = $_SESSION['permission'];
    $rows = selectrec("motorcycle, commercial_vehicle, probiking, international_business", "vertical_services", "permission={$perm}");
    $str = "{";
    foreach ($rows as $row) {
        $str .= '"mc" : "' . $row[0] . '", "cv" : "' . $row[1] . '",';
        $str .= '"pb" : "' . $row[2] . '", "ib" : "' . $row[3] . '"';
    }
    $str .= "}";
    echo $str;
}
function printtable($fields, $tablename, $file = NULL)
{
    $filename = isset($file) ? $file : "adminadd";
    $cc = selcolumn($tablename);
    $multable = selectrec($fields, $tablename, "deleted='n'");
    echo "<table width='80%' align='center' border=2><tr bgcolor='#666666' style='color: white'>";
    foreach ($cc as $c) {
        echo "<td align='center'><b>" . strtoupper($c) . "</b></td>";
    }
    // echo "<td align='center'>&nbsp;</td>";
    echo "</tr>";
    for ($k = 0; $k <= count($multable) - 1; $k++) {
        echo "<tr>";
        for ($j = 0; $j <= count($multable[0]) - 2; $j++) {
            echo "<td align='center'>" . $multable[$k][$j] . "</td>";
        }
        echo "<td align='center' width='80'>" . showbuttons($_SESSION['AUSER'], $multable[$k][0], $filename, 0) . "</td>";
        echo "</tr>";
    }
    echo "</table>";
}
              </div>
            </div>

            <!-- /widget-header -->
            <div class="widget-content">
              <div class="widget big-stats-container">
                <div class="widget-content">
                  <br/>


                  <table width="100%" border="0" cellpadding="4">

<?php 
include "../inc/dbconn.php";
include "../inc/function.php";
$rows = selectrec("DATE_FORMAT(date_time, '%D %M %Y'),url, id,notice_desc", "noticeboards", "active=1 ORDER BY id DESC");
foreach ($rows as $row) {
    ?>

                    <tr style="border-bottom:1px solid #000">
                      <td width="20%" align="center"><strong><?php 
    echo $row[0];
    ?>
</strong></td>
                      <td align="center"><img src="<?php 
    echo $row[1];
    ?>
" style="max-width:90%;"/><hr/><p style="text-align:left"><?php 
    echo $row[3];
    ?>
</td>
                        <div class="login-fields">
                          
                          <div class="field">
                            <label for="firstname">Product Type</label>
                            <input type="text" id="txtProductType" name="txtProductType" value="" placeholder="Product Type" class="login" />
                          </div> <!-- /field -->
                                      
                             
 <div class="field">
                            <label for="firstname">Product Category</label>
                            <select name="txtProductCategory" id="txtProductCategory">
                            <option value="">Select Product Category</option>
<?php 
include "../inc/dbconn.php";
include "../inc/function.php";
$rows = selectrec("`product_category_id`,`product_category`", "product_categories", "active=1");
$count = 0;
foreach ($rows as $row) {
    $count++;
    ?>

<option value="<?php 
    echo $row[0];
    ?>
"><?php 
    echo $row[1];
    ?>
</option>

<?php 
}
    echo $row[2];
    ?>
</td>
                              <td style="vertical-align:top;"><ul>
                                    <?php 
    $rows1 = selectrec("`spare_id`", "groups_details", "active=1 and group_id=" . $row[0]);
    foreach ($rows1 as $row1) {
        echo "<li>" . singlefield("spare_name", "spares", "spare_id=" . $row1[0]) . "</li>";
    }
    ?>

                                  </ul>
                              </td>
                              <td style="vertical-align:top;"><ul>
                                    <?php 
    $rows2 = selectrec("`vin_num`", "groups_vins", "active=1 and group_id=" . $row[0]);
    foreach ($rows2 as $row2) {
        echo "<li>" . $row2[0] . "</li>";
    }
    ?>

                                  </ul>
                              </td>
                              <td align="center"><a href="javascript:deleteGroup(<?php 
    echo $row[0];
    ?>
)" class="btn">Delete</a></td>
                            </tr>
                        <?php 
}
?>
Esempio n. 6
0
                    <table class="table">
                      <thead>
                        <tr>
                          <th>#</th>
                          <th>Product Type</th>
                          <th>Product Name</th>
                          <th>Product Image</th>
                          <th></th>
                        </tr>
                      </thead>
                      <tbody id="tbodyproducts">



<?php 
$rows = selectrec("`product_id`,`product_type_id`,`product`,`url`", "product", "active=1");
foreach ($rows as $row) {
    ?>

                    <tr>
                      <td width="20%" align="center"><strong><?php 
    echo $row[0];
    ?>
</strong></td>
                      <td align="center"><?php 
    echo singlefield("product_type", "product_types", "product_type_id=" . $row[1]);
    ?>
</td>
                      <td align="center"><?php 
    echo $row[2];
    ?>
Esempio n. 7
0
                  <form action="#" method="post" id="submitASC" onsubmit="return submitASC(1)">
                        <input type="hidden" name="action" value="submitASC"/>
                        <h1>Add ASCs</h1>      
                        <p class="alert"></p>
                        <div class="login-fields">
                          
                          <div class="field">
                            <label for="firstname">Select Dealer</label>
                            <select name="txtSelectDealer">
                              <option value="">Select Dealer</option>

                              <?php 
include "../inc/dbconn.php";
include "../inc/function.php";
$rows = selectrec("dealer_id, dealer_name", "dealers", "active=1");
foreach ($rows as $row) {
    ?>

                            <option value="<?php 
    echo $row[0];
    ?>
"><?php 
    echo $row[1];
    ?>
</option>
                            <?php 
}
?>

                            </select>                           
?>
>Kannada</option>
</select>


                          </th>
                        </tr>
                      </thead>
                      <tbody id="tbodyTechnicals">



<?php 
$fields = "`techfiles_id`,`product_type_id`,`group_id`,`bulletin_type_id`,`service_bulletin_id`,`service_bulletin_desc`,`service_document_url`,`service_document_url_french`,`service_document_url_kannada`,DATE_FORMAT(date_time, '%d-%m-%Y'),`plates`";
$table = "techfiles";
$rows = selectrec($fields, $table, "active=1");
$count = 0;
foreach ($rows as $row) {
    if (isset($_GET['lang'])) {
        if ($lang == "en") {
            $cond = $row[6] != "";
        }
        if ($lang == "fr") {
            $cond = $row[7] != "";
        }
        if ($lang == "ka") {
            $cond = $row[8] != "";
        }
    } else {
        $lang = true;
        $cond = $row[6] != "" || $row[7] != "" || $row[8] != "";
Esempio n. 9
0
function getMcCirculars()
{
    if (!$_SESSION['permission_list']['motorcycle']) {
        $str = '{';
        $str .= '"msg" : "Failure"';
        $str .= '}';
        echo $str;
        return;
    }
    $rows = selectrec("circular_id, product_type, group_name, bulletin_type, bulletin_id, bulletin_desc, plates, date, pdf_link", "epc_mc_circulars", "active=1 and category_id=1");
    $str = '{
                "Brand" : "Bajaj Auto Ltd",
                "product" : "Aftersell",
                "msg" : "success",
                "category" : "Commercial Vehicle",
                "sub_category" : "Electronic Parts Catelogue",
                "legend" : [';
    foreach ($rows as $row) {
        $str .= '{"circular_id" : "' . $row[0] . '", "product_type" : "' . $row[1] . '", "group_name" : "' . $row[2] . '", "bulletin_type" : "' . $row[3] . '", "bulletin_id" : "' . $row[4] . '", "bulletin_desc" : "' . $row[5] . '", "plates" : "' . $row[6] . '", "date" : "' . $row[7] . '", "pdf_doc" : "' . $row[8] . '"},';
    }
    if (count($rows) > 0) {
        $str = substr($str, 0, -1);
    }
    $str .= "]\n            }";
    echo $str;
}
        </select><input type="text" id="searchCatalogue" name="searchCatalogue" class="span5 m-wrap" placeholder="Search Catalogue">
        <button type="submit" class="btn btn-success">Go!</button><hr class="hrtopmargin"/>
      </div>
    </div>  <!-- /controls -->      
</div>
</form>

<div class="container">        
  <div class="row" id="search_results">
    <?php 
include "../inc/dbconn.php";
include "../inc/function.php";
$fields = "`product_id`,`product`,`url`";
$table = "product";
$cond = "product_id>4 and active=1";
$rows = selectrec($fields, $table, $cond);
foreach ($rows as $row) {
    ?>

    <div class="span3"> <div class="info-box"> <a href="javascript:noRecord()"><span class="cs">Coming Soon</span> <img class="imgInfo" src="<?php 
    echo $row[2];
    ?>
"> <span><?php 
    echo $row[1];
    ?>
</span> </a> </div> </div>

<?php 
}
?>
Esempio n. 11
0
function listAllChannels($assignedChannel = 0)
{
    $fields = "channel_type_id,channel_type";
    $table = "channel_type";
    $rows = selectrec($fields, $table, "active=1");
    $str = "[";
    foreach ($rows as $row) {
        $sel = $row[0] == $assignedChannel ? "1" : "0";
        $str .= '{"channel_type_id":"' . $row[0] . '","channel_type":"' . $row[1] . '","selected":"' . $sel . '"},';
    }
    $str = substr($str, 0, -1);
    $str .= "]";
    return $str;
}
    ?>
"><?php 
    echo $row[1];
    ?>
</option>

<?php 
}
?>

        </select>

        <select id="bulletinid" name="bulletinid" class="selMargin">
          <option value="">--Select Bulletin Type--</option>
<?php 
$rows = selectrec("`bulletin_type_id`,`bulletin_type_name`", "bulletin", "active=1");
$count = 0;
foreach ($rows as $row) {
    $count++;
    ?>

<option value="<?php 
    echo $row[0];
    ?>
"><?php 
    echo $row[1];
    ?>
</option>

<?php 
}
Esempio n. 13
0
function fetchUserById($userid)
{
    $fields = "username,name,email,mobile,admin";
    $table = "users";
    $cond = "ID=" . $userid;
    $rows = selectrec($fields, $table, $cond);
    foreach ($rows as $row) {
        $arr['username'] = $row[0];
        $arr['name'] = $row[1];
        $arr['email'] = $row[2];
        $arr['mobile'] = $row[3];
        $arr['admin'] = $row[4];
    }
    if ($row) {
        $arr['status'] = 1;
        $arr['message'] = 'Success';
    } else {
        $arr = array('status' => 0, 'message' => 'No Records fetched. Try again.');
    }
    echo json_encode($arr);
}